Skip Headers
Oracle® Fusion Middleware Developing Portals with Oracle WebCenter Portal and Oracle JDeveloper
11g Release 1 (11.1.1.8.3)

Part Number E27739-04
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

55 Developing Components for WebCenter Portal Using JDeveloper

Out-of-the-box, WebCenter Portal provides tools targeted at knowledge workers and developers to quickly and easily create portals, intranets, extranets, and self-service applications that offer users a more effective and efficient way to access and interact with information, business applications, and process. WebCenter Portal can be customized using browser-based tools and also using JDeveloper.

This chapter describes how a developer can leverage JDeveloper to develop components that can be deployed and used in WebCenter Portal. Components can be ADF task flows, data controls, managed beans, and other assets such as skins, page styles, task flow styles, page templates, content present display templates, navigations, and resource catalogs.

This chapter includes the following sections:

Audience

This section is intended for developers who have basic knowledge of JDeveloper (with the WebCenter Portal extension) and want to perform advanced customizations for their WebCenter Portal deployment.

55.1 Developing Assets for WebCenter Portal

This section includes the following subsections:

55.1.1 About the WebCenterSpacesResources Project

WebCenter Portal's round-trip development features provide a simple, convenient way to create and modify WebCenter Portal assets without redeploying the entire application. Round-trip development refers to features and techniques that allow you to download assets from WebCenter Portal and upload them to JDeveloper for maintenance or enhancement. Once modified, you can upload the asset back to WebCenter Portal for immediate use or for testing (see Figure 55-1).

Figure 55-1 Round-Trip Asset Development Using the WebCenterSpacesResources Project

Description of Figure 55-1 follows
Description of "Figure 55-1 Round-Trip Asset Development Using the WebCenterSpacesResources Project"

Out-of-the-box, WebCenter Portal provides some default assets, such as skins and page templates, for people to use or modify. If your asset requirements extend beyond the browser-based editing capabilities of Portal Builder, you can further develop assets using the JDeveloper project WebCenterSpacesResources (available as a download from OTN). This project provides everything you need to create, modify, and upload the following WebCenter Portal assets:

  • Page templates

  • Navigations

  • Page styles

  • Skins

  • Content Presenter display templates

  • Resource catalogs

  • Task flow styles

Note:

This chapter describes how to manage asset customizations through the WebCenterSpacesResources project. For information on how to build/develop assets, see Section 55.1.5.4, "How to Build Assets for WebCenter Portal".

When you are ready to deploy asset customizations, you can upload them directly to a live WebCenter Portal application simply by providing JDeveloper with the name of the host and port where WebCenter Portal is running.

Alternatively, you can log in to WebCenter Portal and upload the asset through the relevant asset management page. If you decide to use this method you must save the asset to an export archive (.ear file) as shown in Figure 55-2.

Figure 55-2 Developing Assets Using the WebCenterSpacesResources Project

Description of Figure 55-2 follows
Description of "Figure 55-2 Developing Assets Using the WebCenterSpacesResources Project"

55.1.2 Setting Up Your JDeveloper Environment for Asset Development

Before you start, complete the following steps:

  1. Download and install Oracle JDeveloper 11g (11.1.1.7.0).

    For details, see Section 2.2.1, "Installing Oracle JDeveloper".

  2. Install the WebCenter Portal Extension for JDeveloper (11.1.1.8.0).

    For details, see Section 2.2.2, "Installing the WebCenter Portal Extension for JDeveloper".

  3. Download the WebCenter Portal asset development ZIP file (DesignWebCenterSpaces_11.1.1.8.0.zip) from Oracle Technology Network:

    http://download.oracle.com/otndocs/tech/webcenter/files/DesignWebCenterSpaces_11.1.1.8.0.zip

  4. Unzip the content locally (Table 55-1).

    Table 55-1 DesignWebCenterSpaces_11.1.1.8.0.zip - Unzip Folders

    Unzip Folders Description

    \DesignWebCenterSpaces

    Includes DesignWebCenterSpaces.jws.

    This workspace provides the WebCenterSpacesResources project-- a design environment for editing and redeploying assets for WebCenter Portal.

    Note: In previous releases, this workspace was also used to configure WebCenter Portal's shared library list. In this release, you must use the WebCenter Portal Server Extension workspace for shared library development. For details, see Section 55.2, "Developing Task Flows, Data Controls, and Managed Beans for WebCenter Portal".

    \copy_to_common

    Includes a common directory that contains WebCenter Portal WLST commands.

    WebCenter Portal's WLST commands are required to upload customized assets directly to the portal server from DesignWebCenterSpaces.jws.

    \copy_to_jdev_ext

    Includes oracle.webcenter.portal.jar.

    Required update to the Oracle JDeveloper WebCenter Portal Extension.


  5. Copy WebCenter Portal's WLST (WebLogic Scripting Tool) commands to the Oracle home directory where JDeveloper is installed:

    1. Navigate to: <DesignWebCenterSpaces_Unzip_Location>\copy_to_common

    2. Make a copy of the common directory.

      The common directory is located under <DesignWebCenterSpaces_Unzip_Location>\copy_to_common.

    3. Navigate to: <JDeveloper_install_directory>\oracle_common

      Tip:

      The JDeveloper_install_directory is the base directory under which JDeveloper is also installed, that is, the same directory that you configure as the jdeveloper.install.home.directory in config.properties (see also Table 55-2).

    4. Copy the content of the common directory here.

      Tip:

      On Linux, use the following command: cp -r <DesignWebCenterSpaces_Unzip_location>/copy_to_common/common/.

  6. Copy new version of oracle.webcenter.portal.jar to the Oracle JDeveloper extensions directory:

    1. Navigate to: <DesignWebCenterSpaces_Unzip_Location>\copy_to_jdev_ext

    2. Make a copy of oracle.webcenter.portal.jar.

      The oracle.webcenter.portal.jar file is located under <DesignWebCenterSpaces_Unzip_Location>\copy_to_jdev_ext.

    3. Navigate to: <JDeveloper_install_directory>\jdeveloper\jdev\extensions\

      Tip:

      The JDeveloper_install_directory is the base directory under which JDeveloper is also installed, that is, the same directory that you configure as the jdeveloper.install.home.directory in config.properties (see also Table 55-2).

    4. Copy the oracle.webcenter.portal.jar file here.

  7. Restart JDeveloper if it is open.

55.1.3 Enabling Direct Download and Uploads to WebCenter Portal

If you build or modify skins, page templates, and so on, for a WebCenter Portal application that is live or running in a test environment you can upload your updates directly to WebCenter Portal from JDeveloper. To enable direct updates from the JDeveloper WebCenterSpacesResources project you must:

  • Specify the name of the host and port where the WebCenter Portal application is running in config.properties.

  • Check that you have the appropriate roles and permissions to upload the asset to WebCenter Portal. You must have the following:

    • WebLogic Server role - monitor AND

    • WebCenter Portal asset permissions - For example, to upload a new skin you must have the Create, Edit, Delete Skins permission.

    Note:

    Out-of-the-box, only the default Fusion Middleware administrator (weblogic) has all the required permissions.

Configuring the WebCenter Portal hostname and port, enables the Upload Portal Resource option in your project. The first time you use this option, within a JDeveloper session, you must enter your WebCenter Portal login name and password. For security reasons, your credentials are not saved for future sessions but they are stored in memory for the current JDeveloper session.

