Difference between revisions of "GCube Portlets Deploying on Liferay"

From Gcube Wiki
Jump to: navigation, search
(Modify the configuration files)
(Modify the configuration files)
Line 37: Line 37:
  
 
* <b>Liferay-portlet.xml</b>
 
* <b>Liferay-portlet.xml</b>
<portlet>
+
  <portlet>
 
<portlet-name>”portletName”</portlet-name>
 
<portlet-name>”portletName”</portlet-name>
<icon>/icon.png</icon> //optional  
+
<icon>/icon.png</icon> <b>//optional</b>
<layout-cacheable>false</layout-cacheable> // for loading the new portlet
+
<layout-cacheable>false</layout-cacheable>  <b>// for loading the new portlet</b>
<instanceable>false</instanceable> // to use one portlet instance for the D4S portal
+
<instanceable>false</instanceable>  <b>// to use one portlet instance for the D4S portal</b>
<ajaxable>false</ajaxable> // it is need for the correct rendering of the GWT portlet  
+
<ajaxable>false</ajaxable>  <b>// it is need for the correct rendering of the GWT portlet</b>
 
<header-portlet-css>/css/test.css</header-portlet-css>
 
<header-portlet-css>/css/test.css</header-portlet-css>
</portlet>
+
  </portlet>
  
 
----
 
----

Revision as of 15:10, 21 June 2010

Gcube Portlets to Liferay

Porting and deploying the existing gCube portlets to Liferay portal is an easy task. The deployment of a portlet to Liferay requires an existing installation of the Liferay portal bundled with the Apache Tomcat server (For more information on how to install and configure Liferay portal visit: [D4Science Portal Installation] ).
The required changes are focused on the configuration files that Liferay requires and on the way the logged in user's information are retrieved. After setting up these information then the portlet can be compiled and deployed on liferay.

Create a new Liferay Portlet

  • Go to $LIFERAY_HOME/liferay-plugins-sdk/ directory
  • If the create.sh script file (located in the current directory) is not executable, change its permissions
  • Execute ./create.sh "portlet-id" "portlet-name"
  • A new directory with name portlet-name-portlet is created at the $LIFERAY_HOME/liferay-plugins-sdk/portlets directory


Liferay portlet hierarchical organization

The hierarchical organization of a liferay portlet is the following:

  • portlet-name-portlet
    • docroot
      • css
      • js
      • WEB-INF
        • classes
        • lib
        • src
        • tld
        • liferay-display.xml
        • liferay-plugin-package.properties
        • liferay-portlet.xml
        • portlet.xml
        • web.xml
      • icon.png
      • view.jsp
    • build.xml

The source code of the portlet should be copied inside the src directory.

Modify the configuration files

  • Liferay-portlet.xml
  <portlet>

<portlet-name>”portletName”</portlet-name> <icon>/icon.png</icon> //optional <layout-cacheable>false</layout-cacheable> // for loading the new portlet <instanceable>false</instanceable> // to use one portlet instance for the D4S portal <ajaxable>false</ajaxable> // it is need for the correct rendering of the GWT portlet <header-portlet-css>/css/test.css</header-portlet-css>

  </portlet>