Official Liferay Documentation
Liferay 6.2
Preparing the app
General Requirements
App Name:
Must not be longer than 50 characters.
Compatibility:
Please include a "+" at the end of the latest version when specifying version constraints in your liferay-plugin-package.properties file.
liferay-versions=6.2.0+,6.2.10+
Icon:
Icons for your app must be exactly 90 pixels in both height and width.
Must be in PNG, JPG, or GIF format.
The image size cannot exceed 512kb.
Animated images are prohibited.
Screenshots:
Screenshots for your app must not exceed 1080 pixels in width x 678 pixels in height.
Must be in the JPG format.
The file size of each screenshot must not exceed 384KB.
Each screenshot should preferably be the same size (each will be automatically scaled to match the aspect ratio of the above dimensions)
It is preferable if they are named sequentially, for example fluffy-puppies-01.jpg, fluffy-puppies-02.jpg, and so on.
Deployment Requirements
- JRE:
- Liferay Portal 6.2 targets Java 1.7.
- Set the Java version by overriding the
ant.build.javac.target
property in the Plugins SDK’sbuild.properties
file.
- Liferay Portal 6.2 targets Java 1.7.
- WAR:
- WAR files must contain a
WEB-INF/liferay-plugin-package.properties
file. - WAR files must NOT contain any
WEB-INF/liferay-plugin-package.xml
file. - WAR file names must NOT contain any commas.
- WAR file names must conform to the following naming convention: rl-context_name
-
plugin_type-A.B.C.D.war
- context_name: Alpha-numeric (including
-
and_
) short name of your app. This name is used as the deployment context, and must not duplicate any other app’s context - plugin_type: one of the following:
hook
,layouttpl
,portlet
,theme
, orweb
. A.B.C.D
: The 4 digit version of your WAR file. 4 digits must be used.- Example:
rl-address-validator-portlet-1.0.0.0.war
- context_name: Alpha-numeric (including
- WAR files must contain a
WEB-INF/
liferay-plugin-package.properties
file:- Property
recommended.deployment.context
must NOT be set. - Setting property
security-manager-enabled
totrue
is mandatory for all paid apps on 6.1 CE GA3, 6.1 EE GA3, and later; the setting is optional for free apps. - Setting this property to
true
enables Liferay’s Plugin Security Manager. If you’re enabling the security manager, you’ll also need to define your Portal Access Control List (PACL) in this file.
- Property
- Define the Portal Access Control List (PACL):
- Setup a empty liferay CE portal instance with the latest release and fix pack. Log in as Alaaeldin El-Nattar and download the latest release here: https://web.liferay.com/group/customer/products/portal/6.2
- Start the server as usual so the database is populated with the portal tables.
- Shutdown the server.
Add the next property in the portal-ext.properties file:
portal.security.manager.strategy=liferayAdd the next parameters in the /tomcat-7.0.62/bin/setenv.sh file
-Djava.security.manager -Djava.security.policy==$CATALINA_BASE
/conf/catalina
.policy
- Open the next file: liferay-portal-6.2-ce-ga6/tomcat-7.0.62/conf/server.xml
Find the <Host> tag and add the next attribute: deployXML="true". So it looks like this:
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true" deployXML="true">- Start the server with the next command: ./startup.sh -security
- A log saying "Using Security Manager" should be displayed.
- Wait for the server to be up.
Before deploying any plugin make sure the property security-manager-enabled is set to "generate"
liferay-plugin-package.properties
security-manager-enabled=generate
- When you deploy your plugins and you will see a file like this: liferay-portal-6.2-ce-ga6/pacl-policy/plugin-name.pacl-policy
- Copy the content of plugin-name.pacl-policy and paste it in the
liferay-plugin-package.properties file.
Change the property security-manager-enabled to true.
The file liferay-plugin-package.properties should look like this:
name=Address Validator
module-group-id=rivetlogic
module-incremental-version=1
tags=validator, validation, verification, verificator, address, google geocode, map, location
short-description=The Address validator plugin enables the verification of \
addresses entered by the user. It uses some third party services or APIs for that purpose.
change-log=
page-url=http://rivetlogic.com/
author=Rivet Logic Corporation
licenses=GPLv3
portal-dependency-jars=\
jstl-api.jar,\
jstl-impl.jar
long-description=The initial implementation uses Google Geocoding API, \
but it can be extended to use different APIs. The Address validation is optional, \
this means users can choose not use it and they can store not invalid addresses.
liferay-versions=6.2.0+,6.2.10+
security-manager-enabled=true
security-manager-files-read=\
${liferay.web.portal.dir}/WEB-INF/lib/velocity.jar
security-manager-hook-custom-jsp-dir-enabled=\
true
security-manager-hook-portal-properties-keys=\
application.startup.events,\
portlet.add.default.resource.check.whitelist,\
rivetlogic.address.validation.api,\
value.object.listener.com.liferay.portal.model.Address
security-manager-properties-read=\
file.separator,\
java.version,\
line.separator,\
log4j.configDebug,\
log4j.configuration,\
log4j.configuratorClass,\
log4j.debug,\
log4j.defaultInitOverride,\
log4j.ignoreTCL,\
portal:velocity.engine.logger,\
portal:velocity.engine.logger.category
security-manager-services[portal]=\
com.liferay.portal.service.ResourcePermissionLocalService#setResourcePermissions,\
com.liferay.portal.service.RoleLocalService#getRole,\
com.liferay.portlet.expando.service.ExpandoColumnLocalService#addColumn,\
com.liferay.portlet.expando.service.ExpandoColumnLocalService#getColumn,\
com.liferay.portlet.expando.service.ExpandoTableLocalService#addDefaultTable,\
com.liferay.portlet.expando.service.ExpandoTableLocalService#getDefaultTable,\
com.liferay.portal.service.RegionService#getRegion,\
com.liferay.portal.service.CountryService#getCountry,\
com.liferay.portal.service.CountryService#fetchCountryByA2,\
com.liferay.portlet.expando.service.ExpandoValueLocalService#deleteValues,\
com.liferay.portal.service.RoleLocalService#getRole,\
com.liferay.portal.service.ResourcePermissionLocalService#setResourcePermissions
security-manager-sockets-connect=\
maps.googleapis.com:443
security-manager-expando-bridge=\
com.liferay.portal.model.AddressPlease be sure the plugin has not been deployed to the portal before. Many scripts runs when the plugin is installed the first time.
If the plugin was installed before, please generate the PACL security file in another portal OR do these steps:
+ undeploy the plugin, remove it from webapps (tomcat), wait the logs shows the plugin is undeployed
+ shutdown liferay
+ clean tmp and work folders (tomcat)
+ drop the database and create it again
+ start liferay
+ drop the plugin in the deploy folder