Enabling Custom Tabs by using Trigger scripts

You can enable Custom Tabs in the Persona-based UI by using Trigger scripts.

Before you begin

For Custom Tabs support, you should first install and configure Hazelcast.

Procedure

  1. In the Admin UI, create a trigger script in the Script Console.
    Following is a sample trigger script:
    function getURL(entry){
    var itemId = 0;
    itemId =entry.getEntryId();
    var colArea= getColAreaByName("Camera Features");
    var url="/CustomTab.wpc?itemId="+itemId+"&collabId="+colArea.getColAreaId();
    return url;
    }
  2. Add the trigger script in the data_entry_properties.xml file.
  3. Create a servlet that implements AsyncEnabled and RequestResponseEnabled interfaces.
  4. Create servlet and JSP mapping in the flow-config.xml file.
    <flow path=" CustomTab" command="com.test.CustomTab" method="entryPoint">
    <flow-dispatch name="ok" location="/user/custom_tab.jsp" dispatchType="forward" />
    </flow>
  5. Create a JSP to render response from servlet and place the JSP in the $TOP/public_html/user folder.
  6. Create a JAR for compiled extension code and place it in class path for the Admin UI:
    1. Add custom JAR entry in the $TOP/bin/conf/classpath/jars-custom.txt file.
    2. Run the $TOP/bin/conf/updateRtClasspath.sh file.
  7. Create a JAR for compiled extension code and set the class path in the WebSphere® Application Server for the Persona-based UI.
    Servers > Server Types > > WebSphere Application servers > mdmui > Java and Process Management > Process definition > Java Virtual Machine
  8. Restart the Admin UI and the Persona-based UI Servers.
  9. In the Admin UI, create an entry preview script in the Script Console of the Admin UI.
    1. Click New, and then select container type, Catalog, and input parameter specs.
    2. In the Selected type list, select Regular.
    3. Implement getURL() method, as illustrated in the following sample:
      function getURL(entry){
      var pk = entry.getEntryId();
      var content = "/user/ SamplePage.jsp?mdmId="+pk;
      return content;
      }
    4. Copy the JSP file to the $TOP/public_html/user folder.
    Important: You can integrate a Custom Tab for a user-defined custom stand-alone JSP with the following limitations:
    • Place in the $TOP/public_html/user folder.
    • Should not contain any static includes such as
      • <%@ include file=/utils/header.jsp.include %>
      • %> <%@ include file=/utils/footer.jsp.include %>
    • Should contain all the required JAVA imports.

Results

Select an item from the Catalog Explorer or a collaboration area and the custom tab is visible in the single-edit page. The configured scripts runs and resulting JSP is displayed in the tab.