To set connection properties in config.properties and grant permissions:

  1. Open config.properties, available at:

    <Unzip_Directory>\DesignWebCenterSpaces\config.properties

  2. Enter details relating to JDeveloper and your WebCenter Portal installation, as shown in Table 55-2:

    The config.properties file describes each property and offers examples. The defaults provided are only samples and must be replaced with your own, installation-specific values.

    Table 55-2 config.properties Settings to Enable Direct Uploads

    Configuration Property Description

    jdeveloper.install.home.directory

    Base directory where JDeveloper is installed. In addition to \jdeveloper, the directory you specify must contain \wlserver_10.3, \modules, and so on.

    wlst.executable

    Name of the WebLogic Scripting Tool (WLST) executable file.

    Either wlst.cmd (on Windows) or wlst.sh (on Linux).

    wls.port

    Port number on which the WebLogic Server Administration Console is running

    wls.host

    Host machine on which the WebCenter Portal application is running and where the custom shared library is to be deployed

    wc.host

    Name of the host machine where the WebCenter Portal application is running.

    wc.port

    Port number on which the WebCenter Portal application is running.

    wc.protocol

    Specify whether the WebCenter Portal URL protocol is http or https.

    wls.webcenter.app.target

    Managed server on which the WebCenter Portal application (webcenter.ear) is deployed. For example, WC_Spaces.

    In a clustered environment, enter a comma separated list of servers, for example, WC_Spaces1,WC_Spaces2.

    webcenter.app.name

    Name of the WebCenter Portal application. Always webcenter.


  3. Save your updates to config.properties.

  4. Verify and, if necessary, request permissions shown in Table 55-3.

    Table 55-3 Permissions to Upload and Manage Assets Through JDeveloper

    Asset Type Required Role or Permission Granted By Description

    Shared Assets

    • monitor

    WebLogic Server

    • This role enables you to run the WLST scripts which upload assets from JDeveloper to WebCenter Portal.

      See also, "Administrative Users and Roles" section in Oracle Fusion Middleware Application Security Guide.

    • Create, Edit, Delete AssetType

    WebCenter Portal

    • This permission enables you to create and manage various shared assets for WebCenter Portal.

    • Manage Configuration

    WebCenter Portal

    • This application-level permission gives you access to Portal Builder Administration.

      Note: The Administrator role in WebCenter Portal includes both these permissions, that is, Create, Edit, Delete Assets and Manage Configuration. See also, the section "Managing Application Roles and Permissions" in Oracle Fusion Middleware Administering Oracle WebCenter Portal.

           

    Portal Assets

    • monitor

    WebLogic Server

    • This role enables you to run the WLST scripts which upload resources from JDeveloper to WebCenter Portal.

    • Create, Edit, Delete Assets
      (standard permission model)

      OR

      Create, Edit, Delete AssetType
      (advanced permission model)

    WebCenter Portal

    • These permissions enable you to create and manage assets for a particular portal.

      Either standard or advanced permissions will apply, depending on the portal.

    • Manage Configuration

    WebCenter Portal

    • This portal-level permission gives you access to the Asset page for a particular portal.

      Note: The Moderator role in WebCenter Portal includes both these permissions, that is, Create, Edit, Delete Assets/AssetType and Manage Configuration. See also, the section "Managing Application Roles and Permissions" in Oracle Fusion Middleware Administering Oracle WebCenter Portal.


  5. To test the connection, upload a sample asset and verify that the asset is available in WebCenter Portal.

    For details, see Section 55.1.4, "Opening and Exploring the WebCenterSpacesResources Project" and Section 55.1.6, "Uploading Assets Directly to WebCenter Portal".

    See also, Section 55.1.8, "Troubleshooting Asset Round-Trip Development"

