The View Mapping system can be used to set up preview functionality for assets, so ATG Business Control Center users can preview assets in a specified Web page or template. You can configure asset preview by setting the atgPreviewURL attribute on the appropriate itemView or itemViewMapping:

The atgPreviewURL attribute takes the following form:

atgPreviewURL=preview-url

where preview-url points to the JSP where the asset is previewed. This setting is parsed by the page fragment previewURLParser.jspf, which is located in:

<ATG2007.3dir>\PubPortlet\PubPortlets.ear\portlets.war\html\ProjectsPortlet

The preview URL can reference an independent page that you create for previewing assets; it can also be a page within a Web application that is installed on the BCC server. For more information on setting up a Web application on BCC server to preview assets, see “Setting Up Preview Features” in the ATG Business Control Center Administration and Development Guide.

The page fragment substitutes the asset’s properties or special properties for corresponding values in the URL. The following table shows the special properties that the preview URL can include:

Property

Description

$id

The asset’s repository ID or the absolute path of a file.

$projectId

The project ID. Empty if there is no current project.

$componentPath

The Nucleus path of the repository or virtual file system.

$itemType

The item descriptor name for repository items or file type for files.

For example, given the following URL:

http://my.page?type=$itemType&name=displayName

  • $itemType is replaced with the item descriptor name (in the case of repository items) or the file type (for file assets).

  • name is replaced with the repository asset’s displayName property, or removed from the URL if the asset contains no displayName.

Parameter values that do not match asset properties are removed from the result.

When you add preview functionality to a view, a Preview button appears on the corresponding editing page in the ATG Business Control Center.

The following procedure shows how to add preview functionality to the Properties tab that represents the default editor used for text file assets in the ATG Business Control Center:

  1. If necessary, create a page to use to display the preview of the asset.

  2. In the ACC, locate the default itemMapping used for editing text file assets.

    You can determine which itemMapping is being used by displaying the asset’s editing page in the ATG Business Control Center, displaying the source for the page, and then locating a section titled “Mapping Information.” The Mapping Information section shows the itemMapping being used; in the case of the text file asset editor, the following information is shown:

    • Description: Text File Edit Mapping

    • itemPath: /atg/epub/file/wwwFileSystem

    • itemName: wwwTextFileAsset

    • view: TextFileEditView, /html/views/item/fileEdit.jsp

    Note: To display an asset’s editing page, add an asset of the appropriate type to a project, and then click the asset’s name in the Asset tab.

  3. In the ACC’s Publishing > View Mapping window, display the itemViewMapping associated with this itemMapping. (In this case, the itemViewMapping being used is TextFileEditView.)

  4. Click the attributeValues property of the itemViewMapping.

  5. Click Add to create an attribute.

  6. Click New Item. The dialog box for new items of type AttributeValue appears.

  7. In the Value field, specify the URL that you want to use to preview the asset (the relative URL of the page you set up in step 1). You can specify any of the additional parameters (special properties) described earlier in this section.

  8. Click OK.

  9. In the New Dictionary Entry field, enter atgPreviewURL and then click OK.

  10. Click OK in the AttributeValues dialog box.

In the ATG Business Control Center, reload the asset’s editing page and verify that a Preview button appears.

 
loading table of contents...