14 Creating, Editing, and Managing Portal Assets

Use portal assets to define the structure, look and feel, and the content of a portal.

Permissions:

To perform the tasks in this chapter, you need one of the following portal-level permissions:

  • Assets: Create, Edit, and Delete Assets or Create Assets and Edit Assets (standard permissions)

  • Create, Edit, and Delete or Create and Edit on the asset type with which you want to work (advanced permissions).

    For example, users with the Create, Edit, and Delete Page Templates permission can create, edit, and delete the page templates owned by a portal.

For more information about portal-level permissions, see About Roles and Permissions for a Portal.

About Assets

Assets are the objects that define the structure, look and feel, and the content of your portals.

The following table lists the assets available in WebCenter Portal.

Table 14-1 Assets in WebCenter Portal

Assets Description Reference

Page Templates

Define the interface that surrounds page content and help to apply a consistent look and feel across all pages in a portal.

Working with Page Templates

Resource Catalogs

Define the components that 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 portal or the entire application.

Working with Skins

Page Styles

Define the initial layout of the main content area of a newly created page, and may also dictate the type of content the page supports. A page style may be unique for every portal page.

Working with Page Styles

Content Presenter Display Templates

Define templates for displaying content

Working with Content Presenter Display Templates

Task Flow Styles

Define the layout of task flows created in WebCenter Portal

Working with Task Flow Styles

Layouts

Define how to present data retrieved by a web service data control.

Working with Layouts

Task Flows

Define how to present data retrieved by a web service data control.

Working with Task Flows

Data Visualizations

Define the configuration of a business object that retrieves data from a REST or SQL data source, and the visualization template that displays that data on a page.

Working with Data Visualizations

Visualization Templates

Define how data retrieved by a business object from a REST or SQL data source should be presented on a page.

Working with Visualization Templates

Data Controls

Define how to connect to and retrieve data from a web service to present that data on a page in a task flow asset.

Working with Web Service Data Controls

Business Objects

Define the data to retrieve from a REST or SQL data source to present that data on a page in a visualization template.

Working with Business Objects

REST Data Sources

Define REST data sources that can be used to provide data for portal pages through business objects configured through data visualizations.

Working with Data Sources

SQL Data Sources

Define SQL data sources that can be used to provide data for portal pages through business objects configured through data visualizations.

Working with Data Sources

Shared Assets and Portal Assets

Assets can exist at the application level (shared assets) or at the portal level (portal assets). At both these levels, the assets available and their functionality are the same. The difference between shared assets and portal assets is that of scope:

  • Shared assets are available for use in all portals, unless a portal has been specifically excluded.

  • Portalassets are available for use only in the portal in which they are created.

If a shared asset is available for use in a portal, it is shown on the Assets page for that portal. The Shared icon next to the asset's name indicates that it is a shared asset. However, shared assets can be edited only at the application level on the Shared Assets page.

Figure 14-1 The Shared Icon

Shared icon

This chapter focuses on how to work with portal assets. For information about shared assets, see Working with Shared Assets.

Default Asset Settings

By default, global default asset settings, such as the page template, skin, and resource catalogs, are used by all portals (indicated by [system default] in the portal-level settings). However, in a portal, you can choose to specify portal-specific asset settings. If your portal uses global default settings, any changes to a global setting are reflected in your portal too. For example, consider that the global default skin is the WebCenter Portal skin, and you have two portals: PortalA and PortalB. By default, both your portals will use the WebCenter Portal skin. Consider that you change PortalB to use the Mist skin. PortalA still uses the global default WebCenter Portal skin. If you then change the global default skin to the Dew skin, PortalA is automatically updated to use the Dew skin; however PortalB continues to use Mist.

For information about configuring global default asset settings, see Configuring Global Defaults Across Portals in Administering Oracle WebCenter Portal.

For information about configuring portal-specific default asset settings, see Administering Look and Feel Settings for a Portal.

Accessing Portal Assets

To access the assets for a portal, open the Assets page in the portal administration.

You can also enter the following URL in your browser to navigate directly to the Assets page:

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