55.1.4 Opening and Exploring the WebCenterSpacesResources Project

  1. Download and unzip the DesignWebCenterSpaces.jws workspace.

    See Section 55.1.2, "Setting Up Your JDeveloper Environment for Asset Development".

  2. Open DesignWebCenterSpaces\DesignWebCenterSpaces.jws in JDeveloper (Figure 55-3).

    This workspace contains a project dedicated to asset development called WebCenterSpacesResources.

    Note:

    You can ignore the WebCenterSpacesExtensionLibrary project.; this project is not used for asset development.

    Figure 55-3 Projects in the DesignWebCenterSpaces Workspace

    Description of Figure 55-3 follows
    Description of "Figure 55-3 Projects in the DesignWebCenterSpaces Workspace"

  3. Expand the WebCenterSpacesResources project.

    The WebCenterSpacesResources project contains several files and folders (Figure 55-4):

    Figure 55-4 Exploring the WebCenterSpacesResources Project in JDeveloper

    Description of Figure 55-4 follows
    Description of "Figure 55-4 Exploring the WebCenterSpacesResources Project in JDeveloper"

    Table 55-4 describes the files and folders in the WebCenterSpacesResources project.

    Table 55-4 Files and Folders in the WebCenterSpacesResources Project

    Configuration Property Description

    \Application Sources

    Supporting files and folders.

    \Web Content

    Contains assets for WebCenter Portal.

    \oracle\webcenter\siteresources

    Directory containing assets. You can develop and manage all your assets for WebCenter Portal under this folder.

    \scopedMD

    Contains shared assets and portal assets:

    • Shared assets are stored under the default scope directory named s8bba98ff_4cbb_40b8_beee_296c916a23ed

      Several sample shared assets are available under this directory.

    • Portal assets are stored under portal-specific directories with the same name as the portal's internal ID.

      No sample portal assets are provided.

    For more information, see "Shared Assets vs Portal Assets".

    \<Default Scope ID>

    Contains sample shared assets.

    \contenttemplates

    Includes a sample Content Presenter display template (content-default-list-item-view.jsff) - Sample Content List Item View.

    \navigation

    includes a sample navigation (Navigation.xml) - SampleNavigation.

    \pageStyle

    Includes a blank page style (TemplateHome.jspx) - Sample Home Page Style.

    \resourceCatalog

    Includes a sample catalog (ResourceCatalog.xml) - Sample Home Portal Catalog

    \siteTemplate

    Includes a sample page templates (Template.jspx) - Sample Side Navigation

    Note: This directory is the correct directory for developing page templates (even though the directory name is siteTemplate).

    \skin

    Includes a sample skin (Skin.css) - Sample Portal FX Skin.

    \taskFlowStyle

    Includes files for a sample task flow style (pform.jsff and pform-definition.xml - Sample Parameter Form.

    \shared

    Legacy directory in MDS for images and content used by assets, such as, icons, images, and so on.

    Oracle recommends that you relocate all such artifacts to your content server and that you use a folder structure on your content server specifically for asset artifacts so that content is easy to identify and move, if required.

    If you choose not to move artifacts stored in MDS, your administrator can use the MDS WLST commands exportMetadata/importMetadata to migrate content to and from MDS.

    \Page Flows

    Supporting files and folders.


Shared Assets vs Portal Assets

In WebCenter Portal:

  • Shared assets are available to all portals

    You must develop all shared assets under the WebCenterSpacesResources project directory oracle/webcenter/siteresources/scopedMD/s8bba98ff_4cbb_40b8_beee_296c916a23ed.

    To upload shared assets to the WebCenter Portal application you must have WebCenter Portal permissions: Application-Manage Configuration plus Create, Edit, Delete <AssetType>.

  • Portal assets are only available within a particular portal

    You must develop a resource for a specific portal under the appropriate namespace, so that it can be uploaded to that portal:

    oracle/webcenter/siteresources/scopedMD/<space_internal_id>

    Similarly, assets downloaded from an existing portal and imported into JDeveloper, can only be uploaded back to the same portal. You cannot upload such assets to a different portal.

    To upload assets to a particular portal you must have the Portal-Manage Configuration permission, plus one of:

    Create, Edit, Delete Assets (standard permission model)
    Create, Edit, Delete <AssetType> (advanced permission model)

If you want to upload assets directly from JDeveloper, you must also have the WebLogic Server monitor role. See Section 55.1.3, "Enabling Direct Download and Uploads to WebCenter Portal".

55.1.5 Editing WebCenter Portal Assets in JDeveloper

You do not have to develop WebCenter Portal assets from scratch. Most developers will download an existing asset from the WebCenter Portal application and edit it in JDeveloper.

There are two techniques for bringing assets into JDeveloper. You can either download the asset to JDeveloper directly from WebCenter Portal or you can export the asset to an archive (.ear file) and then import the asset archive to JDeveloper.

For more information, see:

55.1.5.1 Downloading an Asset Directly from WebCenter Portal to JDeveloper

You can download an asset directly from WebCenter Portal into JDeveloper from within the WebCenterSpacesResources project.

  1. If you have not done so already, configure WebCenter Portal connection details in config.properties and request the appropriate asset management permissions.

    See also, Section 55.1.3, "Enabling Direct Download and Uploads to WebCenter Portal".

  2. In the Navigator, right-click the WebCenterSpacesResources project and then select Download Portal Resource from Server, as shown in Figure 55-5.

    Figure 55-5 Download Portal Resource from Server Menu

    Description of Figure 55-5 follows
    Description of "Figure 55-5 Download Portal Resource from Server Menu"

  3. In the Download Portal Resources dialog, choose to download either a shared asset (Application-Level Resource) or a portal asset (Portal-Level Resource), as shown in Figure 55-6.

    See "Shared Assets vs Portal Assets" for information on these selections.

    Figure 55-6 Download Portal Resources Dialog

    Description of Figure 55-6 follows
    Description of "Figure 55-6 Download Portal Resources Dialog"

  4. To filter the list of possible asset names, select the type of asset you wish to download from the Resource Type menu, as shown in Figure 55-7.

    Figure 55-7 Selecting the Type of Asset to Download

    Description of Figure 55-7 follows
    Description of "Figure 55-7 Selecting the Type of Asset to Download"

  5. Finally, select the name of the asset you wish to download from the Resource Name menu.

  6. Click OK.

55.1.5.2 Downloading an Asset to an Archive from WebCenter Portal

For detailed steps, see the "Downloading an Asset" section in Oracle Fusion Middleware Building Portals with Oracle WebCenter Portal.

55.1.5.3 Importing a WebCenter Portal Asset to JDeveloper

When you import an asset from a WebCenter Portal asset archive (.ear file) into the WebCenterSpacesResources project, the asset is uploaded to the appropriate project directory.

  • Shared assets are imported to:

    WebCenterSpacesResources\oracle\webcenter\siteresources\scopedMD\
    application_ID\resource_type\resource_ID

    For example, a shared skin with the asset ID gsr5a8c2fcc_bc7f_4cba_9254_36df58d66e60 is created under the application directory s8bba98ff_4cbb_40b8_beee_296c916a23ed:

    WebCenterSpacesResources\oracle\webcenter\siteresources\scopedMD\
    s8bba98ff_4cbb_40b8_beee_296c916a23ed\skin\gsr5a8c2fcc_bc7f_4cba_9254_36df58d66e60

  • Portal assets are imported to:

    WebCenterSpacesResources\oracle\webcenter\siteresources\scopedMD\
    Space_ID\resource_type\resource_ID

    For example, a portal skin with the asset ID gsre9cbef77_28b2_4f46_a69a_25beac543382 is created under the portal directory sc48d77f4_ca06_4fa9_8d51_0e23bed74eac:

    WebCenterSpacesResources\oracle\webcenter\siteresources\scopedMD\
    sc48d77f4_ca06_4fa9_8d51_0e23bed74eac\skin\gsre9cbef77_28b2_4f46_a69a_25beac543382

Its important to know the internal IDs of assets and the parent portal (portal assets only) so that you can locate the appropriate asset folders in JDeveloper. In WebCenter Portal, internal IDs are published in the asset's About dialog (Figure 55-8). For details, see the "Viewing Information About an Asset" section in Oracle Fusion Middleware Building Portals with Oracle WebCenter Portal.

Figure 55-8 Checking Asset IDs in WebCenter Portal

Description of Figure 55-8 follows
Description of "Figure 55-8 Checking Asset IDs in WebCenter Portal"

Internal IDs are not easy to remember like display names. If you want to identify an imported asset you can check its display name using the Update Resource option. Navigate to the resource directory, drill down to the resource file (for example, mynavigation.xml, myskin.css, mypagetemplate.jpsx, mycatalog.xml), and then click Update Resource from the right mouse menu (Figure 55-9).

Figure 55-9 Checking Asset Display Names in JDeveloper

Description of Figure 55-9 follows
Description of "Figure 55-9 Checking Asset Display Names in JDeveloper"

To import a WebCenter Portal asset from an archive:

  1. In the Application Navigator, right-click the WebCenterSpacesResources project, and choose Import Portal Resource.

  2. In the Import Portal Resource dialog, enter the name or browse for the archive file (.ear file) that contains the asset that you want to import.

    If the archive does not exist yet, login to WebCenter Portal and download the asset to an .ear file. For details, see the "Downloading an Asset" section in Oracle Fusion Middleware Building Portals with Oracle WebCenter Portal.

  3. Click OK.

  4. Navigate to the asset as follows:

    • Locate shared assets under:

      WebCenterSpacesResources\oracle\webcenter\siteresources\scopedMD\
      s8bba98ff_4cbb_40b8_beee_296c916a23ed

    • Locate portal assets under:

      WebCenterSpacesResources\oracle\webcenter\siteresources\scopedMD\<portal_GUID>

    Note:

    If you import an asset that was not originally created in WebCenter Portal or not developed using the WebCenterSpacesResources project the asset will be imported to:

    WebCenterSpacesResources\oracle\webcenter\portalapp

    In this instance, to consolidate future development, Oracle recommends that you manually move the asset to the appropriate shared or portal asset directory under WebCenterSpacesResources\oracle\webcenter\siteresources\scopedMD.

55.1.5.4 How to Build Assets for WebCenter Portal

This chapter describes the environment that you must use to develop and deploy assets for WebCenter Portal. This chapter does not describe individual asset types or how to build or modify them. To learn more about asset development and some guidance on best practices, read the appropriate chapter:

Asset Chapter

Page Templates

Developing Page Templates

Page Styles

Developing Page Styles

Skins

Developing Skins

Navigations

Developing a Navigation Model

Content Presenter Display Templates

Creating Content Presenter Display Templates

Resource Catalogs

Developing Resource Catalogs

Task Flow Styles

Developing Task Flow Styles


55.1.6 Uploading Assets Directly to WebCenter Portal

If WebCenter Portal is up and running you can deploy new or updated assets directly to WebCenter Portal from your JDeveloper environment.

You must have appropriate asset management permissions in WebCenter Portal to upload assets in this way. If you do not have the correct privileges, you are not allowed to upload assets. See also Section 55.1.3, "Enabling Direct Download and Uploads to WebCenter Portal".

  1. If you have not done so already, configure WebCenter Portal connection details in config.properties and request the appropriate asset management permissions.

    See also, Section 55.1.3, "Enabling Direct Download and Uploads to WebCenter Portal".

  2. In JDeveloper, open the WebCenterSpacesResources project, and navigate to the asset you want to upload.

    For example, to upload the sample shared navigation SampleNavigation, navigate to (Figure 55-10):

    WebCenterSpacesResources\Web Content\oracle\ webcenter\siteresources\scopedMD\s8bba98ff_4cbb_40b8_beee_296c916a23ed\navigation\gsrcc8dab1c_6161_4bb8_8764_127b4ecee01b

    Figure 55-10 Navigating to WebCenter Portal Resource Folders

    Description of Figure 55-10 follows
    Description of "Figure 55-10 Navigating to WebCenter Portal Resource Folders"

  3. Verify that the asset is complete.

  4. Ensure that any artifact referenced by the asset, such as images, icons, and so on, is available and accessible on the target content server.

  5. Right-click the file associated with the asset you want to upload to WebCenter Portal, and choose Upload Portal Resource to Server.

    There is a single file associated with most asset types. The exception is task flow style which has two files: definition.xml and .jsff. To upload a task flow style you must right-click the definition.xml file.

  6. If prompted, enter your WebCenter Portal username and password and click OK.

    An information message displays to indicate that the upload process is complete and also provides the name and location of the upload log file—upload_<asset_type_id>.log.

    Figure 55-11 Asset Upload Complete Message

    Description of Figure 55-11 follows
    Description of "Figure 55-11 Asset Upload Complete Message"

  7. Review the upload log file.

    The following message indicates that the upload was successful.

    Imported <temp_log_directory>\<asset_type_id>.ear

    If you do not see this message, refer to Section 55.1.8, "Troubleshooting Asset Round-Trip Development"

  8. Log in to WebCenter Portal and verify that the asset is available as expected.

    1. Log in to WebCenter Portal.

    2. Navigate to the appropriate Asset page.

      To verify shared assets, navigate to the following URL:

      http://host:port/webcenter/portal/builder/assets

      To verify portal assets, navigate to the following URL:

      http://host:port/webcenter/portal/portalName/admin/assets

    3. Select the appropriate asset type from the panel on the left, and verify that the asset you just uploaded is available and working as expected.

      Dependent images and so on, must be available and accessible on your content server. If an image or file is missing, check that you copied it to the appropriate directory.

55.1.7 Exporting WebCenter Portal Assets to an Archive

If for some reason you do not want or cannot upload your asset directly to WebCenter Portal from JDeveloper, you can export the asset to an archive (.ear file) and import the asset at some other time.

To export a WebCenter Portal asset to an archive:

  1. In the Application Navigator, navigate to the asset directory and drill down to the asset file (for example, myskin.css, mypagetemplate.jpsx, mycatalog.xml).

  2. Click Export Portal Resource from the right mouse menu.

  3. In the Export Portal Resource dialog, enter or browse for the path and file name for the export archive file. For example: C:\myskin.ear

  4. Click OK.

The steps to upload the asset to WebCenter Portal from the archive are available in the "Uploading an Asset" section in Oracle Fusion Middleware Building Portals with Oracle WebCenter Portal.

Note:

Artifacts referenced by the asset, such as images, icons, and so on, are not included in the asset archive. If you have not done so already, ensure that all such artifacts are available and accessible on the target content server.

55.1.8 Troubleshooting Asset Round-Trip Development

This troubleshooting section includes the following subsections:

Examining the Asset Upload Log File

When you upload an asset to WebCenter Portal, progress details are recorded in a log file. The name of the log file includes the type of asset you are uploading and a unique ID, in the format—upload_asset_type_id.log. For example, upload_siteTemplate_17283.log.

The location of the log file depends on your local temp directory settings. The exact log file location displays in an information message such as this:

Figure 55-12 Asset Upload Log File Location

Description of Figure 55-12 follows
Description of "Figure 55-12 Asset Upload Log File Location"

The following log entry indicates that the upload process was successful.

Imported <temp_log_directory>\<asset_type_id>.ear

Insufficient permissions result in "Access denied" or "java.lang.Exception" errors, as described below.

Unable to Upload Assets to WebCenter Portal - Access Denied

The following error displays in the asset upload log file if you do not have the monitor role:

Operation: getScopeName(java.lang.String)  Detail: Access denied. Required roles: Admin, Operator, Monitor, executing subject: principals=[yourusername]

The monitor role is a Weblogic Server role. This role enables you to run the WLST scripts which upload assets from JDeveloper to WebCenter Portal. Ask your system administrator to grant you this role through the WebLogic Server Administration Console. See also, the "Administrative Users and Roles" section in Oracle Fusion Middleware Application Security Guide.

Unable to Upload Assets to WebCenter Portal - java.lang.Exception

The following error displays in the asset upload log file if you do not have permission to manage any assets in WebCenter Portal or the particular type of asset you are trying to upload:

javax.management.MBeanException at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234) 
Root Cause: Caused by: java.lang.Exception at
oracle.webcenter.portalframework.genericsiteresources.model.lifecycle.SiteResourcesHelper.updateResource(SiteResourcesHelper.java)

