Friday, November 29, 2013

Kaleo Workflow Configuration for Custom Portlet in Liferay 6.1

1. Make sure you have deployed kaleo workflow war in your liferay portal.

2. Create the service.xml


3. Build the service

4. Edit the FeedbackLocalServiceImpl class and add the following methods:



5. Make the following entries in liferay-portlet.xml file



6. create the FeedbackAssetRendererFactory class



7. create the FeedbackAssetRenderer class-



8. create the /html/feedback.jsp file.


9. create the FeedbackWorkflowHandler class -



10. We are done with all the changes now, to see our portlet in action go to control panel → Workflow Configuration and set the workflow for your custom portlet.

Tuesday, November 19, 2013

Hiding SessionErrors Default Error Message

Whenever we make use of SessionErrors to display error message in Liferay, below default error message is also displayed by Liferay.



To get rid of this default message use the below code snippet -

NOTE: This will work for specific portlet only.

Monday, November 18, 2013

Adding Success Message in Liferay Custom Portlet Configuration Page

To add success message and page refresh in configuration page, just add the following snippet in your ConfigurationImpl class's processAction method ..


Configure Solr With Liferay 6

Configuring solr on standalone tomcat-

1. download solr and unzip to any directory say d:
2. set environment variable SOLR_HOME as D:\apache-solr-1.4.1\example\solr
3. Copy D:\apache-solr-1.4.1\dist\apache-solr-1.4.1.war and paste it in \Tomcat 6.0\webapps folder. make sure rename the war file to solr.war.
4. start the tomcat to unzip the war.
5. stop tomcat
6. edit the file \Tomcat 6.0\webapps\solr\WEB-INF\web.xml. Uncomment the following entry and provide path of your SOLR_HOME

7. Start tomcat and browse http://localhost:8080/solr/admin to verify your solr installation.

Configuring Solr plugin in Liferay-

1. download the required solr-web.war compatible with your liferay version
2. put this war in LIFERAY_HOME\deploy folder
3. After deployment shut down the Liferay server as well as solr instance.
4. Edit the file D:\liferay-portal-6.1.20-ee-ga2\tomcat-7.0.27\webapps\solr-web\WEB-INF\classes\META-INF\solr-spring.xml

provide your solr instance settings as above.
5. Copy D:\liferay-portal-6.1.20-ee-ga2\tomcat-7.0.27\webapps\solr-web\WEB-INF\conf\schema.xml file and paste it into D:\apache-solr-1.4.1\example\solr\conf folder.

Now start your tomcat and then Liferay server.