Portal PAR Sample

Portal PAR Sample

This document gives an example of how the Portal PAR command-line utility is used to import and export a PAR file. For more information about the PAR command-line utility, please reference the Portal Server Administration Guide.

This document contains the following sections:

- Examine the PAR file
- Deploy a PAR file to a Portal Server system
- Create a PAR file from a Portal Server system

The PAR command-line utility works with the desktop configuration properties that are defined in the desktop configuration file (desktopconfig.properties). In this example, the following properties are used:

- providerClassBaseDir
- templateBaseDir

Examine the PAR file

This example use the sample PAR file that is shipped with the Portal Server 6 2004Q2 sdk. After installation, the parsample.par file will be installed in the $INSTALL_BASE_DIR/sdk/deployment directory. First, to see what's included this PAR file, the following command can be used:
`$INSTALL_BASE_DIR/bin/par describe parsample.par`

> `Class Root: /`
> `Property Based File Root: /pbfiles`
> `Display Profile Root: /dp`
> `Static Content Root: /static`
> `Entry: ParSampleChannel`
> `AutoExtract: dpnode=dc%3Dacme%2Cdc%3Dcom,channel,entry=ParSampleChannel`
> `DP Document:`
> `ParSampleProvider`
> ``
> `Provider: ParSampleProvider`
> `Channel: ParSampleChannel`
> `Includes: Class com/sun/portal/providers/pctest/ParSampleProvider.class (provider)`
> `Includes: Property based file, root providerClassBaseDir, path ParSampleProvider.properties (provider)`
> `Includes: Property based file, root templateBaseDir, path default/ParSampleChannel/parSampleContent.template (channel)`
> `Includes: Property based file, root templateBaseDir, path default/ParSampleChannel/parSampleEdit.template (channel)`
> `Includes: Static content file, path static/images/me.jpg (channel)
> `

From the above information, this PAR file includes the display profile segment for the provider and channel, the provider class file, the provider properties file, two channel template files, and one static file.
Deploy a PAR file to a Portal Server system

The parsample.par file can be deployed into an existing Portal Server system. First, use the "containers" subcommand to find out which containers are available in a particular DN (with -d option) that has the display profile document:
`$INSTALL_BASE_DIR/bin/par containers -r <AMADMIN_DN> -p <AMADMIN_PASSWORD> -v -d <DP_NODE>`

> `AUTHENTICATING`
> `AUTHENTICATED - Setting DN - dc=acme,dc=com.`
> `DP Document written to dn.xml.`
> `Yahoo_weather (YahooProvider)`
> `SampleXML (XMLProvider)`
> `SampleURLScraper (URLScraperProvider)`
> `SamplesTabPanelContainer (JSPTableContainerProvider)`
> `Available: SampleRSS SampleURLScraper Notes SampleSimpleWebService Yahoo_channel Yahoo_quotes Yahoo_weather Yahoo_comics`
> `Selected: SampleRSS SampleURLScraper Notes SampleSimpleWebService Yahoo_channel Yahoo_quotes Yahoo_weather Yahoo_comics`
> `DiscussionLite (DiscussionLiteProvider)`
> `MyFrontPageFramePanelContainer (JSPTableContainerProvider)`
> `Available: UserInfo MailCheck App Bookmark SampleJSP SampleRSS SampleXML`
> `Selected: UserInfo MailCheck App Bookmark SampleJSP SampleRSS SampleXML`
> `JSPCustomThemeContainer (JSPSingleContainerProvider)`
> `Available:`
> `Selected:`
> `Search (SearchProvider)`
> `SampleRSS (XMLProvider)`
> `JSPPresetThemeContainer (JSPSingleContainerProvider)`
> `Available:`
> `Selected:`
> `SearchTabPanelContainer (JSPTableContainerProvider)`
> `Available: Search`
> `Selected: Search`
> `YahooContainer (YahooContainerProvider)`
> `Available: JSPTabContainer`
> `Selected: JSPTabContainer`
> `HelloWorldPortlet (__Portlet__testportlets.HelloWorldPortlet)`
> `JSPCreateChannelContainer (JSPSingleContainerProvider)`
> `Available:`
> `Selected:`
> `SampleSimpleWebServiceConfigurable (SimpleWebServiceConfigurableProvider)`
> `SampleJSP (JSPProvider)`
> `MyFrontPageTabPanelContainer (JSPTableContainerProvider)`
> `Bookmark2 (BookmarkProvider)`
> `Available: UserInfo MailCheck Bookmark`
> `Selected: UserInfo MailCheck Bookmark`
> `TestPortlet (__Portlet__testportlets.TestPortlet)`
> `_DPTest (DPTestProvider)`
> `MyFrontPageTemplatePanelContainer (TemplateTableContainerProvider)`
> `Available: UserInfo MailCheck SampleRSS SampleJSP SampleXML App Bookmark`
> `Selected: UserInfo MailCheck SampleRSS SampleJSP SampleXML App Bookmark`
> `CollaborationTabPanelContainer (JSPTableContainerProvider)`
> `Available: Discussions DiscussionLite Subscriptions`
> `Selected: Discussions DiscussionLite Subscriptions`
> `TemplateTabContainer (TemplateTabContainerProvider)`
> `Available: MyFrontPageTemplatePanelContainer SamplesTemplatePanelContainer ToolsTemplatePanelContainer`
> `Selected: MyFrontPageTemplatePanelContainer SamplesTemplatePanelContainer`
> `Yahoo_comics (YahooProvider)`
> `Yahoo_channel (YahooProvider)`
> `SamplesFramePanelContainer (JSPTableContainerProvider)`
> `Available: SampleRSS SampleURLScraper Notes SampleSimpleWebService`
> `Selected: SampleRSS SampleURLScraper Notes SampleSimpleWebService`
> `portletsamples0BookmarkPortlet (__Portlet__portletsamples.BookmarkPortlet)`
> `Discussions (DiscussionProvider)`
> `TemplateTableContainer (TemplateTableContainerProvider)`
> `Available: UserInfo MailCheck SampleRSS SampleJSP SampleXML App SampleSimpleWebService Bookmark Notes PersonalNotes`
> `Selected: UserInfo MailCheck SampleRSS SampleJSP SampleXML App SampleSimpleWebService Bookmark Notes PersonalNotes`
> `JSPDynamicSingleContainer (JSPSingleContainerProvider)`
> `Available: SampleJSP`
> `Selected: SampleJSP`
> `App (AppProvider)`
> `PersonalNotes (PersonalNoteProvider)`
> `_PCTest (PCTestProvider)`
> `Subscriptions (SubscriptionsProvider)`
> `Yahoo_quotes (YahooProvider)`
> `JSPLayoutContainer (JSPSingleContainerProvider)`
> `Available:`
> `Selected:`
> `JSPPopupContainer (JSPSingleContainerProvider)`
> `Available:`
> `Selected:`
> `FrameTabContainer (JSPTabContainerProvider)`
> `Available: MyFrontPageFramePanelContainer SamplesFramePanelContainer`
> `Selected: MyFrontPageFramePanelContainer SamplesFramePanelContainer`
> `portletsamples0NotepadPortlet (__Portlet__portletsamples.NotepadPortlet)`
> `portletsamples0JSPPortlet (__Portlet__portletsamples.JSPPortlet)`
> `Notes (NotesProvider)`
> `UserInfo (UserInfoProvider)`
> `ToolsTemplatePanelContainer (TemplateTableContainerProvider)`
> `Available: UserInfo MailCheck App Bookmark Notes`
> `Selected: UserInfo MailCheck App Bookmark Notes`
> `Login (LoginProvider)`
> `JSPTabContainer (JSPTabContainerProvider)`
> `Available: MyFrontPageTabPanelContainer SamplesTabPanelContainer SearchTabPanelContainer CollaborationTabPanelContainer`
> `Selected: MyFrontPageTabPanelContainer SamplesTabPanelContainer SearchTabPanelContainer CollaborationTabPanelContainer`
> `MailCheck (MailCheckProvider)`
> `JSPContentContainer (JSPSingleContainerProvider)`
> `Available:`
> `Selected:`
> `Bookmark (BookmarkProvider)`
> `SamplesTemplatePanelContainer (TemplateTableContainerProvider)`
> `Available: SampleRSS SampleURLScraper SampleSimpleWebService Notes`
> `Selected: SampleRSS SampleURLScraper SampleSimpleWebService Notes`
> `JSPTableContainer (JSPTableContainerProvider)`
> `Available: UserInfo MailCheck App SampleSimpleWebService Bookmark SampleJSP SampleRSS SampleXML Notes PersonalNotes`
> `Selected: UserInfo MailCheck App SampleSimpleWebService Bookmark SampleJSP SampleRSS SampleXML Notes PersonalNotes`
> `SampleSimpleWebService (SimpleWebServiceProvider)`

