Skip Headers
Oracle® Fusion Middleware Developer's Guide for Oracle WebCenter Portal
11g Release 1 (11.1.1.7.0)

Part Number E10148-20
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

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

55 Extending the Spaces Application Using JDeveloper

WebCenter Portal's Spaces application can be customized using browser-based tools and also using JDeveloper. This chapter describes how to customize the Spaces application and Spaces resources in JDeveloper and subsequently utilize them in the Spaces application. For example, you may want to deploy additional shared libraries that include custom code or some additional task flows. Or, you might want to edit Spaces resources, such as skins, page templates, and navigations, in JDeveloper.

It includes the following sections:

Audience

This section is intended for developers who have basic knowledge of JDeveloper with WebCenter Portal: Framework extensions and want to perform advanced customizations for their Spaces deployment.

55.1 Downloading a Workspace for Spaces Development

A JDeveloper workspace for developing Spaces extensions is available as a download from Oracle Technology Network - this workspace is named DesignWebCenterSpaces.jws.

To download the Spaces development workspace:

  1. Ensure the Spaces application is installed, configured, and working as expected.

  2. Download and install Oracle JDeveloper 11g (11.1.1.6.0).

    Oracle JDeveloper 11g (11.1.1.6.0) is available for download from: http://www.oracle.com/technetwork/developer-tools/jdev/downloads/jdeveloper11116-1377208.html.

  3. Download and install Oracle JDeveloper WebCenter Portal Framework and Services Design Time Extensions:

    1. In JDeveloper, select Help > Check for Updates.

    2. Click Next, and then Next again to display all available updates.

    3. Use the search field to filter the list, for example, enter 'webcenter'.

      Figure 55-1 Download Oracle JDeveloper WebCenter Portal Framework and Services Design Time Extensions

      Description of Figure 55-1 follows
      Description of "Figure 55-1 Download Oracle JDeveloper WebCenter Portal Framework and Services Design Time Extensions"

    4. Select WebCenter Framework and Services Design Time.

    5. Click Finish.

    See also, Section 3.2, "Installing WebCenter Portal's Extension for Oracle JDeveloper."

  4. Download the Spaces development ZIP file (DesignWebCenterSpaces_PS6.zip) from Oracle Technology Network:

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

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

    Table 55-1 DesignWebCenterSpaces_PS6.zip - Unzip Folders

    Unzip Folders Description

    \DesignWebCenterSpaces

    Includes DesignWebCenterSpaces.jws.

    This workspace enables you to configure your shared library list, that is, you can specify one or more shared libraries containing various customizations (such as custom java code, custom task flows, and so on) that you want to utilize in the Spaces application.

    The workspace also provides a design environment for editing and uploading Spaces resources.

    \copy_to_common

    Includes a common directory that contains WebCenter Portal WLST commands.

    WebCenter Portal's WLST commands are required to upload customized resources directly to the Spaces application from DesignWebCenterSpaces.jws.

    \copy_to_jdev_ext

    Includes oracle.webcenter.portal.jar.

    Required update to Oracle JDeveloper WebCenter Portal Framework and Services Design Time Extensions.


  6. 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/.

  7. 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.

  8. Restart JDeveloper if it is open.

55.2 Including Additional Shared Libraries in Spaces

This section includes the following subsections:

55.2.1 What You Should Know About Shared Library Deployment for Spaces

The Spaces application includes the standard shared library extend.spaces.webapp.war. This .WAR file includes a deployment descriptor (weblogic.xml) which can reference other libraries that contain Spaces customizations.

Therefore, if you have custom code or task flows deployed in several shared libraries from multiple sources you can add them to the extend.spaces.webapp shared library list, as illustrated in Figure 55-2.

Figure 55-2 Referencing Custom Shared Libraries in extend.spaces.webapp.war

Description of Figure 55-2 follows
Description of "Figure 55-2 Referencing Custom Shared Libraries in extend.spaces.webapp.war"

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

Whenever you deploy a new shared library that includes Spaces extensions you must modify the Spaces shared library dependency list and redeploy extend.spaces.webapp.war. Figure 55-3 illustrates the process.

