Initializing the server and establishing client session

  1. Configure the Portal Channel

    The following code is an example of the entry in the toolkit configuration file (the btt.xml file on the server-side ) for the Portal Channel configuration. Multichannel support requires the specification of the request handler and the presentation handler. For the Portal Channel, the request handler is com.ibm.btt.portal.base.PortalRequestHandler, and the presentation handler is com.ibm.btt.portal.base.PortalPresentationHandler.

    <kColl id="portal">
    	<field id="requestHandler" value="com.ibm.btt.portal.base.PortalRequestHandler" />
    	<field id="presentationHandler" value="com.ibm.btt.portal.base.PortalPresentationHandler" />
    	<field id="filePath" value="/btt/jsp/" />
    	<field id="errorPage" value="error.jsp" />
    	<field id="homePage" value="mainframe.jsp" />
    	<field id="startUpOp" value="startUpHtmlSessionOp" />
    </kColl>

    Attributes used for the Portal Channel are listed in the following table.

    Table 1. Portal Channel attributes
    Attribute Name Description
    filePath The file path that is relative to the web application server default web path. The Web resources (typically JSP files) are obtained using this path.
    errorPage The name of a JSP that is displayed when a system exception occurs.
    homepage Specifies the JSP that builds the HTML page which serves as the entry point to the application. This is the name of the JSP that will be used as the response page for the creating session request. After the client session is established, the client is presented with this page as the entry point to the portlet application.
    startUpOp The name of the operation to which is be executed by the creating session request when called by the web browser client.
  2. Configure the portlet

    The init parameters of the portlet should be configured. See the following code for example:

    	<portlet>
    		...
    		<init-param>
    			<name>dsePath</name>
    			<value>jar:///btt.xml</value>
    		</init-param>
    		<init-param>
    			<name>com.ibm.btt.portal.homePage</name>
    			<value>mainframe1.jsp</value>
    		</init-param>
    		...
    	</portlet>

    The parameters related to the portlet init are described in the following table.

    Table 2. Portlet init parameters
    Parameter Name Description
    dsePath The btt.xml file path. For example, jar:///btt.xml.
    com.ibm.btt.portal.homePage Specifies the JSP that builds the HTML page which serves as the entry point to the application. This is the name of the JSP that will be used as the response page for the creating session request. After the client session is established, the client is presented with this page as the entry point to the portlet application. It has higher priority than the homePage attribute in the btt.xml file.
  3. Initialize the server

    The init method of the BTTBasePortlet class delivered by BTT is responsible for initializing the BTT runtime environment. You can extend the BTTBasePortlet class and override it, and then add your initialization. See the following code for example:

    	public class MyBasePorlet extends BTTBasePortlet {
    	    public void init() throws PortletException {
    	        super.init();
    	        initMyServer();
    	    }
    	    private void initMyServer() {
    				...
    	    }
    	}
  4. Establish the client session
    1. Define the client startup operation in the dseoper.xml file

      The Operation id value must be same as the startUpOp attribute value which is defined in the Portal Channel configuration in the btt.xml file. See the following code for example:

      <operation id="startUpHtmlSessionOp" context="startupHtmlCtx" 
      implClass="test.StartHtmlSession"/>
    2. Define the client session context

      Add the Portal Channel session Context definition to the dsectxt.xml file. The Context id value must be same as the one which is used in the execute method of the startup Operation (defined in the previous step). See the following code for example:

      	<context id="sessionCtx" parent="branchServer" type="session">
      		<refKColl refId="sessionData" />
      	</context>
    3. Define the client session date

      Add the Portal Channel session data definition to the dsedata.xml file. See the following code for example:

      	<kColl id="sessionData">
      		<refData refId="userId" />
      		<refData refId="HostBuff" />
      		<refData refId="sessionID" />
      		<refData refId="locale" />
      		<refData refId="dse_errorMessages" />
      		<refData refId="accounts" />
      	</kColl>