Portlet Descriptor to OSGi Service Property Map

This section describes the mapping of portlet XML descriptor values to OSGi service properties that can be used when publishing OSGi Portlets.

OSGi services can contain properties in their definitions. Using OSGi service properties makes dealing with configuration concerns simple and cohesive. These properties are typically represented as key-value pairs or, more generally, as a Map-like object.

Portlet spec property keys are prefixed by:

javax.portlet.

Liferay property keys are prefixed by:

com.liferay.portlet.

The mappings essentially flatten what is found in the XML descriptor, sticking relatively closely to the original naming in order to have a memorable relationship with those definitions.

JSR-168 & JSR-286 Descriptor Mappings

Note: XPath notation derived from the Portlet XSD 4 is used in this document for simplicity.

portlet.xml XPathOSGi Portlet Service Property
/portlet-app/portlet/descriptionjavax.portlet.description=<String>
/portlet-app/portlet/portlet-name 6javax.portlet.name=<String> 6
/portlet-app/portlet/display-namejavax.portlet.display-name=<String>
/portlet-app/portlet/portlet-class1
/portlet-app/portlet/init-param/namejavax.portlet.init-param.<name>=<value>
/portlet-app/portlet/expiration-cachejavax.portlet.expiration-cache=<int>
/portlet-app/portlet/cache-scopenot supported
/portlet-app/portlet/supports/mime-typejavax.portlet.mime-type=<mime-type>
/portlet-app/portlet/supports/portlet-modejavax.portlet.portlet-mode=<mime-type>;<portlet-mode>[,<portlet-mode>]*
/portlet-app/portlet/supports/window-statejavax.portlet.window-state=<mime-type>;<window-state>[,<window-state>]*
/portlet-app/portlet/supported-localenot supported
/portlet-app/portlet/resource-bundlejavax.portlet.resource-bundle=<String>
/portlet-app/portlet/portlet-info/titlejavax.portlet.info.title=<String>
/portlet-app/portlet/portlet-info/short-titlejavax.portlet.info.short-title=<String>
/portlet-app/portlet/portlet-info/keywordsjavax.portlet.info.keywords=<String>
/portlet-app/portlet/portlet-preferencesjavax.portlet.preferences=<String>
OR
javax.portlet.preferences=classpath:<path_to_file_in_jar>
/portlet-app/portlet/security-role-refjavax.portlet.security-role-ref=<String>[,<String>]2
/portlet-app/portlet/supported-processing-event/namejavax.portlet.supported-processing-event=<String>
OR
javax.portlet.supported-processing-event=<String>;<QName>2
/portlet-app/portlet/supported-publishing-eventjavax.portlet.supported-publishing-event=<String>
OR
javax.portlet.supported-publishing-event=<String>;<QName>2
/portlet-app/portlet/supported-public-render-parameterjavax.portlet.supported-public-render-parameter=<String>2
/portlet-app/portlet/container-runtime-optionnot supported
/portlet-app/custom-portlet-modenot supported
/portlet-app/custom-window-statenot supported
/portlet-app/user-attributenot supported
/portlet-app/security-constraintnot supported
/portlet-app/resource-bundlenot supported
/portlet-app/filter
/portlet-app/filter-mapping
3
/portlet-app/default-namespacenot supported
/portlet-app/event-definitionnot supported
/portlet-app/filter/init-param/namejavax.portlet.init-param.<name>=<value>
/portlet-app/public-render-parameternot supported
/portlet-app/listenernot supported
?javax.portlet.PortletURLGenerationListener?
/portlet-app/container-runtime-optionnot supported

Liferay Descriptor Mappings

Liferay Display

liferay-display.xml XPathOSGi Portlet Service Property
/display/category\[@name\]com.liferay.portlet.display-category=<value>

Liferay Portlet

Note: XPath notation derived from Liferay Portlet 5 is used in this document for simplicity.