Figure 55-3 Overview - Including Additional Shared Libraries in Spaces

Deploying WebCenter Spaces shared library steps

For more detail, see Section 55.2.2, "Deploying Your Own Custom Code and Task Flows in Shared Libraries" and Section 55.2.3, "Rebuilding the Spaces Shared Library List".

55.2.2 Deploying Your Own Custom Code and Task Flows in Shared Libraries

Developers can build extensions for the Spaces application, package them in ADF Library JARs, and then deploy them as shared libraries for use in Spaces. For example, you can:

  • Develop custom code in JDeveloper and make it available in the Spaces application.

  • Develop custom task flows in JDeveloper and make them available to the Spaces application

To help you get started, Oracle provides a sample workspace in which you can develop extensions, and build and deploy Spaces shared libraries that contain your custom code.

Note:

"Shared libraries can include other shared libraries. For details on this approach, see "Assembling Shared Java EE Library Files" in Oracle Fusion Middleware Developing Applications for Oracle WebLogic Server.

The sample workspace, SampleWebCenterSpacesExtension.jws, contains sample extensions and scripts that enable you to deploy custom code for Spaces. For more information, download the accompanying whitepaper, Using Spaces Extension Samples (11.1.1.6.0), from Oracle Technology Network at http://www.oracle.com/technetwork/index.htm.

55.2.3 Rebuilding the Spaces Shared Library List

Whenever you deploy a new shared library that includes Spaces extensions you must update the Spaces shared library dependency list and redeploy extend.spaces.webapp.war.

This section describes:

55.2.3.1 Editing the Shared Library List

Use the WebCenterSpacesExtensionLibrary project to build and deploy extend.spaces.webapp.war—a shared library containing weblogic.xml in which you configure the Spaces shared library dependency list.

  1. Download and unzip the Spaces development workspace.

    See Section 55.1, "Downloading a Workspace for Spaces Development".

  2. Navigate to the unzip directory, and open DesignWebCenterSpaces\DesignWebCenterSpaces.jws in JDeveloper (Figure 55-4).

    Figure 55-4 Projects in the DesignWebCenterSpaces Workspace

    Projects in DesignWebCenterSpaces Workspace
  3. Expand the WebCenterSpacesExtensionLibrary project.

  4. Navigate to weblogic.xml, under Resources\WebCenterSpacesExtensionLibrary\public_html\WEB-INF (Figure 55-5).

    Out-of-the-box, this file is blank, that is, no additional shared libraries are listed in the file.

    Figure 55-5 WebCenterSpacesExtensionLibrary - Out-of-the-box weblogic.xml

    Out-of-the-box weblogic.xml
  5. Add a <library-ref> entry for each shared library that you want to use in Spaces.

    For example, you can include a single library entry, as shown in Figure 55-6:

    <library-ref>
        <library-name>com.mycompanyname.shared.lib.1</library-name>
      </library-ref>
    

    Figure 55-6 weblogic.xml - Single Shared Library Reference

    Projects in the ExtendWebCenterSpaces Workspace

    Or, reference multiple shared libraries, as shown in Figure 55-7:

    <library-ref>
        <library-name>com.mycompanyname.shared.lib.1</library-name>
    </library-ref>
    <library-ref>
        <library-name>com.mycompanyname.shared.lib.2</library-name>
    </library-ref>
    <library-ref>
         <!--reference to the shared library (custom.wencenter.spaces.war) that 
          includes customizations from WebCenter 11gR1 11.1.1.3.0 or earlier-->
        <library-name>custom.webcenter.spaces</library-name>
    </library-ref>
    

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

    Projects in the ExtendWebCenterSpaces Workspace

    Note: If you want to use custom extensions developed for a previous WebCenter Spaces release (11.1.1.3.0 or earlier), include the name of the old shared library, custom.webcenter.spaces, in weblogic.xml, as shown in Figure 55-7.

  6. Ensure each shared library that you reference is deployed on the Spaces managed server.

