public class ExperimentLoggingECEventListenerImpl
extends com.ibm.commerce.event.impl.AbstractECEventListener
When customizing the experiment statistics, this class needs to be extended to persist the customer's actions to the EXPLOG logging table by doing the following:
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String | CLICKED
This field contains a constant specifies that the test element was clicked by the user.
|
static java.lang.String | COPYRIGHT
IBM copyright notice field.
|
protected static java.lang.String | SQL_EXPLOG_UPDATE_BEGIN
This field contains a SQL fragment to update the Experiment Logging table, part 1 of 3.
|
protected static java.lang.String | SQL_EXPLOG_UPDATE_END
This field contains a SQL fragment to update the Experiment Logging table, part 3 of 3.
|
protected static java.lang.String | SQL_EXPSTATS_UPDATE_BEGIN
This field contains the SQL fragment to update the Experiment Statistics table, part 1 of 4.
|
protected static java.lang.String | SQL_EXPSTATS_UPDATE_END
This field contains the SQL fragment to update the Experiment Statistics table, part 4 of 4.
|
Constructor and Description |
---|
ExperimentLoggingECEventListenerImpl()
Creates an instance of the experiment logging event listener.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Class | getECEventContainer()
This method returns the class ExperimentLoggingEventContainer as the event container.
|
java.util.Set | getEvents()
This method returns a set containing the extension name for the experiment logging event.
|
protected ExperimentLoggingDataBean | getExperimentLoggingData(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent cbe)
This method extracts the experiment logging data from the common base event.
|
protected void | insertLog(ExperimentLoggingDataBean expLogData)
This method inserts a new row into the EXPLOG table.
|
protected void | insertStatistics(ExperimentLoggingDataBean expLogData)
This method inserts a new row in the EXPSTATS table.
|
void | processEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent commonBaseEvent)
This method processes experiment logging common base events.
|
protected void | processExperimentLoggingEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent cbe) |
protected void | processExperimentLoggingEvent(ExperimentLoggingDataBean expLogData)
This method checks the Experiment event data for custom fields, and updates the statistics and log tables.
|
protected boolean | queryLog(ExperimentLoggingDataBean expLogData, boolean checkView)
This method checks whether or not the user has seen or clicked this test element before in the same session with the same results.
|
protected boolean | queryStatistics(ExperimentLoggingDataBean expLogData)
This method checks whether or not the test element has already been recorded in the statistics table.
|
void | setTestData(ExperimentLoggingDataBean expId)
Reserved for IBM internal use.
|
protected void | updateLog(java.lang.String sql, java.lang.String experimentId, java.lang.String testElementId, java.lang.String storeId, java.lang.String sessionId)
This method updates the data in the EXPLOG table.
|
protected void | updateStatistics(java.lang.String sql, java.lang.String experimentId, java.lang.String testElementId, java.lang.String storeId)
This method updates the data in the EXPSTATS table.
|
public static final java.lang.String COPYRIGHT
protected static final java.lang.String SQL_EXPLOG_UPDATE_BEGIN
protected static final java.lang.String SQL_EXPLOG_UPDATE_END
protected static final java.lang.String SQL_EXPSTATS_UPDATE_BEGIN
protected static final java.lang.String SQL_EXPSTATS_UPDATE_END
protected static final java.lang.String CLICKED
public ExperimentLoggingECEventListenerImpl()
public void processEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent commonBaseEvent)
protected void processExperimentLoggingEvent(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent cbe)
protected boolean queryStatistics(ExperimentLoggingDataBean expLogData)
protected void insertStatistics(ExperimentLoggingDataBean expLogData) throws java.sql.SQLException
protected void updateStatistics(java.lang.String sql, java.lang.String experimentId, java.lang.String testElementId, java.lang.String storeId) throws java.sql.SQLException
protected boolean queryLog(ExperimentLoggingDataBean expLogData, boolean checkView)
protected void insertLog(ExperimentLoggingDataBean expLogData) throws java.sql.SQLException
protected void updateLog(java.lang.String sql, java.lang.String experimentId, java.lang.String testElementId, java.lang.String storeId, java.lang.String sessionId) throws java.sql.SQLException
public void setTestData(ExperimentLoggingDataBean expId)
public java.lang.Class getECEventContainer()
public java.util.Set getEvents()
protected ExperimentLoggingDataBean getExperimentLoggingData(org.eclipse.hyades.logging.events.cbe.CommonBaseEvent cbe)
protected void processExperimentLoggingEvent(ExperimentLoggingDataBean expLogData) throws java.sql.SQLException
if (expLogData.getTestElementWasCustom1() == true) { StringBuffer sb = new StringBuffer(SQL_EXPSTATS_UPDATE_BEGIN); sb.append(" GIFTCLICK = GIFTCLICK + 1 "); sb.append(SQL_EXPSTATS_UPDATE_END); // increment gift clicks in EXPSTATS updateStatistics(sb.toString(), expLogData.getExperimentId(), expLogData.getTestElementId(), expLogData.getStoreId()); sb = new StringBuffer(SQL_EXPLOG_UPDATE_BEGIN); sb.append(" GIFTCLICKED = '1' "); sb.append(SQL_EXPLOG_UPDATE_END); // set gift clicked in EXPLOG updateLog(sb.toString(), expLogData.getExperimentId(), expLogData.getTestElementId(), expLogData.getStoreId(), expLogData.getSessionId()); }