You extend the repository definition of the PublishingFileRepository
in order to support new item types. Because files are either in text or binary format, most extensions require two new item types—one that extends textFileAsset
and another that extends binaryFileAsset
. You can extend either or both, as needed. You can also create multiple item types with the same super-type, as with the personalization
item type.
Two requirements are important for custom item types:
Refer to the figure shown earlier in Versioned Content Repository, which shows the Item Type Hierarchy of the PublishingFileRepository.
By default, both textFileAsset
and binaryFileAsset
are extensions of fileAsset
. The content
property for fileAsset
is defined as a transient property of a custom type, VersionFilePropertyDescriptor
:
<property name="content"
property-type="atg.epub.file.VersionFilePropertyDescriptor"
</property>
VersionFilePropertyDescriptor
is an extension of FilePropertyDescriptor
that returns the content
property as a java.io.File
. It is required so ATG Content Administration can store the file asset contents on a file system. Make sure that your custom items do not override the VersionFilePropertyDescriptor
property.
To extend the repository definition of the PublishingFileRepository
, modify the repository’s definition file publishingFiles.xml
:
Define the new item descriptors.
Add the new item types as options to the sub-type-property definition of the
fileAsset
parent item descriptor.
Modify the definition by layering on a new definition file. Place the new file in the config
directory of your versioned module at /atg/epub/file/publishingFiles.xml
.
In the FTPFileSystem
example, you want to manage versioned FTP assets that are ultimately deployed as text and binary files to a target FTP server. The repository must be extended to support two new item types:
ftpTextFileAsset
ftpBinaryFileAsset
The new definition file to layer on looks like this:
<item-descriptor name="ftpTextFileAsset" super-type="textFileAsset" content="true" sub-type-value="ftpTextFileAsset" display-name="FTP text file" item-cache-size="1000" query-cache-size="500"> </item-descriptor> <item-descriptor name="ftpBinaryFileAsset" super-type="binaryFileAsset" content="true" sub-type-value="ftpBinaryFileAsset" display-name ="FTP binary file" item-cache-size="1000" query-cache-size="500"> </item-descriptor> <item-descriptor name="fileAsset"> <table name="epub_file_asset"> <property name="type"> <option value="ftpTextFileAsset" code="10001"/> <option value="ftpBinaryFileAsset" code="10002"/> </property> </table> </item-descriptor>