The next section describes how to set build and deployment options for the shared library list (extend.spaces.webapp.war).

55.2.3.2 Setting Build and Deployment Options (config.properties)

Before you can build the shared library list and deploy extend.spaces.webapp.war to the Spaces managed server, you must provide some information about your environment and your WebCenter Portal installation in the configuration file config.properties.

To set build and deployment properties for the extend.spaces.webapp shared library:

  1. Open DesignWebCenterSpaces.jws.

    See also, Section 55.1, "Downloading a Workspace for Spaces Development"

  2. Expand the WebCenterSpacesExtensionLibrary project.

  3. Open config.properties.

  4. Enter information about your JDeveloper environment and 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 Configuring config.properties to Enable Deployment to the Managed Server

    Configuration Property Description

    jdeveloper.install.home.directory

    Base directory where JDeveloper is installed.

    The directory you specify contains other folders such as jdeveloper, 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).

    extending.spaces.home.dir

    Path to the Spaces development workspace directory.

    For example, C:\DesignWebCenterSpaces

    oracle.jdeveloper.ojdeploy.path

    Path to ojdeploy.exe (Windows) or ojdeploy (Linux).

    wls.port

    Port number on which the WebLogic Server Administration Console is running

    wls.host

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

    wls.userkey

    Name and location of the file storing administrator passwords.

    config.properties describes how to generate the file using WLST. The file can be copied to any suitable, accessible location.

    wls.userconfig

    Name and location of the file storing administrator user details.

    config.properties describes how to generate the file using WLST. The file can be copied to any suitable, accessible location.

    wls.target

    Managed server on which the Spaces shared library is to be deployed. For example, WC_Spaces.

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

    wls.webcenter.app.target

    Managed server on which the Spaces 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 Spaces application. Always webcenter.

    restart.implementation.version.suffix

    Controls incremental implementation version numbers.


  5. Save your updates to config.properties.

Updates to config.properties are available immediately so there is no need to restart JDeveloper.

The next section describes how to build and deploy the shared library list extend.spaces.webapp.war.

55.2.3.3 Building and Deploying the Shared Library List (extend.spaces.webapp.war)

You must rebuild and redeploy the extend.spaces.webapp.war shared library whenever you modify the shared library list (weblogic.xml).

To build and deploy the shared library list:

  1. Open DesignWebCenterSpaces.jws in JDeveloper.

    See also, Section 55.1, "Downloading a Workspace for Spaces Development".

  2. Expand the WebCenterSpacesExtensionLibrary project.

  3. If you have not done so already, specify environment details in config.properties.

    See also, Section 55.2.3.2, "Setting Build and Deployment Options (config.properties)".

  4. To rebuild extend.spaces.webapp.war, open the Run Ant dropdown menu, and then select clean-stage (Figure 55-8)

    Figure 55-8 Building a Customized WebCenter Portal: Spaces Extension Library

    Building a Customized WebCenter Spaces .WAR

    This generates a new version of the shared library list extend.spaces.webapp.war. The implementation version number associated with the new WAR is saved to MANIFEST.MF as follows:

    <UnzipDir>/DesignWebCenterSpaces/WebCenterSpacesExtensionLibrary/META-INF/MANIFEST.MF

  5. To redeploy the Spaces shared library list, open the Run Ant dropdown menu, and then select deploy-shared-lib.

A new version of the shared library list is deployed to the Spaces managed server. To verify the new deployment, login to the WLS Administration Console, navigate to the deployment overview page, and check the implementation version, that is, navigate to:

Deployments> extend.spaces.webapp>Overview

If the latest version is not active, refer to the Section 55.2.3.5, "Troubleshooting Shared Library Deployment".

55.2.3.4 Reverting to a Previous Shared Library List