Figure 14-2 Portal Administration: Assets

Description of Figure 14-2 follows
Description of "Figure 14-2 Portal Administration: Assets"

Shared assets are identified by the Shared Shared icon icon. To work with shared assets, you must use the Shared Assets page (see Working with Shared Assets).

Creating Assets

You can create some assets from scratch, and other assets only by making a copy of an existing asset. For example, you can create a resource catalog from scratch, but you can create a skin only by making a copy of an existing skin. Further, there are some assets, such as Content Presenter display templates, that must be created using other methods.

The permissions provided through your assigned role determine the assets you can manage, and which options are available. Menu options appear greyed out if you do not have the required permissions for a particular asset.

The following table describes the support available for creating assets in WebCenter Portal.

Table 14-2 Support for Creating Assets in a Browser

Asset Create in Browser? How? Further Information

Page Templates

Yes

Only by extending another page template

Creating a Page Template

Resource Catalogs

Yes

From scratch or by extending another resource catalog

Creating a Resource Catalog

Skins

Yes

Only by making a copy of another skin

Creating a Skin

Page Styles

Yes

By saving an existing page to create a new page style, or making a copy of another page style

Creating a Page Style

Content Presenter Display Templates

No

(Not applicable)

Creating a Content Presenter Display Templates in Developing for Oracle WebCenter Portal

Task Flow Styles

Yes

Only by making a copy of another task flow style and editing the source code

Editing a Task Flow Style

Layouts

Yes

Only by making a copy of another layout

Creating a Layout

Task Flows

Yes

Only from scratch

Creating a Task Flow

Data Visualizations

Yes

Configure in page editor

Configuring a Data Visualization

Visualization Templates

No

(Not applicable)

Developing Visualization Templates in Developing for Oracle WebCenter Portal

Data Controls

Yes

Only from scratch

Creating a Web Service Data Control

Business Objects

Yes

By making a copy of another business object, or from scratch

Creating a Business Object

REST Data Sources

Yes

In the Define Data Visualization wizard or from scratch

Creating a REST Data Source

SQL Data Sources

Yes

Only from scratch

Creating a SQL Data Source

Editing Assets

The Assets page enables you to edit the assets that have been created within a portal. It provides two options for editing assets:

  • Edit—Provides a means of editing an asset either in Structure view in the page editor or in an Edit dialog.

  • Edit Source—Enables you to work with the source code of an asset.

    You may want to edit an asset's source file to make advanced edits to its code without having to download the file, edit it in JDeveloper, and upload it back into WebCenter Portal. You can even use the Edit Source option to create an asset from scratch; by creating the asset 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, and should only be done by experienced ADF developers.

You cannot edit built-in assets. If you want to modify a built-in asset, you must first create a copy of the asset and then edit the copy according to your requirements.

WebCenter Portal supports round-trip development of assets. To get enhanced functionality for your assets, you can download the asset, edit it in JDeveloper, and then upload it back into WebCenter Portal. For more information, see Working with Portal Assets in JDeveloper.

This section includes the following topics:

Editing an Asset Using the Edit Link

Depending on the asset being edited, clicking Edit alongside an asset on the Assets or Shared Assets page either opens the asset in the page editor or in an asset-specific Edit dialog. The following table provides information about editing an asset.

Table 14-3 Editing Assets Using the Edit Link

Asset Edit Using Documentation

Page Templates

Page editor

Editing a Page Template

Resource Catalogs

Edit dialog

Editing a Resource Catalog

Skins

Edit dialog

Editing a Skin

Page Styles

Page editor

Editing a Page Style

Content Presenter Display Templates

Edit Source dialog

Editing the Source Code of an Asset

Task Flow Styles

Edit Source dialog

Editing the Source Code of an Asset

Layouts

Edit Source dialog

Editing a Layout

Task Flows

Page editor (Design and Structure views)

Editing a Task Flow

Data Visualizations

(Not applicable)

Configuring a Data Visualization

Visualization Templates

(Not applicable)

Developing Visualization Templates in Developing for Oracle WebCenter Portal

