17 Adding and Using the Resource Manager

This chapter explains how to enable users to administer portal resources at runtime using the Resource Manager.

Using the Resource Manager users can also download runtime portal resources (from WebCenter Portal: Framework applications or WebCenter Portal: Spaces) and import them into Oracle JDeveloper for further development. These resources can then be exported from JDeveloper and uploaded back into the deployed application. Portal resources can also be created from scratch in JDeveloper and uploaded to the deployed application.

This chapter includes the following subsections:

For information about using the Resource Manager to administer portal resources at runtime, see the chapter "Working with the Resources that Compose a Portal or Community" in the Oracle Fusion Middleware User's Guide for Oracle WebCenter Portal: Spaces.

17.1 Introduction to Runtime Resource Management

A portal is a constantly evolving application. While the initial framework for the portal is designed prior to deployment, this really acts as a starting point. The design of the portal is likely to be enhanced by the actual users of the portal.

This runtime resource management provides:

WebCenter Portal enables runtime resource management through the Resource Manager. Using the Resource Manager, users with the appropriate privileges can continue developing the portal after the application has been deployed (Figure 17-1).

Figure 17-1 The Resource Manager in a WebCenter Portal: Framework Application

Resource Manager
Description of "Figure 17-1 The Resource Manager in a WebCenter Portal: Framework Application"

At runtime, users with the appropriate privileges can create and edit:

  • Pages

  • Page templates

  • Navigation models

  • Resource Catalogs

  • Skins

  • Page styles

  • Content Presenter display templates

  • Mashup styles

  • Data controls

  • Task flows

Using the Resource Manager, portal users can also download resources, or an entire application, from the runtime environment, edit them in JDeveloper, and then upload them back into the deployed application.

Users can also create resources from scratch in JDeveloper, export them as portal resources, and then upload them into the deployed portal. This is a very useful way of creating more fully functional portal resources for use in WebCenter Portal: Spaces.

This process is known as round-trip development. For more information, see Section 17.4, "Enabling Round-Trip Development of Resources."

17.2 Working with Portal Resources in JDeveloper

For a resource to be included in the Resource Manager and therefore available for runtime administration, it must be created as a portal resource.

To create a resource as a portal resource it must be located in the oracle/webcenter/portalapp directory of the application project.

This section includes the following subsections:

17.2.1 How to Add a Resource to the Resource Manager

To enable runtime administration of a resource it must be included in the Resource Manager. To do this, you need to identify the resource as a portal resource.

To add a resource to the Resource Manager:

  1. In the Application Navigator, right-click the resource that you want to include in the Resource Manager and choose Create Portal Resource.

    Note:

    If you do not see the Create Portal Resource option in the context menu, the resource is not under the oracle/webcenter/portalapp directory. To move the resource to the correct directory, right-click it, choose Refactor, and then Move.

  2. In the Create Portal Resource dialog (Figure 17-2), in the Display Name field, edit the name if required.

    This is the name that is listed in the Resource Manager at runtime, so make sure that users are able to easily identify the resource from the display name.

    Figure 17-2 The Create Portal Resource Dialog

    Description of Figure 17-2 follows
    Description of "Figure 17-2 The Create Portal Resource Dialog"

  3. The Resource Type field identifies the kind of resource you are adding to the Resource Manager. You cannot edit this field.

  4. In the Icon URL field, enter the path and file name of an image to use as a graphical representation of the resource.

    For page styles, this icon is displayed in the Create Page dialog.

  5. In the Description field, enter a description for the resource. This description should help users determine if they want to use the resource in their application.

    The description is displayed in the About dialog for the resource and in the Resource Manager at runtime.

  6. In the Content Directory field, enter or browse for the directory where dependent objects for the resource, such as images, JavaScripts, style sheets, and HTML files, are stored. For more information, see Section 17.2.2, "What You May Need to Know About the Content Directory."

    Note:

    The folder specified here is included in the export archive when the resource is exported, so any dependent objects created under the folder are pushed into the target system.

    This field appears only for resources that can include such dependent objects.

  7. If you want to specify resource-level security for the resource, click the Security tab. Otherwise, skip to step 11.

    Resource-level security enables you to override the application-level security for individual resources to specify who can edit and delete the resource at runtime.

  8. Select Override default access policy (Figure 17-3).

    Figure 17-3 Create Portal Resource - Security Tab

    Description of Figure 17-3 follows
    Description of "Figure 17-3 Create Portal Resource - Security Tab"

  9. Click the Add permissions to new role icon and select the role for which you want to grant permissions.

  10. Select the Manage checkbox to grant full access to the resource at runtime. Users with the role can edit and delete the resource.

    Select the Update checkbox to grant the permission to edit the resource at runtime. Users with the role can edit the resource, but they cannot delete it.

    Note:

    The user must also have the appropriate permissions to access the Resource Manager. For more information, see Section 17.3.1, "How to Add the Resource Manager Task Flow."

  11. Click OK.

    The resource is added to the Resource Manager and users with the appropriate privileges can manage the resource at runtime.

