XML Registry Syntax

This document presents the XML syntax used by the default XML Registry implementation.

Registry

Overview

The registry element needs to be the root elements of any registry fragment. It can contains any of the currently defined entries.

DTD

<!ELEMENT registry ( portlet-entry*,
                     portlet-control-entry*,
                     portlet-controller-entry*,
                     skin-entry*,
                     media-type-entry*,
                     client-entry*,
                     security-entry*
                   )>
<!ATTLIST registry 
          version    CDATA  "1.0">
      

Portlet

Overview

The portlet-entry element is the main element encountered in the Registry. It describes a Portlet object that can be used within a portal page description.

There are 3 main types of portlet-entry definitions, controlled by the value of the type attribute in the entry:

abstract

These portlets cannot be used directly in a portlet page and simply provide a configuration template for creating ref portlet-entry.

The classname element is required in an abstract portlet

instance

These are the default portlet entries created within the registry and describe standard Java component complying to the Portlet API that can be added directly within a portal page.

The classname element is required in an instance portlet

ref

These entries are the more frequently encountered definitions in the registry. They define portlets that reference another existing portlet entry in the registry, yet override or complement the previous definitions with additionnal parameters.

The parent attribute is required in a ref portlet and must refer another existing abstract or instance portlet, but not another ref portlet.

The classname element should not occur within a ref prtlet definition.

In addition to the type attribute, portlet entries can also use standard attributes and elements that can be used in most other registry entries and are explained here

DTD

<!ELEMENT portlet-entry  ( security?,
                           security-ref?,
			   meta-info?,
			   classname?,
			   parameter*,
			   media-type*,
			   url?,
			   category* )>
<!ATTLIST portlet-entry
          name           ID                 #REQUIRED
          hidden         ( true | false )   "false"
          type           ( abstract | instance | ref ) "instance"
          application    ( true | false )   "false"
          parent         IDREF              #IMPLIED >

<!ELEMENT parameter      ( security?, security-ref?, meta-info? )>
<!ATTLIST parameter
          name           CDATA              #REQUIRED
          value          CDATA              #REQUIRED
          type           (int | boolean | string | list | style ) "string"
          cachedOnName	 ( true | false )   "false"
          cachedOnValue  ( true | false )   "false" >

<!ELEMENT classname      CDATA>

<!ELEMENT meta-info      ( title?, description?, image? ) >
<!ELEMENT title          CDATA>
<!ELEMENT description    CDATA>
<!ELEMENT image          CDATA>

<!ELEMENT media-type     EMPTY>
<!ATTLIST media-type
          ref            IDREF              #REQUIRED >

<!ELEMENT url            CDATA>
<!ATTLIST url
          cachedOnUrl    ( true | false )   "false" >

<!ELEMENT category       CDATA>
<!ATTLIST category
          group          CDATA              #IMPLIED >
      

Usage notes

Parameter handling

Some parameters have special meanings when encountered in a portlet-entry defintion:

NameMinimum

Version
Usage
_showtitlebar1.4b1 Will cause the default portlet control not to draw any title bar around the portlet. This behavior is deprecated 1.4b2 and replaced by the more powerful _control attribute associated with a no title bar control like "ClearControl"
_control1.4b2 Will cause any new instance of this portlet-entry to be associated with the control specified in the parameter value when added to a portal page.

Also note that any parameter starting with a "_" will not be ignored by the default portlet customizer.

Examples

The first example presents a minimal abstract type portlet definition. Note that it's defined as hidden to prevent the entry from showing up when browsing for portlets

<portlet-entry name="Velocity" type="abstract" hidden="true">
  <classname>org.apache.jetspeed.portal.portlets.VelocityPortlet</classname>
</portlet-entry>
      

The second example provides a standard instance type portlet definition.

<portlet-entry name="JetspeedContent" type="instance">
  <meta-info>
    <title>Jetspeed Content Example</title>
    <description>Example of Jetspeed Content portlet.</description>
  </meta-info>
  <classname>org.apache.jetspeed.portal.portlets.JetspeedContent</classname>
  <parameter name="provider-name" value="jetspeed" hidden="false"/>
  <media-type ref="html"/>
</portlet-entry>
      

The third example shows how to reference the above abstract definition and add additionnal parameters that will specify the actual behavior of the portlet.

<portlet-entry name="SecurityExample" type="ref" parent="Velocity">
  <security-ref parent="user-view_admin-all"/>
  <meta-info>
    <title>SecurityExample</title>
    <description>Simple Security Example</description>
  </meta-info>
  <parameter name="template" value="SecurityExample" hidden="false"/>
  <media-type ref="html"/>
  <category>demo</category>
  <category>velocity.demo</category>
</portlet-entry>
      

Control

Overview

The portlet-control-entry element defines the available PortletControl available to decorate the different portlets.

The portlet-control-entry definition is nearly identical to those of instance type portlet-entry, expect that there's no category, url or caching related attributes.

DTD

<!ELEMENT portlet-control-entry  ( security?,
                                   security-ref?,
			           meta-info?,
			           classname?,
			           parameter*,
			           media-type+ )>
<!ATTLIST portlet-control-entry
          name           ID                 #REQUIRED
          hidden         ( true | false )   "false" >

<!ELEMENT parameter      ( security?, security-ref?, meta-info? )>
<!ATTLIST parameter
          name           CDATA              #REQUIRED
          value          CDATA              #REQUIRED
          type           (int | boolean | string | list) "string" >

<!ELEMENT classname      CDATA>

<!ELEMENT meta-info      ( title?, description?, image? ) >
<!ELEMENT title          CDATA>
<!ELEMENT description    CDATA>
<!ELEMENT image          CDATA>

<!ELEMENT media-type     EMPTY>
<!ATTLIST media-type
          ref            IDREF               #REQUIRED >
      

Usage notes

Examples

A typical control defintion will use the default VelocityPortletControl and simply specify the associated template and working parameters.

<portlet-control-entry name="TitlePortletControl">
  <classname>org.apache.jetspeed.portal.controls.VelocityPortletControl</classname>
  <parameter name="theme" value="jetspeed.vm"/>
  <meta-info>
    <title>Simple titled control</title>
  </meta-info>
  <media-type ref="html"/>
  <media-type ref="wml"/>
</portlet-control-entry>
      

Controller

Overview

The portlet-controller-entry element defines the available PortletController that are used to lay out a pane content.

The syntax and usage of this element is exactly the same as the portlet-control-entry

DTD

<!ELEMENT portlet-controller-entry ( parameter*, media-type+ )>
<!ATTLIST portlet-controller-entry
          name           ID                 #REQUIRED
          hidden         ( true | false )   "false" >

<!ELEMENT parameter EMPTY>
<!ATTLIST parameter
          name           CDATA              #REQUIRED
          value          CDATA              #REQUIRED
          type           (int | boolean | string | list ) "string" >

<!ELEMENT media-type EMPTY>
<!ATTLIST media-type
          ref           IDREF              #REQUIRED >
      

Usage notes

Examples

A typical controller defintion will use the default VelocityPortletController and simply specify the associated template and working parameters.

<portlet-controller-entry name="TwoColumns">
  <classname>org.apache.jetspeed.portal.controllers.VelocityPortletController</classname>
  <parameter name="template" value="multicolumn.vm" />
  <parameter name="action" value="controllers.MultiColumnControllerAction" />
  <parameter name="sizes" value="50%,50%" />
  <parameter name="cols" value="2" />
  <media-type ref="html"/>
  <meta-info>
    <title>Two columns (50/50)</title>
  </meta-info>
</portlet-controller-entry>
      

Skin

Overview

The skin-entry element defines the color scheme that can be used to decorate the portal pages. It contists of a simple named list of properties that can be associated to a portal or pane on a portal page.

DTD

<!ELEMENT skin-entry     ( property+ )>
<!ATTLIST skin-entry
          name           ID                 #REQUIRED
          hidden         ( true | false )   "false" >

<!ELEMENT property EMPTY>
<!ATTLIST property
          name           CDATA              #REQUIRED
          value          CDATA              #REQUIRED
          type           (int | boolean | string | list) "string" >
      

Usage notes

The following properties are currently used by the default controls and controllers. It's possible to freely add new properties.

These properties are only styling hints that may be disregarded by some controls or controllers.

NameDescription
text-colorThe default text color for portlet content
background-colorThe default background color for portlet context
title-text-colorThe default text color within a control titlebar
title-background-colorThe default background color within a control titlebar
highlight-text-colorThe default text color for the selected pane title within a paned titlebar
highlight-background-colorThe default background color for the selected pane title within a paned titlebar
title-style-classThe CSS class name for a control titlebar.
highlight-title-style-classThe CSS class name for the selected pane title within a paned titlebar
controller-style-classThe CSS class name for a controller-managed content area
portlet-style-classThe CSS class name for a portlet area
content-style-classThe CSS class name for portlet content
tab-style-classThe CSS class name for a tabbed pane area
tab-title-style-classThe CSS class name for the title area in a tabbed pane
tab-content-style-classThe CSS class name for the content area in a tabbed pane

Examples

This example presents the default skin definition used by the default Jetspeed portal.

<skin-entry name="orange-grey">
  <property name="text-color" value="#000000"/>
  <property name="background-color" value="#ffffff"/>
  <property name="title-text-color" value="#000000"/>
  <property name="title-background-color" value="#dddddd"/>
  <property name="title-style-class" value="TitleStyleClass"/>
  <property name="highlight-text-color" value="#000000"/>
  <property name="highlight-background-color" value="#FFCC00"/>
  <property name="highlight-title-style-class" value="HighlightTitleStyleClass"/>
  <property name="controller-style-class" value="ControllerStyleClass"/>
  <property name="portlet-style-class" value="PortletStyleClass"/>
  <property name="content-style-class" value="ContentStyleClass"/>
  <property name="tab-style-class" value="TabStyleClass"/>
  <property name="tab-title-style-class" value="TabTitleStyleClass"/>
  <property name="tab-content-style-class" value="TabContentStyleClass"/>
</skin-entry>
      

Media

