Explains the basic principles for creating templates for use with the Web Publisher Editor. This article is valid for Web Publisher 5.2 and above.
Blue Fish Development Group
701 Brazos St. #700
Austin, TX 78701
(512) 469-9300
Explains the basic principles for creating templates for use with the Web Publisher Editor. This article is valid for Web Publisher 5.2 and above.
This article describes the creation of xml templates and their supporting files for use within Web Publisher. It describes the basic principles of Web Publisher templates, rules files, xsl stylesheets, preview images, xml applications and folder mapping.
This document will prove helpful if:
To get the most from this article, you should already have:
Web Publisher is a browser-based, customizable tool that allows a business user to create web content. It has the advantage over raw web page authoring tools by allowing a more secure enforcement of business rules. A content author can be permitted to create a wide variety of content formats such a Word, PDF, PowerPoint, Images or XML to name a few. Any XML content created by the author would then be transformed using XSL to the proper web site format. This document focuses on transforming XML files into HTML web pages.
There are several components of Web Publisher templates that are important for you to understand:
The location within Web Publisher of many of the components described above is shown in the following image:
When content is published, the transformation engine built-in to Web Publisher will use an associated XSL file and the XML content file to create an XHTML page.
Figure 2: XML Content Transformation
There are a few things you should be aware of when creating XML templates for content:
In order to create a Web Publisher template, the user must be in the web developer or administrator group within Web Publisher.
Figure 3: Presentation File Association
Editor rules files define which widgets are used in the Web Publisher content editor to populate the XML elements and attributes in the associated template with the user-entered values. There are two ways to create a new rules file:
Set your preferred rules editor within the Web Developer tab on the Web Publisher Preferences screen. We recommend starting out using the Web Publisher rules editor and switching to a local text editor when more advanced functionality such as custom tags are needed.
To create a new rules file with the web based editor:
Figure 4: Web based Rules Editor
To create a new rules file with the local text editor:
The following table lists a brief summary of the available widget options. For more detailed information, please refer to the “Web Publisher Administration Guide” provided by Documentum.
| Widget Name | Description | Tips |
| Calendar* | Displays a calendar to allow the author to select a date. | If the calendar widget is used, this date field must be filled in by the author. By default, Web Publisher sets that date to TODAY and there is no way to clear out the value. The format of the outputted date is defined by the dateFormatString attribute. This format follows simple date format standards. *Note: This widget is only available in version 5.3 and above. |
| Checkbox | Displays a checkbox to allow the author a yes or no choice. | The checkbox is a good widget to use when the author’s decision determines whether something appears or does not appear on the web page. A checkbox will store a different value in the content based on the author’s selection. Make sure your checkbox label and instructions are clear and easy to understand. |
| Choice | Displays a selection list for the author to choose an option. | The choice list may be populated through a DQL query or a hard coded list. When possible we recommend using a DQL query to keep the list dynamic. With the choice widget, the value displayed is the value stored in the content. It is not possible to display one value such as the object name and store another value such as the object id. |
| Content | Displays a rich text area to allow the author to enter formatted content. | The content widget is great for the main content of a web page. Authors can be given the ability to edit the html directly making the editor robust for those one off situations which always occur. All content must be xml compliant so it is recommended to not edit the code unless absolutely necessary. As of Web Publisher 5.3, the content widget cannot be synchronized with Documentum attributes. |
| Custom | Allows developers to create and display custom widgets. | Custom widgets are frequently created for look ups into a registered table or to browse the Repository and select a piece of related content. for information on creating custom widgets please refer to “Web Publisher Administration Guide” provided by Documentum. |
| Graphic | Displays a image selector for the author to choose an image to display on their web page. The author may be presented with the folder structure to browse and select an image or a list of images. | It is extremely convenient for the author to import local images directly into the editor. However in order to allow the author to import an image, the images must be displayed in a list. This list can only display one image attribute (typically the object name) and it can not be sorted. If there are many images in the system that may be used for the template, the list may become cumbersome fast. Where possible, we recommended storing images for each template in a separate folder to allow the list to stay manageable. For general web pages that are used by all authors for a wide variety of purposes, we would recommend using the tree control and not allowing import. |
| Repeatdef | Displays a repeating list of xml tags. This allows the author to designate how many values will be stored in the content. | The repeatdef may be used to repeat a single or multiple xml tags. If a set of tags will be repeated together (i.e. title, details), we recommend grouping them together in under one tag underlying xml file. This will make it easier to display in the presentation file. By default when an author selects to add a new repeating element, Web Publisher copies the content of the previous repeating element into the new element. This can be turned off by setting repeatdef.populateContent=false in the /wp/editors/contenteditor/resources/EditorUI.properties file. There is no easy way to limit the number of repeating items added by the author. We recommended adding the maximum number allowed in the repeatdef instructions and using the presentation file to limit the number of items displayed. |
| Tabledef | Displays a table structure for the authors to create tables within the xml content. | The tabledef tag is good to use if you have pre-defined, structured, non dynamic tables on your web page. We have found that these type of tables are typically the exception. Majority of tables displayed on a web page are dynamic or unique. Unique tables should be handled with the rich text editor to allow more flexibility. Tabledefs are not exposed through the web based rules editor. You must use a local text editor to add them to your rules file. |
| Tagcontent | For XML templates, this defines that the inputted information will be stored within the content of the xml tag. For non-XML templates, this widget must be used to display content input fields within the editor. | The tagcontent is specifically used for storing content within non-XML templates. In order for the content to be edited with the Web Publisher tagcontent elements must be used. Template: ‘<dctmEditor teComponentType=”myTitle”>default title</dctmEditor>’ Rules File: ‘<tagcontent tag_name=”myTitle”/>’ |
| Tagattribute | For XML templates, this defines that the inputted information will be stored within an attribute of the xml tag. For non-XML templates, this must be used to display attribute input fields within the editor. | The tagattribute is specifically used for storing attributes within non-XML templates. In order for the attribute to be edited with the Web Publisher tagcontent elements must be used. Template: ‘<img teComponentType=”myImage” width=”100″ height=”100″/ >’ Rules File: ‘<tagattribute tag_name=”myImage” selected_attr=”src”/>’ |
| Textarea* | Displays a multiple line text field for entering content you don’t want parsed by an XML parser. | One option for the text area is to mark the output data as cdata. This is helpful if you would like the user to enter special characters such as a registered trademark into the short description. When you set type=”cdata” the text is output wrapped in CDATA tags. *Note: This widget is only available in version 5.3 and above. |
| Textline | Displays a single line text field for entering unformatted content. | Prior to the new 5.3 calendar widget, the textline was used to default and store date attributes. Due to limitation of not being able to set a nulldate with the calendar widget, the textline may still be used if business needs define that the author must have the ability to set a nulldate. |
| Textselector | Displays a file selection to allow the author to choose text from a existing file. | The textselector may only be used for simple text files. This widget is great to use for disclaimers or other supporting information that is used across many pages. The value of output_property determines the information that is stored in the content (i.e. folderPath, contents, ID). Be careful when using contents because the fragment must be well-formed XML. |
| Xselector | Displays a file selection with a Browse button for the author to choose a file. | The xselector is meant to be used when the author must browse through a large amount of files. A dropdown list of pre-defined queries enables the author to quickly find their file. When using the xselector make sure you have thought through the design so the queries are easy to use and intuitive for the author. |
A sample rules file is provided for download, here
Presentation files define how to transform the xml content into a web viewable format. The XML can be renderd into many different formats (html, asp, jsp, etc). The format you choose depends on your application and web server. This article focuses on simple html pages.
Web Publisher does not provide an interface for the creation of XSL stylesheets. We recommend using a text or simple xsl editor.
A sample xsl presentation file is provided for download, here
A sample xml file and its rendered html file file are provided for download as well. These files are example using the sample presentation file.
These files provide a thumbnail image of the template to aid the author in choosing which type of content to create. The optimal image is 100 x 100.
An XML application defines how to store the xml file within Web Publisher. The typical use with Web Publisher templates is to synchronize xml elements with Documentum attributes. For example, the title xml content may be synchronized with the title attribute so the user does not have to enter the information twice. Synchronization of attributes is extremely helpful when building dynamic web sites.
XML Applications are created through Application Builder. A sample xml application that synchronizes the title attribute with the page_title xml content is provided for download, here. For more detailed information, please refer to “Managing XML Content in Documentum” provided by Documentum.
Folder Mapping defines where the content will be stored within the Web Cabinets for publishing. Content attributes are typically used for defining the storage location. The default foldermap file is located under Site Manager/Configurations/Foldermaps.
A sample foldermap that stores content based on the subject and author is provided for download, here. For more detailed information please refer to the “Web Publisher Administration Guide” provided by Documentum.
Question: I have created the template, rules and presentation files and have set my template to Available but the content author cannot see the template, why is this happening?
Answer: Check the permission on the content template and ensure all content authors have at least RELATE permission to the template.
Question: When an author is creating new content, why is Web View not available?
Answer: If you are using Web Publisher 5.3, first upgrade to 5.3 SP1 to get the fix for a web view bug within the editor. The availability of web view depends on if there is both a web ready rendition for your content and a site publishing configuration has been configured for your web cabinet. If you are experiencing web view problems, check the following:
Question: What is the difference between Preview and Web View in the Web Publisher Editor?
Answer:
Question: How do I edit the default behavior of the Web Publisher Editor? For example, I would like to turn off the mandatory comments?
Answer: The default behavior for the editor is stored in the /wp/editors/contenteditor/resources/EditorUI.properties file.
[...] To learn more about creating document types, refer to the Web Publisher Developers Guide or the article on this website titled “Web Publisher Template Basics” [...]
Blue Fish Development Group » Blog Archive » Synchronizing Web Content Across Web Publisher Environments | November 8th, 2008 3:40 pm
You must be logged in to post a comment.
Subscribe to our newsletter to be notified when new articles are posted. You can unsubscribe at any time.
This is very useful article for the beginners.
Amit Gupta | November 6th, 2008 10:08 am