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
- 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;
}
- Add the trigger script in the data_entry_properties.xml
file.
- Create a servlet that implements
AsyncEnabled
and
RequestResponseEnabled
interfaces.
- 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>
- Create a JSP to render response from servlet and place the JSP in the
$TOP/public_html/user
folder.
- Create a JAR for compiled extension code and place it in class path for the Admin UI:
- Add custom JAR entry in the
$TOP/bin/conf/classpath/jars-custom.txt
file.
- Run the
$TOP/bin/conf/updateRtClasspath.sh
file.
- Create a JAR for compiled extension code and set the class path in the WebSphere® Application Server for the Persona-based UI.
- Restart the Admin UI and the Persona-based UI Servers.
- In the Admin UI, create an entry preview
script in the Script Console of the Admin UI.
- Click New, and then select container type, Catalog, and input
parameter specs.
- In the Selected type list, select
Regular.
- 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;
}
- 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.