Data Controls

Edit dialog

Editing a Web Service Data Control

Business Objects

Edit dialog (Edit Business Object wizard)

Editing a Business Object

REST Data Sources

Edit dialog (Edit REST Data Source wizard)

Editing a REST Data Source

SQL Data Sources

Edit dialog (Edit SQL Data Source wizard)

Editing a SQL Data Source

Editing the Source Code of an Asset

Use the Edit Source dialog to get more control over asset editing in WebCenter Portal. You can edit the underlying source code of any asset except data controls. Changes made to an asset are saved to the Oracle Metadata Services Repository (MDS Repository), and are made available immediately.

The content of the Edit Source dialog varies depending on the type of asset being edited. If there are multiple files associated with the asset, the dialog provides different tabs for editing the source code of each of these files.

You cannot edit the source code of built-in assets. If you want to modify the code of a built-in asset, you must first create a copy of the asset and then edit the copy according to your requirements.

Note:

Edit an asset's source files only when absolutely necessary. To ensure that you do not end up with an invalid asset that does not work properly, edit the source code very carefully.

To edit the source code of an asset:

  1. Open the Assets page for the portal that owns the asset.
  2. Click the type of asset that you want to edit, for example, Page Templates.
  3. Select the asset that you want to edit.
  4. In the toolbar, click Actions, and then choose Edit Source.
  5. In the Edit Source dialog, edit the code as required.

    Tip:

    For XML files, 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 for skins.

    Table 14-4 Editing Asset Source Code

    Asset Tab Description

    Page Templates

    Template

    Page Definition

    Edit the JSF (.jspx) file that represents the page template.

    Edit the page template's associated page definition XML file.

    Resource Catalogs

    Catalog Definition

    Edit the XML file that represents the resource catalog.

    Skins

    CSS

    Edit the CSS file for the skin.

    Page Styles

    Page

    Page Definition

    Edit the JSF (.jspx) file that represents the page style.

    Edit the page style's associated page definition XML file.

    Content Presenter Display Templates

    Fragment

    Page Definition

    Edit the JSFF file that represents the Content Presenter display template.

    Edit the page fragment's page definition XML file.

    Task Flow Styles

    Taskflow Definition

    Fragment

    Page Definition

    Edit the XML file that represents the task flow style.

    Edit the page fragment JSFF file.

    Edit the page fragment's page definition XML file.

    Layouts

    Component

    CSS

    Edit the XML file that represents the layout component.

    Edit the CSS file for the layout.

    Task Flows

    Taskflow Definition

    Fragment

    Page Definition

    Edit the XML file that represents the task flow.

    Edit the page fragment JSFF file.

    Edit the page fragment's page definition XML file.

    Data Visualizations

    Taskflow Definition

    Fragment

    Page Definition

    Edit the XML file that represents the data visualization.

    Edit the page fragment JSFF file.

    Edit the page fragment's page definition XML file.

    Visualization Templates

    Fragment

    Edit the page fragment JSFF file.

    Data Controls

    (Not Applicable)

    Source code cannot be edited in the browser.

    Business Objects

    (Not Applicable)

    Source code cannot be edited in the browser.

    REST Data Sources

    (Not Applicable)

    Source code cannot be edited in the browser.

    SQL Data Sources

    (Not Applicable)

    Source code cannot be edited in the browser.

  6. When you are done, click Save and Close.

Managing Assets

In addition to creating and editing assets, there are other operations that you can perform on assets in the Assets page.

This section includes the following topics:

Viewing Information About an Asset

Each asset has an associated Show Properties dialog that summarizes useful information about it. You cannot edit the properties displayed in the Show Properties dialog of an asset.

To view information about an asset:

  1. Open the Assets page for the portal that owns the asset.

  2. Click the type of asset for which you want to view information (for example, Page Templates).

  3. Select the asset for which you want to view information.

  4. In the toolbar, click Actions, and then choose Show Properties. Review the properties for the selected asset:

Table 14-5 Asset Properties

Property Description

Display Name

The display name of the asset.

Editable in the Edit Properties dialog.

