Importing portlet policies

You can import the policies in a portlet WAR file into instances of the Multi-Channel Server (MCS) database.

About this task

When a portlet is installed into WebSphere® Portal, the policies within the portlet WAR file are imported into the MCS database . (The portlet install code looks for the mcs-policies directory in the portlet WAR file and imports any policies found under that directory).

The portlet installation command triggers the import operation asynchronously. Therefore, the install portlet user interface provided no visual indication if the import fails. If the import fails, however, an error is logged in the latest wps log file in the wp_profile_root/logs/WebSphere_Portal directory.

If the import fails, you must manually import the portlet's policies using the mcsImport command.
Note: This command is located in the wp_root/wp.mobile/wp.mobile.mcs/repository/bin directory on the WebSphere Portal server.

Procedure

  1. Run the following command to ensure that the WebSphere environment is set up correctly:
    AIXLinuxSolaris
    wp_profile_root/bin/setupCmdLine.sh
    Note: There is a space between the period (.) and the rest of the command.
    Windows
    wp_profile_root\bin\setupCmdLine
  2. Use the appropriate database-specific commands to add the JDBC driver to your current CLASSPATH environment variable, as illustrated in the following examples:
    DB2 (version 9.1 (with fix pack 5) or 9.5 (with fix pack 3))
    CLASSPATH=db_root/db2instance/sqllib/java/db2jcc.jar:
              db_root/db2instance/sqllib/java/db2jcc_license_cu.jar:$CLASSPATH
    export CLASSPATH   
    DB2 (version 9.7)
    CLASSPATH=db_root/db2instance/sqllib/java/db2jcc4.jar:
              db_root/db2instance/sqllib/java/db2jcc_license_cu.jar:$CLASSPATH
    export CLASSPATH   
    Note: If DB2® and WebSphere Portal are not installed on the same machine, specify the path to where the files are located on the WebSphere Portal server.
    Oracle
    CLASSPATH=oracle_driver_path/ojdbc6.jar:$CLASSPATH
    export CLASSPATH
    MS SQL
    CLASSPATH=mssql_driver_path\sqljdbc4.jar:$CLASSPATH
    export CLASSPATH
  3. Change your working directory to wp_root/wp.mobile/wp.mobile.mcs/repository/bin.
  4. To import the updated policies, run the mcsImport command, as in the following example:
    mcsImport -vendor database-vendor-type
              -host database-hostname
              -port db-port-number
              -source mcs-database-name
              -user db-username
              -password db-password
              -allcomponents
              -theme theme-names
              -layout
              -updateall
              -enableundo
              -project portlet-jdbc-project-name
              -srcdir directory
    where:
    • database-vendor-type is either db2-type4, oracle, mssql-ms (for Microsoft SQL 2000 or 2008), or mssql-jsql (for Microsoft SQL 2005 or 2008 with the NetDirect JDBC Driver).
    • database-hostname is the hostname of the database server for the Multi-Channel Server database
    • db-port-number is the port number used by the database driver to access the Multi-Channel Server database
    • mcs-database-name is the name of the Multi-Channel Server database. If Oracle Database is being used, this parameter is the Oracle SID.
    • db-username is either the user name of the DB2 instance user or the Multi-Channel Server Oracle database user name.
    • db-password is the password of the database user.
    • theme-names is the filename of one or more files in the following format: theme1.mthm.
    • portlet-jdbc-project-name is the portlet application unique id (uid) value from the portlet-app element in the portlet portlet.xml file.
    • directory is the path to the directory containing the portlet's policies. This path is wp_profile_root/installedApps/node_name/portlet_WAR_filename portlet_object_id.ear/portlet_WAR_filename.war/mcs-policies.

    For a complete list of the command parameters, refer to the topic Importing and exporting repositories in the Multi-Channel Server portion of this information center.




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