Ask your WebCenter Portal administrator to grant you appropriate permissions through Portal Builder Administration. Or, if the asset you are trying to upload is for a particular portal, contact the portal moderator to request the required permission. See also, Table 55-3, "Permissions to Upload and Manage Assets Through JDeveloper".

55.2 Developing Task Flows, Data Controls, and Managed Beans for WebCenter Portal

This section describes how you can package and deploy your ADF task flows, data controls, and managed beans in your own custom shared libraries (WAR files) for use in WebCenter Portal.

The section also describes WebCenterPortal's PortalSharedLibrary project (available through the JDeveloper WebCenter Portal Server Extension template) which enables you to configure the names of all the custom shared libraries that want to use with WebCenter Portal.

Note:

Oracle recommends that you use the WebCenter Portal Server Extension template to configure shared libraries for WebCenter Portal (11.1.1.8.0).

For backward compatibility, if you developed and deployed custom shared libraries using SampleWebCenterSpacesExtension.jws and DesignWebCenterSpaces.jws then this approach continues to work as previously documented. You must only use one approach, you cannot use the WebCenter Portal Server Extension template and DesignWebCenterSpaces.jws.

To help you understand how you can develop, test, deploy, and use your own ADF task flows, data controls, and managed beans in WebCenter Portal, Figure 55-13 shows the development lifecycle of a single task flow (called mytaskflow). Development steps 1 through 5 are described in this chapter.

Figure 55-13 Development Lifecycle for an ADF Task Flow

Description of Figure 55-13 follows
Description of "Figure 55-13 Development Lifecycle for an ADF Task Flow"

The following subsections describe the development and deployment process in more detail:

55.2.1 Understanding the WebCenter Portal Server Extension Template

The WebCenter Portal Server Extension template creates a workspace with two projects:

  • PortalSharedLibrary – A project that when deployed creates extend.spaces.webapp.war, a shared library that:

    • References one or more custom shared libraries for WebCenter Portal.

    • Wraps the ADF Library JAR created from the PortalExtension project (only if used).

    Note:

    Do not add any code to this project; this project only contains descriptor files that reference other shared libraries and/or includes ADF Library JARs.

  • PortalExtension – A starter project in which you create custom ADF components, such as task flows, data controls, and managed beans. You can deploy this project to an ADF Library, which is added to the extend.spaces.webapp.war shared library.

    The components you create in a PortalExtension project typically require Java, ADF, and other related software development skills.

This section describes:

55.2.1.1 How the WebCenter Portal Server Extension Workspace is Organized

The WebCenter Portal Server Extension workspace contains two default projects PortalExtension and PortalSharedLibrary each containing specific libraries and default files (Figure 55-14).

Figure 55-14 WebCenter Portal Server Extension Workspace in Application Navigator

Description of Figure 55-14 follows
Description of "Figure 55-14 WebCenter Portal Server Extension Workspace in Application Navigator"

55.2.1.2 The PortalSharedLibrary Project

The PortalSharedLibrary project, shown in Figure 55-15, enables you to register one or more custom shared libraries that you want to use in WebCenter Portal and also provides a convenient mechanism for deploying task flows, data controls, and managed beans (developed in the PortalExtension project) to a managed server running WebCenter Portal.