Description

The description of the asset.

Editable in the Edit Properties dialog.

Icon URI

The URI of the icon that is associated with the asset. Specify either an absolute URL, or a relative URL that points to an image located somewhere on the portal server. Currently, the only asset that can be associated with an icon is a page style.

Editable in the Edit Properties dialog.

Category

The category to which the asset belongs. For example, all page styles associated with Sales could belong to a Sales category.

Editable in the Edit Properties dialog.

Asset Type

The type of the asset. For example, pageStyle or taskFlow.

Internal ID

The unique internal identification number assigned to the asset.

Content Directory

The path where dependent objects of the asset, such as images, JavaScripts, style sheets, and HTML files, are stored on the portal server.

JSPx File

The path to the JSF (.jspx) file for the asset.

Page Definition

The path where the page definition XML file of the asset is stored on the portal server.

Page definitions are used for page templates, page styles, task flow styles, and task flows.

Metadata File

The path where metadata files, if any, of the asset are stored on the portal server.

Created By

The name of the user who created the asset.

Date Created

The date and time when the asset was created.

Modified By

The name of the user who last edited the asset.

Date Modified

The date and time when the asset was last edited.

Locked By

The name of the user who most recently locked the asset.

Date Locked

The date and time when the asset was most recently locked.

Exclude From Home Portal

(Shared assets only) Specifies whether the asset is available in the Home portal.

Editable in the Edit Properties dialog.

Exclude From Portal(s)

(Shared assets only) Specifies in which portals the asset is available or excluded.

Editable in the Edit Properties dialog.

Attributes

Attributes that determine the behavior of the asset. For example, editPageAfterCreation is a custom attribute of the page style asset and controls whether a newly created page of that style opens in Edit or View mode. It takes a value of true or false. When you associate this attribute with a particular page style, every time a user creates a page based on the selected style, the attribute value is considered and the page behaves accordingly.

Editable in the Edit Properties dialog.

To set attribute values, see Setting Asset Attributes.

Previewing an Asset

WebCenter Portal provides a way to preview certain assets, namely page templates, page styles, task flow styles, and task flows. This enables you to quickly get an idea of how the asset looks, without having to publish it and go through the process of using it within the portal. This means that you can make adjustments quickly, if required.

To preview an asset:

  1. Open the Assets page for the portal that owns the asset.
  2. Click the type of asset that you want to preview, for example, Page Templates.
  3. Click the name of the asset that you want to preview.

    Note:

    Not all assets can be previewed. If the name of the asset is not a hyperlink, then it cannot be previewed.

    The asset is displayed as it would appear when used in a portal.

  4. View and interact with the asset to determine whether it looks and behaves the way you want.
  5. When you are done, click Close.

    You can either edit the asset to make changes or publish it to make it available in the portal.

Showing and Hiding Assets

The system administrator can make shared assets available for use in all portals, or hide some assets so that they cannot be selected in a portal. At the portal level, you can make a custom asset available for use in a portal by marking it as available, or you can hide an asset to prevent users of your portal from selecting it. For example, you may want to hide an asset while you are making further refinements to it after its initial creation and publication.

Note:

Even if an asset is hidden, it can still be referred to by its internal ID through an EL expression. For example, you can refer to a hidden page template by using an EL expression to set the Page Template value on the Settings page in portal administration.

The following table shows several skins. The built-in shared skins are all available, the custom OraMosaic skin is available, and the custom Karen Skin is hidden.

Figure 14-3 Showing and Hiding Assets

Description of Figure 14-3 follows
Description of "Figure 14-3 Showing and Hiding Assets"

When you first create or upload an asset, by default it is marked as hidden. A hidden asset is not available for wherever assets are selected. For an asset to become available, it must be published, that is, made available. For example, the figure shows the list of skins that are available for selection as the portal's default skin. Note that the hidden skin, Karen Skin, is not included in this list.

Figure 14-4 Hidden Asset Not Available for Selection to Assign

Description of Figure 14-4 follows
Description of "Figure 14-4 Hidden Asset Not Available for Selection to Assign"

