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
:
Set
itemView
to display the same preview button on all tabs of the view.Set
itemViewMapping
to display a different preview button on each tab of a view.
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 |
---|---|
| The asset’s repository ID or the absolute path of a file. |
| The project ID. Empty if there is no current project. |
| The Nucleus path of the repository or virtual file system. |
| 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’sdisplayName
property, or removed from the URL if the asset contains nodisplayName
.
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:
If necessary, create a page to use to display the preview of the asset.
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 theitemMapping
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.
In the ACC’s Publishing > View Mapping window, display the
itemViewMapping
associated with thisitemMapping
. (In this case, theitemViewMapping
being used isTextFileEditView
.)Click the
attributeValues
property of theitemViewMapping
.Click Add to create an attribute.
Click New Item. The dialog box for new items of type
AttributeValue
appears.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.Click OK.
In the New Dictionary Entry field, enter
atgPreviewURL
and then click OK.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.