Thursday, May 23, 2013

Difference between JSR 168 and JSR 286 Liferay

JSR 168 VS JSR 286

There are Major and Minor Improvements in  JSR 286 while compare with JST 168 

Major Improvements :-

*. Events Handling – enabling a portlet to send and receive events and perform state changes or send further events as a result of processing an event. 
*. Public render parameters ( Shared Parameters) – allowing portlets to share parameters with other portlets.
*. Resource serving (Resource Addressing) – provides the ability for a portlet to serve a resource
*. Portlet filter – allowing on -the -fly transformations of information in both the request to and the response from a portlet.

Minor Improvemetns :- 


  • getNamespace() – this method gives unique value for the portlet window
  • getWindowsID()- this method returns portlet window ID
  • Portlet Cookies- Can beset  on particular phase and retrieved on the subsequest phase
  • Additions to PortletRequestDispatcher
  • Portlet container runtime options

Monday, April 15, 2013

Reindexing all Indexes by using properties file Liferay

To Reindex all indexes add the below properties in the portal-ext.properties.

This file is available in "tomcat\webapps\root\web-inf\classes\portal-ext.properties".

index.on.startup=true


users.indexer.enabled=false

users.search.with.index=false

organizations.indexer.enabled=false

organizations.search.with.index=false

Monday, February 25, 2013

Remove Link to Anchor tag using css

.html :-

<a href="sample.jsp" class="removelink"> Click me </a>

.css :-

.removelink {
      text-decoration: none;
      pointer-events : none;
}

Thursday, February 21, 2013

Jsp Pages are Not Loading in Mobile Browsers,Liferay

In Some Mobile Default browsers JSP Pages will not load Properly then we need to add the following code in the " Portlet.xml " file


   <supports>
          <mime-type>application/vnd.wap.xhtml+xml </mime-type>
</supports>

Tuesday, January 1, 2013

How to Display Theme Images in Portlet or Jsp Page,Liferay

First we need to reference the liferay theme tag library then only we can able to liferay theme tags

ex  :-  xmlns:liferay-theme="http://liferay.com/tld/theme"

Then Next in the JSP Page we need to instantiate the liferay objects

<liferay-theme:defineObjects />
Now the following objects are available:
  • themeDisplay - com.liferay.portal.theme.ThemeDisplay
  • company - com.liferay.portal.model.Company
  • account - com.liferay.portal.model.Account (deprecated)
  • user - com.liferay.portal.model.User
  • realUser - com.liferay.portal.model.User
  • contact - com.liferay.portal.model.Contact
  • ?layout - com.liferay.portal.model.Layout
  • ?layouts - List<com.liferay.portal.model.Layout>
  • plid - java.lang.Long
  • ?layoutTypePortlet - com.liferay.portal.model.LayoutTypePortlet
  • portletGroupId - java.lang.Long
  • permissionChecker - com.liferay.portal.security.permission.PermissionChecker
  • locale - java.util.Locale
  • timeZone - java.util.TimeZone
  • theme - com.liferay.portal.model.Theme
  • colorScheme - com.liferay.portal.model.ColorScheme
  • portletDisplay - com.liferay.portal.theme.PortletDisplay
Example : To display the image following code is sample code.

<img src="${themeDisplay.pathThemeImages}/foldername/Sample.png"/>
 themeDisplay.pathThemeImages :- It will give the path upto the images folder in theme.

foldername :- If you have created any folder inside the images folder of theme

Sample.png :- the image which u want to display in the jsp page

Thursday, December 27, 2012

Removing the Portlet Borders Through out Portal From Theme Level , Liferay

To Remove the Portlet Borders from theme Level ,

You need to write a simple code in "liferay-look-and-feel.xml " file which is in ur "Theme/docroot/WEB-INF" folder

code :-
                 <theme id="Your-Theme-Id" name="Your Theme Name">
       <settings>
            <setting key="portlet-setup-show-borders-default" value="false" />
        </settings>
    </theme>

Role checking in Template/vm file , Liferay

To perform the accesing of the service layers in web content we need to add the propertie in the portal-ext.properties file

journal.template.velocity.restricted.variables=

#set($roleLocalServiceUtil = $serviceLocator.findService("com.liferay.portal.service.RoleLocalService"))
#set($adminrole = $roleLocalServiceUtil.getRole($company_id, "Administrator"))

#set($hasadminrole = $roleLocalServiceUtil.hasUserRole($user_id, $getterUtil.getLong($adminrole.getRoleId())))

Liferay DXP JNDI Data Source Cofiguration

 This Blog will help us to learn about the JNDI Data Source Configuration in Liferay DXP. We have tested this with Liferay 7.3 with Tomcat. ...