Catalog and marketing attachments - developer overview
For catalog and marketing assets, an attachment consists of an attachment relationship, attachment target, and an attachment asset.
- Attachment relationship
- An attachment relationship is a link between a catalog or marketing asset and its supplementary material.
- Attachment target
- An attachment target is a container for the supplementary material. An attachment target can contain one or more files or URLs. No two files in an attachment target may apply to the same language.
- Attachment asset
- An attachment asset is an individual file or URL in an attachment target.
The following diagram shows the structure of relationships between catalog and marketing assets, attachment relationships, attachment targets, and attachment assets:
A JSP application developer can reference attachments when designing a store using the Attachment code snippet and the attachment data bean. WebSphere Commerce ensures that the correct attachment asset displays, depending on the language of the user when browsing the store.
For example, if your store sells televisions, you might want to provide access to the user manuals for the televisions, from the product page. The following diagram shows the relationship between the catalog entry for a television and the user manuals for the television in various languages:
For this example, the store page for the television catalog entry would display one link to the television user manual. When users click the link, they would see the television user manual in the same language in which they are viewing the store.
The first time you add an attachment asset to a catalog or marketing asset, an attachment target is automatically created. Also, the first attachment asset is assigned to all languages. Adding attachment assets for different languages to the same attachment target requires you to adjust the language assigned to the original attachment asset in the attachment target.
Managed files are initially written to the WebSphere Commerce database. When certain criteria are met, managed files are copied from the WebSphere Commerce database to the WebSphere Commerce EAR file. In a federated environment, all copies of the WebSphere Commerce EAR file are updated automatically.
If a file asset is available only in the WebSphere Commerce database (and not in the WebSphere Commerce EAR file), you can view the file in a store page only using the preview function.