The PortalSharedLibrary project includes a WAR deployment profile called extend.spaces.webapp. When you deploy to extend.spaces.webapp.war, all the custom shared libraries that you register (in weblogic.xml) and any ADF library that you create and using a PortalExtension project are automatically included as dependencies of extend.spaces.webapp.war.

See Section 55.2.4, "Registering Additional Shared Libraries With WebCenter Portal" and Section 55.2.5, "Deploying Extensions to the WebCenter Portal Shared Library (extend.spaces.webapp.war)".

Note:

Do not add any code to the PortalSharedLibrary project; this project only contains descriptor files that reference other shared libraries or include ADF Library JARs.

For general information on shared libraries, see Section 55.2.2.2, "General Documentation for Shared Library Deployment".

Figure 55-15 PortalSharedLibrary Project

Description of Figure 55-15 follows
Description of "Figure 55-15 PortalSharedLibrary Project"

55.2.1.2.1 Versioning extend.spaces.webapp.war

The PortalSharedLibrary project contains a MANIFEST.MF file. Each time you update and deploy extend.spaces.webapp.war, edit this MANIFEST.MF file to increment the shared library implementation version. With each iteration, you must increment the Implementation-Version number in the MANIFEST.MF file, as shown in Example 55-1. The default implementation version is 11.1.2.

Example 55-1 Manifest File for extend.spaces.webapp

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: builder
Build-Jdk: 1.6.0_20
Extension-Name: extend.spaces.webapp
Implementation-Label: 11.1.1.8.0
Implementation-Title: extend.spaces.webapp
Implementation-Vendor: Oracle
Implementation-Version: 11.1.2
Specification-Title: extend.spaces.webapp
Specification-Vendor: Oracle
Specification-Version: 11.1.1

For detailed steps on how to change the implementation version, see Section 55.2.5, "Deploying Extensions to the WebCenter Portal Shared Library (extend.spaces.webapp.war)".

55.2.1.3 The PortalExtension Project

The PortalExtension project is a standard ADF project where you can create custom components like task flows, data controls, and managed beans.

A PortalExtension project is deployed to an ADF Library. This library is automatically added as a dependency to the extend.spaces.webapp.war shared library file generated from the PortalSharedLibrary project. See Section 55.2.6, "Developing ADF Library Components for WebCenter Portal Using the PortalExtension Project".

For more information on ADF Libraries, see Section 55.2.2.1, "General Documentation for ADF Library Development".

Figure 55-16 The PortalExtension Project

Description of Figure 55-16 follows
Description of "Figure 55-16 The PortalExtension Project"

55.2.2 Understanding Shared Library Development for WebCenter Portal

WebCenter Portal includes the standard shared library extend.spaces.webapp.war. This WAR file can include a deployment descriptor (weblogic.xml) which references other shared libraries containing custom ADF library components.

If you have custom code or task flows deployed in several shared libraries from multiple sources that you want to use in WebCenter Portal you can list them in extend.spaces.webapp.war, as illustrated in Figure 55-17.

Figure 55-17 Reference Multiple Custom Shared Libraries in extend.spaces.webapp.war

Description of Figure 55-17 follows
Description of "Figure 55-17 Reference Multiple Custom Shared Libraries in extend.spaces.webapp.war"

This development model provides an easy way to utilize additional shared libraries in WebCenter Portal from multiple contributors, including developers, customers, partners.

Whenever you deploy a new shared library that includes extensions for WebCenter Portal you must register the name of your shared library with WebCenter Portal and redeploy extend.spaces.webapp.war. For details, see Section 55.2.4, "Registering Additional Shared Libraries With WebCenter Portal".

This Guide does not teach you how to develop ADF task flows, data controls, and managed beans and package them into custom shared libraries as such techniques and procedures are not specific to WebCenter Portal deployments. If you are new to shared library development, Oracle recommends that you familiarize yourself with the documentation listed at:

This Guide explains how to reference shared libraries that you want to use in WebCenter Portal using the WebCenter Portal Server Extension template. Table 55-5 provides an overview of the ADF library and shared library development processes, highlighting information that is specific to WebCenter Portal and pointing to other documentation where applicable.

Table 55-5 Developing and Deploying ADF Libraries and Shared Libraries for WebCenter Portal

Subject WebCenter Portal Documentation General Documentation

Creating ADF library components

WebCenter Portal supports several component types deployed to ADF Library JARs: task flows, data controls, and managed beans

Create task flows, data controls, or managed beans for WebCenter Portal the same way as any standard ADF Library component.

Alternatively, use the starter project supplied with WebCenter Portal. See Section 55.2.6, "Developing ADF Library Components for WebCenter Portal Using the PortalExtension Project".

See also, Section 55.2.7, "Tutorial for WebCenter Portal Shared Library Developers".

The section "Introduction to Reusable Components" in Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework describes various types of reusable ADF components, such as a task flows, that you can deploy to an ADF Library JAR.

Note that the subsection "Extension Libraries" does not apply to WebCenter Portal.

See also, the section "Creating Reusable Components" in Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

- Naming conventions

Every ADF Library JAR file that you want to use with WebCenter Portal must have a unique file name. You cannot add two ADF Library JAR files with the same name even if their content is completely different.

See also, the section "Naming Conventions" in Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

- Managing connections

If your ADF Library JAR utilizes a connection you must manually register that connection with WebCenter Portal using the same connection name and details (just including the connection within the ADF Library JAR does not expose that connection in WebCenter Portal).

To create connections for WebCenter Portal, you must use Fusion Middleware Control or WLST commands.

To add a WebCenter Portal specific connection, refer to the "Managing Tools and Services" section in Oracle Fusion Middleware Administering Oracle WebCenter Portal.

To add a database connection, refer to the "Creating and Managing JDBC Data Sources" section in the Oracle Fusion Middleware Administrator's Guide.

To add a Web Service connection, configure the ADFConnections MBean using the System MBean Browser. Refer to the "System MBean Browser" section in Oracle Fusion Middleware Administering Oracle WebCenter Portal and the "Web Service Connection" section in the Oracle Fusion Middleware Administrator's Guide for Oracle Application Development Framework.

See also, the section "Naming Considerations for Connections" in Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework.

- Including descriptors

Descriptors in custom shared libraries, such as web.xml and application.xml, merge with corresponding descriptors deployed with the WebCenter Portal application. To avoid corrupting your WebCenter Portal installation, Oracle recommends that you do not include descriptor files in your custom shared libraries.

 

- Versioning

Each time you redeploy the WebCenter Portal shared library WAR file (extend.spaces.wepapp.war) to add an ADF library JAR or to reference a custom shared library you must increment the shared library implementation version number.

For details, see Section 55.2.1.2.1, "Versioning extend.spaces.webapp.war" and Section 55.2.5, "Deploying Extensions to the WebCenter Portal Shared Library (extend.spaces.webapp.war)".

 

Packaging components into ADF Library JAR

Package your task flow, data control, or managed bean into a standard ADF Library JAR.

Alternatively, use the starter PortalExtension project. For details, see Section 55.2.6, "Developing ADF Library Components for WebCenter Portal Using the PortalExtension Project".

The section "Packaging a Reusable ADF Component into an ADF Library" in Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework describes how to package a reusable component, such as a task flow, to a ADF Library JAR file.

Note that the subsection "How to Place and Access JDeveloper JAR Files" does not apply to WebCenter Portal.

Adding ADF library components to a shared library

