![]() |
Debe definirse el área de la página que muestra la oferta de actualizaciones. Asimismo, una vez que Interact selecciona una oferta para visualizarla, la información debe registrarse.
|
NameValuePair evtParam_TreatmentCode = new NameValuePairImpl();
evtParam_TreatmentCode.setName("UACIOfferTrackingCode");
evtParam_TreatmentCode.setValueAsString(offer.getTreatmentCode());
evtParam_TreatmentCode.setValueDataType(NameValuePair.DATA_TYPE_STRING);
Response response=getOffers(sessionID, ip_planSummaryBottomRight, 1)
OfferList offerList=response.getOfferList();
if(offerList.getRecommendedOffers() != null)
{
Offer offer = offerList.getRecommendedOffers()[0];
NameValuePair[] attributes = offer.getAdditionalAttributes();
for(NameValuePair attribute: attributes)
{
if(attribute.getName().equalsIgnoreCase("offerImg"))
{
/* Utilizar este valor en el código de la página, por
ejemplo: stringHtml = "<img src="+attribute.getValueAsString()+ " > */
}
}
}
NameValuePair evtParam_TreatmentCode = new NameValuePairImpl();
evtParam_TreatmentCode.setName("UACIOfferTrackingCode");
evtParam_TreatmentCode.setValueAsString(offer.getTreatmentCode());
evtParam_TreatmentCode.setValueDataType(NameValuePair.DATA_TYPE_STRING);
postEvent(sessionID, evt_logOffer, evtParam_TreatmentCode)
Command getOffersCommand = new CommandImpl();
getOffersCommand.setMethodIdentifier(Command.COMMAND_GETOFFERS);
getOffersCommand.setInteractionPoint(ip_planSummaryBottomLeft);
getOffersCommand.setNumberRequested(1);
Command postEventCommand = new CommandImpl();
postEventCommand.setMethodIdentifier(Command.COMMAND_POSTEVENT);
postEventCommand.setEvent(evt_logOffer);
/** Crear la matriz de comandos */
Command[] commands =
{
getOffersCommand,
postEventCommand
};
/** Realizar la llamada */
BatchResponse batchResponse = api.executeBatch(sessionId, commands);
Response response=getOffers(sessionID, ip_planSummaryBottomLeft, 3)
OfferList offerList=response.getOfferList();
if(offerList.getRecommendedOffers() != null)
{
for(int x=0;x<3;x++)
{
Offer offer = offerList.getRecommendedOffers()[x];
if(x==0)
{
// obtener el valor de atributo offerimg y almacenarlo en algún lugar;
// será la primera imagen que se muestre
}
else if(x==1)
{
// obtener el valor de atributo offerimg y almacenarlo en algún lugar;
// será la segunda imagen que se muestre
}
else if(x==2)
{
// obtener el valor de atributo offerimg y almacenarlo en algún lugar;
// será la tercera imagen que se muestre
}
}
}
NameValuePair evtParam_TreatmentCodeSTR = new NameValuePairImpl();
NameValuePair evtParam_TreatmentCodeSBR = new NameValuePairImpl();
NameValuePair evtParam_TreatmentCodeSBL = new NameValuePairImpl();
OfferList offerList=response.getOfferList();
if(offerList.getRecommendedOffers() != null)
{
for(int x=0;x<3;x++)
{
Offer offer = offerList.getRecommendedOffers()[x];
if(x==0)
{
evtParam_TreatmentCodeSTR.setName("UACIOfferTrackingCode");
evtParam_TreatmentCodeSTR.setValueAsString(offer.getTreatmentCode());
evtParam_TreatmentCodeSTR.setValueDataType(NameValuePair.DATA_TYPE_STRING);
}
else if(x==1)
{
evtParam_TreatmentCodeSBR.setName("UACIOfferTrackingCode");
evtParam_TreatmentCodeSBR.setValueAsString(offer.getTreatmentCode());
evtParam_TreatmentCodeSBR.setValueDataType(NameValuePair.DATA_TYPE_STRING);
}
else if(x==2)
{
evtParam_TreatmentCodeSBL.setName("UACIOfferTrackingCode");
evtParam_TreatmentCodeSBL.setValueAsString(offer.getTreatmentCode());
evtParam_TreatmentCodeSBL.setValueDataType(NameValuePair.DATA_TYPE_STRING);
}
}
}
postEvent(sessionID, evt_offerAccept, evtParam_TreatmentCodeSTR)
postEvent(sessionID, evt_offerReject, evtParam_TreatmentCodeSBR)
postEvent(sessionID, evt_offerReject, evtParam_TreatmentCodeSBL)
Copyright IBM Corporation 2013. All Rights Reserved.
|