Global policy projects

There are global policy projects that contain policies, which can be used by multiple portlets and the XDIME aggregator.

If a policy is used by the XDIME aggregator or by multiple projects, the policy should be placed in a global (that is, predefined) MCS policy project in the Mobile Portal Toolkit.

Each global policy project contains the following names:
MCS project name
The name of the MCS project that you create using the Mobile Portal Toolkit. This name can be anything, but it is recommended that you use the same name that portlet developers will use when referencing the global policies (for example, MCS_GlobalProject).
User-friendly project name
A name used by portlet developers when they reference global portlet policies in their XDIME markup. It is recommended that you use a URL format (for example, http://www.ibm.com/mwp/MCS_GlobalProject).
JDBC project name
The project name that will be stored in the PROJECT columns in the MCS database when the policies are imported into the MCS database.

There is a default project whose user-friendly name is “default” and whose JDBC project name is “mobile-portal”. The aggregator policies must go into the default project. You will be responsible for creating the toolkit project name for this project and populating it with the aggregator policies that you want to view, create, or modify.

Policies that are used by multiple portlets can be grouped together in one or more global policy projects.

Note: It is possible for portlets to reference policies in the aggregator project, but this is not recommended. The only exception is the theme policy. IBM® Mobile Portal Accelerator defines a single theme policy that is part of the default project and used by the aggregator and is inherited by portlets.

Aggregator policies

You can use the Mobile Portal Toolkit to view and modify the XDIME aggregator policies if you are customizing the aggregator's look and feel. To work with the aggregator's policies, create a MCS project (as opposed to a portlet project) to contain the aggregator policies. You can name the project anything that you want but it may be best to include “Default” in the name since it will be known as the default project to MCS. When you create the project, you will also be asked to specify the location of the policy files within the project. You can specify any directory within the MCS project. The only files you should include in this project are policies used by the XDIME aggregator.

The Mobile Portal Accelerator aggregator policies are located in the wp_profile_root/PortalServer/wp.mobile/wp.mobile.mwp/policies/aggregator directory on your portal server and on the servers where you have installed Mobile Portal Toolkit.

When you are ready to import the aggregator policies into the MCS database, follow the procedure described in the topic Importing policies into the Multi-Channel Server database.

Global policy projects for common portlet policies

You can create one or more global policy projects to contain policies that are used by multiple portlets. Use the Mobile Portal Toolkit to create a MCS project (as opposed to a portlet project) for each global project. You will be asked the location of the policy files within the project. You can specify any directory within the project.

In addition to the MCS project name, you will need to define two unique names for each global policy project:
User-friendly project name
A name used by portlet developers when they reference global portlet policies in their XDIME markup. It is recommended that you use a URL format (for example, http://www.ibm.com/mwp/MCS_GlobalProject).
JDBC project name
The project name that will be stored in the PROJECT columns in the MCS database when the policies are imported into the MCS database.
If you want portlet developers to use policies in a global policies project when they develop and test their portlets in the Mobile Portal Toolkit test environment, the “owner” of the project should export the policies and each portlet developer should import them.
Note: You can use the Rational Application Developer export and import functions or you can just distribute the policy files using some other mechanism to each portlet developer.
The MCS runtime that is used in the Mobile Portal Toolkit test environment must be configured with the location of the policy files for each global policy project. To do this configuration, edit the mcs-config.xml file in the wp_profile_root/PortalServer/wp.mobile/wp.mobile.mcs directory and add a new project element within the projects element.
Note: wp_profile_root is where the WebSphere® Portal profile directory is located.
The following illustrates the format of a project element:
    <project name="user-friendly-project-name">
       <xml-policies directory="policies_directory"/>
       <assets base-url="/assests_base_url/">
          <audio-assets prefix-url="/audio/"/>
                  <image-assets prefix-url="/images/"/>
          <script-assets prefix-url="/scripts/"/>
          <text-assets prefix-url="/text/"/>
       </assets>
    </project>
Note:
  • user-friendly-project-name is the user-friendly project name described previously.
  • policies_directory is the file system directory containing the policy files for the global MCS project.
  • assests_base_url is the context root of your Portal server. By default, wps is used. (Use the same value that appears for other project elements in mcs-config.xml.)
After modifying mcs-config.xml, follow the configuration steps in the topic Configuring Multi-Channel Server on WebSphere Portal.

When you are ready to import the global project policies into the MCS database, follow the procedure described in the topic Importing policies into the Multi-Channel Server database.

Global policy project provided with Mobile Portal Accelerator

Mobile Portal Accelerator provides a global policy project with the following project names. This project contains generic portlet layout policies that are used by the XDIME portlets provided with Mobile Portal Accelerator.
User-friendly project name
http://www.ibm.com/mwp/generic-portlet-policies
JDBC project name
com.ibm.mwp.generic.portlet.policies
The following table lists the policies that are defined in the project.
Table 1. Predefined layout policies for portlets
Policy name Description
portlet_generic_1x1.mlyt Contains one pane
portlet_generic_1x3_4x1.mlyt Contains a form with several panes surrounded by header and footer panes
portlet_generic_3x1.mlty Contains two panes in a row, followed by another 2 in a spatial iterator
portlet_generic_Spatial1x1.mlyt Contains a single pane in a spatial iterator
portlet_generic_form_pane.mlyt Contains two panes in a row, wrapped in a form
portlet_generic_graphic.mlyt Contains one pane, suitable for a graphic
portlet_generic_p_5rowform_p.mlyt Contains five panes in a row wrapped in a form, and surrounded by header and footer panes
The policy files for this project are located in the wp_profile_root/PortalServer/wp.mobile/wp.mobile.mwp/policies/global-portlet directory on your Mobile Portal server and on the servers where you have installed Mobile Portal Toolkit. If you want to view or modify these policies, use Mobile Portal Toolkit to create an MCS project and copy these policy files into the projects's policies directory.



Terms of use
(C) Copyright IBM Corporation 2012. All Rights Reserved.