The UDTT Smart client-side data collectors provide API to help collect the data from client and send to server side in order to record data into database.
Following are the general steps for smart client collector:
1 Add following jars into the web project: bttsmartchannel.jar, bttweb2collector.jar, bttweb2.jar, bttcore.jar, dwr.jar into the java build path and Java EE module.
2 Install Web2.0 feature pack for WAS, and copy the JSON4J.jar into the EAR project, and add it as the web project library. The JSON4J.jar is located at ${app_server_root}\web2fep\optionalLibraries\JSON4J.
3 Download the dwr.jar and copy it into the EAR project, and add it as the web project library. DWR is available under the Apache Software License v2 (http://www.apache.org/licenses/LICENSE-2.0.html). Download the file dwr.jar from http://directwebremoting.org/dwr/downloads/index.html.
The UDTT Smart visit client collector provides API to help collect the data when user logon and logout. To add smart visit collector to my project to collect the data when user logon and logout, you can:
2 Copy the file clientCollector.jsp from the bttweb2collector/client/collector directory into the web directory of the web project. Add bttweb2.jar into the build path and Java EE Module Dependencies of the web project.
3 Integrate the file clientCollector.jsp into the login destination web page to invoke the collector. Following is the sample code:
The UDTT Smart preference client collector provides API to help collect the data when users save the interested business items. To add smart preference client collector to project to collect the data when users save the interested business items, you can:
2 Copy the file clientCollector.jsp from the bttweb2collector/client/collector directory into the web directory of the web project. Add bttweb2.jar into the build path and Java EE Module Dependencies of the web project. Update the following code according to the real project:
The profileRootPath is the root path of all the user profiles. In this sample, the profiles are located at the BTTXMLfolder.
The daoConfigPath is the path of the Web2ProfileDAO.xml. This file is packaged in the profileDefinitions folder of the bttweb2collector.jar. You can also copy it into your project, and then configure the real path in the daoConfigPath.
The daoIdis the id of the profileDAO pattern of the UDTT web2.0 framework. There are two patterns: BTTWeb2ProfileFileDAOand BTTWeb2ProfileDB2DAO.
3 Integrate the clientCollector.jsp file into the web page in which the preference data is collected. Following is the sample code:
The UDTT Smart behavior client collector provides API to help collect the data when users view the transaction information. To add smart behavior client collector to project to collect the data when users view the transaction information, you can:
2 Copy the file clientCollector.jsp from the bttweb2collector/client/collector directory into the web directory of the web project. Add file bttweb2.jar into the build path and Java EE Module Dependencies of the web project.
3 Create a .js script to define following code for preference collector.
saveBehaviorData(0,servId);
4 Invoke the method to save behavior. Following is the sample code: