CUSTOM PROPERTIES

Custom document and directory properties can be declared for and managed in all versions of the "Document Properties," "Template Properties," and "Directory Properties" screens. Custom properties that may be used in "Requests" are declared independently from those associated with published content or templates.

Custom Properties are implemented using external "property definition files" and, optionally, "HTML property template" files. Unless you specify one or more "property templates," WSD will use only the information in the property definition file when it builds the Properties screens.

Property Definition Files

WSD uses different property definition files to build each Property screen so that different custom properties can be exposed for documents vs. templates vs. requests vs. directories. The property definition filenames and their associated WSD screens are:

  • docrequest.properties - Request Properties screen for Documents accessed from the Application Desktop and Submit New Request Screens
  • templaterequest.properties - Request Properties screen for Templates accessed from the Submit New Request Screen
  • document.properties - Properties screen for published Documents accessed from the Maintain Web Site or Version History screens
  • template.properties - Properties screen for published Templates accessed from the Version History screen
  • dir.properties - Properties screen for Directories accessed from the Maintain Web Site screen

These files must be placed in the WSD installation directory. Each file defines ALL custom properties you want WSD to include in the Properties screens.

Basic Property Definitions

You MUST declare one entry for each custom property. Each property definition must be placed on a separate line in the following format:

"|propertyname|screenprompt"

where "propertyname" is the name of the custom property you are declaring, and "screenprompt" is the value WSD will display as the form field prompt in the Properties screen. The prompt can include HTML tags. Some Examples are:

  • |CustomTextField|<font face="Arial,Helvetica" color="#000088" size=2>Custom Text Field:</font>
  • |PhotoCat|Type of Image
  • |ProductStatus|Available for Sale

The basic property definitions only define the existence of a property. Unless you provide additional information, these properties are used for storing textual information and the user will be able to manipulate them in the same manner as the WSD Title or Description properties. This means the WSD users will be allowed to enter up to 255 characters of text in a form field when updating these properties.

You control the user's ability to update properties by inserting additional HTML code on one or more lines immediately following the basic property definition of any custom property. You can limit the user's ability to choose property values in several ways. The remainder of this section describes these methods.

Drop-down Selection Lists

This example defines a custom Property named "Category" with a specific list of values (Catalog, Web, Custom, or Other) that will be presented as a drop-down list on property screens displayed when the data values can be assigned or changed.

|PicType|Image Category:
<tr valign=bottom><td>Image Category:</td>
<td>
<SELECT name="PicType">
<OPTION value="Catalog" {$prop:PicType$:"Catalog":selected}>Catalog Image
<OPTION value="Web" {$prop:PicType$:"Web":selected}>For Web Site Only
<OPTION value="Custom" {$prop:PicType$:"Custom":selected}>Custom Photo
<OPTION value="Other" {$prop:PicType$:"Other":selected}>Not Categorized
</OPTION></SELECT></td></tr>

Radio Button-based Values

This example shows how to set up Radio buttons to provide a choice for whether a document can be referenced externally (Never, Always, Sometimes) where WSD will display this property as radio buttons.

|RefVal|Reference Value:
<tr valign=bottom><td>Reference Value:</td>
<td align=left>
<input type=radio name="RefVal" value="No" {$prop:RefVal$:"No":checked}>Never Referenced<br>
<input type= radio name= "RefVal" value= "Yes"{$prop:RefVal$:"Yes":checked}>AlwaysReferenced<br>< /FONT>< /FONT>
<input type=radio name="RefVal" value="Maybe" {$prop:RefVal$:"Maybe":checked}>Sometimes Referenced
</td></tr>

Checkbox-based Properties

You can use Checkbox-based properties to provide an easy-to-use method to record completed tasks or to selectively associate several conditions as content properties. The following example shows how to use a single checkbox on the property screen as a method for recording a completed task associated with content:

|ShipFlag|Delivery Status:
<tr><td>Delivery Status:</td>
<td><input type=checkbox name="ShipFlag" {$prop:ShipFlag$:"on":checked}>Shipped to customer
</td></tr>

Choosing Values from WSD list-based Properties

You can create custom properties that contain values selected from lists that are managed by WSD. This means you can create a custom property, like "Approval Contact," and tell WSD to provide a drop-down list of all WSD users on the Properties screen as the choice list. You may select the list of WSD users or lists of defined Templates, Groups, Stages, and Approval Classes. The following example defines a custom property (AppContact) which is populated from the list of valid WSD users.

|AppContact|ApprovalControlled By:
<tr valign= bottom><td>ApprovalControlled By:</td>
<td><$insert userlist></td></tr>

