Difference between revisions of "Developing gCube Portlets Guide"
(→Integrate a GWT2 Web Application Project) |
(→Integrate a GWT2 Web Application Project) |
||
Line 108: | Line 108: | ||
---- | ---- | ||
− | + | Now '''copy your GWT src packages into Dynamic Web Project''' |
Revision as of 16:51, 25 June 2010
Contents
Development of a gCube Portlet
Prerequisites
- IDE: Eclipse 3.4+ J2EE with the following plugins installed
- Portal Pack 2.0.1 [PPAC] get PPAC Eclipse Plugin
- Google Eclipse Plugin [GECLIPSE] (If you want your portlet to use GWT) get GECLIPSE
- GWT 2.03 (Bundled with the above Plugin)
Creating an empty Portlet Project
- Create a new Dynamic Web Project using eclipse
- In the Wizard next step we are going to add support for Porlet 2.0. and specify Tomcat 5.5 as Target Runtime (Optional)
- Finally in the Wizard last step we change "Web Content" to "war" as Content Directory (To have ETICS and GWT2 Projects compatibility)
Portlet creation
To create your portlet using eclipse, click on your newly created project > New -> Other -> JavaPortlet.
You are also required to change your project default output folder from <MyGCubePortletName>/build/classes to <MyGCubePortletName>/war/WEB-INF/classes
If you performed the above procedure correctly now your project should look similar to the picture below:
You have created a Standard Portlet Project, to generate a war simple use the Eclipse Export > War Wizard
Adapting your Portlet to Liferay Portal
D4Science II Project as chosen to move to Liferay Portal from its 1.9 release. In order to make your portlet be deployable on Liferay you need to add some Liferay Portal specific deployment descriptor xml and property files.
Create two empty xml files into your project war WEB-INF folder and name them
- liferay-portlet.xml
- liferay-display.xml
Create 1 empty xml file into your project war WEB-INF folder and name it
- liferay-plugin-package.properties
Content for the above files
<MyGCubePortletName> has to be changed with your actual portlet name
- liferay-portlet.xml
The elements that should be placed in that file must follow the exact order
<portlet> <portlet-name><MyGCubePortletName></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>
- liferay-display.xml
The element 'category' is recommended to use the name "gCube Applications"
<display> <category name="gCube Applications"> <portlet id="<MyGCubePortletName>" /> </category> </display>
- liferay-plugin-package.properties
name=<MyGCubePortletName> module-group-id=liferay module-incremental-version=1 tags= short-description= change-log= page-url=http://www.d4science.eu author=D4Science EU licenses=
If you performed the above procedure correctly now your project should look similar to the picture below:
Integrate a GWT2 Web Application Project
Adapting your GWT2 Project is now a straightforward procedure. (We assume you have the GWT Eclipse Plugin Installed)
To add GWT support to your project go to your Project Properties: Google -> Web Toolkit -> Use Google Web Toolkit
Now copy your GWT src packages into Dynamic Web Project