To use ADF Library components in WebCenter Portal, you must:

  1. Deploy your ADF Library components to a shared library WAR file.

    See, the "Creating Shared Java EE Libraries and Optional Packages" section in Oracle Fusion Middleware Developing Applications for Oracle WebLogic Server.

  2. Deploy your shared library to the managed server on which WebCenter Portal is deployed.

  3. Register your shared library in the WebCenter Portal shared library (extend.spaces.webapp.war).

  4. Deploy a new version of the WebCenter Portal shared library (extend.spaces.webapp.war).

  5. Use Fusion Middleware Control or WLST to create any connections that your custom ADF Library components require.

  6. Restart the managed server on which WebCenter Portal is deployed.

Note: You can add ADF Library components directly to the WebCenter Portal shared library WAR (extend.spaces.webapp.war) if you want. For details, see Section 55.2.5, "Deploying Extensions to the WebCenter Portal Shared Library (extend.spaces.webapp.war)".

The section "Adding ADF Library Components into Projects" in Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework describes how to deploy ADF library components, such as a task flow, to a project.

The information in this section does not apply to WebCenter Portal.

Using ADF library components

An ADF Library adapter in WebCenter Portal's resource catalog automatically picks up any task flows, data controls and managed beans that you deploy and reference through extend.spaces.webapp.war and adds them to WebCenter Portal's resource registry. Custom components in the resource registry are exposed to WebCenter Portal users through resource catalogs as components that you can drop onto portal pages.

  1. Log in to WebCenter Portal.

  2. Add your custom component to a resource catalog.

    See, the "Adding a Resource to a Resource Catalog" section in Oracle Fusion Middleware Building Portals with Oracle WebCenter Portal.

  3. Open a page with access to the resource catalog.

  4. Add your custom component to the page.

    See, the "Adding a Component to a Page" section in Oracle Fusion Middleware Building Portals with Oracle WebCenter Portal.

The section "What You May Need to Know About Using ADF Library Components" in Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework describes how various different ADF Library component types appear in JDeveloper. For WebCenter Portal, only the information pertaining to task flows, data controls, and managed beans applies.

Creating a shared library WAR

The WebCenter Portal Server Extension template provides a deployment profile for the WebCenter Portal shared library WAR extend.spaces.webapp.war.

For details, see Section 55.2.3, "Creating a WebCenter Portal Server Extension Workspace".

The section "Creating Shared Java EE Libraries" in Oracle Fusion Middleware Developing Applications for Oracle WebLogic Server describes how to create a shared library WAR file.

Deploying a shared library WAR

The WebCenter Portal Server Extension template enables you to redeploy the WebCenter Portal shared library WAR extend.spaces.webapp.war.

For details, see Section 55.2.5, "Deploying Extensions to the WebCenter Portal Shared Library (extend.spaces.webapp.war)".

The section "Deploying Shared Java EE Libraries and Dependent Applications" in Oracle Fusion Middleware Developing Applications for Oracle WebLogic Server describes how to deploy any shared library WAR file.

Reverting to a previous library version

Use the WebLogic Server Administration Console to revert to a previous shared library WAR version or remove unwanted versions.

For details, see Section 55.2.5.3, "Reverting to a Previous WebCenter Portal Shared Library Version".

The section "Removing an ADF Library JAR from a Project" in Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework describes how remove ADF Library components in JDeveloper.

The information in this section does not apply to WebCenter Portal.


55.2.2.1 General Documentation for ADF Library Development

55.2.2.2 General Documentation for Shared Library Deployment

55.2.3 Creating a WebCenter Portal Server Extension Workspace

This section explains how to create a WebCenter Portal Server Extension workspace in JDeveloper in which you can:

  • Register one or more custom shared libraries to use with WebCenter Portal.

  • Create and deploy a custom ADF component for WebCenter Portal such as a task flow, data control, or managed bean.

To create a WebCenter Portal Server Extension workspace:

  1. Download and install Oracle JDeveloper 11g (11.1.1.7.0).

    For details, see Section 2.2.1, "Installing Oracle JDeveloper".

  2. Install the WebCenter Portal Extension for JDeveloper (11.1.1.8.0).

    For details, see Section 2.2.2, "Installing the WebCenter Portal Extension for JDeveloper".

  3. Open JDeveloper and choose File > New.

  4. In the New Gallery dialog, open the General node and select Applications.

  5. In the Items list, select WebCenter Portal Server Extension, and click OK.

    See Figure 55-18.

    Figure 55-18 New Gallery Dialog

    Description of Figure 55-18 follows
    Description of "Figure 55-18 New Gallery Dialog"

    Note:

    At this point, you are on the first page of the Create WebCenter Portal Server Extension wizard. The wizard includes four pages, which are explained in the following steps.

  6. In the Create WebCenter Portal Server Extension dialog, enter a name for the workspace in the Application Name field, as shown in Figure 55-19.

    Figure 55-19 Create WebCenter Portal Extension Wizard Step 1 of 4

    Description of Figure 55-19 follows
    Description of "Figure 55-19 Create WebCenter Portal Extension Wizard Step 1 of 4"

  7. In the Directory field, enter a path to the base directory in which to store the workspace, or accept the default path.

    For example:

    /scratch/jdeveloper/mywork/MyPortalExtension
    

    Optionally, click the Browse button to navigate to the desired directory.

  8. Optionally, enter an Application Package Prefix.

    This prefix is used for Java classes, interfaces, and packages created within the workspace. For example, a common prefix pattern is com.companyDomainName, like com.oracle.

    Tip:

    At this point, you could click Finish to create a project with default portal project names and directories. The following steps continue and review the rest of the wizard pages.

  9. Click Next.

  10. In the Project 1 Name part of the wizard, enter a Project Name, or keep the default name, PortalExtension, as shown in Figure 55-20.

    This project provides all of the project technology components that are required for building and testing custom ADF components for WebCenter Portal (task flows, data controls, and managed beans).

    Figure 55-20 Create WebCenter Portal Server Extension Wizard Step 2 of 4

    Description of Figure 55-20 follows
    Description of "Figure 55-20 Create WebCenter Portal Server Extension Wizard Step 2 of 4"

  11. If you want to change the default directory for the project, enter it or use the Browse button to select a directory.

  12. Optionally add Project Technologies.

    Also called technology scopes, project technologies are a collection of libraries and files designed to provide specific functionality within a project.

    Note:

    Technology scopes are attributes on the project that can be used to identify the different technologies used for that particular project. These attributes are used only within JDeveloper to assist you as you work. With technology scopes, the choices presented to you in the New Gallery and in the menus and palettes are filtered so that you see only those items that are most relevant to you as you work. Technology scopes have no effect on the data in the project itself. For more information, see refer to JDeveloper Online Help.

  13. Optionally, select the Generated Components and Associated Libraries tabs to view additional configuration files and libraries that will be added to the project.

  14. Click Next.

  15. Optionally, edit the default package name and directories for Java source files and output class files for the project, as shown in Figure 55-22.

    Figure 55-21 Create WebCenter Portal Server Extension Wizard Step 3 of 4

    Description of Figure 55-21 follows
    Description of "Figure 55-21 Create WebCenter Portal Server Extension Wizard Step 3 of 4"

  16. In the Project 2 Name part of the wizard, enter a project name, or keep the default name, PortalSharedLibrary, as shown in Figure 55-22.

    This project allows you to register one or more shared libraries that you want to use in WebCenter Portal, as well as deploy custom ADF components built using the PortalExtension project. See Section 55.2.5, "Deploying Extensions to the WebCenter Portal Shared Library (extend.spaces.webapp.war)"

    Figure 55-22 Create WebCenter Portal Server Extension Wizard Step 4 of 4

    Description of Figure 55-22 follows
    Description of "Figure 55-22 Create WebCenter Portal Server Extension Wizard Step 4 of 4"

  17. If you want to change the default directory for the project, enter it or use the Browse button to select a directory.

  18. Optionally add Project Technologies, also called technology scopes.

    Note:

    Technology scopes are attributes on the project that can be used to identify the different technologies used for that particular project. These attributes are used only within JDeveloper to assist you as you work. With technology scopes, the choices presented to you in the New Gallery and in the menus and palettes are filtered so that you see only those items that are most relevant to you as you work. Technology scopes have no effect on the data in the project itself. For more information, see refer to JDeveloper Online Help.

  19. Optionally, select the Generated Components and Associated Libraries tabs to view additional configuration files and libraries that will be added to the project.

  20. Click Finish.

