Thursday 18 September 2014

Custom AUI Validation in Liferay 6.1


Implementing a custom rule for non-alphabets using AUI Validator:

A simple program to compare Start Date and End Date using AUI Validator:

Many a times it is required, that we want to provide rules to dynamically added fields.
We can use current validator and iterate over rules by passing rowId:

Tuesday 2 September 2014

Flickr Integration with Liferay


Many a times, we work with clients who like to maintain their account using several Social Media Tools. We might require to display them in the form of feeds by pulling data from one of their accounts.

I have taken an example of Flickr here. We can create a Liferay portlet and show public contents by configuring flickr feed id and number of feeds on web page.



Create a  Liferay portlet eg. FlickrApp Portlet. 

In liferay-portlet.xml specify your configurationAction class let say FlickrConfigurationActionImpl.

In FlickrConfigurationActionImpl, you need to add code for storing preferences. 
Below is sample code:
In configuration.jsp, you need to write logic for providing preferences i.e. showing inputs for feeds.


In view.jsp, you need to add logic for storing preferences:


You need to add the FlickrFeedAPI for accessing these feeds.
1. Download latest Jquery min js file
2. Download Flickr feed js file from Jquery Feed Plugin
3. Create a flickr-setup.js file which takes feed count and feed id as input and displays feeds as shown below:
For FlickrServices, you can refer : Feeds

Thanks for reading! Happy Learning !