If there is a problem with the latest shared library list 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 WLS 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 the Spaces application 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 the Spaces application 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. Run the following script to stop the managed server on which the Spaces application is deployed:

    • UNIX: DOMAIN_HOME/bin/stopManagedWeblogic.sh

    • Windows: DOMAIN_HOME\bin\stopManagedWeblogic.cmd

  2. Login to the WLS Administration Console, navigate to the deployment overview page (Deployments> extend.spaces.webapp>Overview), and remove the latest shared library version.

    To revert to the out-of-the-box Spaces deployment, revert to the original extend.spaces.webapp.war shared library, that is, delete all other Spaces shared library versions, except for extend.spaces.webapp.war version 11.1.1.

  3. Run the following script to start the managed server on which the Spaces application is deployed:

    • UNIX: DOMAIN_HOME/bin/startManagedWeblogic.sh

    • Windows: DOMAIN_HOME\bin\startManagedWeblogic.cmd

55.2.3.5 Troubleshooting Shared Library Deployment

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

    The Spaces application always uses the latest shared library version. Check that the implementation version in MANIFEST.MF matches the implementation version displayed in the WLS Administration Console.

    For example, check the value in <UnzipDir>/DesignWebCenterSpaces/WebCenterSpacesExtensionLibrary/META-INF/MANIFEST.MF is the same as that displayed in the WLS Admin Console under Deployments> extend.spaces.webapp>Overview

  • "Security: 090219" error displays:

    weblogic.security.internal.encryption.EncryptionServiceException: weblogic.security.internal.encryption.EncryptionServiceException: weblogic.security.internal.encryption.EncryptionServiceException: 
    [Security:090219]Error decrypting Secret Key com.rsa.jsafe.JSAFE_InputException: Invalid input length for decryption. Should be a multiple of the block size - 8
    
    

    Check that wls.userconfig and wls.userkey are both set correctly in the config.properties file, and verify that both security files specified are accessible

  • "DeployerException: Task 9 failed" displays:

    weblogic.Deployer$DeployerException: weblogic.deploy.api.tools.deployer.DeployerException: Task 9 failed: [Deployer:149117]deploy library custom.webcenter.spaces [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 WLS Administration Console to verify the current implementation version and then change the restart.implementation.version.suffix property in config.properties to this value. When you rebuild and redeploy the shared library, the implementation version should increment by '1'.

  • "ReDeploy Spaces Failed" displays:

    Failed to redeploy the application with status failed
    Current Status of your Deployment:
    Deployment command type: redeploy
    Deployment State     : failed
    Deployment Message: weblogic.application.ModuleException:[exec] No stack trace available.
    #########  ReDeploy Spaces Failed 
    

    Restart the managed server on which the Spaces application is deployed.

  • "java.lang.IllegalArgumentException" displays:

    Restart the managed server on which the Spaces application is deployed.

  • Deployment hangs:

    If you encounter issues during the deployment phase (Run Ant Target > deploy-shared-lib) and the process hangs, end/kill the Ant process from inside JDeveloper, and then restart the Administration Server and the managed server for the Spaces application.

  • Newly deployed Spaces shared library is not active:

    If a newly deployed shared library is not active, use WLS Administration Console to manually delete the non-active shared library version, and then rebuild (Run Ant Target>clean-dist) and redeploy (Run Ant Target > deploy-shared-lib) the Spaces shared library.

  • webcenter.ear redeployment fails in a clustered environment:

    Sometimes redeployment of webcenter.ear fails. Either restart all the managed servers or wait for 5 minutes and attempt to redeploy again (Run Ant Target > deploy-shared-lib).

  • Unable to access Spaces after deploying a custom shared library in a clustered environment

    If you cannot access any of the Spaces applications after deploying a custom shared library to a cluster (Run Ant Target > deploy-shared-lib), restart all the managed servers.

  • "Error occurred attempting to display the list of pages you can access. Please contact the administrator" displays after logging in:

    Restart the managed server on which the Spaces application is deployed.

  • "WCS#2009.12.22.00.49.35: Fatal error occurred while getting members" displays:

    Restart Spaces.

55.3 Developing Resources for the Spaces Application

This section describes the WebCenterSpacesResources project—-a design environment for Spaces resource development. Through this project, you can upload resources, developed or customized through JDeveloper, to the Spaces application.

This section includes the following subsections:

55.3.1 Using the WebCenterSpacesResources Project for Round-Trip Development

WebCenter Portal's round-trip development features provide a simple, convenient way to modify Spaces resources without redeploying the entire application. Round-trip development refers to features and techniques that allow you to download resources from a deployed application and upload them to JDeveloper for maintenance or enhancement. Once modified, you can upload the resource back to the Spaces application for immediate use or for testing.

Out-of-the-box, Spaces provides some default resources, such as skins and page templates, for people to use or modify. To keep Spaces easy to use, the built-in functionality for creating and editing resources within Spaces is purposely somewhat limited. If your resource requirements extend beyond the editing capabilities of the Spaces application, you can further develop resources using a JDeveloper project that is especially designed for that purpose—WebCenterSpacesResources.

Oracle recommends that you use this project to build and manage custom skins, page templates, page styles, navigations, content display templates, mashup styles, and resource catalogs. The project provides some sample resources, as well as other files and folders you might need. You do not have to develop resources from scratch; you can export existing resources from the Spaces application and edit them in JDeveloper, or use one of the samples as your starting point.

Note:

This chapter describes how to use the WebCenterSpacesResources project to manage resource customizations. If you need more information on how to build/develop resources, see Section 55.3.4.3, "How to Build Spaces Resources".

When you are ready to deploy new resources, you can upload them directly from JDeveloper to a live Spaces application simply by providing JDeveloper with the name of the host and port where the Spaces application is running.

Note: You do not need to deploy customized resources to a shared library.

Alternatively, you can login to Spaces and upload new resources through the Resource Manager. If you decide to use this method you must save the resource to an export archive (.ear).

Figure 55-9 Designing Resources Using the WebCenterSpacesResources Project

Building WeCenter Spaces Resources

55.3.2 Opening and Exploring the WebCenterSpacesResources Project

  1. Download and unzip the Spaces workspace.

    See Section 55.1, "Downloading a Workspace for Spaces Development".

  2. Navigate to the unzip directory, and open DesignWebCenterSpaces\DesignWebCenterSpaces.jws in JDeveloper (Figure 55-10).

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

    Figure 55-10 Projects in the DesignWebCenterSpaces Workspace

    Projects DesignWebCenterSpaces.jws
  3. Expand the WebCenterSpacesResources project.

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

    Figure 55-11 Exploring the WebCenterSpacesResources Project in JDeveloper

    Exploring the WebCenterSpacesResource Project in JDeveloper

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

    Table 55-3 Files and Folders in the WebCenterSpacesResources Project

    Configuration Property Description

    \Application Sources

    Supporting files and folders.

    \Web Content

    Contains Spaces resources.

    \oracle\webcenter\siteresources

    Directory containing Spaces resources. You can develop and manage all your application resources under this folder.

    \scopedMD

    Contains application-level and space-level resources.

    • Application-level resources are stored under the "default scope" directory s8bba98ff_4cbb_40b8_beee_296c916a23ed

      Out-of-the box, this directory contains several sample application resources.

    • Space-level resources are stored under space-specific directories with the same name as the space's internal ID.

      No space-level resources are provided out-of-the-box.

    \<Default Scope ID>

    Contains sample application-level resources.

    \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 Space 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 Spaces FX Skin.

    \taskFlowStyle

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

    \shared

    Content directory for images/content used by resources, such as, icons, images, and so on.

    When you upload a resource to the Spaces application, content in the \shared directory is copied to Spaces automatically.

    Ensure that you copy all files that your resources reference to this \shared directory and verify that all references to such content point to this location, for example: <af:image source="/oracle/webcenter/siteresources/scopedMD/shared/mylogo.gif id="pt_12">

    \Page Flows

    Supporting files and folders.


55.3.3 Enabling Direct Uploads to the Spaces Application

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

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

  • Check that you have the appropriate roles and permissions to upload the resource to Spaces. You must have the following:

    • WebLogic Server role - monitor AND

    • Resource permissions - For example, to upload a new skin you must have the Create, Edit, Delete Skins permission. For details, see Table 55-5.

Configuring the Spaces 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 Spaces 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.

Once you are logged in to Spaces you can upload resources, providing, of course, that you have the appropriate permissions to manage Spaces resources.

Note:

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

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 Spaces installation, as shown in Table 55-4:

    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-4 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 Spaces application is running and where the custom shared library is to be deployed

    wc.host

    Name of the host machine where the Spaces application is running.

    wc.port

    Port number on which the Spaces application is running.

    wc.protocol

    Specify whether the Spaces URL protocol is http or https.

    wls.webcenter.app.target

    Managed server on which the Spaces 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 Spaces application. Always webcenter.


  3. Save your updates to config.properties.

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

    See also, "Managing Roles and Permissions for a Space" in Oracle Fusion Middleware User's Guide for Oracle WebCenter Portal: Spaces.

    Table 55-5 (Cont.) Permissions to Upload and Manage Resources Through JDeveloper

    Resource Required Role or Permission Type Description

    Application-level resource

    • monitor

    WebLogic Server Role

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

    • Create, Edit, Delete <resourcetype>

    WebCenter Portal: Spaces Permission

    • This permission enables you to create and manage application-level resources for Spaces.

    • Manage Configuration

    WebCenter Portal: Spaces Permission

    • The application-level Manage Configuration permission gives you access to the Spaces administration page.

      Note: The Admimistator role in WebCenter Portal: Spaces includes both these permissions, that is, Create, Edit, Delete Resources and Manage Configuration.

           

    Space-level resource

    • monitor

    WebLogic Server Role

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

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

      OR

      Create, Edit, Delete <resourcetype>
      (advanced permission model)

    WebCenter Portal: Spaces Permission

    • These permissions enable you to create and manage resources for a particular space. Either standard or advanced permissions will apply, depending on the space.

    • Manage Configuration

    WebCenter Portal: Spaces Permission

    • The space-level Manage Configuration permission gives you access to the resource administration page for a particular space.

      Note: The Moderator role in WebCenter Portal: Spaces includes both these permissions, that is, Create, Edit, Delete Resources/<resourcetypes> and Manage Configuration.


  5. Upload a sample resource, to test the connection, and verify that the resource is available in Spaces:

    For details, see Section 55.3.5, "Uploading Resources Directly to the Spaces Application".

    See also, Section 55.3.7, "Troubleshooting Resource Round-Trip Development."

55.3.4 Editing Spaces Resources in JDeveloper

Oracle recommends that you extend Spaces resources in the JDeveloper project, WebCenterSpacesResources. This project provides everything you need to create, modify, and upload the following Spaces resources:

  • Page Templates

  • Navigations

  • Page Styles

  • Skins

  • Content Display Templates

  • Resource Catalogs

  • Mashup Styles

Where To Start...

You do not have to develop Spaces resources from scratch. Most developers will download an existing resource from the Spaces application and edit it in JDeveloper. There are two techniques for bringing Spaces resources into JDeveloper. The first is downloading the resource into JDeveloper directly from the server. The second is exporting the resource from Spaces and then importing it into JDeveloper.

For more information, see:

See, also How to Build Spaces Resources.

Application-Level vs Space-Level Resources

The difference between application- and Space-level resources is one of scope. In the Spaces application:

  • Application-level resources are available to all Spaces.

    You must develop all application-level resources under the WebCenterSpacesResources project directory oracle/webcenter/siteresources/scopedMD/s8bba98ff_4cbb_40b8_beee_296c916a23ed.

    To upload application resources to the Spaces application you must have Spaces permissions: Application-Manage Configuration plus Create, Edit, Delete <Resource_Type>.

  • Space-level resources are only available within a particular Space.

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

    oracle/webcenter/siteresources/scopedMD/<space_internal_id>

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

    To upload resources to a particular space you must have the Space-Manage Configuration permission, plus one of:

    Create, Edit, Delete Resources (standard permission model)
    Create, Edit, Delete <Resource_Type> (advanced permission model)

If you want to upload resources directly from JDeveloper, you must also have the WebLogic Server monitor role. See Section 55.3.3, "Enabling Direct Uploads to the Spaces Application".

For information on how to create and edit Spaces resources, see:

55.3.4.1 Downloading a Spaces Resource Directly into JDeveloper

You can download a Spaces resource directly into JDeveloper from within the WebCenterSpacesResources project.

  1. Be sure the configuration properties and permissions are set properly, as described in Section 55.3.3, "Enabling Direct Uploads to the Spaces Application." See also Section 55.2.3.2, "Setting Build and Deployment Options (config.properties)."

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

    Figure 55-12 Download Portal Resource from Server Menu

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

  3. In the Download Portal Resources dialog, choose to download either an Application-Level Resource or a Space-Level Resource, as shown in Figure 55-13 See "Application-Level vs Space-Level Resources" for information on these selections.

    Figure 55-13 Download Portal Resources Dialog

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

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

    Figure 55-14 Selecting a Resource Type to Download

    Description of Figure 55-14 follows
    Description of "Figure 55-14 Selecting a Resource Type to Download"

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

  6. Click OK.

55.3.4.2 Importing a Spaces Resource into JDeveloper

When you import a Spaces resource archive (.ear) into the WebCenterSpacesResources project the resource is uploaded to the appropriate project directory.

  • Application-level resources are imported to:

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

    For example, an application-level skin with the resource 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

  • Space-level resources are imported to:

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

    For example, a Space-level skin with the resource ID gsre9cbef77_28b2_4f46_a69a_25beac543382 is created under the Space 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 Spaces resources and the parent space (space-level resources only) so that you can locate the appropriate resource folders in JDeveloper. In the Spaces application, internal IDs are published in the resource's About dialog (Figure 55-15). For details, see "Viewing Information About a Resource" in Oracle Fusion Middleware User's Guide for Oracle WebCenter Portal: Spaces.

Figure 55-15 Checking Resource IDs in Spaces

Viewing Resource IDs

Internal IDs are not easy to remember like display names. If you want to identify an imported resource 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-16).