17.2.2 What You May Need to Know About the Content Directory

If you are making a resource available for runtime management, any dependent objects referenced by the resource, such as images, JavaScripts, style sheets, or HTML files, must be stored under the following directory:

APPLICATION_ROOT/Portal/public_html/oracle/webcenter/portalapp/shared

In addition, as a best practice, it is recommended to store dependent objects in resource-specific directories under the shared directory. For example, images for a page template named Template1 could be stored in:

APPLICATION_ROOT/Portal/public_html/oracle/webcenter/portalapp/shared/pageTemplates/Template1

This avoids any potential conflict when additional resources that include dependent objects are imported from runtime.

To reference dependent objects in a resource, use the following format:

/oracle/webcenter/portalapp/shared/object

For example:

<af:image source="/oracle/webcenter/portalapp/shared/pageTemplates/Template1/logo.gif" id="pt_12">

When adding the resource as a portal resource (as described in Section 17.2.1, "How to Add a Resource to the Resource Manager"), you must ensure that the Content Directory points to the appropriate shared directory.

Note:

For runtime-created resources, the default content directory is /oracle/webcenter/siteresources/scopedMD/shared.

17.2.3 How to Update Portal Resource Properties

You can update the details of resources in the Resource Manager.

To update portal resource properties:

  1. In the Application Navigator, right-click the resource that you want to edit and choose Update Portal Resource.

  2. In the Update Portal Resource dialog, edit the fields as necessary.

    For information about the fields in this dialog, see Section 17.2.1, "How to Add a Resource to the Resource Manager."

  3. Click OK.

17.2.4 How to Remove a Resource from the Resource Manager

If you no longer want users to be able to administer a particular resource at runtime, you can remove it from the Resource Manager.

To remove a resource from the Resource Manager:

  1. In the Application Navigator, right-click the resource that you want to remove and choose Remove Portal Resource.

  2. In the Remove Portal Resource dialog, click Yes to confirm that you want to remove the resource from the Resource Manager.

    The resource is removed from the Resource Manager and can no longer be edited or downloaded at runtime. The resource itself is not deleted, so it is still available for use within the Framework application.

17.3 Enabling Runtime Administration of Your Portal

You can enable portal administrators to manage resources at runtime by adding the Resource Manager to a page in your portal.

If you use WebCenter Portal's Framework application template to create your application, an Administration page is automatically included in the application. This page includes a tab for the Resource Manager.

If you prefer, you can add the Resource Manager to any other page in your application by adding the List of Resource Types task flow to that page.

This section includes the following subsections:

17.3.1 How to Add the Resource Manager Task Flow

For applications created using WebCenter Portal's Framework application template, the Resource Manager task flow is available out of the box through the WebCenter Portal Administration Console (Resources tab). For details, see the section "Managing Application Resources" in the Oracle Fusion Middleware Administrator's Guide for Oracle WebCenter Portal.

In addition, just like other task flows, you can add the Resource Manager task flow to your application pages. This might be especially useful if you are not using WebCenter Portal's Framework application template, and the WebCenter Portal Administration console is therefore not part of your project.

When you add the Resource Manager task flow to a page, anyone with view access to the page can view the task flow and perform view related operations on resources, such as viewing resource properties, previewing resources, and so on. For users to be able to perform other operations on resources, such as creating new resources, editing resources, or deleting resources, they must have the appropriate permissions on the type of resource they want to work with. These permissions can be provisioned using the Role Manager task flow. For more information, see Section 69.4, "Using the Role Manager Task Flow." By default, the Administrator role has manage access on all resource types exposed in the Resource Manager task flow.

