Category: Java

Determine Path to Portlet Assets in Liferay JSP Files

When developing the front end (i.e. templates and JSP files) for portlets you will definitely at some want to include/reference custom assets, such as images. Luckily, in Liferay in order to determine the path to your portlet’s assets you only need to follow two steps. In your view.jsp (or any custom JSP file for that […]

Search Categories by Name or Vocabulary in Liferay 6+

When using categories (AssetCategory) for assets such as web content (i.e. JournalArticles) in Liferay one of the use cases you will most probably come across is to search for matching entries by name. Furthermore, as categories are made up of sets of vocabularies (AssetVocabulary) you might also want to search for categories matching certain vocabularies. […]

Add Email Verification to Registration Process in Liferay

By default users registering on a Liferay portals are assigned a randomly generated password and their accout is active immediately. Upon first login, users are then required to change their password. Well, to put it delicately, especially the second step in this registration process will definitely confuse some of your potential users since why do […]

Image Scaling in Liferay

Have you ever wondered if Liferay offer image scaling out of the box? Yes it does, you only need to enable this option! In portal-ext.properties add: The second property image.hook.impl sets the hook implementation to be used to trigger automatic data migration during an upgrade. Requesting Scaled Images Now in order to request scaled images […]

Setting Character Set for Jersey Web Services

When developing RESTful Web services using Jersey you will at some point be forced to define/change the character set and content type of your response. Setting the content type is simply done by using the Produces tag, like so: At this point it comes in handy to know that Jersey uses UTF-8 as default encoding […]

body onLoad Event im ZK JavaScript Frameworkbody onLoad Event in ZK JavaScript Framework

Um den body-onLoad Event einer ZK-basierten Anwendung zu realisieren verwendet man einfachsten das eingebaute JQuery, mit der darin enthaltenen load-Funktion: Dieses Beispiel verwendet zusätzlich das Dojo-Toolkit welches folgendermaßen in ZK eingebunden werden kann: Um zu überprüfen ob alle DOM Elemente auch tatsächlich fertig geladen wurden sollten Elementzugriffe noch mittels der ready-Funktion gekapselt werden:

Emuliere onClick Event für labels via Client Seite in ZKEmulate onClick event for labels in ZK via the client side

Recently I needed to emulate the built-in functionality of HTML <label> entities to put the focus on its referenced item using the ZK JavaScript framework. Basically, the goal was to define an onClick event for the label that would toggle the checked-status of a checkbox and simultaneously trigger its onCheck event (sending the update request […]