Overview

The media-type-entry element defines the media types supported the portal instance.

These media types are defined by a MIME content type, an optional character set and an optional set of user agent capabilities required to correctly access this media type.

The media types are referenced by the portlet-entry, portlet-control-entry and portlet-controller-entry to define when these entries can be used.

DTD

<!ELEMENT media-type-entry ( mime-type,
                             character-set?,
                             capability-map?
                           )>
<!ATTLIST media-type-entry
          name           ID                 #REQUIRED
          hidden         ( true | false )   "false" >

<!ELEMENT mime-type      CDATA>
<!ELEMENT character-set  CDATA>

<!ELEMENT capability-map ( capability* )>
<!ELEMENT capability     CDATA>
      

Usage notes

These elements needs to be ordered from most preferred to least preferred for the client detection to work correctly.

For more information, see the Client media detection document.

Examples

<media-type-entry name="html">
  <mime-type>text/html</mime-type>
  <character-set>UTF-8</character-set>
  <meta-info>
    <title>HTML</title>
    <description>Rich HTML for HTML 4.0 compliants browsers</description>
  </meta-info>
  <capability-map>
    <capability>HTML_TABLE</capability>
    <capability>HTML_IMAGE</capability>
  </capability-map>
</media-type-entry>
      

Client

Overview

The client-entry element, introduced in the Jetspeed release 1.4b2, describes known user agents and their capabilities in handling the different content-types.

DTD

<!ELEMENT client-entry ( user-agent-pattern,
                         manufacturer,
                         model,
                         version,
                         mimetype-map,
                         capability-map?
                       )>
<!ATTLIST client-entry 
          name           ID                 #REQUIRED
          hidden         ( true | false )   "false" >

<!ELEMENT user-agent-pattern CDATA>
<!ELEMENT manufacturer CDATA>
<!ELEMENT model CDATA>
<!ELEMENT version CDATA>

<!ELEMENT mimetype-map ( mimetype+ )>
<!ELEMENT mimetype CDATA>

<!ELEMENT capability-map ( capability* )>
<!ELEMENT capability CDATA>
      

Usage notes

These elements needs to be ordered from most preferred to least preferred for the client detection to work correctly.

For more information, see the Client media detection document.

Examples

<client-entry name="mozilla">
  <user-agent-pattern>.*Mozilla/5.*</user-agent-pattern>
  <manufacturer>Mozilla</manufacturer>
  <model>Mozilla</model>
  <version>1.1</version>
  <mimetype-map>
    <mimetype>text/html</mimetype>
    <mimetype>text/xhtml</mimetype>
    <mimetype>text/xml</mimetype>
  </mimetype-map>
  <capability-map>
    <capability>HTML_3_2</capability>
    <capability>HTML_4_0</capability>
    <capability>HTML_JAVA</capability>
    <capability>HTML_JAVA_JRE</capability>
    <capability>HTML_JAVASCRIPT</capability>
    <capability>HTML_TABLE</capability>
    <capability>HTML_NESTED_TABLE</capability>
    <capability>HTML_FORM</capability>
    <capability>HTML_FRAME</capability>
    <capability>HTML_IFRAME</capability>
    <capability>HTML_IMAGE</capability>
    <capability>HTML_CSS1</capability>
    <capability>HTML_CSS2</capability>
    <capability>HTML_CSSP</capability>
    <capability>HTML_DOM_1</capability>
    <capability>HTML_PLUGIN</capability>
    <capability>HTTP_COOKIE</capability>
  </capability-map>
</client-entry>
      

Security

Overview

The security-entry element is used to describe standard sets of access rules that can be used to protect portal elements or actions. These security entry are referenced by the other types of registry entries by using the security-ref element.

DTD

<!ELEMENT security-entry ( meta-info?, access+ )>
<!ATTLIST security-entry
          name           ID      #REQUIRED >

<!ELEMENT access (allow-if*, allow-if-owner? )>
<!ATTLIST access
          action         CDATA   #REQUIRED >

<!ELEMENT allow-if EMPTY>
<!ATTLIST allow-if
          role           CDATA   #REQUIRED >

<!ELEMENT allow-if-owner EMPTY>
      

Usage notes

See the Security system overview

Examples

<security-entry name="user-view_admin-all">
  <meta-info>
    <title>Users+V and Admin+C</title>
    <description>Users view, Admin full access.</description>
  </meta-info>
  <access action="*">
    <allow-if role="admin"/>
  </access>
  <access action="view">
    <allow-if role="user"/>
  </access>
</security-entry>
      

Standard

Overview

Several attributes and inner elements can be found in all registry entry types with similar semantics. This section describes these attributes and elements.

NameTypeDescription
hiddenattribute

The hidden attribute that can be set on the registry entries and parameters to prevent them from being visible in a user browser.

Usage of this attribute should considered deprecated since the same functionality can be achieved better by using the security elements.

meta-infoelement

The meta-info element is used to describe properties of the registry entry. It can currently contains the 3 following sub-elements:

  • title
  • description
  • image
security-refelement

The security-ref element is used to describe access rights on the registry entry or parameter considered.