Any WSD list can be inserted as a drop-down selection list using the following syntax:

  • <$insert userlist> -- Drop-down list of current WSD users
  • <$insert grouplist> -- Drop-down list all defined WSD user groups
  • <$insert stagelist> -- Drop-down list all defined WSD workflow stages
  • <$insert classlist> -- Drop-down list all defined WSD Approval Classes
  • <$insert templatelist(header)> -- Drop-down list of ALL WSD Header templates
  • <$insert templatelist(header,restrict)> -- Drop-down list of only those WSD Header templates assigned to the directory where the content with this property is published (restricted templates only)
  • <$insert templatelist(footer)> -- Drop-down list of ALL WSD Footer templates
  • <$insert templatelist(footer,restrict)> -- Drop-down list of only those WSD Footer templates assigned to the directory where the content with this property is published (restricted templates only)
  • <$insert templatelist(layout)> -- Drop-down list of ALL WSD Page Layout templates
  • <$insert templatelist(layout,restrict)> -- Drop-down list of only those WSD Page Layout templates assigned to the directory where the content with this property is published (restricted templates only)
  • <$insert templatelist(editlayout)> -- Drop-down list of ALL WSD Edit Layout templates
  • <$insert templatelist(editlayout,restrict)> -- Drop-down list of only those WSD Edit Layout templates assigned to the directory where the content with this property is published (restricted templates only)
  • <$insert templatelist(index)> -- Drop-down list of ALL WSD Index templates
  • <$insert templatelist(index,restrict)> -- Drop-down list of only those WSD Index templates assigned to the directory where the content with this property is published (restricted templates only)
  • <$insert templatelist(email)> -- Drop-down list of ALL WSD E-mail templates

Customizing the WSD Properties Screens

You can define HTML-based templates for displaying and editing your custom properties in WSD. The most common use for this feature is to group multiple custom properties under a single descriptive prompt to provide a more meaningful reference for your content contributors. You may have other reasons for creating a custom display.

You may include any of the following three commands in any property definition file. When present, each command must begin on a new line and be the only command on that line. These commands are:

  • ViewTemplate=filename -- WSD will use this template when creating a "view only" Properties screen
  • EditTemplate=filename -- WSD will use this template when creating a Properties screen that allows editing
  • Template=filename -- WSD will use this template for ALL Properties screens and it is your responsibility to provide the necessary <$if editing> statements when a portion of the template is different during editing than it is in view only mode.

Warning: If any of these commands is not at the beginning of the property definition file, WSD will begin creating it's property screen using what it encounters in the property definition file and then append the template-based content.

Property Screen Template Format and Syntax

Custom property templates always append as additional rows to the standard WSD properties displayed in a 2-column table. This means your template must contain one table "Row" for each custom property you are displaying or editing, where each row has 2 cells (first cell for the Prompt and the 2nd cell for the property value). For the examples below, the Property Definition Files define three (3) custom document/request properties:

  • |CustomTextField|A Text Field
  • |UserContact|A name from the list of WSD users
  • |AvailPLTs|A PLT from the list of available PLTs for this directory

Before creating templates for editing and viewing the custom properties, the property definition files contain the following lines:

|CustomTextField|Custom Text Field:
|UserContact|User Contact:
<tr><td>User Contact:</td><td><$insert userlist></td></tr>
|AvailPLTs|Sel. PLT from Avail.:
<tr><td>Sel. PLT from Avail.:</td><td><$insert templatelist(AvailPLTs,layout,restrict)></td></tr>

Creating Custom Property Templates

You can create one or more templates (three different kinds) and tell WSD to use your templates to build "View," "Edit," or combined "View and Edit" versions of the Properties screens. Your template(s) contain the HTML code WSD will use to display your custom properties. Your templates can be located almost anywhere. You tell WSD where your templates are stored by by inserting one or more template location commands as the first entries in your custom property definition files. You may declare any of the following directives:

  • EditTemplate=some_location -- this template allows users to change custom property values
  • ViewTemplate=some_location -- This template allows users to only view custom property values
  • Template=some_location -- this template allows user to both edit and view custom property values

The following examples show valid "some_Location" values for the "EditTemplate=some_location" command:

  • EditTemplate=customproperty.edittemplate -- (the property template file named "customproperty.edittemplate" is in the WSD install directory)
  • EditTemplate={$prop:templatedir$/editlayout/customproperty.edittemplate} -- (the property template file named "customproperty.edittemplate" is defined as an Edit Layout template and stored with the other Edit Layout templates)
  • EditTemplate={$prop:docroot$/_special/customproperty_edittemplate.htm} -- (the property template file named "customproperty_edittemplate.htm" is stored in the /_special sub-directory under the Document Root directory)

