Example: Adding a custom action to the TCM application

You can add an action button to a view in the TCM application user interface that links to an external web application.

NOTE  The design and creation of external web applications is beyond the scope of this help topic. The following assumes that you have a working web application that you want to link to from the TCM application.

Assume that you wish to add an action button to the Tasks tab that allows users to link to your custom status reporting application. Your action button is labeled "make status report" and links to an application at http://appserver.example.com/example/TaskReport.jsp.

  1. Open the TCMconfig.xml file for editing. By default, the file is located at:

    C:\Program Files\FileNet\Collaboration\Web\WEB-INF\config\
  2. Examine the definition of the TaskInfoView view to see that the list of available actions depends on the action set. Assume for this example that you want to make your action button available for both the TaskOpen and TaskClosed state. Add the highlighted lines to enable your button:
        <view id="TaskInfoView">
    <module>ObjectInfoView</module>
    <sub-module>LinksInfoViewManager</sub-module>
    <sub-views>
    <view>TaskGeneral</view>
    <view>TaskLinksView</view>
    </sub-views>
    <actions>
    <when actionset="TaskOpen">
    <action>AddTask</action>
    <action>AddSubTask</action>
    <action>EditTask</action>
    <action>DeleteTask</action>
    <action>CompleteTask</action>
    <action>Subscribe</action>
    <action>SendMessage</action>
    <action>CopyToClipboard</action>
    <action>MakeReport</action>
    </when>
    <when actionset="TaskClosed">
    <action>AddTask</action>
    <action>ReopenTask</action>
    <action>DeleteTask</action>
    <action>SendMessage</action>
    <action>CopyToClipboard</action>
    <action>MakeReport</action> </when>
    </actions>
    </view>
  3. Add an action to the "task actions" section to link the action button to an external URL for your application. Locate the task actions section, and add an action id similar to the highlighted section below. Note that the <type> must be changed to "external" and the <url> tags enclose the URL for your web application. The AddTask action is included for comparison.
  4.     <!-- task actions -->
    <action id="AddTask">
    <form-action>false</form-action>
    <help-topic>addtask</help-topic>
    <label localKey="cwexml.TCMConfig_xml.addTaskLabel">new&#160;top-level&#160;task</label>
    <tooltip localKey="cwexml.TCMConfig_xml.addTaskTooltip">Add a Top-level Task</tooltip>
    <type>helper</type>
    <mode>contentarea</mode>
    <module>AddTask</module>
    <applies-to>
    <object-type>tasks</object-type>
    <object-type>task</object-type>
    </applies-to>
    <access-control>create-operation</access-control>
    <action-check>isTeamspaceActive</action-check>
    </action> <action id="MakeReport">
    <form-action>false</form-action>
    <label localKey="cwexml.TCMConfig_xml.makeReportLabel">make&#160;status&#160;report</label>
    <tooltip localKey="cwexml.TCMConfig_xml.makeReportTooltip">Make a Status Report</tooltip>
    <type>external</type>
    <url>
    <string-value>http://appserver.example.com/example/TaskReport.jsp</string-value>
    <param name=”guid”>
    <context-value>ObjectId</context-value>
    </param>
    <param name=”type”>
    <string-value>task</string-value>
    </param>
    </url>
    <applies-to>
    <object-type>tasks</object-type>
    <object-type>task</object-type>
    </applies-to>
    <access-control>view-operation</access-control>
    <action-check>isTeamspaceActive</action-check>
    </action>
  5. Additional notes on the above sample code:

    The above code will generate URLs of this form:

  6. http://appserver.example.com/example/TaskReport.jsp&guid=%7B64C95D5C-6C7F-47A7-8E70-ED7206DBA26A%7D&type=task  
  7. Add entries to the resource file cwexml.strings.<locale>.prb for the action button label and the tool tip. If your button label string has more than one word, replace the space character with "u00A0" to insert a non-breaking space. Your entries would look similar to this:
  8. cwexml.TCMConfig_xml.makeReportLabel=makeu00A0statusu00A0report 
    cwexml.TCMConfig_xml.makeReportTooltip=Make a Status Report 
  9. Save and close all files. Recycle the Application Server (Tomcat, Weblogic, etc.) to eliminate any cached copies of the configuration files, then restart the Collaboration Engine.