55.2.4 Registering Additional Shared Libraries With WebCenter Portal

If you have one or more shared libraries containing custom task flows, data controls or managed beans that you want to use them in WebCenter Portal, you must register them in the weblogic.xml file associated with WebCenter Portal's shared library extend.spaces.webapp.war.

  1. Select the PortalSharedLibrary project (Figure 55-23).

    If you have not created a WebCenter Portal Extension workspace yet, refer to Section 55.2.3, "Creating a WebCenter Portal Server Extension Workspace".

    Figure 55-23 PortalSharedLibrary Project

    Description of Figure 55-23 follows
    Description of "Figure 55-23 PortalSharedLibrary Project"

  2. If the deployment descriptor weblogic.xml does not exist yet under PortalSharedLibrary\Web Content\WEB-INF, create the deployment descriptor as follows:

    1. Select New > Deployment Descriptors > WebLogic Deployment Descriptor

    2. Select OK.

    3. Select weblogic.xml from the list (Figure 55-24).

      Figure 55-24 Create WebLogic Deployment Descriptor weblogic.xml

      Description of Figure 55-24 follows
      Description of "Figure 55-24 Create WebLogic Deployment Descriptor weblogic.xml"

    4. Select Finish.

  3. Open weblogic.xml (under PortalSharedLibrary\Web Content\WEB-INF).

    Initially, no additional shared libraries are listed in the file.

  4. In the Overview page, select Libraries.

  5. Specify the Library Name for each shared library that you want to use in WebCenter Portal.

    You can register a single shared library or multiple shared libraries, as shown in Figure 55-25.

    Click the Help icon for more information, if required.

    Figure 55-25 weblogic.xml - Multiple Shared Library References

    Description of Figure 55-25 follows
    Description of "Figure 55-25 weblogic.xml - Multiple Shared Library References"

  6. Ensure each shared library that you reference is deployed on the WebCenter Portal managed server (named WC_Spaces by default).

  7. Redeploy a new version of the WebCenter Portal shared library WAR (extend.spaces.webapp.war) that includes your shared library references.

    Remember to increment the version number in MANIFEST.MF. For details, see Section 55.2.5, "Deploying Extensions to the WebCenter Portal Shared Library (extend.spaces.webapp.war)".

55.2.5 Deploying Extensions to the WebCenter Portal Shared Library (extend.spaces.webapp.war)

This section explains how to deploy extensions to the WebCenter Portal shared library (extend.spaces.webapp.war) where your extensions are either:

This section includes the following topics:

55.2.5.1 Deploying Extensions Directly to the Portal Server

Before deploying extensions to WebCenter Portal from JDeveloper:

To deploy extensions for WebCenter Portal from JDeveloper:

  1. In JDeveloper, open the workspace containing extensions to be deployed.

    See also Section 55.2.4, "Registering Additional Shared Libraries With WebCenter Portal" and Section 55.2.6, "Developing ADF Library Components for WebCenter Portal Using the PortalExtension Project".

  2. In the Application Navigator, navigate to the PortalSharedLibrary > Application Sources > META-INF folder.

  3. Open the MANIFEST.MF file in a text editor.

  4. Increment the Implementation-Version number. The default version is Implementation-Version: 11.1.2.

    Note:

    You must increment the shared library Implementation-Version number each time you update and redeploy the WebCenter Portal shared library extend.spaces.webapp.war. Otherwise, an error is reported from WebLogic Server in the Deployment - Log tab. For more information, see Section 55.2.1.2, "The PortalSharedLibrary Project."

  5. In the Application Navigator, right-click the PortalSharedLibrary project, select Deploy, and then select extend.spaces.webapp (Figure 55-26).

    Note:

    Note that extend.spaces.webapp is the name of the deployment profile for the shared library that you are deploying to the server. The shared library created by a subsequent deployment action is called extend.spaces.webapp.war.

    Figure 55-26 Selecting the Shared Library extend.spaces.webapp

    Description of Figure 55-26 follows
    Description of "Figure 55-26 Selecting the Shared Library extend.spaces.webapp"

  6. In the Deploy dialog, select Deploy to Application Server and click Next (Figure 55-27).

    Figure 55-27 Portal Extension Deployment Actions

    Description of Figure 55-27 follows
    Description of "Figure 55-27 Portal Extension Deployment Actions"

  7. Select the connection that points to the WebLogic Server where you want to deploy the shared library, for example, WC_Spaces, and click Next.

  8. In the Deploy extend.spaces.webapp dialog, select Deploy to selected instances in the domain, as shown in Figure 55-28.

    Figure 55-28 Selecting Deployment Option

    Description of Figure 55-28 follows
    Description of "Figure 55-28 Selecting Deployment Option"

  9. In the list of servers, select the managed server on which WebCenter Portal is deployed, as shown in Figure 55-29.

    Note:

    The name of the managed server depends on how the system administrator set up the server. By default, the name is WC_Spaces; however, this name might be different on your system.

    Figure 55-29 Selecting the Managed Server

    Description of Figure 55-29 follows
    Description of "Figure 55-29 Selecting the Managed Server"

  10. Select Deploy as a shared library, as shown in Figure 55-30

    Note:

    This step is critical: you must select Deploy as a shared library, otherwise, the deployment will not be successful.

    Figure 55-30 Selecting Deploy As Shared Library

    Description of Figure 55-30 follows
    Description of "Figure 55-30 Selecting Deploy As Shared Library"

  11. Click Next.

  12. On the Deployment Summary screen, verify the deployment options, and click Finish to deploy the portal extension to the server.

  13. Open the Deployment -Log tab to examine for any deployment issues. If deployment is successful, you should see this log entry: "Application Deployed Successfully," as shown in Chapter 55, "Deployment - Log Tab."

    Figure 55-31 Deployment - Log Tab

    Description of Figure 55-31 follows
    Description of "Figure 55-31 Deployment - Log Tab"

  14. To verify the new deployment, log in to the WebLogic Server Administration Console, navigate to the Deployments Overview page, and check the implementation version displayed.

    1. Log in to the WebLogic Server Administration Console.

    2. Click Deployments, and locate extend.spaces.webapp.

    3. Note the entries for the extend.spaces.webapp shared library and verify the one with the implementation version that you updated previously in the MANIFEST.MF file. See also Section 55.2.1.2.1, "Versioning extend.spaces.webapp.war."

    Note:

    WebLogic Server only uses the latest shared library version when an application starts up. If you go through several "change-build-deploy-test" iterations, incremental versions are retained by default. You can use the Administration Console to remove unwanted shared library versions if you want, but it is recommended that you retain the first version (extend.spaces.webapp(11.1.1,11.1.1)) as a backup so you can revert to the default behavior if necessary.

  15. (Optional) Create any connections that your custom ADF Library components may require:

    • To add a database connection, refer to the "Creating and Managing JDBC Data Sources" section in Oracle Fusion Middleware Administrator's Guide.

    • To add a Web Service connection, configure the ADFConnections MBean using the System MBean Browser in Fusion Middleware Control. Refer to the "System MBean Browser" section in Oracle Fusion Middleware Administering Oracle WebCenter Portal and the "Web Service Connection" section in the Oracle Fusion Middleware Administrator's Guide for Oracle Application Development Framework.

    • To add a connection type specific to WebCenter Portal, for example to a portlet producer or content repository connection, refer to the "Managing Tools and Services" section in Oracle Fusion Middleware Administering Oracle WebCenter Portal.

  16. Restart the managed server on which WebCenter Portal is running.

    This step is required for the task flows, data controls, and managed beans in the shared library to show up in the WebCenter Portal Resource Registry. For more information, see the "Starting and Stopping Managed Servers for WebCenter Portal Application Deployments" section in Oracle Fusion Middleware Administering Oracle WebCenter Portal.

    Note:

    The name of the managed server depends on how the system administrator set up the server. By default, the name is WC_Spaces; however, this name might be different on your system.

  17. Log in to WebCenter Portal and verify that all newly deployed task flows, data controls, or managed beans are available in the Resource Registry.