To add the Resource Manager task flow:

  1. Open the page to which you want to add the Resource Manager.

  2. In the Resource Catalog, expand the WebCenter Portal - Services Catalog and then Task Flows.

  3. Select the List of Resource Types task flow and drag it to the desired location on the page.

  4. From the menu that displays, select Region.

    You may be prompted to add the Resource Manager library to the project. Confirm by clicking Add Library.

  5. The Resource Manager task flow is added to the page.

  6. To enable users to upload and download resources at runtime, the usesUpload property for the form that contains the Resource Manager task flow must be set to true:

    <af:form id="f1" usesUpload="true">
    

17.3.2 How to Use the Resource Manager at Runtime

At runtime, the Resource Manager provides access to administration tools for the resources available to the portal. For example, the administrator can create new resources (navigation models, page templates, mashup styles, and so on), edit existing resources, upload resources exported from other applications, and so on.

Table 17-1 lists the types of resources that you can manage at runtime and provides links to the Oracle Fusion Middleware User's Guide for Oracle WebCenter Portal: Spaces where you can find out more about working with these resources at runtime.

Table 17-1 WebCenter Portal Resources That Can Be Managed at Runtime

Resource Description Documentation

Pages

Create and manage pages for your application.

"Building Pages"

Page Templates

Define how individual pages and groups of pages display on a user's screen

"Working with Page Templates"

Navigation Models

Define how to link together information from multiple sources, such as spaces, pages, content repositories, and even external Web pages

"Working with Navigation"

Resource Catalogs

Define the components and connections that WebCenter Portal: Spaces users can add to their pages, page templates, and task flows.

"Working with Resource Catalogs"

Skins

Define the appearance and look and feel, including colors and fonts, of a specific space or the entire application.

"Working with Skins"

Page Styles

Define the layout of a newly created page and may also dictate the type of content the page supports.

"Working with Page Styles"

Content Presenter Display Templates

Manage the templates for presenting content.

"Publishing Content Using Content Presenter"

Mashup Styles

Manage the templates available for creating task flows

"Managing Mashup Styles"

Data Controls

Create and manage data controls, which connect to and read data from external repositories, particularly for use in business mashups.

"Creating and Managing Data Controls"

Task Flows

Create and manage task flows based on a selected mashup style.

"Creating and Managing Task Flows"


This section includes the following subsections:

Note:

The process for working with pages at runtime is different from other resources. For more information, see the section "Working with Pages" in the Oracle Fusion Middleware Administrator's Guide for Oracle WebCenter Portal

17.3.2.1 Accessing the Resource Manager

To access the Resource Manager at runtime, users can navigate to the built-in Administration page (if it is available in the application) and click the Resources tab. If the Administration page is not included in the application, you must direct users to the page that includes the Resource Manager.

17.3.2.2 Creating a Resource

Users may want to create custom resources at runtime if the resources available in the Framework application do not meet their requirements.

At runtime, users can create certain resources from scratch. There are some resources that users can create only by extending an existing resource. For example, at runtime, users can create a task flow from scratch, but can create a skin only by extending an existing skin. Other resources, such as Content Presenter display templates, cannot be created at runtime.

Table 17-2 describes the support available for creating resources at runtime.

Table 17-2 Support for Creating Resources at Runtime

Resource Users Can Create the Resource at Runtime? How Can the Resource Be Created?

Pages

Yes

From scratch and by creating a copy of an existing page

Page Templates

Yes

Only by creating a copy of an existing page template

Navigation Models

Yes

From scratch and by creating a copy of an existing navigation model

Resource Catalogs

Yes

From scratch and by creating a copy of an existing Resource Catalog

Skins

Yes

Only by creating a copy of an existing skin

Page Styles

Yes

Only by creating a copy of an existing page style and editing the source

Content Presenter Display Templates

No

NA

Mashup Styles

Yes

Only by creating a copy of an existing mashup style and editing the source

Data Controls

Yes