You can, however, use a hidden asset as the starting point for creating a new asset. For example, the figure shows that the hidden skin, Example Skin, is listed in the Copy From list when you create a new skin.

Figure 14-5 Hidden Asset Available for Selection to Copy

Description of Figure 14-5 follows
Description of "Figure 14-5 Hidden Asset Available for Selection to Copy"

To show or hide an asset:

  1. Open the Assets page for the portal that owns the asset.
  2. Click the type of asset that you want to show or hide (for example, Page Templates).
  3. Select or deselect the check box in the Available column for the asset that you want to show or hide.

Copying an Asset

You can create copies of most assets, including the built-in assets. This is useful for when you want to:

  • Create a backup of an asset.

  • Update an asset while keeping the original in use.

  • Use a built-in asset as the starting point for creating a new asset. You cannot edit built-in assets, but you can create a copy to use as a starting point for further refinement.

When you create a copy of an asset, the copy is initially hidden regardless of the status of the original asset.

Note:

You cannot create copies of Content Presenter display templates.

To copy an asset:

  1. Open the Assets page for the portal that owns the asset.
  2. Click the type of asset that you want to copy, for example, Page Templates.
  3. Select the asset that you want to copy.
  4. In the toolbar, click Actions, and then choose Copy.
  5. In the Copy dialog, in the Display Name field, enter a name for the copy.

    Figure 14-6 Copy Dialog for a Page Template

    Description of Figure 14-6 follows
    Description of "Figure 14-6 Copy Dialog for a Page Template"
  6. In the Description field, optionally enter a description for the new asset.
  7. Click OK.

Setting Properties on an Asset

Every asset has associated properties that define its display, availability, and attributes.

Use the Edit Properties dialog to view and edit the properties associated with assets:

  • General—This section displays details such as the asset's name, location, and internal ID. These properties are common across all asset types.

  • Attributes—This section lists the attributes associated with an asset. The attributes displayed in the Attributes section vary from asset to asset. For example, while a page template does not have any default attributes, skins have the following default attributes: skinFamily, skinId, and skinExtends.

Note:

The Edit Properties dialog for shared assets also includes an Exclude Asset Usage section for specifying in which portals a shared asset is available.

This section includes the following topics:

Accessing the Edit Properties Dialog for an Asset

To access the Edit Properties dialog for a portal asset:

  1. Open the Assets page for the portal.

  2. Click the type of asset that you want to edit (for example, Page Templates).

  3. Select the asset that you want to edit.

  4. In the toolbar, click Actions, and then choose Edit Properties to open the Edit Properties dialog. View and edit the properties of the selected asset:

Table 14-6 Asset Properties

Property Description

Display Name

The display name of the asset.

Editable in the Edit Properties dialog.

Description

The description of the asset.

Editable in the Edit Properties dialog.

Icon URI

The URI of the icon that is associated with the asset. Specify either an absolute URL, or a relative URL that points to an image located somewhere on the portal server. Currently, the only asset that can be associated with an icon is a page style.

Editable in the Edit Properties dialog.

Category

The category to which the asset belongs. For example, all page styles associated with Sales could belong to a Sales category.

Editable in the Edit Properties dialog.

Asset Type

The type of the asset. For example, pageStyle or taskFlow.

Internal ID

The unique internal identification number assigned to the asset.

Content Directory

The path where dependent objects of the asset, such as images, JavaScripts, style sheets, and HTML files, are stored on the portal server.

JSPx File

The path to the JSF (.jspx) file for the asset.

Page Definition

The path where the page definition XML file of the asset is stored on the portal server.

Page definitions are used for page templates, page styles, task flow styles, and task flows.

Metadata File

The path where metadata files, if any, of the asset are stored on the portal server.

Created By

The name of the user who created the asset.

Date Created

The date and time when the asset was created.

Modified By

The name of the user who last edited the asset.

Date Modified

The date and time when the asset was last edited.

Locked By

The name of the user who most recently locked the asset.

Date Locked

The date and time when the asset was most recently locked.

Exclude From Home Portal