liferay-portlet.xml XPathOSGi Liferay Portlet Service Property
/liferay-portlet-app/portlet/portlet-namenot supported
/liferay-portlet-app/portlet/iconcom.liferay.portlet.icon=<String>
/liferay-portlet-app/portlet/virtual-pathcom.liferay.portlet.virtual-path=<String>
/liferay-portlet-app/portlet/struts-pathcom.liferay.portlet.struts-path=<String>
/liferay-portlet-app/portlet/parent-struts-pathcom.liferay.portlet.parent-struts-path=<String>
/liferay-portlet-app/portlet/configuration-pathcom.liferay.portlet.configuration-path=<String>
/liferay-portlet-app/portlet/configuration-action-class3
/liferay-portlet-app/portlet/indexer-class3
/liferay-portlet-app/portlet/open-search-class3
/liferay-portlet-app/portlet/scheduler-entry3
/liferay-portlet-app/portlet/portlet-url-class3
/liferay-portlet-app/portlet/friendly-url-mapper-class3
/liferay-portlet-app/portlet/friendly-url-mappingcom.liferay.portlet.friendly-url-mapping=<String>
/liferay-portlet-app/portlet/friendly-url-routescom.liferay.portlet.friendly-url-routes=<String>
/liferay-portlet-app/portlet/url-encoder-class3
/liferay-portlet-app/portlet/portlet-data-handler-class3
/liferay-portlet-app/portlet/staged-model-data-handler-class3
/liferay-portlet-app/portlet/template-handler3
/liferay-portlet-app/portlet/portlet-layout-listener-class3
/liferay-portlet-app/portlet/poller-processor-class3
/liferay-portlet-app/portlet/pop-message-listener-class3
/liferay-portlet-app/portlet/social-activity-interpreter-class3
/liferay-portlet-app/portlet/social-request-interpreter-class3
/liferay-portlet-app/portlet/social-interactions-configuration3
/liferay-portlet-app/portlet/user-notification-definitionsnot supported
/liferay-portlet-app/portlet/user-notification-handler-class3
/liferay-portlet-app/portlet/webdav-storage-tokennot supported
/liferay-portlet-app/portlet/webdav-storage-class3
/liferay-portlet-app/portlet/xml-rpc-method-class3
/liferay-portlet-app/portlet/control-panel-entry-categorycom.liferay.portlet.control-panel-entry-category=<String>
/liferay-portlet-app/portlet/control-panel-entry-weightcom.liferay.portlet.control-panel-entry-weight=<double>
/liferay-portlet-app/portlet/control-panel-entry-class3
/liferay-portlet-app/portlet/asset-renderer-factory3
/liferay-portlet-app/portlet/atom-collection-adapter3
/liferay-portlet-app/portlet/custom-attributes-display3
/liferay-portlet-app/portlet/ddm-display3
/liferay-portlet-app/portlet/permission-propagator3
/liferay-portlet-app/portlet/trash-handler3
/liferay-portlet-app/portlet/workflow-handler3
/liferay-portlet-app/portlet/preferences-company-widecom.liferay.portlet.preferences-company-wide=<boolean>
/liferay-portlet-app/portlet/preferences-unique-per-layoutcom.liferay.portlet.preferences-unique-per-layout=<boolean>
/liferay-portlet-app/portlet/preferences-owned-by-groupcom.liferay.portlet.preferences-owned-by-group=<boolean>
/liferay-portlet-app/portlet/use-default-templatecom.liferay.portlet.use-default-template=<boolean>
/liferay-portlet-app/portlet/show-portlet-access-deniedcom.liferay.portlet.show-portlet-access-denied=<boolean>
/liferay-portlet-app/portlet/show-portlet-inactivecom.liferay.portlet.show-portlet-inactive=<boolean>
/liferay-portlet-app/portlet/action-url-redirectcom.liferay.portlet.action-url-redirect=<boolean>
/liferay-portlet-app/portlet/restore-current-viewcom.liferay.portlet.restore-current-view=<boolean>
/liferay-portlet-app/portlet/maximize-editcom.liferay.portlet.maximize-edit=<boolean>
/liferay-portlet-app/portlet/maximize-helpcom.liferay.portlet.maximize-help=<boolean>
/liferay-portlet-app/portlet/pop-up-printcom.liferay.portlet.pop-up-print=<boolean>
/liferay-portlet-app/portlet/layout-cacheablecom.liferay.portlet.layout-cacheable=<boolean>
/liferay-portlet-app/portlet/instanceablecom.liferay.portlet.instanceable=<boolean>
/liferay-portlet-app/portlet/remoteablecom.liferay.portlet.remoteable=<boolean>
/liferay-portlet-app/portlet/scopeablecom.liferay.portlet.scopeable=<boolean>
/liferay-portlet-app/portlet/single-page-applicationcom.liferay.portlet.single-page-application=<boolean>
/liferay-portlet-app/portlet/user-principal-strategycom.liferay.portlet.user-principal-strategy=<String>
/liferay-portlet-app/portlet/private-request-attributescom.liferay.portlet.private-request-attributes=<boolean>
/liferay-portlet-app/portlet/private-session-attributescom.liferay.portlet.private-session-attributes=<boolean>
/liferay-portlet-app/portlet/autopropagated-parameterscom.liferay.portlet.autopropagated-parameters=<String>2
/liferay-portlet-app/portlet/requires-namespaced-parameterscom.liferay.portlet.requires-namespaced-parameters=<boolean>
/liferay-portlet-app/portlet/action-timeoutcom.liferay.portlet.action-timeout=<int>
/liferay-portlet-app/portlet/render-timeoutcom.liferay.portlet.render-timeout=<int>
/liferay-portlet-app/portlet/render-weightcom.liferay.portlet.render-weight=<int>
/liferay-portlet-app/portlet/ajaxablecom.liferay.portlet.ajaxable=<boolean>
/liferay-portlet-app/portlet/header-portal-csscom.liferay.portlet.header-portal-css=<String>2
/liferay-portlet-app/portlet/header-portlet-csscom.liferay.portlet.header-portlet-css=<String>2
/liferay-portlet-app/portlet/header-portal-javascriptcom.liferay.portlet.header-portal-javascript=<String>2
/liferay-portlet-app/portlet/header-portlet-javascriptcom.liferay.portlet.header-portlet-javascript=<String>2
/liferay-portlet-app/portlet/footer-portal-csscom.liferay.portlet.footer-portal-css=<String>2
/liferay-portlet-app/portlet/footer-portlet-csscom.liferay.portlet.footer-portlet-css=<String>2
/liferay-portlet-app/portlet/footer-portal-javascriptcom.liferay.portlet.footer-portal-javascript=<String>2
/liferay-portlet-app/portlet/footer-portlet-javascriptcom.liferay.portlet.footer-portlet-javascript=<String>2
/liferay-portlet-app/portlet/css-class-wrappercom.liferay.portlet.css-class-wrapper=<String>
/liferay-portlet-app/portlet/facebook-integrationcom.liferay.portlet.facebook-integration=<String>
/liferay-portlet-app/portlet/add-default-resourcecom.liferay.portlet.add-default-resource=<boolean>
/liferay-portlet-app/portlet/systemcom.liferay.portlet.system=<boolean>
/liferay-portlet-app/portlet/activecom.liferay.portlet.active=<boolean>
/liferay-portlet-app/portlet/includenot supported
  • [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] http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd

  • [5] http://www.liferay.com/dtd/liferay-portlet-app_7_0_0.dtd

  • [6] Liferay DXP creates each portlet’s ID based on the portlet’s name (i.e., the portlet-name descriptor in liferay-portlet.xml or the javax.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 DXP logs a message like this:

    Portlet id [portletId] is already in use
    
« Liferay API ModulesClasses Moved from portal-service.jar »
¿Fue útil este artículo?
Usuarios a los que les pareció útil: 0 de 0