Portlet Descriptor to OSGi Service Property Map
Here’s a map of portlet XML descriptor values to OSGi service properties for publishing OSGi Portlets. The properties centralize and simplify portlet configuration. They are typically represented as key-value pairs or, more generally, as a Map-like object.
The property keys essentially flatten the XML descriptors but resemble the descriptor names.
The mappings are organized by descriptor type:
-
Standard portlet descriptor. Property keys use this prefix:
javax.portlet.
-
Liferay descriptor descriptor. Property keys use this prefix:
com.liferay.portlet.
The Liferay descriptors are grouped further by descriptor file name:liferay-display.xml
liferay-portlet.xml
The standard portlet descriptor mappings are first.
Portlet Descriptor Mappings
Note: XPath notation derived from the Portlet XSD 4 is used for simplicity.
portlet.xml XPath | OSGi Portlet Service Property |
---|---|
/portlet-app/container-runtime-option | not supported for the portlet-app scope |
/portlet-app/custom-portlet-mode | not supported |
/portlet-app/custom-window-state | not supported |
/portlet-app/default-namespace | javax.portlet.default-namespace=<String> |
/portlet-app/event-definition | javax.portlet.event-definition=<QNameLocalPart>;<QNameURI>[;<PayloadType>][,<AliasQNameLocalPart>;<AliasQNameURI>] 2 |
/portlet-app/filter /portlet-app/filter/init-param/name /portlet-app/filter-mapping | 3javax.portlet.init-param.<name>=<value> 3, 93 |
/portlet-app/public-render-parameter | not supported |
/portlet-app/resource-bundle | not supported for the portlet-app scope |
/portlet-app/security-constraint | not supported |
/portlet-app/user-attribute | not supported |
/portlet-app/version | javax.portlet.version=<value> |
/portlet-app/portlet/async-supported | javax.portlet.async-supported=<boolean> |
/portlet-app/portlet/cache-scope | not supported |
/portlet-app/portlet/container-runtime-option | javax.portlet.container-runtime-option.<name>=<value> 2 |
/portlet-app/portlet/dependency | javax.portlet.dependency=<name>;<scope>;<version> 2, 6 |
/portlet-app/portlet/description | javax.portlet.description=<String> |
/portlet-app/portlet/display-name | javax.portlet.display-name=<String> |
/portlet-app/portlet/expiration-cache | javax.portlet.expiration-cache=<int> |
/portlet-app/portlet/init-param/name | javax.portlet.init-param.<name>=<value> |
/portlet-app/portlet/listener | javax.portlet.listener=<listener-class>;<ordinal> 2,8 |
/portlet-app/portlet/multipart-config/file-size-threshold | javax.portlet.multipart.file-size-threshold=<Integer> |
/portlet-app/portlet/multipart-config/location | javax.portlet.multipart.location=<String> |
/portlet-app/portlet/multipart-config/max-file-size | javax.portlet.multipart.max-file-size=<Long> |
/portlet-app/portlet/multipart-config/max-request-size | javax.portlet.multipart.max-request-size=<Long> |
/portlet-app/portlet/portlet-class | 1 |
/portlet-app/portlet/portlet-info/keywords | javax.portlet.info.keywords=<String> |
/portlet-app/portlet/portlet-info/short-title | javax.portlet.info.short-title=<String> |
/portlet-app/portlet/portlet-info/title | javax.portlet.info.title=<String> |
/portlet-app/portlet/portlet-name 10 | javax.portlet.name=<String> 10 |
/portlet-app/portlet/portlet-preferences | javax.portlet.preferences=<String> OR javax.portlet.preferences=classpath:<path_to_file_in_jar> |
/portlet-app/portlet/portlet-preferences/preferences-validator | javax.portlet.preferences-validator=<String> 1 |
/portlet-app/portlet/resource-bundle | javax.portlet.resource-bundle=<String> |
/portlet-app/portlet/security-role-ref | javax.portlet.security-role-ref=<String>[,<String>] 2 |
/portlet-app/portlet/supported-locale | javax.portlet.supported-locale=<String> 2 |
/portlet-app/portlet/supported-processing-event | javax.portlet.supported-processing-event=<QNameLocalPart> OR javax.portlet.supported-processing-event=<QNameLocalPart>;<QNameURI> 2 |
/portlet-app/portlet/supported-public-render-parameter | javax.portlet.supported-public-render-parameter=<String> 2 |
/portlet-app/portlet/supported-publishing-event | javax.portlet.supported-publishing-event=<QNameLocalPart> OR javax.portlet.supported-publishing-event=<QNameLocalPart>;<QNameURI> 2 |
/portlet-app/portlet/supports/mime-type | not supported |
/portlet-app/portlet/supports/portlet-mode | javax.portlet.portlet-mode=<mime-type>;<portlet-mode>[,<portlet-mode>]* |
/portlet-app/portlet/supports/window-state | javax.portlet.window-state=<mime-type>;<window-state>[,<window-state>]* |
Liferay Descriptor Mappings
Liferay Display
liferay-display.xml XPath | OSGi Portlet Service Property |
---|---|
/display/category[@name] | com.liferay.portlet.display-category=<value> |
Liferay Portlet
Note: XPath notation derived from Liferay Portlet 5 is used for simplicity.
liferay-portlet.xml XPath | OSGi Liferay Portlet Service Property |
---|---|
/liferay-portlet-app/portlet/action-timeout | com.liferay.portlet.action-timeout=<int> |
/liferay-portlet-app/portlet/action-url-redirect | com.liferay.portlet.action-url-redirect=<boolean> |
/liferay-portlet-app/portlet/active | com.liferay.portlet.active=<boolean> |
/liferay-portlet-app/portlet/add-default-resource | com.liferay.portlet.add-default-resource=<boolean> |
/liferay-portlet-app/portlet/ajaxable | com.liferay.portlet.ajaxable=<boolean> |
/liferay-portlet-app/portlet/application-type | com.liferay.portlet.application-type=full-page-application or com.liferay.portlet.application-type=widget 2 |
/liferay-portlet-app/portlet/asset-renderer-factory | 3 |
/liferay-portlet-app/portlet/atom-collection-adapter | 3 |
/liferay-portlet-app/portlet/autopropagated-parameters | com.liferay.portlet.autopropagated-parameters=<String> 2 |
/liferay-portlet-app/portlet/configuration-action-class | 3 |
/liferay-portlet-app/portlet/configuration-path | not supported |
/liferay-portlet-app/portlet/control-panel-entry-category | com.liferay.portlet.control-panel-entry-category=<String> |
/liferay-portlet-app/portlet/control-panel-entry-class | 3 |
/liferay-portlet-app/portlet/control-panel-entry-weight | com.liferay.portlet.control-panel-entry-weight=<double> |
/liferay-portlet-app/portlet/css-class-wrapper | com.liferay.portlet.css-class-wrapper=<String> |
/liferay-portlet-app/portlet/custom-attributes-display | 3 |
/liferay-portlet-app/portlet/ddm-display | 3 |
/liferay-portlet-app/portlet/facebook-integration | not supported |
/liferay-portlet-app/portlet/footer-portal-css | com.liferay.portlet.footer-portal-css=<String> 2 |
/liferay-portlet-app/portlet/footer-portal-javascript | com.liferay.portlet.footer-portal-javascript=<String> 2 |
/liferay-portlet-app/portlet/footer-portlet-css | com.liferay.portlet.footer-portlet-css=<String> 2 |
/liferay-portlet-app/portlet/footer-portlet-javascript | com.liferay.portlet.footer-portlet-javascript=<String> 2 |
/liferay-portlet-app/portlet/friendly-url-mapper-class | 3 |
/liferay-portlet-app/portlet/friendly-url-mapping | com.liferay.portlet.friendly-url-mapping=<String> |
/liferay-portlet-app/portlet/friendly-url-routes | com.liferay.portlet.friendly-url-routes=<String> |
/liferay-portlet-app/portlet/header-portal-css | com.liferay.portlet.header-portal-css=<String> 2 |
/liferay-portlet-app/portlet/header-portal-javascript | com.liferay.portlet.header-portal-javascript=<String> 2 |
/liferay-portlet-app/portlet/header-portlet-css | com.liferay.portlet.header-portlet-css=<String> 2 |
/liferay-portlet-app/portlet/header-portlet-javascript | com.liferay.portlet.header-portlet-javascript=<String> 2 |
/liferay-portlet-app/portlet/header-request-attribute-prefix | com.liferay.portlet.header-request-attribute-prefix=<String> 7 |
/liferay-portlet-app/portlet/header-timeout | header-timeout=<int> |
/liferay-portlet-app/portlet/icon | com.liferay.portlet.icon=<String> |
/liferay-portlet-app/portlet/include | com.liferay.portlet.include=<boolean> |
/liferay-portlet-app/portlet/indexer-class | 3 |
/liferay-portlet-app/portlet/instanceable | com.liferay.portlet.instanceable=<boolean> |
/liferay-portlet-app/portlet/layout-cacheable | com.liferay.portlet.layout-cacheable=<boolean> |
/liferay-portlet-app/portlet/maximize-edit | com.liferay.portlet.maximize-edit=<boolean> |
/liferay-portlet-app/portlet/maximize-help | com.liferay.portlet.maximize-help=<boolean> |
/liferay-portlet-app/portlet/open-search-class | 3 |
/liferay-portlet-app/portlet/parent-struts-path | com.liferay.portlet.parent-struts-path=<String> |
/liferay-portlet-app/portlet/partial-action-serve-resource | com.liferay.portlet.partial-action-serve-resource=<boolean> |
/liferay-portlet-app/portlet/permission-propagator | 3 |
/liferay-portlet-app/portlet/poller-processor-class | 3 |
/liferay-portlet-app/portlet/pop-message-listener-class | 3 |
/liferay-portlet-app/portlet/pop-up-print | com.liferay.portlet.pop-up-print=<boolean> |
/liferay-portlet-app/portlet/portlet-data-handler-class | 3 |
/liferay-portlet-app/portlet/portlet-dependency-css-enabled | com.liferay.portlet.portlet-dependency-css-enabled=<boolean> |
/liferay-portlet-app/portlet/portlet-dependency-javascript-enabled | com.liferay.portlet.dependency-javascript-enabled=<boolean> |
/liferay-portlet-app/portlet/portlet-layout-listener-class | 3 |
/liferay-portlet-app/portlet/portlet-name | not supported |
/liferay-portlet-app/portlet/portlet-url-class | 3 |
/liferay-portlet-app/portlet/preferences-company-wide | com.liferay.portlet.preferences-company-wide=<boolean> |
/liferay-portlet-app/portlet/preferences-owned-by-group | com.liferay.portlet.preferences-owned-by-group=<boolean> |
/liferay-portlet-app/portlet/preferences-unique-per-layout | com.liferay.portlet.preferences-unique-per-layout=<boolean> |
/liferay-portlet-app/portlet/private-request-attributes | com.liferay.portlet.private-request-attributes=<boolean> |
/liferay-portlet-app/portlet/private-session-attributes | com.liferay.portlet.private-session-attributes=<boolean> |
/liferay-portlet-app/portlet/remoteable | not supported |
/liferay-portlet-app/portlet/render-timeout | com.liferay.portlet.render-timeout=<int> |
/liferay-portlet-app/portlet/render-weight | com.liferay.portlet.render-weight=<int> |
/liferay-portlet-app/portlet/requires-namespaced-parameters | com.liferay.portlet.requires-namespaced-parameters=<boolean> |
/liferay-portlet-app/portlet/restore-current-view | com.liferay.portlet.restore-current-view=<boolean> |
/liferay-portlet-app/portlet/scheduler-entry | 3 |
/liferay-portlet-app/portlet/scopeable | com.liferay.portlet.scopeable=<boolean> |
/liferay-portlet-app/portlet/show-portlet-access-denied | com.liferay.portlet.show-portlet-access-denied=<boolean> |
/liferay-portlet-app/portlet/show-portlet-inactive | com.liferay.portlet.show-portlet-inactive=<boolean> |
/liferay-portlet-app/portlet/single-page-application | com.liferay.portlet.single-page-application=<boolean> |
/liferay-portlet-app/portlet/social-activity-interpreter-class | 3 |
/liferay-portlet-app/portlet/social-request-interpreter-class | 3 |
/liferay-portlet-app/portlet/social-interactions-configuration | 3 |
/liferay-portlet-app/portlet/staged-model-data-handler-class | 3 |
/liferay-portlet-app/portlet/struts-path | com.liferay.portlet.struts-path=<String> |
/liferay-portlet-app/portlet/system | com.liferay.portlet.system=<boolean> |
/liferay-portlet-app/portlet/template-handler | 3 |
/liferay-portlet-app/portlet/trash-handler | 3 |
/liferay-portlet-app/portlet/url-encoder-class | 3 |
/liferay-portlet-app/portlet/use-default-template | com.liferay.portlet.use-default-template=<boolean> |
/liferay-portlet-app/portlet/user-notification-definitions | 3 |
/liferay-portlet-app/portlet/user-notification-handler-class | 3 |
/liferay-portlet-app/portlet/user-principal-strategy | com.liferay.portlet.user-principal-strategy=<String> |
/liferay-portlet-app/portlet/virtual-path | com.liferay.portlet.virtual-path=<String> |
/liferay-portlet-app/portlet/webdav-storage-class | 3 |
/liferay-portlet-app/portlet/webdav-storage-token | declared in the webdav-storage-token=<string> WebDavStorage OSGi service property |
/liferay-portlet-app/portlet/workflow-handler | 3 |
/liferay-portlet-app/portlet/xml-rpc-method-class | 3 |
-
[1] Portlets are registered as concrete objects.
-
[2] Multiples of these properties may be used. This results in an array of values.
-
[3] This type is registered as an OSGi service.
-
[4] https://xmlns.jcp.org/xml/ns/portlet/portlet-app_3_0.xsd
-
[6] Here’s an example of using multiple
javax.portlet.dependency
properties.Old:
<portlet> ... <dependency> <name>jquery</name> <scope>com.jquery</scope> <version>2.1.1</version> </dependency> <dependency> <name>jsutil</name> <scope>com.mycompany</scope> <version>1.0.0</version> </dependency> ... </portlet>
New:
@Component( ... property = { ... "javax.portlet.dependency=jquery;com.jquery;2.1.1", "javax.portlet.dependency=jsutil;com.mycompany;1.0.0", ... }, service = Portlet.class ) public class MyPortlet extends GenericPortlet { ... }
-
[7] Here’s an example for the
com.liferay.portlet.header-request-attribute-prefix
property.Old:
<portlet> ... <header-request-attribute-prefix>com.mycompany</header-request-attribute-prefix> ... </portlet>
New:
@Component( property = { ... "javax.portlet.dependency=jsutil;com.mycompany;1.0.0", "com.liferay.portlet.header-request-attribute-prefix=com.mycompany", ... }, service = Portlet.class ) public class MyPortlet extends GenericPortlet { ... }
-
[8] Here’s an example for the
javax.portlet.listener
property.Old:
<portlet> ... <listener> <listener-class>com.mycompany.MyPortletURLGenerationListener</listener-class> <ordinal>1</ordinal> </listener> ... </portlet>
New:
@Component( property = { ... "javax.portlet.listener=com.mycompany.MyPortletURLGenerationListener;1", ... }, service = Portlet.class ) public class MyPortlet extends GenericPortlet { ... }
-
[9] An
javax.portlet.init-param
property can be declared like this:@Component( ... property = { ... "javax.portlet.init-param.myInitParam=1234", ... }, service = PortletFilter.class ) public class MyFilter implements RenderFilter { ... }
-
[10] Liferay creates each portlet’s ID based on the portlet’s name (i.e., the
portlet-name
descriptor inliferay-portlet.xml
or thejavax.portlet.name
OSGi service property). Dashes, periods, and spaces are allowed in the portlet name, but they and all other JavaScript unsafe characters are stripped from the name value that’s used for the portlet ID. Therefore, make your portlet name unique in light of the characters that are removed. Otherwise, if you try to deploy a portlet whose ID is the same as a portlet that’s already deployed, your portlet deployment fails and Liferay logs this message:Portlet id [portletId] is already in use