From scratch and by creating a copy of an existing data control

Task Flows

Yes

From scratch and by creating a copy of an existing task flow


To create a resource:

  1. In your Framework application, navigate to the Resource Manager. For more information, see Section 17.3.2.1, "Accessing the Resource Manager."

  2. In the left navigation panel, select the type of resource that you want to create.

  3. On the menu bar, click Create.

  4. In the resulting dialog, enter details for the resource.

    These details depend on the type of resource you are creating. For links to the Oracle Fusion Middleware User's Guide for Oracle WebCenter Portal: Spaces where you can find out more about creating resources at runtime, see Table 17-1.

  5. Click Create.

    The newly created resource is listed in the Resource Manager. The gray icon next to a resource indicates that it is not yet published an hence is not available to users for use. For information about publishing resources, see Section 17.3.2.8, "Showing or Hiding a Resource."

Note:

If you create resources at runtime and do not import them back into the design time environment, your new resources may be lost when the application is redeployed. For more information, see the "Preserving Resource Customizations" section in the Oracle Fusion Middleware Administrator's Guide for Oracle WebCenter Portal.

17.3.2.3 Uploading and Downloading a Resource

The Upload and Download options enable post-deployment, round-trip application development. These actions greatly simplify the process of bringing new or revised resources from JDeveloper into your application and pushing them back into development from your application to JDeveloper as needed.

For more information, see Section 17.4, "Enabling Round-Trip Development of Resources."

17.3.2.4 Editing a Resource

Authorized users can edit Framework application resources using the Resource Manager, regardless of whether they were created at design time or runtime, or have been uploaded to the application after deployment.

To edit a resource:

  1. In your Framework application, navigate to the Resource Manager. For more information, see Section 17.3.2.1, "Accessing the Resource Manager."

  2. In the left panel, select the type of resource that you want to edit.

  3. In the right panel, select the resource that you want to edit.

  4. From the menu bar, click Edit and then choose Edit.

  5. In the resulting dialog, edit the details for the resource.

    These details depend on the type of resource you are editing. For links to the Oracle Fusion Middleware User's Guide for Oracle WebCenter Portal: Spaces where you can find out more about editing resources at runtime, see Table 17-1.

  6. Click OK.

17.3.2.5 Copying a Resource

At runtime, users can create a copy of a resource. This feature is useful for:

  • Creating a backup of a resource

  • Updating a resource while keeping the original in use

  • Using an existing resource as the starting point for a new resource.

You can create a copy of all types of resources except pages and Content Presenter display templates. When you create a copy of a resource, the copy is marked as hidden.

To copy a resource:

  1. In your Framework application, navigate to the Resource Manager. For more information, see Section 17.3.2.1, "Accessing the Resource Manager."

  2. In the left panel, select the type of resource that you want to copy.

  3. In the right panel, select the resource that you want to copy.

  4. From the menu bar, click Edit and then choose Copy.

  5. In the Copy dialog, in the Display Name field, enter a name for the new resource.

  6. In the Description field, enter a description of the new resource.

  7. Click Copy.

17.3.2.6 Setting Security for a Resource

Users can use security settings to specify who can revise and remove a selected resource. By default, resource access is controlled by application-level permissions. The Security Settings dialog provides a way of overriding application-level permissions and defining specific permissions on a selected resource.

To set security for a resource:

  1. In your Framework application, navigate to the Resource Manager. For more information, see Section 17.3.2.1, "Accessing the Resource Manager."

  2. In the left panel, select the type of resource for which you want to set security.

  3. In the right panel, select the resource for which you want to set security.

  4. From the menu bar, click Edit and then choose Security Settings.

  5. In the Security Settings dialog, select Use Custom Permissions to define who may manage and update the selected resource.

    To inherit access settings from those defined for the application, select Use Application Permissions.

  6. Click Add Users or Add Groups to select the user or group to whom you want to grant resource access.

  7. Select the Manage checkbox to grant full access to the resource. Such users can edit and delete the resource.

    Select the Update checkbox to grant the permission to edit the resource. Such users can edit the resource, but they cannot delete it.

  8. To revoke access, select the user or group and click Delete Access.

  9. Click Set Access.

17.3.2.7 Deleting a Resource

