Difference between revisions of "Building your gCube Portlet in ETICS"

From Gcube Wiki
Jump to: navigation, search
(Portlet's servicearchive configuration)
Line 89: Line 89:
 
== Portlet's servicearchive configuration ==
 
== Portlet's servicearchive configuration ==
 
=== Build Commands ===
 
=== Build Commands ===
 +
 +
''Please in following example replace QuickSearchPortlet and org.gcube.portlets-user.quick-search-portlet with actual portlet's name and component's name''
 +
 
* '''init''': mkdir -p ${prefix}/QuickSearchPortlet/lib;
 
* '''init''': mkdir -p ${prefix}/QuickSearchPortlet/lib;
 
* '''install''': cp ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/etc/profile.xml ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/README ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/LICENSE ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/INSTALL ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/CHANGELOG ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/MAINTAINERS ${prefix}; cp ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/installPortlet.sh ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/build.xml ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/build.properties ${prefix}/QuickSearchPortlet; cp `find ${org.gcube.portlets-user.quick-search-portlet.moduleDir} -name "*.war" -print` ${prefix}/QuickSearchPortlet/lib; echo ${org.gcube.portlets-user.quick-search-portlet.vcsroot}/${org.gcube.portlets-user.quick-search-portlet.tag} > ${prefix}/QuickSearchPortlet/svnpath.txt;
 
* '''install''': cp ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/etc/profile.xml ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/README ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/LICENSE ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/INSTALL ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/CHANGELOG ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/MAINTAINERS ${prefix}; cp ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/installPortlet.sh ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/build.xml ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/build.properties ${prefix}/QuickSearchPortlet; cp `find ${org.gcube.portlets-user.quick-search-portlet.moduleDir} -name "*.war" -print` ${prefix}/QuickSearchPortlet/lib; echo ${org.gcube.portlets-user.quick-search-portlet.vcsroot}/${org.gcube.portlets-user.quick-search-portlet.tag} > ${prefix}/QuickSearchPortlet/svnpath.txt;
 +
 +
=== Dependencies ===
 +
Servicearchive's configuration must express a configuration on portlet

Revision as of 12:04, 8 July 2010

Build Scripts

To build portlets 3 standard scripts have been created that should be suitable for all portlets. These files are:

Please copy those file in your portlet's root directory.


build.xml

Targets provided by build.xml are:

  • setenv: sets classpath. All other targets depend on it;
  • compile: compiles java soruces
  • gwt-compile: runs gwt compiler
  • war: creates war package
  • javadoc: runs javadoc compiler
  • d4s-deploy: used for automatic portlet's deploy

Download from here the build.xml file. File:Build.xml

build.properties

Following properties, at least, must be customized:

  • war.filename
  • gwt-module (if any)
  • javadoc.doctitle
  • javadoc.windowtitle

Download from here the basic build.properties file. File:Build.properties

installPortlet.sh

Create a file named installPortlet.sh in your portlet's root directory containing:

#!/bin/bash
#
if [ -f "$HOME/.bashrc_portal" ]
then
	source "$HOME/.bashrc_portal"
fi

if [ -z "$CATALINA_HOME"  ]
then
	echo  "Cannot deploy portlet(s), tomcat was not detected!"
	exit 1
else
	ant -f build.xml d4s-deploy >& ant_logs.txt
	if [ $? != 0 ]
	then
		echo  "Cannot deploy portlet(s), build was not successfull!"
		exit 1
	fi
exit 0
fi

ETICS Configuration

In this page a guide to create an ETICS configuration for a D4Science-II portlet is provided.

Build Commands

Build commands specification is quite straightforward: you can refer to following screenshot.

PortletBuildCommands.png


clean: ant clean

compile: ant compile gwt-compile war

doc: ant javadoc

install: mkdir -p ${prefix}/lib; cp build/*.war ${prefix}/lib; cp -r doc/ ${prefix}

Dependencies

In order to simplify portlet's dependencies management a special component has been created: org.gcube.portal.portal-framework. This component aims to:

  • decouple portlets from the specific portal implementation (e.g.: gridsphere, liferay,...);
  • provide a common environment to compile portlets;


All portlets should express a dependency on org.gcube.portal.portal-framework.

portal-framework details

At the moment, org.gcube.portal.portal-framework provide portlets that express it as dependency with:

  • a PORTAL_HOME env variable that point to actual location on filesystem of portal libraries;
  • a GWT_HOME anv variable that point to actual location of gwt installation directory;
  • gwt dependency;
  • liferay dependency;

Portlet's servicearchive configuration

Build Commands

Please in following example replace QuickSearchPortlet and org.gcube.portlets-user.quick-search-portlet with actual portlet's name and component's name

  • init: mkdir -p ${prefix}/QuickSearchPortlet/lib;
  • install: cp ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/etc/profile.xml ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/README ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/LICENSE ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/INSTALL ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/CHANGELOG ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/MAINTAINERS ${prefix}; cp ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/installPortlet.sh ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/build.xml ${org.gcube.portlets-user.quick-search-portlet.moduleDir}/build.properties ${prefix}/QuickSearchPortlet; cp `find ${org.gcube.portlets-user.quick-search-portlet.moduleDir} -name "*.war" -print` ${prefix}/QuickSearchPortlet/lib; echo ${org.gcube.portlets-user.quick-search-portlet.vcsroot}/${org.gcube.portlets-user.quick-search-portlet.tag} > ${prefix}/QuickSearchPortlet/svnpath.txt;

Dependencies

Servicearchive's configuration must express a configuration on portlet