Sun Java System Portal Server 7.1 Community Sample Guide

Creating and Modifying a Template

To create a new or modify an existing template, following the instructions in this section. You can create a template in one of the following three ways:

ProcedureTo Create a New Template for Single Portal Environment

  1. Go to the communityTemplateBaseDir.

    Create a:

    • New directory for the new template

    • Copy an existing template to the new template directory

    For example, type:


    cd PortalServer-DataDir/portals/portal-ID/communitytemplates
    mkdir NewTemplate
    cp 2column/* NewTemplate/
  2. Modify the role based display profile documents in the new template directory as needed.

    For more information on the role based display profile documents, see Template Syntax and Semantics.

  3. Create and edit the properties file to include the properties described in Template Descriptor File and save the file.

    For example, to create a new properties files for the new template, type:


    cp 2colimn.properties NewTemplate.properties

    Or,


    touch NewTemplate.properties

    Note –

    In order to see the newly added template, log out of any current portal session and re-login to see the change.


ProcedureTo Customize or Modify an Existing Template for Single Portal Environment

  1. Go to the communityTemplateBaseDir/template directory and open the file you wish to modify.

  2. Log out of any current portal session and re-login to see the change.

ProcedureTo Create a Template for Multi-Portal Environment

In a muti-portal environment (when there are more than one portal on the system), use PAR mechanism (as opposed to directly editing files in communityTemplateBaseDir) so that the change of community templates can be applied across multiple portals. This will allow all the portals to have the same set of community templates. If you do not wish to have synchronized environment across portals, use the instructions outlined in To Create a New Template for Single Portal Environment.

  1. Either use psadmin export --type desktop to export desktop data (which includes community templates) and then export it so the content can be edited or, create a new PAR structure from scratch with only the community templates and no other desktop data.

    Follow instructions in To Create a New Template for Single Portal Environment to edit content.

    • Create a new PAR file which contains:

         -+-- META-INF -- MANIFEST.MF
          |    
          +-- pbfiles -+-- communityTemplateBaseDir -+-- template1 -+-- owner.xml
          |                                          |              |
          |                                          |              +-- member.xml
          |                                          |              |
          |                                          |              +-- visitor.xml
          |                                          |
          |                                          +-- template1.properties
          |                                          |
          |                                          +-- template1_en.properties
          |                                          |
          |                                          +-- template1_fr.properties
          |                                          |
          |                                          +-- ...
          |
          +-- static -- community -- images -- template1.gif
  2. Edit or add content as needed.

  3. Create a new PAR file.

  4. Use psadmin import subcommand to import the PAR content across all portals.

    If you exported all desktop data, note that psadmin export subcommand will export all desktop data; if you create a new PAR structure from scratch with only the community templates, the command will only export community templates.


    Tip –

    For more information, see the psadmin export in Sun Java System Portal Server 7.1 Command Line Reference.