When a resource is no longer required in an applications, users may delete it. Users can delete resources created at runtime or design time, and uploaded resources.

To delete a resource:

  1. In your Framework application, navigate to the Resource Manager. For more information, see Section 17.3.2.1, "Accessing the Resource Manager."

  2. In the left panel, select the type of resource that you want to delete.

  3. In the right panel, select the resource that you want to delete.

  4. From the menu bar, click Edit and then choose Delete.

  5. In the Delete confirmation dialog, click Delete.

17.3.2.8 Showing or Hiding a Resource

All resources, whether created at runtime or design time, can be marked as hidden or available. For all resources that are available for use, a green tick mark and the word "Available" appear next to the resource's name in the Resource Manager. A gray icon and the word "Hidden" next to a resource's name indicate that the resource is marked as hidden and cannot be used in the application.

When you create or upload a resource, by default it is marked as hidden. A hidden resource is not available for use in the application. You can still use hidden resources in the Resource Manager, for example, to copy them or to use them as the starting point for another resource.

To show or hide a resource:

  1. In your Framework application, navigate to the Resource Manager. For more information, see Section 17.3.2.1, "Accessing the Resource Manager."

  2. In the left panel, select the type of resource that you want to show or hide.

  3. In the right panel, select the resource that you want to show or hide.

  4. From the menu bar, click Edit and then choose Show or Hide, depending on whether the resource is current shown or hidden.

    If the resource was previously hidden, the Show option displays in the Edit menu. When you choose Show, the resource becomes available for use in the application (indicated by a green tick mark and the word "Available" next to the resource)

    If the resource was previously shown, the Hide option displays in the Edit menu. When you choose Hide, the resource becomes unavailable for use in the application (indicated by a gray icon and the word "Hidden" next to the resource).

17.3.2.9 Editing the Source Code of a Resource

To give you more control over resource editing at runtime, the Resource Manager provides the Edit Source option. You can use this option to edit the underlying source code of all your resources except data controls. The changes are saved to the MDS, and available immediately.

You may want to edit a resource's source code to make advanced edits to its code without having to having to go through the entire round-trip development cycle. For more information about round-trip development, see Section 17.4, "Enabling Round-Trip Development of Resources."

You can even use the Edit Source option to create a resource from scratch, by creating the resource and then replacing its default source code with your own original code. Note, however, that due to the heavy hand-coding requirement, this scenario is not recommended.

To edit the source code of a resource:

  1. In your Framework application, navigate to the Resource Manager. For more information, see Section 17.3.2.1, "Accessing the Resource Manager."

  2. In the left panel, select the type of resource for which you want to edit the source code.

  3. In the right panel, select the resource for which you want to edit the source code.

  4. From the menu bar, click Edit and then choose Edit Source.

  5. In the Edit Source dialog, edit the code as required.

    The XML syntax in the code is validated and an error message is displayed if you miss any tags or add them incorrectly. Validation is not performed for non-XML files, such as CSS files.

  6. Click Edit Source.

17.3.2.10 Setting Properties on a Resource

Each type of resource has certain associated properties that define its display properties, availability, and attributes. Authorized users can edit these properties for resources created or uploaded at runtime by using the Edit Properties dialog. Users cannot edit properties for resources created at design time.

To set properties on a resource:

  1. In your Framework application, navigate to the Resource Manager. For more information, see Section 17.3.2.1, "Accessing the Resource Manager."

  2. In the left panel, select the type of resource for which you want to set properties.

  3. In the right panel, select the resource for which you want to set properties.

  4. From the menu bar, click Edit and then choose Edit Properties.

  5. In the Display Name field, edit the display name for the resource.

  6. In the Description field, edit the description for the resource.

  7. In the URI Icon field, enter a standard URI path to an icon to represent the resource, for example:

    /myCompany/webcenter/page/images/myimage.png
    

    You can either specify an absolute URL or a relative URL that points to an image located somewhere in the application.

  8. In the Category field, enter a category name to help classify the resource within the application.

  9. In the Attributes section, enter values for any custom attributes for the resource by entering the Name and an appropriate Value for the attribute. For information about the custom attributes that can be added for the different resources, see the appropriate chapter for the resource type as listed in Table 17-1.

  10. Click OK.