(Shared assets only) Specifies whether the asset is available in the Home portal.

Editable in the Edit Properties dialog.

Exclude From Portal(s)

(Shared assets only) Specifies in which portals the asset is available or excluded.

Editable in the Edit Properties dialog.

Attributes

Attributes that determine the behavior of the asset. For example, editPageAfterCreation is a custom attribute of the page style asset and controls whether a newly created page of that style opens in Edit or View mode. It takes a value of true or false. When you associate this attribute with a particular page style, every time a user creates a page based on the selected style, the attribute value is considered and the page behaves accordingly.

Editable in the Edit Properties dialog.

To set attribute values, see Setting Asset Attributes.

Editing the Name or Description of an Asset

To maintain a well-organized set of assets, consider developing a standard naming scheme and method of description. This is not a required step, but it may be useful in identifying your intended purpose for a given asset.

To edit the name or description of an asset:

  1. Open the Edit Properties dialog for the asset that you want to edit.

  2. In the Edit Properties dialog, in the Display Name field, edit the name of the asset, if desired.

  3. In the Description field, enter a description for the asset.

  4. Click OK.

Associating an Icon with an Asset

You can associate an icon with an asset. Currently, the only asset that can be associated with an icon is a page style.

To associate an icon with an asset:

  1. Open the Edit Properties dialog for the asset that you want to edit.

  2. In the Edit Properties dialog, in the Icon URI field, enter a standard URI path to the icon.

    Tip:

    You can specify either an absolute URL, or a relative URL that points to an image located somewhere on the portal server.

    To store an image on the portal server, you must first upload the required file and then obtain the image's URL using Get Link.

  3. Click OK.

Categorizing an Asset

You can classify assets into relevant groups. For example, all page styles associated with Sales could belong to a Sales category.

Note:

This value is available and exposed only in the Edit Properties dialog.

To categorize an asset:

  1. Open the Edit Properties dialog for the asset that you want to edit.

  2. In the Edit Properties dialog, in the Category field, enter a category name.

  3. Click OK.

Setting Asset Attributes

Asset attributes determine the behavior of an asset. For example, editPageAfterCreation is a custom attribute of the page style asset and controls whether a newly created page of that style opens in Edit or View mode.

To set asset attributes:

  1. Open the Edit Properties dialog for the asset that you want to edit.

  2. In the Attributes section, edit or enter the Name field.

  3. In the Value field, edit or enter the value for the attribute.

  4. Click Add More if you want to add more attributes.

  5. To remove an attribute associated with an asset, click the Remove icon displayed next to the attribute you want to remove.

  6. Click OK.

Setting Security for an Asset

You can define and manage access permissions for a specific asset. By default, asset access is controlled by application-level permissions. After you define asset-specific permissions, the permissions defined at the application or portal level no longer apply.

To set security for an asset:

  1. Open the Assets page for the portal that owns the asset.
  2. Click the type of asset for which you want to set access permissions, for example, Page Templates.
  3. Select the asset for which you want to set access permissions.
  4. In the toolbar, click Actions, and then choose Security Settings.
  5. In the Security Settings dialog, select Use Custom Permissions to define who can access the selected asset and what level of access they have. When you select this option, the other controls in the dialog become available.

    Figure 14-7 Security Settings Dialog

    Description of Figure 14-7 follows
    Description of "Figure 14-7 Security Settings Dialog"

    Tip:

    If you select Use Custom Permissions, ensure that at least one user or group is granted the Manage permission.

  6. Specify the user or group to whom you want to grant access.
    • Click Add Users to search for and select individual users available in your identity store.

    • Click Add Groups to search for and select groups of users available in your identity store.

    Tip:

    For help on searching for a user or group, see Searching for a User or Group in the Identity Store.

  7. For each user or group selected, specify the level of access you want to grant. Select:
    • Manage to grant full access on the asset. Such users can perform tasks such as edit, delete, grant access, show or hide, and so on.

    • Update to grant the permission to edit the asset. Such users can edit the asset, but they cannot delete it.

  8. If you want to revoke access from any user or group, select that entity and click Delete Access.
  9. To revoke all custom permissions granted on the asset, select Use Portal Security Settings.
  10. Click OK.

