Example: Changing default poll responses

The following are the groups of TCM default poll responses:

Assume that you want to add a new group to the list for polls about meeting refreshments:

Use the following procedure to make this set of responses available for all polls:

  1. Open the file appConfig.xml for editing. (By default the appConfig.xml file is located in the C:\Program Files\FileNet\Collaboration\TCM\WEB_INF\Config folder on the Collaboration Engine.)
  2. Search for the poll object type, or the <responseset-definition> tag. Specifically, you should find this:
        <object-type id="poll">
<label localKey="cwexml.appConfig_xml.typePoll">Poll</label>
<image>Poll16</image>
<image type="open">Poll16</image>
<image type="openNeedsResponse">PollOpenNeedsResponse16</image>
<image type="openResponded">PollOpenResponded16</image>
<image type="closed">PollClosed16</image>
<actionset-definition>PollActions</actionset-definition>
<responseset-definition>YesNoMaybe</responseset-definition>
<responseset-definition>YesNo</responseset-definition>
<responseset-definition>ApproveReject</responseset-definition>
</object-type>
  1. Create a new response set definition for your custom list by inserting the following line into the above list:
    <responseset-definition>CoffeeTeaWaterSoda</responseset-definition>
  2. Note that the above step added a reference to the new response set, but did not actually define the text to display to the user. Add a response set definition id for your new set of responses, and provide a resource key for it. To do this, search for the response set definition ids for the other entries. (Search for the string "ApproveReject" for example.) Within the response set definition id, each response is also listed. A response set definition id looks like this:
        <responseset-definition id="ApproveReject">
    <label localKey="cwexml.appConfig_xml.responseApproveReject">Approve; Reject</label>
    <responses>
    <response>ResponseApprove</response>
    <response>ResponseReject</response>
    </responses>
    </responseset-definition>
  3. Using the above as a guide, insert the following code for your new set:
    <responseset-definition id="CoffeeTeaWaterSoda">
<label localKey="cwexml.appConfig_xml.responseCoffeeTeaWaterSoda">Coffee; Tea; Water; Soft Drinks</label>
<responses>
<response>ResponseCoffee</response> <response>ResponseTea</response> <response>ResponseWater</response>
<response>ResponseSoftDrink</response>
</responses>
</responseset-definition>
  1. Add the labels for your new poll responses to the list of poll responses. Search for "poll response items" to find the other labels:
  2.  <!-- poll response items -->
     <response id="ResponseYes">
          <label localKey="cwexml.appConfig_xml.responseYes">Yes</label>
     </response>
     <response id="ResponseNo">
          <label localKey="cwexml.appConfig_xml.responseNo">No</label>
     </response>
     <response id="ResponseMaybe">
          <label localKey="cwexml.appConfig_xml.responseMaybe">Maybe</label>
     </response>
     <response id="ResponseApprove">
          <label localKey="cwexml.appConfig_xml.responseApprove">Approve</label>
     </response>
     <response id="ResponseReject">
          <label localKey="cwexml.appConfig_xml.responseReject">Reject</label>
     </response>
             
  3. Add the following definitions for the response labels. Each local key value must be unique:
  4. 	<reponse id="ResponseCoffee">
    <label localkey=”cwexml.appConfig_xml.labelCoffee>Coffee</label>
    </response>
    <response id="ResponseTea">
    <label localkey=”cwexml.appConfig_xml.labelTea>Tea</label>
    </response>
    <response id="ResponseWater">
    <label localkey=”cwexml.appConfig_xml.labelWater>Water</label>
    </response>
    <response id="ResponseSoftDrink">
    <label localkey=”cwexml.appConfig_xml.labelSoftDrink>Soft Drink</label>
    </response>
  5. As an option you can add the strings for the new responses to a localizable resource file. Resource files allow you to isolate changes related to translating strings in the user interface into other languages, and other changes for different locales. If you do not add the keys for your new response strings to the resource file, the application uses the values set in the XML file.
  6. To make this change, open the resource file cwexml.strings.< locale >.prb for editing. This file is located by default in the Collaboration\TCM\WEB_INF\resources folder on the Collaboration Engine. (The <locale> identifies the language and locale. You may have different versions of the resource string file for different localized versions.) Add the keys and the string values for your new responses to the file. For this example, add the following lines:

    	cwexml.appConfig_xml.responseCoffeeTeaWaterSoda=Coffee; Tea; Water; Soft Drinks 
    	cwexml.appConfig_xml.labelCoffee=Coffee
    	cwexml.appConfig_xml.labelTea=Tea
    	cwexml.appConfig_xml.labelWater=Water
    	cwexml.appConfig_xml.labelSoftDrinks=Soft Drinks
  7. If the same response appears in more than one response set, you need only one entry for that response in the resource file. For example, there are two default response sets that use ResponseYes and ResponseNo. You need only one entry in the cwexml.strings.<locale>.prb file for each response.
  8. Save and close the resource file and appConfig.xml. Restart the Application Engine (Weblogic, etc.) to eliminate any cached copies of the configuration files, then restart the Collaboration Engine.