Running Integration Objects

The processRequest() method is used to run Integration Objects in standard portlets and special considerations have to be made for Integration Object chaining.

For Integration Object chaining (see Integration Object chaining) the same connection must be used by all Integration Objects in the chain. When using the processRequest() method to run the Integration Object, the key that represents the connection for the Integration Object chain must be extracted from the first Integration Object in the chain and set on subsequent Integration Objects in the chain. The connection can be extracted from the first Integration Object using the getHPubLinkKey() method and set on subsequent IOs using the setHPubLinkKey().

The key representing the connection is passed across JSP as a parameter on the HttpServletRequest object by adding a hidden input field to a FORM as shown:
<INPUT TYPE="HIDDEN" NAME="<%CommonConstants.HPUB_LINK_KEY%>"VALUE="<%=FirstInChainIO.getHPubLinkKey()%>"/>
The subsequent JSP then retrieves it using the getParameter() method and sets it on the subsequent Integration Object as shown:
<% MiddleInChainIO.setHPubLinkKey((String)request.getParameter(CommonConstants.HPUB_LINK_KEY)); %>

When the Forward To URL action is used to pass the connection being used by the HATS Portlet to the Integration Object(s), the key representing the connection is saved in the CommonConstants.HPUB_LINK_KEY attribute of the PortletRequest object.

In this case, the user must edit the JSP that gets control from the Forward To URL Action to retrieve the key from the PortletRequest object and set it for the first Integration Object calling the setHpubLinkKey() method, as shown below:

<% ExampleIO.setHPubLinkKey((String)request.getAttribute(CommonConstants.HPUB_LINK_KEY)); %>

The following statements also have to be added to the JSP that gets control from the Forward To URL action, regardless of whether it's an input page that gathers the data required by the Integration Object, or an output page that presents the results after the Integration Object is run:

<%@ taglib uri="http://java.sun.com/portlet" prefix="portletAPI" %>
<portletAPI:defineObjects/>

If the JSP that gets control from the Forward To URL action is an input page, the application developer is also required to modify the FORM statement by replacing the use of the request and response objects with the portlet renderRequest and renderResponse objects as shown below:

<FORM NAME="iojsp_ExampleIOOutput" METHOD="POST"
ACTION='<%= renderResponse.encodeURL(renderRequest.getContextPath() + "/iojsp/ExampleIOOutput.jsp")%>'>