Once successfully deployed components are added to the Resource Registry, you can add them to resource catalogs where they are made available for drag and drop onto portal pages. See also, the "About the Resource Registry" section in Oracle Fusion Middleware Building Portals with Oracle WebCenter Portal.

55.2.5.2 Deploying Extensions to an Archive

If you do not have a connection to the portal server or permissions to deploy the extend.spaces.webapp shared library on the portal server, you can deploy extensions to the extend.spaces.webapp shared library to an archive (.war file) and give the .war file to an administrator for deployment to a managed server running WebCenter Portal.

To deploy extensions to the extend.spaces.webapp shared library to an archive:

  1. In JDeveloper, open the workspace containing extensions to be deployed.

    See also Section 55.2.4, "Registering Additional Shared Libraries With WebCenter Portal" and Section 55.2.6, "Developing ADF Library Components for WebCenter Portal Using the PortalExtension Project".

  2. In the Application Navigator, navigate to the PortalSharedLibrary > Application Sources > META-INF folder.

  3. Open the MANIFEST.MF file in a text editor.

  4. If required, increment the Implementation-Version number. The default version is Implementation-Version: 11.1.2.

    Note:

    You do not need to increment the version number every time you generate a new archive (.war file). You must however, increment the shared library Implementation-Version number each time you deploy a new extension version to the server or an error is reported from WebLogic Server in the Deployment - Log tab. For more information, see Section 55.2.1.2, "The PortalSharedLibrary Project."

  5. In the Application Navigator, right-click the PortalSharedLibrary project, select Deploy and then select the deployment profile extend.spaces.webapp.

    Note:

    Note that extend.spaces.webapp is the name of the deployment profile for the shared library that you are deploying to a file. The shared library created by a subsequent deployment action is called extend.spaces.webapp.war.

  6. In the Deploy dialog, select Deploy to WAR, and then click Next (Figure 55-32).

    Figure 55-32 Deployment Actions

    Description of Figure 55-32 follows
    Description of "Figure 55-32 Deployment Actions"

  7. Review the Summary page and click Finish.

    The location of the .war file displays in the "Deployment - Log Tab." This new shared library .war file version can now be deployed to any server instance on which WebCenter Portal is deployed.

For More Information

See "Deploying Applications" in JDeveloper Online Help. See also the "Creating Shared Java EE Libraries and Optional Packages" section in Oracle Fusion Middleware Developing Applications for Oracle WebLogic Server.

55.2.5.3 Reverting to a Previous WebCenter Portal Shared Library Version

If there is a problem with the latest WebCenter Portal shared library or you want to revert to a previous version for some reason, you can undeploy (remove) the current version and revert to the previous version, using the WebLogic Server Administration Console.

You can remove unwanted shared library versions too. If you go through several "change-build-deploy-test" iterations, each incremental version is retained by default. As WebCenter Portal only uses the latest shared library version you can clean up or delete previous versions if you want.

Before undeploying the latest version, you must shut down the managed server on which WebCenter Portal is running. Once you have removed the latest version, you can restart the managed server.

Note: Oracle recommends that you do not delete the original extend.spaces.webapp shared library (version 11.1.1) as this enables you to revert to the out-the-box version if necessary.

  1. Stop the managed server on which WebCenter Portal is deployed.

    For details, see the "Starting and Stopping Managed Servers for WebCenter Portal Application Deployments" section in Oracle Fusion Middleware Administering Oracle WebCenter Portal.

  2. Log in to the Weblogic Server Administration Console.

  3. Click Deployments, then locate and select the latest extend.spaces.webapp version you want to remove.

  4. Click Delete to undeploy the latest shared library version.

    To revert to the original extend.spaces.webapp.war shared library, delete all other shared library versions, except for extend.spaces.webapp.war version 11.1.1.

  5. Start the managed server on which WebCenter Portal is deployed:

    For details, see the "Starting and Stopping Managed Servers for WebCenter Portal Application Deployments" section in Oracle Fusion Middleware Administering Oracle WebCenter Portal.

55.2.6 Developing ADF Library Components for WebCenter Portal Using the PortalExtension Project

Developing an ADF Library for WebCenter Portal is exactly the same as any other ADF Library. If you are not familiar with ADF library development, refer to the documentation links in Section 55.2.2.1, "General Documentation for ADF Library Development".

Development teams typically build and deploy ADF libraries to a set of well defined shared libraries that they can reuse across multiple applications, such as WebCenter Portal.

To help you get started, Oracle provides the PortalExtension project in which you can build ADF libraries containing task flows, data controls, and managed beans and deploy them to WebCenter Portal's own shared library extend.spaces.webapp.war.

If you want to use the PortalExtension project, follow these steps:

  1. Create a WebCenter Portal Server Extension workspace.

    For details, see Section 55.2.3, "Creating a WebCenter Portal Server Extension Workspace".

  2. Open the PortalExtension project and add the custom code for your ADF library.

    See also Section 55.2.1.3, "The PortalExtension Project".

  3. Deploy the ADF Library to the WebCenter Portal shared library extend.spaces.webapp.war.

    See also Section 55.2.5, "Deploying Extensions to the WebCenter Portal Shared Library (extend.spaces.webapp.war)".

55.2.7 Tutorial for WebCenter Portal Shared Library Developers

If you are new to WebCenter Portal and shared library development, read the whitepaper "Development Lifecycle for Task Flows in Oracle WebCenter Portal (11.1.1.8.0)". This step-by-step tutorial teaches you how to add a custom ADF task flow developed in JDeveloper to a page in WebCenter Portal. The whitepaper is available on Oracle Technology Network at:

http://www.oracle.com/technetwork/middleware/webcenter/portal/learnmore/wcp-createcustomtaskflow-2135965.pdf

55.2.8 Troubleshooting WebCenter Portal Shared Library Deployment

  • Changes are not available after deployment even though deployment successful.

    WebCenter Portal always uses the latest shared library version. Check that the implementation version in MANIFEST.MF matches the implementation version displayed in the WebLogic Server Administration Console.

    For example, check the value in PortalSharedLibrary/Application Sources/META-INF/MANIFEST.MF is the same as that displayed in the Administration Console under Deployments> extend.spaces.webapp>Overview

  • "DeployerException: Task 9 failed" displays:

    weblogic.Deployer$DeployerException: weblogic.deploy.api.tools.deployer.DeployerException: Task 9 failed:
    [Deployer:149117]deploy library com.mycompanyname.shared.lib [LibSpecVersion=11.1.1.2,LibImplVersion=11.1.1.2.5] on AdminServer,WC_Spaces.
    
    

    This error occurs if the implementation version of the new deployment and the existing deployment are the same. Use the Administration Console to verify the current implementation version and if necessary change the version and redeploy the shared library.

  • "java.lang.IllegalArgumentException" displays:

    Restart the managed server on which WebCenter Portal is deployed.