Liferay.com

Friday, July 22, 2011

Entity caching disabling - custom portlet

In some cases we need to disable caching for some Entities in Liferay according to requirements. In one of my project i got a requirement where i got this use case for my plugin portlet


By default Liferay caches all the entities.

First Option : One way to do it is, at entity level in service.xml set cache-enabled attribute to false as below

    <entity name="MyModelEntity" table="MyModelEntity" local-service="true" remote-service="true" cache-enabled="false">

Second option:  You can disable the same @ portlet level by setting following properties, in your portal.properties underr src folder of your portlet plugin add following porperties (I am not pretty much sure about below one)

value.object.entity.cache.enabled.com.xyz.abc.common.model.MyModelEntity=false;
value.object.finder.cache.enabled.com.xyz.abc.common.model.MyModelEntity=false;

Colored in blue is path to your model entity

I hope it will helpful for some who is looking for similar stuff.

Please feel free to drop your comments

Friday, June 3, 2011

Getting context path in jsp

Some times while developing plugin portlets/hooking into existing liferay files we may need to get context path in jsps, either to make ajax calls/to navigate to different jsp in same or different folder. Here is how you will get context path in jsps

<%= request.getContextPath()%>

Comments are most welcome, if any body wants to dicuss more on this topic


Wednesday, September 22, 2010

Deployment/Undeployment with Ext plugins environment

I found some weird behavior when i started working with ext plugins using Liferay version 6.0.5. These problems are related to deployment & undeployment of ext plugins.I thought it might be helpful to beginners of new liferay ext plugins.

You will be having files related to your each ext plugin under following places

Suppose for example i have created a ext plugin named "second"

1) You will be having some jars @ temp folder of your tomcat instance @ \temp\liferay\com\liferay\portal\deploy\dependencies

In my case,
D:\projects\liferay\rNd\liferay-portal-6.0.5\tomcat-6.0.26\temp\liferay\com\liferay\portal\deploy\dependencies\ext-second-ext-util-bridges.jar
D:\projects\liferay\rNd\liferay-portal-6.0.5\tomcat-6.0.26\temp\liferay\com\liferay\portal\deploy\dependencies\ext-second-ext-util-taglib.jar
D:\projects\liferay\rNd\liferay-portal-6.0.5\tomcat-6.0.26\temp\liferay\com\liferay\portal\deploy\dependencies\ext-second-ext-util-java.jar

2) You will be having jars related to each of your ext plugin @ \webapps\ROOT\WEB-INF\lib

In my case,
D:\projects\liferay\rNd\liferay-portal-6.0.5\tomcat-6.0.26\webapps\ROOT\WEB-INF\lib\ext-second-ext-util-bridges.jar
D:\projects\liferay\rNd\liferay-portal-6.0.5\tomcat-6.0.26\webapps\ROOT\WEB-INF\lib\ext-second-ext-util-taglib.jar
D:\projects\liferay\rNd\liferay-portal-6.0.5\tomcat-6.0.26\webapps\ROOT\WEB-INF\lib\ext-second-ext-util-java.jar
D:\projects\liferay\rNd\liferay-portal-6.0.5\tomcat-6.0.26\webapps\ROOT\WEB-INF\lib\ext-second-ext-impl.jar


3) xml file related to each ext plugin will be placed @ \webapps\ROOT\WEB-INF

In my case,
D:\projects\liferay\rNd\liferay-portal-6.0.5\tomcat-6.0.26\webapps\ROOT\WEB-INF\ext-second-ext.xml

4) Service file @ global class path of app server - \lib\ext\ext-second-ext-service.jar. Since this is a shared library/global class path you cannot undeploy when server is in running state.


D:\projects\liferay\rNd\liferay-portal-6.0.5\tomcat-6.0.26\lib\ext\ext-second-ext-service.jar

5) Once your ext plugin is deployed properly you may see some message some thing like below
[ExtHotDeployListener:188] Extension environment for "YOUR_EXT_PLUGIN_NAME" has been applied. You must reboot the server and redeploy all other plugin
s.



Copy the below code to a bat file, change tomcat_home according to your tomcat instance
> you need to send your ext plugin name as parameter , in my case "second"
> before redeploying stop the server & run the following command then redeploy

@echo off
set app_name=%1
if "%app_name%" == "" goto end
set tomcat_home=E:\Liferay605\bundles\tomcat-6.0.26
rmdir /S /Q %tomcat_home%\webapps\%app_name%-ext
del /S /Q %tomcat_home%\lib\ext\ext-%app_name%-ext-service.jar
del /S /Q %tomcat_home%\webapps\ROOT\WEB-INF\lib\ext-%app_name%-ext-util-bridges.jar
del /S /Q %tomcat_home%\webapps\ROOT\WEB-INF\lib\ext-%app_name%-ext-util-taglib.jar
del /S /Q %tomcat_home%\webapps\ROOT\WEB-INF\lib\ext-%app_name%-ext-util-java.jar
del /S /Q %tomcat_home%\webapps\ROOT\WEB-INF\lib\ext-%app_name%-ext-impl.jar
del /S /Q %tomcat_home%\webapps\ROOT\WEB-INF\ext-%app_name%-ext.xml
del /S /Q %tomcat_home%\temp\liferay\com\liferay\portal\deploy\dependencies\ext-%app_name%-ext-util-bridges.jar
del /S /Q %tomcat_home%\temp\liferay\com\liferay\portal\deploy\dependencies\ext-%app_name%-ext-util-taglib.jar
del /S /Q %tomcat_home%\temp\liferay\com\liferay\portal\deploy\dependencies\ext-%app_name%-ext-util-java.jar
:end
Please post your comments/feedback/suggestions on this topic if possible

Friday, September 10, 2010

Where you can find versions of jars included Liferay

You will find the versions information @ following path

<liferay-portal-source-code>/lib/versions.html


Tuesday, September 7, 2010

Introducing Friendly URL Routes

A very good article related to Friendly URLs - Friendly URL Routes feature, which is available from Liferay version 6.0.3+. Its kind of killer feature i can say

http://www.liferay.com/web/connor.mckay/blog/-/blogs/introducing-friendly-url-routes


Wednesday, September 1, 2010

Liferay control panel changes in 6.0.x

Here are the first glance changes i observed in control panel of Liferay 6.0.4 which are marked by red arrow (Navigation changes only)


Marked by comparing with "My Account "& "Content" related sections in earlier version (5.2.3)


Marked by comparing with "Portal" & "Server" related sections of earlier version (5.2.3)



Communities/Organizations scope section moved as shown in below (near content section in Liferay 5.2.3)



Now bread crumb looks like below

New bread crumb look


Isn't it cool? :)