Figure 55-16 Checking Resource Display Names in JDeveloper

Checking Resource Display Names

To import a Spaces resource 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) that contains the resource that you want to import.

    If the archive does not exist yet, login to Spaces and download the resource to an EAR file. See "Downloading a Spaces Resource" in the Oracle Fusion Middleware User's Guide for Oracle WebCenter Portal: Spaces.

  3. Click OK.

  4. Navigate to the resource:

    • Locate application resources under:

      WebCenterSpacesResources\oracle\webcenter\siteresources\scopedMD\
      s8bba98ff_4cbb_40b8_beee_296c916a23ed

    • Locate space-level resources under:

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

55.3.4.3 How to Build Spaces Resources

To learn more about building resources, read the appropriate chapter:

55.3.5 Uploading Resources Directly to the Spaces Application

If the Spaces application is up and running you can deploy new or updated resources directly to the application from your JDeveloper environment.

You must have appropriate resource management permissions in the Spaces application to upload resources in this way. If you do not have the correct privileges, you are not allowed to upload resources. See also Section 55.3.3, "Enabling Direct Uploads to the Spaces Application".

  1. If you have not done so already, configure Spaces connections details in config.properties and request the appropriate resource management permissions.

    See also, Section 55.3.3, "Enabling Direct Uploads to the Spaces Application".

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

    For example, to upload the sample application-level navigation SampleNavigation, navigate to (Figure 55-17):

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

    Figure 55-17 Navigating to Spaces Resource Folders

    Navigating to WebCenter Spaces Resource Folders
  3. Verify that the resource is complete.

  4. Ensure that all content used by the resource, such as images, icons, and so on, are located under the content directory /oracle/webcenter/siteresources/scopedMD/shared and verify that all references to such content point to this location, for example:
    <af:image source="/oracle/webcenter/siteresources/scopedMD/shared/mylogo.gif id="pt_12">

  5. Right-click the file associated with the resource you want to upload to Spaces, and choose Upload Portal Resource.

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

  6. If the selected resource references content under the shared directory, specify whether or not you want to upload the content from JDeveloper.

    • Entire content directories are uploaded rather than individual files. For example, if a skin references two files (...\shared\skins\logos\mylogo.gif and ...\shared\skins\icons\myicon.gif), the entire content of both directories (\logos and \icons) are uploaded.

    • On upload, all files under the resource's content directories are uploaded to the target application and existing files with the same name are overwritten. While you can opt not to upload content directories, it's an all or nothing approach, that is, you cannot only upload files referenced by this resource.

  7. If prompted, enter your Spaces 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_<resource_type_id>.log.

    Figure 55-18 Resource Upload Complete Message

    Resource Upload Complete Message
  8. Review the upload log file.

    The following message indicates that the upload was successful.

    Imported <temp_log_directory>\<resource_type_id>.ear

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

  9. Log in to the Spaces application and verify that the resource is available through Resource Manager as expected.

    1. Log in to Spaces.

    2. Navigate to the Resource Manager as follows:

      To verify an application-level resource, navigate to the following URL:

      http://host:port/webcenter/spaces/admin/resources

      To verify a space-level resources, navigate to the following URL:

      http://host:port/webcenter/spaces/spaceName/admin/resources

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

      Dependent images, and so on, must be located in the Spaces content directory. If an image is missing, check that you copied it to the appropriate content directory in JDeveloper (under /oracle/webcenter/siteresources/scopedMD/shared).

