A Print View for WDK Properties
| January 2007 | |
|
Software Environment
| Feature | Tested on |
| Operating System | Windows 2003 Server SP1 |
| Compiler | Sun JDK 1.4.2_08 |
| Runtime | Sun JRE 1.4.2_08 |
| DFC | 5.3 SP3 |
| WDK | 5.3.0.216 |
| Webtop | 5.3.0.216 |
| Content Server | 5.3 SP1 |
Abstract
Webtop displays an object's properties in a dialog box with a scrollbar. This makes is difficult to print the properties because the browser only prints the properties that are currently visible in the window.
This article discusses a method of creating a 'Print View' of a repository object's properties in WDK/Webtop.
Introduction
Webtop displays an object's properties in a dialog box with a scrollbar. This makes is difficult to print the properties because the browser only prints the properties that are currently visible in the window.
This customization adds a 'Print View' button in the Webtop attributes component, which is one of the components displayed by the properties component in a tabbed view. The event handler of this button basically reopens the attributes component outside the context of a dialog bog so that all the properties appear without a scrollbar and can be easily printed using the browser's 'Print' command.
Customization
As part of the customization, the 'attributes' component needs to be extended. To do this, extend the attributes definition from VIRTUAL_ROOT/webcomponent/config/library/attributes/attributes_dm_document_component.xml.
This is what our XML config looks like -
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<config version='1.0'>
<!-- dm_document specific version -->
<scope type='dm_document'>
<component id="attributes"
extends=
"attributes:webcomponent/config/library/attributes/attributes_dm_document_component.xml">
<params>
<param name="objectId" required="true"></param>
<param name="readOnly" required="false"></param>
<param name="enableShowAll" required="false"></param>
<param name="viewState" required="false"></param>
</params>
<!-- Component Layouts -->
<pages>
<start>/custom/library/attributes/attributes_dm_document.jsp</start>
<all>/custom/library/attributes/attributes_all.jsp</all>
</pages>
<class>com.documentum.custom.attributes.Attributes</class>
</component>
</scope>
</config>
|
The JSPs ('start' and 'all') were copied from VIRTUAL_ROOT/webcomponent/library/attributes. We need to customize the dm_document properties JSP and also the attributes_all.jsp. In these JSPs we placed a dmf:button control. This button opens up the 'Print View'. Note that the 'all' page comes from the base definition - VIRTUAL_ROOT/webcomponent/config/library/attributesattributes_dm_sysobject_component.xml
We also extended the 'attributes' component class by a custom one - com.documentum.custom.attributes.Attributes. This class contains the event handler for the dmf:button control that we added to the JSPs. This event handler performs a nested component jump to the attributes component and passes the current object id as an argument.
In the custom definition of the component, we added an extra argument called 'viewState'. This was needed because the we needed to change the label and function of the button 'Print View' during the print view. Since the print view is basically the same attributes component displayed outside the context of a dialog box, the 'Print View' button still shows up even when in 'Print View'. To overcome this, we added the 'viewState' parameter based on which the label and function of the button is changed. When already in 'Print View' the button label changes to 'Back' and its function changes to going back to the previous component (setComponentReturn), which is nothing but the 'properties' component.
Downloads
The WDKPropertiesPrintView.zip contains the customized XML config files, JSPs and the component class source code.
|