This section contains examples explaining how we can practically implement Folder Mapping in Documentum.
Let us begin with a simple example, where the Folder Map is configured so that the content file is placed at a specified location in the Web Cabinet if and only if the user provides some non-blank value for its subject property while creating the content.
FolderMap.xml
file under Site Manager | Configurations | Foldermaps. Modify the FolderMap.xml
file as shown below and check it back into the Docbase.<folder_map> <rule> <attr_list> <attr> <name>subject</name> <value>*</value> </attr> </attr_list> <path_list> <path>/Test_WebCabinet/Subject_Content</path> </path_list> </rule> <rule> <attr_list> <attr> <name></name> <value></value> </attr> </attr_list> <path_list> <path></path> </path_list> </rule> </folder_map>
Try creating some content using a template and leave the Subject: field blank. The following error is thrown; view it by clicking on the All Messages button in Web Publisher status bar:
The new content cannot be created. This file, based on the folder map, cannot be linked to any Web cabinet. Your file will not be created.
/Test_WebCabinet/Subject_Content
.Ensure that the Web Cabinet Test_WebCabinet already exists in the Docbase. If it does not exist, please create it before you start creating content and trying out Folder Mapping examples.
Let us now take an example where the Folder Map is configured so that the content file is placed at a specified location in the Web Cabinet if and only if two property conditions are met for the content as follows:
It should have a non-blank Name: field (object_name
property) and its Subject: field (subject
property) should have a value office
. Until and unless both these conditions are met, the content file is not created.
FolderMap.xml
file under Site Manager | Configurations | Foldermaps. Modify the FolderMap.xml
file as shown below and check it back into the Docbase.<folder_map> <rule> <attr_list> <attr> <name>object_name</name> <value>*</value> </attr> <attr> <name>subject</name> <value>office</value> </attr> </attr_list> <path_list> <path>/Test_WebCabinet/Official docs</path> </path_list> </rule> <rule> <attr_list> <attr> <name></name> <value></value> </attr> </attr_list> <path_list> <path></path> </path_list> </rule>
Try creating content using a template and do any one of the following:
OFFICE
as the value of Subject: field office
, for example JUNK
In all four cases, the following error is thrown (view the All Messages button in Web Publisher status bar) and the new content is not created in Web Publisher:
The new content cannot be created. This file, based on the folder map, cannot be linked to any Web cabinet. Your file will not be created.
office
for its Subject: field as shown in figure 16.6: /Test_WebCabinet/Official docs
.As discussed earlier, you must ensure first that the Web Cabinet Test_WebCabinet
already exists in the Docbase. If it does not exist, please create it before you start creating content.
Let us now take an example where Folder Map is configured so that the same content file is placed at two different specified locations in the Web Cabinet. An important condition that must be met for the content is that it should have a non-blank file name (object_name
property).
If the above condition is met, the same content file is placed under two folders in the Web Cabinet: /Test_WebCabinet/FilePath One
and /Test_WebCabinet/FilePath Two
.
FolderMap.xml
file under Site Manager | Configurations | Foldermaps. Modify the FolderMap.xml
file as shown below and check it back into the Docbase.<folder_map> <rule> <attr_list> <attr> <name>object_name</name> <value>*</value> </attr> </attr_list> <path_list> <path>/Test_WebCabinet/FilePath One</path> <path>/Test_WebCabinet/FilePath Two</path> </path_list> </rule> <rule> <attr_list> <attr> <name></name> <value></value> </attr> </attr_list> <path_list> <path></path> </path_list> </rule> </folder_map>
Try creating content using a template and provide a non-blank file name (Name: field) as shown in figure 16.8.
/Test_WebCabinet/FilePath One
and /Test_WebCabinet/FilePath Two
.Till now we were dealing with single-valued attributes. Let us now take an example where Folder Map is configured so that the content file is placed at a specified location in the Web Cabinet if a particular repeating property condition is met for the content as follows:
If the above condition is met, the content file is placed within the following location in the Web Cabinet: /Test_WebCabinet/Keywords_ABC
.
FolderMap.xml
file under Site Manager | Configurations | Foldermaps.Modify the FolderMap.xml
file as shown below and check it back into the Docbase.
<folder_map> <rule> <attr_list> <attr> <name>keywords</name> <value>abc</value> </attr> </attr_list> <path_list> <path>/Test_WebCabinet/Keywords_ABC</path> </path_list> </rule> <rule> <attr_list> <attr> <name></name> <value></value> </attr> </attr_list> <path_list> <path></path> </path_list> </rule> </folder_map>
ABC
for the Keywords value: keywords[0]='ABC'
xyz
for the Keywords value: keywords[0]='xyz'
xyz
and abc
as Keywords values. Note that here abc
is the second keyword and not the first keyword.keywords[0]='xyz' keywords[1]='abc'
You will notice that the following error is thrown (view by clicking the All Messages button in Web Publisher status bar) and the new content is not created in Web Publisher:
The new content cannot be created.
This file, based on the folder map, cannot be linked to any Web cabinet. Your file will not be created.
abc
for its Keywords: field as shown in figure 16.11. /Test_WebCabinet/Keywords_ABC
.Let us take an example where Folder Map is configured so that the content file is placed at a specified location in the Web Cabinet. The repeating property condition that must be met for the content is that it should have a non-blank keywords property with hello as its second keyword (index position 1).
If the above condition is met, the content file is placed under the following location in the Web Cabinet: /Test_WebCabinet/Keywords_Hello
.
FolderMap.xml
file under Site Manager | Configurations | Foldermaps.Modify the FolderMap.xml
file as shown below and check it back into the Docbase.
<folder_map> <rule> <attr_list> <attr> <name>keywords[1]</name> <value>hello</value> </attr> </attr_list> <path_list> <path>/Test_WebCabinet/Keywords_Hello</path> </path_list> </rule> <rule> <attr_list> <attr> <name></name> <value></value> </attr> </attr_list> <path_list> <path></path> </path_list> </rule> </folder_map>
hello
as Keywords value: keywords[0]='hello'
Or: xyz
and HELLO
as Keywords values. Note that HELLO
is in upper case, even though it is the second keyword.keywords[0]='xyz' keywords[1]='HELLO'
You will notice that the following error is thrown (view by clicking the All Messages button in Web Publisher status bar) and the new content is not created in Web Publisher:
The new content cannot be created.
This file, based on the folder map, cannot be linked to any Web cabinet. Your file will not be created.
xyz
and hello
as values for its Keywords: field as shown in figure 16.13. /Test_WebCabinet/Keywords_Hello
.Till now, we were considering examples where a fixed location was provided in the FolderMap.xml
file based on some property values. Folder Map provides additional features to create the location/paths at run time dynamically based on some attribute/property values.
Let us take an example where Folder Map is configured so that the content file is placed within a dynamically created folder in the Web Cabinet. The property condition that must be met for the content is that it should have a non-blank subject property.
If the above condition is met, the content file is placed under the Test_WebCabinet Web Cabinet within a folder having the same name as the value provided by content creator for the content's subject property.
FolderMap.xml
file under Site Manager | Configurations | Foldermaps.<folder_map> <rule> <attr_list> <attr> <name>subject</name> <value>*</value> </attr> </attr_list> <path_list> <path>/Test_WebCabinet/$(subject)</path> </path_list> </rule> <rule> <attr_list> <attr> <name></name> <value></value> </attr> </attr_list> <path_list> <path></path> </path_list> </rule> </folder_map>
At run time Web Publisher substitutes the value of the subject property as the name of the folder. Note that $(...)
signifies run-time substitution of the specified Docbase property value.
test subject)
as shown in figure 16.15. test_subject
created at run time by Folder Map.Having gone through a simple example of dynamic folder mapping, let's now take an example where Folder Map is configured so that the content file is placed within a dynamically created folder in the Web Cabinet. The repeating property condition that must be met for the content is that it should have abc
as the second keywords property: keywords[1]='abc'
If the above condition is met, the content file is placed under the Test_WebCabinet Web Cabinet within a folder having the same name as the second value provided by content creator for the content's keywords property (i.e. abc)
.
FolderMap.xml
file under Site Manager | Configurations | Foldermaps.Modify the FolderMap.xml
file as shown below and check it back into the Docbase.
<folder_map> <rule> <attr_list> <attr> <name>keywords[1]</name> <value>abc</value> </attr> </attr_list> <path_list> <path>/Test_WebCabinet/$(keywords[1])</path> </path_list> </rule> <rule> <attr_list> <attr> <name></name> <value></value> </attr> </attr_list> <path_list> <path></path> </path_list> </rule> </folder_map>
Folder Map will create a folder at run time with the same name as the value of the second keyword (i.e. keywords[1]
).
abc
as the second entry in the keywords property as shown in figure 16.17. abc
created at run time by Folder Map.There is much more to Folder Mapping than what we have discussed in this chapter. The Documentum Web Publisher manuals talk about Folder Mapping in detail and you can go through them to get a better understanding of the topic.
3.144.40.182