55.3.6 Exporting Spaces Resources to an Archive

When your resource is ready for use in the Spaces application you can upload it directly to Spaces or you can export the resource to an EAR file format which you (or someone else) can upload at any time using Spaces Resource Manager.

To export a Spaces resource:

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

    Note:

    Ensure that all dependent content such as images, icons, style sheets, and so on, are copied to the /oracle/webcenter/siteresources/scopedMD/shared/ directory and verify that all references to such content point to this location, for example: <af:image source="/oracle/webcenter/siteresources/scopedMD/shared/mylogo.gif id="pt_12">

  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. If the selected resource references content under the shared directory, specify whether or not you want to Include Content Directories in the resource archive.

    Do one of the following:

    • Select Include Content Directories to export content referenced by the portal resource, such as images and icons, in the export archive.

      Consider the following before exporting content directories for the resource:

      • Entire content directories are exported rather than individual files. For example, if a skin references two files (...\shared\skins\logos\mylogo.gif and ...\shared\skins\icons\myicon.gif), the entire content of both directories (\logos and \icons) are exported.

      • On import, all files under the content directories are uploaded to the target Spaces application and existing files with the same name are overwritten. While you can opt not to upload content directories on import, it's an all or nothing approach, that is, you cannot upload individual files for this specific resource.

    • Click No to exclude content under the \shared directory that is referenced by portal resources.

  5. Click OK.

The steps to upload resource archives to Spaces are available in "Uploading a Spaces Resource" in the Oracle Fusion Middleware User's Guide for Oracle WebCenter Portal: Spaces.

55.3.7 Troubleshooting Resource Round-Trip Development

This troubleshooting section includes the following subsections:

Examining the Resource Upload Log File

When you upload a resource to the Spaces application progress details are recorded in a log file. The name of the log file includes the type of resource you are uploading and a unique ID, in the format—upload_resource_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-19 Resource Upload Log File Location

Resource Upload Complete Message

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

Imported <temp_log_directory>\<resource_type_id>.ear

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

Unable to Upload Resources to Spaces - Access denied

The following error displays in the resource 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 resources from JDeveloper to the Spaces application. Ask your Spaces administrator to grant you this role through the WebLogic Server Administration Console.

Unable to Upload a Resource to Spaces - java.lang.Exception

The following error displays in the resource upload log file if you do not have permission to manage any resources in Spaces or the particular type of resource 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 Spaces administrator to grant you appropriate permissions through Spaces Administration. Or, if the resource you are trying to upload is for a particular space, contact the space moderator to request the required permission. See also, Table 55-5, "(Cont.) Permissions to Upload and Manage Resources Through JDeveloper"".