Creating a Custom Property "EditTemplate"

Using EditTemplates allows you to simplify the content of your custom property definitions, making the contents of those files easier to understand. For our EditTemplate example, the Property Definition Files define three (3) custom properties associated with documents and requests. These are:

  • |CustomTextField|A Text Field
  • |UserContact|A name from the list of WSD users
  • |AvailPLTs|A PLT from the list of available PLTs for this directory

Before creating our EditTemplate, the property definition files contain the following lines:

|CustomTextField|Custom Text Field:
|UserContact|User Contact:
<tr><td>User Contact:</td><td><$insert userlist></td></tr>
|AvailPLTs|Sel. PLT from Avail.:
<tr><td>Sel. PLT from Avail.:</td><td><$insert templatelist(AvailPLTs,layout,restrict)></td></tr>

We create our EditTemplate including the following lines:

<tr><td>Custom Text Field:</td>
<td><input type=text name="CustomTextField" size=46 value="<$prop:CustomTextField$>"></td></tr>
<tr><td>User Contact:</td>
<td><$insert userlist(UserContact)></td></tr>
<tr><td>Sel. PLT from Avail.:</td>
<td><$insert templatelist(AvailPLTs,layout,restrict)></td></tr>

And, after we place our EditTemplate file (named: customproperty.edittemplate) in the WSD install directory and remove the items now contained in our EditTemplate, our custom property definition file contains the following lines:

EditTemplate=customproperty.edittemplate
|CustomTextField|Custom Text Field:
|UserContact|User Contact:
|AvailPLTs|Sel. PLT from Avail.:

Remember: We tell WSD where our EditTemplate is located by inserting a "EditTemplate= some_location"line as the 1st line of our configuration file. Examples of valid "some_Location" values are:

  • EditTemplate=customproperty.edittemplate -- (the property template file named "customproperty.edittemplate" is in the WSD install directory)
  • EditTemplate={$prop:templatedir$/editlayout/customproperty.edittemplate} -- (the property template file named "customproperty.edittemplate" is defined as an Edit Layout template and stored with the other Edit Layout templates)
  • EditTemplate={$prop:docroot$/_special/customproperty_edittemplate.htm} -- (the property template file named "customproperty_edittemplate.htm" is stored in the /_special sub-directory under the Document Root directory)

Creating a Custom Property "ViewTemplate"

We can also create a property "ViewTemplate" that contains the HTML code WSD will use to display our custom properties when the properties can not be changed by WSD users (a "view only" mode). Unless you have associated properties that you want to display on a single line, you should let WSD manage the display from the definition file. For our example, we have defined 4 properties named D1WeekDay, D1Month, D1Day, and D1Year that, when combined define a value users consider a single entity called the "Next Modify Date." We want users to see these fields on a single line of the Property screens in the form: "Next Modify Date" followed by the values for D1WeekDay, D1Month, D1Day, and D1Year.

The property definition files contain the following lines:

|D1WeekDay|<font face="Arial,Helvetica" color="#000088" size=2>Next Modify Date:</font>
<tr valign=bottom><td><font face="Arial,Helvetica" color="#000088" size=2><b>Date-1:</b></font></td>
<td><font face="Arial,Helvetica" color="#000088" size=2><SELECT name=D1WeekDay>
<OPTION value= "" {$prop:D1WeekDay$:"":selected}>None
<OPTION value="Monday" {$prop:D1WeekDay$:"Monday":selected}>Monday
<OPTION value="Tuesday" {$prop:D1WeekDay$:"Tuesday": selected}>Tuesday
<OPTION value="Wednesday" {$prop:D1WeekDay$:"Wednesday": selected}>Wednesday
<OPTION value="Thursday" {$prop:D1WeekDay$:"Thursday": selected}>Thursday
<OPTION value="Friday" {$prop:D1WeekDay$:"Friday":selected}>Friday
<OPTION value="Saturday" {$prop:D1WeekDay$:"Saturday": selected}>Saturday
<OPTION value="Sunday" {$prop:D1WeekDay$:"Sunday": selected}>Sunday
</OPTION>
</SELECT>
|D1Month|<font face="Arial,Helvetica" color="#000088" size=2>Modify Month:</font>
<SELECT name=D1Month>
<OPTION value="" {$prop:D1Month$:"":selected}>None
<OPTION value="January" {$prop:D1Month$:"January":selected}>January
<OPTION value="February" {$prop:D1Month$:"February": selected}>February
<OPTION value="March"{$prop:D1Month$:"March": selected}>March
<OPTION value="April" {$prop:D1Month$:"April": selected}>April
<OPTION value="May" {$prop:D1Month$:"May": selected}>May
<OPTION value="June" {$prop:D1Month$:"June": selected}>June
<OPTION value="July" {$prop:D1Month$:"July": selected}>July
<OPTION value="August" {$prop:D1Month$:"August": selected}>August
<OPTION value="September" {$prop:D1Month$:"September": selected}>September
<OPTION value="October" {$prop:D1Month$:"October": selected}>October
<OPTION value="November" {$prop:D1Month$:"November": selected}>November
<OPTION value="December" {$prop:D1Month$:"December": selected}>December
</OPTION>
</SELECT>
|D1Day|<font face="Arial,Helvetica" color="#000088" size=2>Modify Day:</font>
<SELECT name=D1Day>
<OPTION value="" {$prop:D1Day$:"":selected}>None
<OPTION value="1" {$prop:D1Day$:"1":selected}>1
<OPTION value="2" {$prop:D1Day$:"2":selected}>2
<OPTION value="3" {$prop:D1Day$:"3":selected}>3
<OPTION value="4" {$prop:D1Day$:"4":selected}>4
<OPTION value="5" {$prop:D1Day$:"5":selected}>5
<OPTION value="6" {$prop:D1Day$:"6":selected}>6
<OPTION value="7" {$prop:D1Day$:"7":selected}>7
<OPTION value="8" {$prop:D1Day$:"8":selected}>8
<OPTION value="9" {$prop:D1Day$:"9":selected}>9
<OPTION value="10" {$prop:D1Day$:"10":selected}>10
<OPTION value="11" {$prop:D1Day$:"11":selected}>11
<OPTION value="12" {$prop:D1Day$:"12":selected}>12
<OPTION value="13" {$prop:D1Day$:"13":selected}>13
<OPTION value="14" {$prop:D1Day$:"14":selected}>14
<OPTION value="15" {$prop:D1Day$:"15":selected}>15
<OPTION value="16" {$prop:D1Day$:"16":selected}>16
<OPTION value="17" {$prop:D1Day$:"17":selected}>17
<OPTION value="18" {$prop:D1Day$:"18":selected}>18
<OPTION value="19" {$prop:D1Day$:"19":selected}>19
<OPTION value="20" {$prop:D1Day$:"20":selected}>20
<OPTION value="21" {$prop:D1Day$:"21":selected}>21
<OPTION value="22" {$prop:D1Day$:"22":selected}>22
<OPTION value="23" {$prop:D1Day$:"23":selected}>23
<OPTION value="24" {$prop:D1Day$:"24":selected}>24
<OPTION value="25" {$prop:D1Day$:"25":selected}>25
<OPTION value="26" {$prop:D1Day$:"26":selected}>26
<OPTION value="27" {$prop:D1Day$:"27":selected}>27
<OPTION value="28" {$prop:D1Day$:"28":selected}>28
<OPTION value="29" {$prop:D1Day$:"29":selected}>29
<OPTION value="30" {$prop:D1Day$:"30":selected}>30
<OPTION value="31" {$prop:D1Day$:"31":selected}>31
</OPTION>
</SELECT>,
|D1Year|<font face="Arial,Helvetica" color="#000088" size=2>Modify Year:</font>
<SELECT name=D1Year>
<OPTION value="" {$prop:D1Year$:"":selected}>None
<OPTION value="1998" {$prop:D1Year$:"1998":selected}>1998
<OPTION value="1999" {$prop:D1Year$:"1999":selected}>1999
<OPTION value="2000" {$prop:D1Year$:"2000":selected}>2000
<OPTION value="2001" {$prop:D1Year$:"2001":selected}>2001
<OPTION value="2002" {$prop:D1Year$:"2002":selected}>2002
<OPTION value="2003" {$prop:D1Year$:"2003":selected}>2003
<OPTION value="2004" {$prop:D1Year$:"2004":selected}>2004
<OPTION value="2005" {$prop:D1Year$:"2005":selected}>2005
<OPTION value="2006" {$prop:D1Year$:"2006":selected}>2006
</OPTION></SELECT></font></td></tr>

The definition above displays all four data entry/change fields on the same line when users edit the date. Unless we build a "ViewTemplate" file, these properties will appears as 4 different lines when WSD displays our properties in "view Only" mode. The following ViewTemplate will cause WSD to display our 4 properties on a single line of the properties screens:

<tr><td>Next Modify Date:</td>
<td><$prop:D1WeekDay$>, <$prop:D1Month$> <$prop:D1Day$>, <$prop:D1Year$></td></tr>