17.3.2.11 Previewing a Resource

You can preview page templates, mashup styles, and task flows to check how they look while you are editing them.

To preview a resource:

  1. In your Framework application, navigate to the Resource Manager. For more information, see Section 17.3.2.1, "Accessing the Resource Manager."

  2. In the left panel, select the type of resource that you want to preview.

  3. In the right panel, select the resource that you want to preview.

  4. From the menu bar, click Preview.

  5. When you have finished previewing the resource, click Close.

17.4 Enabling Round-Trip Development of Resources

If you enable runtime administration of your portal resources, you need to be able to pull those resources back into JDeveloper. For example, if a portal user adds a new navigation model, you may want to further refine it. To do this, you need to download the resource from the deployed application, using the Resource Manager. You then import the resource into JDeveloper, carry out your development work, export the resource, and finally upload it back into the deployed application. This is known as round-trip development.

You can do this with resources in any deployed WebCenter Portal application that includes the Resource Manager, including WebCenter Portal: Spaces.

Note:

WebCenter Portal provides a special JDeveloper workspace (DesignWebCenterSpaces.jws) to help you develop and upload resources to WebCenter Portal: Spaces. Chapter 56, "Extending the Spaces Application Using JDeveloper" tells you where to find the sample workspace and explains how to use the WebCenterSpacesResources project to build resources for use in WebCenter Portal: Spaces.

The process for round-trip development works as follows:

  1. Build Framework application in JDeveloper

  2. Deploy application

  3. Users add/edit resources and add content to the portal at runtime

  4. Download resource to an EAR file using the Resource Manager.

    See Section 17.4.1, "How to Download a Resource Using the Resource Manager"

  5. Import EAR file into JDeveloper

    See Section 17.4.2, "How to Import a Portal Resource into JDeveloper"

  6. Edit resource in JDeveloper

  7. Export resource to EAR file

    See Section 17.4.3, "How to Export a Portal Resource from JDeveloper"

  8. Upload resource to deployed application using the Resource Manager

    See Section 17.4.4, "How to Upload a Resource Using the Resource Manager"

  9. Repeat from step 3.

In addition, after the deployment of the application, developers can continue to create and edit resources in JDeveloper and upload those resources to the deployed application periodically.

Figure 17-4 illustrates the round-trip development process described above.

Figure 17-4 Round-Trip Development

Description of Figure 17-4 follows
Description of "Figure 17-4 Round-Trip Development"

This section includes the following subsections:

17.4.1 How to Download a Resource Using the Resource Manager

To edit a resource in JDeveloper, you first need to use the Resource Manager in the deployed application to create an EAR file that contains all the metadata for the resource.

To download a resource:

  1. In your Framework application, navigate to the Resource Manager. For more information, see Section 17.3.2.1, "Accessing the Resource Manager."

  2. In the left panel, select the type of resource that you want to download.

  3. In the right panel, select the resource that you want to download.

  4. From the menu bar, click Download.

  5. In the Download dialog (Figure 17-5), in the Archive File Name field, enter a name for the export archive (EAR) file.

  6. Specify where you want to save the export archive file:

    • Save to my computer—Click to save the export archive file to your local file system.

    • Save to WebCenter Portal server—Click to save the export archive file to a remote server file system. In the Path field, enter the server path.

    Figure 17-5 The Download Resource Dialog

    Description of Figure 17-5 follows
    Description of "Figure 17-5 The Download Resource Dialog"

  7. Click Download.

    If you selected Save to my computer, you may be prompted to save the file and select the location for the saved file.

17.4.2 How to Import a Portal Resource into JDeveloper

When you have the EAR file, you must then import it into JDeveloper, where you can edit it.

You must import the resource into an application that uses WebCenter Portal's Framework application template or that includes the appropriate technology scopes.

Note:

When you import a portal resource into JDeveloper, if the resource already exists, the resource in JDeveloper is overwritten with the one from the archive. The original resource is saved to a temporary location, which is identified in the log.

