Runtime tools : Service components : Smart channel services : Smart data collector : Client collector : Smart preference client collector
  
Smart preference client collector
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:
1 Refer to general steps in Client collector.
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:
<%
String profileRootPath=request.getRealPath("/")+"//BTTXML//";
String daoConfigPath="jar:///profileDefinitions/Web2ProfileDAO.xml";
String daoId="BTTWeb2ProfileFileDAO";
%>
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:
<script type="text/javascript">
BTTDemoPage.savePage=function(){
savePreferenceData(); }
</script>
Invoke the method to save preference. Following is the sample code:
<a href="javascript:void(BTTDemoPage.savePage())" id="save_page"></a>