Downloading an Asset

Note:

You cannot download an asset from one portal, then upload that same asset to another portal. In other words, migrating assets from one portal to another is not supported. To use an asset across multiple portals, the asset must be created as a shared asset.

When you download an asset, its configuration is saved into an archive file. You can save the archive file either to your local file system or a remote server file system.

To download an asset:

  1. Open the Assets page for the portal that owns the asset.
  2. Click the type of asset that you want to download, for example, Page Templates.
  3. Select the asset that you want to download.
  4. In the toolbar, click Download.
  5. In the Download dialog, in the Archive File Name field, enter a name for the archive file. The archive file must have the .aar extension.

    Figure 14-8 Download Dialog for a Page Template

    Description of Figure 14-8 follows
    Description of "Figure 14-8 Download Dialog for a Page Template"
  6. Select:
    • Save to My Computer to save the archive file to your local file system. When you click the Download button you are prompted for the location on the file system where you want to save the file.

    • Save to WebCenter Portal Server to save the archive file to the portal server file system. The .aar archive file is saved to the default path DOMAIN_HOME/WC_Archives, where DOMAIN_HOME refers to the domain location where WebCenter Portal is installed.

  7. Click Download.
  8. If you selected to save the archive file to your local file system, you are prompted to specify the location where you want to save the file.
  9. After downloading the asset, you can then import it into the IDE of your choice, such as JDeveloper.

Note:

Artifacts used or referenced by assets, such as icons and images, are not included in the archive when an asset is downloaded. You must manage and move dependent artifacts manually. Oracle recommends 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 are managing legacy assets that store artifacts in MDS, you can relocate dependent artifacts to your content server. However, if you do need to move artifacts stored in MDS, you can use the MDS WLST commands exportMetadata and importMetadata.

Uploading an Asset

Note:

You cannot download an asset from one portal, then upload that same asset to another portal. In other words, migrating assets from one portal to another is not supported. To use an asset across multiple portals, the asset must be created as a shared asset.

When you upload an asset to WebCenter Portal:

  • Existing assets with the same internal ID are overwritten.

  • Portal assets are uploaded back only into their original portal. You cannot upload a portal asset into a different portal.

  • Assets must be in an archive file format on your local file system or a remote server.

To upload an asset:

  1. Open the Assets page for the portal that owns the asset.
  2. Click the type of asset that you want to upload, for example, Page Templates.
  3. In the toolbar, click Upload.
  4. In the Upload dialog, select:
    • Look on My Computer to upload an archive file from your local file system. Click Choose File to locate the file.

    • Look on WebCenter Portal Server to upload an archive file from a remote server file system. In the field below, enter the location on the server where the file is located.

    Figure 14-9 Upload Dialog for a Page Template

    Description of Figure 14-9 follows
    Description of "Figure 14-9 Upload Dialog for a Page Template"
  5. Click Upload.
  6. If the asset already exists in the portal, click Yes to confirm that you want to replace the asset with the contents of the archive file.
  7. Click OK in the resulting success dialog.

    Tip:

    System administrators can upload assets using the WLST command, importWebCenterResource. For more information, see importWebCenterResource in WebCenter WLST Command Reference Reference.

    Note:

    Artifacts used or referenced by assets, such as icons and images, are not included in the archive when an asset is exported. When you upload the asset, you must manage and move dependent artifacts manually. We recommend 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 are managing legacy assets that store artifacts in MDS, Oracle recommends that you relocate dependent artifacts to your content server. However, if you do need to move artifacts stored in MDS, you can use the MDS WLST commands exportMetadata and importMetadata.

Deleting an Asset

When an asset is no longer required, you may want to remove it. You cannot delete built-in assets.

Note:

Before you delete an asset, you must ensure that the asset is not in use. With the exception of page layouts, if you mark an asset for deletion, it is deleted even if it is use. For page layouts, a message notifies you that the layout is in use and cannot be deleted.