To import a portal resource into JDeveloper:

  1. In the Application Navigator, right-click the Portal project of the application into which you want to import the resource, and choose Import Portal Resource.

  2. In the Import Portal Resource dialog (Figure 17-6), in the Import Archive File Name field, enter or browse for the archive file that contains the resource that you want to import.

    Figure 17-6 The Import Portal Resource Dialog

    Description of Figure 17-6 follows
    Description of "Figure 17-6 The Import Portal Resource Dialog"

  3. Click OK.

  4. If the selected archive file contains a content directory, a popup dialog requests whether you want to overwrite the existing target content directory with the content directory from the archive file. Click Yes to overwrite the target content directory with the content directory from the archive file. Click No to update the target content directory with only new files from the archive content directory, that is files that do not already exist in the target directory.

    The imported resource is created in:

    Application_Root/oracle/webcenter/siteresources/scopedMD/s8bba98ff_4cbb_40b8_beee_296c916a23ed
    

    The resource is automatically created as a portal resource.

17.4.3 How to Export a Portal Resource from JDeveloper

After editing the resource, you must export it to create an EAR file that can be uploaded to the deployed application.

Note:

If you edit or add dependent objects to an imported runtime-created resource, those objects must be placed at the following path, which is the default content directory for resources created at runtime:

/oracle/webcenter/siteresources/scopedMD/shared

Dependent objects must always be placed directly under or in a subdirectory of the directory set as the content directory of a portal resource. You can find out the content directory path from the Update Portal Resource dialog.

To prevent any conflicts, you may want to place dependent objects in a subdirectory under the shared directory. For example, images for a page template named Template1 could be stored in a pageTemplates subdirectory. In such a case, you must update the content directory path to point to the new location.

You can reference dependent objects in a portal resource as shown in the following example:

<af:image source="/oracle/webcenter/siteresources/scopedMD/shared/pageTemplates/Template1/logo1.gif" id="pt_12">

To export a a portal resource from JDeveloper:

  1. In the Application Navigator, right-click the resource that you want to export and choose Export Portal Resource.

    Note:

    If you do not see the Export Portal Resource option in the context menu, the resource is not a portal resource. For information about how to create the resource as a portal resource, see Section 17.2.1, "How to Add a Resource to the Resource Manager."

  2. In the Export Portal Resource dialog (Figure 17-7), in the Export Archive File Name field, enter or browse for the path and file name for the export file.

    If you select an existing file, the contents of the file will be overwritten.

    Figure 17-7 The Export Portal Resource Dialog

    Description of Figure 17-7 follows
    Description of "Figure 17-7 The Export Portal Resource Dialog"

  3. Select Include Content Directory to include the directory identified as the resource's content directory in the export archive file.

    Note:

    This checkbox appears only for portal resources that point to a valid content directory.

    The entire resource content directory is included in the export archive file; you cannot select individual files. On import, if a content directory is detected in the archive file, the user can specify whether to overwrite all files in the target content directory, or just add any new ones.

  4. Click OK.

    The export archive contains the files that make up the resource, for example, the .jspx file, the page definition, and (optionally) the content directory pointed to by the resource, if it is not empty. The archive also contains the generic-site-resources.xml file and the registry file with just the information about the exported resource.

17.4.4 How to Upload a Resource Using the Resource Manager

The final step is to take the EAR file of the updated resource and use the Resource Manager to upload the resource back into the deployed application.

To upload a resource:

  1. In your Framework application, navigate to the Resource Manager. For more information, see Section 17.3.2.1, "Accessing the Resource Manager."

  2. In the left panel, select the type of resource that you want to upload.

  3. From the menu bar, click Upload.

  4. In the Upload dialog (Figure 17-8), specify the location of the resource archive file. Depending on the location of your EAR file, select:

    • Look on my computer—Select if the archive is located on your local file system. Enter the path to the EAR file or use the Browse button.

    • Look on WebCenter Portal server—Select if the archive is located on a remote server. Enter the path to the EAR file.

      Figure 17-8 The Upload Resource Dialog

      Description of Figure 17-8 follows
      Description of "Figure 17-8 The Upload Resource Dialog"

  5. Click Upload.

  6. Click Yes in the Confirm Replace dialog.

  7. If the export archive file includes a content directory, the Overwrite Content Directory dialog displays. Click Yes to import all files from the content directory of the export archive or click No to import only new files from the content directory.