Posts

Showing posts from February, 2015

How to know which liferay version we are using

Image
Sometimes we have to know which liferay version we are using, so how can we know? We can know the liferay version in different ways. 1. Liferay has provided some utility methods to know the which liferay version we are using , Here is the utility method ReleaseInfo.getReleaseInfo() It prints this statement " Liferay Portal Community Edition 6.2 CE GA2 (Newton / Build 6201 / March 20, 2014) " as i am using community version it shoes as CE. 2. Also we can also identify by response headers as below screenshot. If your using the chrome, right click on the browser and click inscept element , and navigate to the network  . you will see the URLS , click on the any url. 3. Also we can see during server startup as below statement Liferay Portal Community Edition 6.2 CE GA2 (Newton / Build 6201 / March 20, 2014)

ECJ jar not installed

Image
Today , When I am deploying the new plugin portlet using the ant tool i got a build failed with error stack trace as,                 Task cannot continue because ECJ is not installed.                ECJ was automatically installed. Please rerun your task. As below screenshot as, So what to do ?, how to proceed further? Here it is In Eclipse Go to windows menu, click on the preferences We will see the following screesnshot select the ant and click on the Runtime , by default Classpath tab is selected, click on the Global Entries Then click on the Add External JARS button and select ECJ jar file from the <liferay-tomcat>/tomcat/lib. Click OK button to save the changes. Thats it now we can build the portlet.

Reading the scheduler value from the properties file

In liferay if we want to schedule,then we  write the enries in the liferay-portlet.xml Here we are hard code the value. What if cronValue is retreving the from the portlet.properties Yes we can reterive the value from the propeties , here is the code snippets, liferay-portlet.xml scheduler entry com.sample.scheduler.SchedulerClass cronValue Create the properties file in the /your-portlet/docroot/WEB-INF/src/ Portlet.properties ##cron value ## cronValue = 0/1 1/1 * 1* Here in liferay-portlet.xml we have set the key  " cronValue " in the element of property-key

Export users in liferay

Image
Sometimes it may require to export the users into CSV file to look into the depth of users details. To make life easier, liferay has given such functionality to us, just by clicking the button.  Navigate to the controlPanel and click on the users and Organization , there you will see a button "Export users". Click on the button to export the users. It will download a file called "User.csv" But that csv file contains only 2 columns  1. FullName 2. Email Id But we require more fields to export like(screenName, jobTitle etc) so what to do? Check the following entry in the portal.properties. # # Input a list of user attributes that will be included when exporting users # to a CSV file. You can include custom fields by adding the prefix # "expando:" to the attribute name. # users.export.csv.fields=fullName,emailAddress Add the required entries by comma separated, If you want to know the what are the fields to be added look into the Us

Applying the patches in liferay

We are using EE version of liferay and we found a bug and reported to liferay. They have given patch to solve this issue. This patch will be ZIP file. Copy the ZIP file and paste in patches folder of  this location  "<liferay-tomcat>/tomcat/patching-tool/patches". Sometimes our patching tool will contain the lower version comapared to provided version. So we need to upgrade to latest version. version number can know by using the following command as In Linux ./patching-tool.sh info In Windows patching-tool info After executing this command look into the line of   patching-version  in the  output console. Note : All of these commands should be execute from the "<liferay-tomcat>/tomcat/patching-tool". In Order to install the patch execute the following command In Linux ./patching-tool.sh install In Windows patching-tool install After applying the patch we can see the console installation completed successfully. Sometimes your

Session TimeOut

In Liferay session timeout will be 30 mins by default. If you were idle for 30 mins liferay will expire the session. Sometimes based on the requirement we want to increase the session timeout. So look into the portal.properties  file and search for the "session.timeout"  we can see the  minutes it was set. By default it was 30 minutes. # # Specify the number of minutes before a session expires. This value is # always overridden by the value set in web.xml. # session.timeout=30 Even if we increase this value it would effect because it will be override the entry in the web.xml . so as best option remove the entry in the web.xml Navigate to the tomcat folder as <tomcat>/webapps/ROOT/WEB-INF/web.xml Search for the entry " session-timeout " you can find the following snippets. 30 Remove this entry in the web.xml and increase the value in the portal-ext.properties to your value, suppose if i need to increase the session t