The example shown below demonstrates how to add an additional column in the DocuShare View Collection page.
Prerequisite:
· Custom property must already be created. Refer to the DocuShare Administrator Guide to add custom properties for a DocuShare object. The DocuShare Administrator Guide is available at https://docushare.xerox.com/doug
Note: DocuShare property names are case sensitive.
To view a collection with custom properties:
There are 2 pieces of code that need to be changed:
· The listing header section (Located in the ViewCollection.vdf file)
· The actual content iteration section to display the new custom properties (Located in the dslib.vdf file)
To complete these changes:
Note: The examples listed below use a Custom Document Object named MyProp as the custom property name. This value should be changed to reflect your custom property name.
Note: DocuShare property names are case sensitive.
1. Modify the View Collection.vdf
a. Copy the ViewCollection.vdf from the <dshome>\amber\templates\system directory to <dshome>\amber\templates\local directory.
Where <dshome> is the installation directory for DocuShare. The default installation path for DocuShare is C:\Xerox\Docushare. Depending on your installation environment this path may vary.
Note: If the <dshome>\amber\templates\local directory does not exist then one will need to be created. All customized vdf files should be placed in the local directory.
b. Open the ViewCollection.vdf from the <dshome>\amber\templates\local directory
c. Locate the header section
<define id="header">
d. Add a new column for the custom property into this header section. (or in the location you require, typically it is added after the title and before the owner)
Note: An example is also provided in the View Collection.vdf file to use.
<th class="generic"><a href="${request:pagedUri(caller='${caller}')}?sortOrder=Document.MyProp" title="Click to sort by MyProp" target="_parent">MyProp</a></th>
A new custom property header is added to the View Collection Page.
Example:
<define id="header">
<if cond="${caller}=='collection_speed'">
<if cond="${request:isLocalSite}=='true'">
<th class="nospace">
<if cond="${request:directory:is_logged_in_user}">
<if cond="${viewdef:dslib:runjs}=='Yes'">
<input type="checkbox" name="selectcheckbox" value="selected" title="${viewdef:dslibMessages:selectCheckboxes}" onclick="if (this.checked==true) { SelectAll(true); this.checked = true; } else { SelectAll(false); this.checked = false; }" onmouseover="if (this.checked==true) { describe('${viewdef:dslibMessages:clickToUnselectAll}'); } else { describe('${viewdef:dslibMessages:clickToSelectAll}'); }; return true;" onmouseout="clearstatus();"/>
<else>
<img src="${request:config:abs_path}images/checkbox.gif" alt="${viewdef:dslibMessages:selectCheckboxes}" title="${viewdef:dslibMessages:selectCheckboxes}"/>
</else>
</if>
<else>
<insert ref="viewdef:dslib:nbsp"/>
</else>
</if>
</th>
</if>
<if cond="${caller}!='collection_image'">
<th class="icon"><a href="${local:cgi}View/${handle}?sort=TypeAndTitle" title="${viewdef:ContentPortletMessages:clickToSort}" target="${viewdef:dslib:window_target}"><insert ref="viewdef:ContentPortletMessages:type" /></a></th>
<th class="name"><a href="${local:cgi}View/${handle}?sort=Title" title="${viewdef:ContentPortletMessages:clickToSortTitle}" target="${viewdef:dslib:window_target}"><insert ref="viewdef:ContentPortletMessages:title" /></a></th>
<!-- New column MyProp -->
<th class="generic"><a href="${request:pagedUri(caller='${caller}')}?sortOrder=keywords" title="Click to sort by MyProp" target="_parent">MyProp</a></th>
<!-- End MyProp -->
<th class="generic"><a href="${local:cgi}View/${handle}?
e. Save the changes to the file.
2. Modify the dslib.vdf file
a. Copy the dslib.vdf file from the <dshome>\amber\templates\system directory to <dshome>\amber\templates\local directory.
b. Open the dslib.vdf from the <dshome>\amber\templates\local directory
c. Locate the summarize_speed function. This is the main function that generates each item in a DocuShare Collection object; summarize_speed function contains all the display properties such as, title, owner, date and services icons.
<define id="summarize_speed">
f. Add the custom property after the title property, but before the owner property. (or in the location you require)
<!-- My Prop -->
<td>
<if cond="${object:classname} == 'Document'">
<insert ref="object:MyProp"/>
</if>
</td>
Example:
<define id="summarize_speed">
<define id="objectSequenceNum"><if cond="$ref == 'duplicateItems'"><insert ref="sequenceNum" /><else><insert ref="object:_sequence" /></else></if></define>
<tr about="${object:get_url}" id="row${objectSequenceNum}">
<!-- Checkbox -->
<!--<if cond="${request:isLocalSite}=='true' and ${ref}!='portlet' and $ref != 'duplicateItems'">-->
<if cond="not ${object:handleIsRemote} and ${ref}!='portlet' and $ref != 'duplicateItems'">
<insert ref="local:set_checkbox(object=${object})"/>
</if>
<!-- ICON -->
<insert ref="local:set_icon(object=${object}, locked_by=${locked_by})"/>
<!--Title -->
<insert ref="local:set_title(object=${object}, appears_in=${appears_in}, abstract=${abstract})"/>
<!-- Adding Column MyProp -->
<td>
<if cond="${object:classname} == 'Document'">
<insert ref="object:MyProp"/>
</if>
</td>
<!-- End MyProp -->
<!-- Owner -->
d. Save the changes to the file
Note: Any property can be added to View Collection, Search result, and other VDF pages in this manner.
3. Verify the Additional Column is displayed in the DocuShare View Collection