Remember: We tell WSD where our View template is by inserting a "ViewTemplate= some_location"line as the first line of our configuration file. Examples of valid "some_Location" values are:< /FONT> < /FONT>

  • EditTemplate=customproperty.viewtemplate -- (the property template file named "customproperty.viewtemplate" is in the WSD install directory)
  • EditTemplate={$prop:templatedir$/editlayout/customproperty.viewtemplate} -- (the property template file named "customproperty.viewtemplate" is defined as an Edit Layout template and stored with the other Edit Layout templates)
  • EditTemplate={$prop:docroot$/_special/customproperty_viewtemplate.htm} -- (the property template file named "customproperty_viewtemplate.htm" is stored in the /_special sub-directory under the Document Root directory)

Creating a single Template that combines Edit and View

You can create a single template that provides all of the HTML WSD needs to display Property screens regardless of whether a user id editing or only viewing your custom properties. The <$if editing> command allows you to tell WSD what you want to display differently in each mode. The following template is a modified version of our previously defined EditTemplate, and can be used to display our custom properties in all modes. Before creating our template, the Property Definition Files define three (3) custom document/request properties:

  • |CustomTextField|A Text Field
  • |UserContact|A name from the list of WSD users
  • |AvailPLTs|A PLT from the list of available PLTs for this directory

And, the property definition files contain the following lines:

|CustomTextField|Custom Text Field:
|UserContact|User Contact:
<tr><td>User Contact:</td><td><$insert userlist></td></tr>
|AvailPLTs|Sel. PLT from Avail.:
<tr><td>Sel. PLT from Avail.:</td><td><$insert templatelist(AvailPLTs,layout,restrict)></td></tr>

Our combination Edit and View Template contains the following lines:

<tr><td>Custom Text Field:</td>
<td><$if editing><input type= text name= "CustomTextField" size= 46value= "<$prop:CustomTextField$>"><$else><$prop:CustomTextField$><$endif></td></tr><BR><tr><td>User Contact:</td>
<td><$if editing><$insert userlist(UserContact)><$else><$prop:UserContact.username$><$endif></td></tr>
<tr><td>Sel. PLT from Avail.:</td>
<td><$if editing><$insert templatelist(AvailPLTs,layout,restrict)><$else><$prop:AvailPLTs$><$endif></td></tr>

And, after we place our combined Edit/View template file (named: customproperty.stdtemplate) in the WSD install directory and remove the items now contained in our template, our custom property definition file contains only the following lines:

Template=customproperty.stdtemplate
|CustomTextField|Custom Text Field:
|UserContact|User Contact:
|AvailPLTs|Sel. PLT from Avail.:

Remember: We tell WSD where our combined template is by inserting a "Template= some_location"line as the 1st line of our configuration file. Examples of valid "some_Location" values are:

  • EditTemplate=customproperty.stdtemplate -- (the property template file named "customproperty.stdtemplate" is in the WSD install directory)
  • EditTemplate={$prop:templatedir$/editlayout/customproperty.stdtemplate} -- (the property template file named "customproperty.stdtemplate" is defined as an Edit Layout template and stored with the other Edit Layout templates)
  • EditTemplate={$prop:docroot$/_special/customproperty_stdtemplate.htm} -- (the property template file named "customproperty_stdtemplate.htm" is stored in the /_special sub-directory under the Document Root directory)

Custom Property Samples

WSD is installed with several example files stored in the "Edit Layout" template directory. these files provide specific examples on usage and can be copied and modified for your own use. The following files should either be deleted or moved to the WSD install directory:

  • docrequest.properties - Request Properties screen for Documents accessed from the Application Desktop and Submit New Request Screens
  • templaterequest.properties - Request Properties screen for Templates accessed from the Submit New Request Screen
  • document.properties - Properties screen for published Documents accessed from the Maintain Web Site or Version History screens
  • template.properties - Properties screen for published Templates accessed from the Version History screen
  • dir.properties - Properties screen for Directories accessed from the Maintain Web Site screen

The following files can either be used directly from the Edit Layout template directory or moved to another location on your server:

  • custom_props.edit -- Custom Property Screen "EditTemplate"
  • custom_props.view -- Custom Property Screen "ViewTemplate"
  • custom_props.edit_and_view -- Combined Custom Property Edit and View template

Copyright 2000-2005 CyberTeams, Inc., http://www.cyberteams.com All rights reserved.
CyberTeams and WebSite Director are registered trademarks of CyberTeams, Inc. All other marks are the property of their respective owners.