To delete an asset:

  1. Open the Assets page for the portal that owns the asset.
  2. Click the type of asset that you want to delete, for example, Page Templates.
  3. Select the asset that you want to delete.
  4. In the toolbar, click Delete.
  5. In the Delete dialog, click OK.

Querying Assets Using EL Expressions

You can access any asset anywhere in WebCenter Portal through Expression Language (EL) expressions.

For example, the following EL expression returns the first page template found with a display name of myPage:

#{srmContext.resourceType['siteTemplate'].displayName['myPage'].singleResult}

You must set query parameters in the format .property['value'], where property is the name of the asset property, for example, id, displayName, or resourceScope, and value is the value of that property you want to search for.

If you need EL assistance, an application developer can provide an EL expression; see Expression Language Expressions in Developing for Oracle WebCenter Portal.

Applying Assets Dynamically Using EL Expressions

WebCenter Portal provides a way to dynamically apply certain assets at runtime based on some criteria. For example, you can present content or shape the way content is presented by using personalization-related EL expressions to select and apply a page template based on whoever is the current user.

Consider an example where you want a top-navigation page template to be displayed to portal managers, and a side-navigation page template to be displayed to other users. You could use the following EL expression to specify the page template:

#{WCSecurityContext.userInScopedRole['Moderator'] ? 'gsr3396194a_3a72_44d6_90b4_57fd6efe4ff1' : 'gsr3396194a_3a72_44d6_90b4_57fd6efe4ff7'}

The EL expression uses the internal IDs of the page templates.

Instead of using the exact internal ID of the asset that you want to apply, you can also include queries in an EL expression as shown in the following example:

#{WCSecurityContext.userInScopedRole['Moderator'] ? srmContext.resourceScope['space_name'].resourceType['siteTemplate'].displayName['Top'].singleResult.id :
 srmContext.resourceScope['space_name'].resourceType['siteTemplate'].displayName['Side'].singleResult.id}

To dynamically apply an asset at runtime:

  1. Note down the internal ID of the required asset from its Show Properties dialog.
    To view Show Properties dialog, select the asset for which you want to view information, , click Actions in the toolbar, and then choose Show Properties.
  2. Access WebCenter Portal Administration and open the General page. Or access a specific portal's administration page and open the Settings page.

    Tip:

    You can also enter the following URLs in your browser to navigate directly to the appropriate administration pages:

    • Application-level: http://host:port/webcenter/portal/admin/settings/general

    • Portal-level: http://host:port/webcenter/portal/portalName/admin/settings

  3. Click the Expression Editor icon icon next to the desired asset field, then select Expression Builder to open the editor.
  4. In the Expression Editor dialog, enter the required EL expression.

    Figure 14-10 Expression Editor Dialog

    Description of Figure 14-10 follows
    Description of "Figure 14-10 Expression Editor Dialog"

    For example, if you want to display different page templates depending on whether the page is rendered in a browser on a Windows platform or on a mobile device, you can use the following EL expression:

    #{requestContext.agent.platformName=='windows' ? 'gsr3396194a_3a72_44d6_90b4_57fd6efe4ff7' : 'gsr1472d17b_8f10_4689_89fb_7431f561567f'}
    

    This EL expression is an if-then-else statement. The EL requestContext.agent.platformName retrieves the platform information. The page template IDs are the ones noted down from the Show Properties dialog.

    If you need EL assistance, an application developer can provide an EL expression; see Expression Language Expressions in Developing for Oracle WebCenter Portal.

  5. Click OK.

Working with Portal Assets in JDeveloper

You may find that you want to develop portal assets beyond the capabilities of the browser-based interface offered by WebCenter Portal. In this case, Oracle recommends that developers use JDeveloper to develop more complex assets (such a page templates, skins, and page styles) for portals. When fully developed, the developer can publish the assets directly to WebCenter Portal (the portal server) or to a specific portal for immediate use or for testing. Alternatively, the developer can export an asset to a file and upload it to WebCenter Portal later.

For more information, see Working with WebCenter Portal Assets in Developing for Oracle WebCenter Portal.