With the above information, one can decide where to put the new channel. For example, the new channel can be put in the SamplesTabPanelContainer, be available and selected, also the channel name can be changed to "NewChannel", the following is the command to deploy it:
`
$INSTALL_BASE_DIR/bin/par import -r <AMADMIN_DN> -p <AMADMIN_PASSWORD> -v parsample.par <DP_NODE> "channel=NewChannel,provider,avail=SamplesTabPanelContainer,selected"
`

> `AUTHENTICATING`
> `AUTHENTICATED - Setting DN - dc=acme,dc=com.`
> `Initializing for operation - dpnode=dc%3Dacme%2Cdc%3Dcom,provider,channel=NewChannel.`
> `Adding provider ParSampleProvider, com.sun.portal.providers.pctest.ParSampleProvider.`
> `Adding channel NewChannel, ParSampleProvider.`
> `Operation completed.`
> `Deploying to instance "server1"...`

After the PAR file is deployed, the NewChannel can be seen in the desktop that has the SamplesTabPanelContainer.
Create a PAR file from a Portal Server System

With the above setup in the Portal Server, the NewChannel and provider can be exported using the following par command:

`$INSTALL_BASE_DIR/bin/par export -r <AMADMIN_DN> -p <AMADMIN_PASSWORD> -v parsample.par <DP_NODE> ParSample.txt`

> `AUTHENTICATING
> AUTHENTICATED - Setting DN - dc=acme,dc=com.
> Add manifest entry - NewChannel.
> Autoextract - dpnode=dc%3Dacme%2Cdc%3Dcom,channel
> Streaming to parsample.par.
> Archiving - com/sun/portal/providers/pctest/ParSampleProvider.class.
> Archiving - pbfiles/providerClassBaseDir/ParSampleProvider.properties.
> Archiving - pbfiles/templateBaseDir/default/NewChannel/parSampleContent.template.
> Archiving - pbfiles/templateBaseDir/default/NewChannel/parSampleEdit.template.
> Archiving - dp/NewChannel.xml.`

The following is the content of the ParSample.txt file:

> `from: provider+channel NewChannel
> directory: templateBaseDir . ParSampleProvider
> class: com.sun.portal.providers.pctest.ParSampleProvider provider
> desc: A sample par file
> file: providerClassBaseDir ParSampleProvider.properties provider
> file: templateBaseDir default/NewChannel/parSampleContent.template channel
> file: templateBaseDir default/NewChannel/parSampleEdit.template channel
> file: . images/me.jpg channel`