Skip to Content
0
Jan 26, 2009 at 03:21 PM

Tealeaf

40 Views

Hi,

We try to add informations to Event Properties as show in the

Web Event Capture and Web Analysis Guide. Here is the code

for the new class we have created to add information to the

item transfer infos:

/*

  • Created on 21 janv. 2009

*

  • To change the template for this generated file go to

  • Window>Preferences>Java>Code Generation>Code and Comments

*/

package com.irs.isa.eventlistener;

import java.util.Date;

import com.sap.isa.businessobject.BusinessObjectManager;

import com.sap.isa.businessobject.Product;

import com.sap.isa.businessobject.Shop;

import com.sap.isa.businessobject.item.ItemSalesDoc;

import com.sap.isa.core.businessobject.event.capturer.CapturerEvent;

import com.sap.isa.isacore.BusinessEventTealeafCapturer;

/**

  • @author dcantin

*

  • To change the template for this generated type comment go to

  • Window>Preferences>Java>Code Generation>Code and Comments

*/

public class Z1_BusinessEventTealeafCapturer

extends BusinessEventTealeafCapturer {

/* (non-Javadoc)

  • @see com.sap.isa.isacore.BusinessEventTealeafCapturer#setItemInfo(com.sap.isa.core.businessobject.event.capturer.CapturerEvent, boolean, com.sap.isa.businessobject.item.ItemSalesDoc, com.sap.isa.businessobject.Product, com.sap.isa.businessobject.BusinessObjectManager, java.util.Date, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)

*/

protected void setItemInfo(

CapturerEvent event,

boolean fromProduct,

ItemSalesDoc item,

Product product,

BusinessObjectManager bom,

Date availabilityDate,

String availability,

String currency,

String category,

String basketId,

String oldQuantity,

String prodName,

String productId,

String quantity,

String totalPrice,

String unit,

String price) {

Shop shop = bom.getShop();

String shopid = "XXXXXX";

if (shop != null) {

shopid = shop.getId().toString();

}

event.setProperty("Item", "AvailabilityDate", availabilityDate);

event.setProperty("Item", "Availability", availability);

event.setProperty("Item", "Currency", currency);

event.setProperty("Item", "Category", category);

event.setProperty("Item", "BasketID", basketId);

event.setProperty("Item", "OldQuantity", oldQuantity);

event.setProperty("Item", "ProductName", prodName);

event.setProperty("Item", "SKU", productId);

event.setProperty("Item", "Quantity", quantity);

event.setProperty("Item", "TotalPrice", totalPrice);

event.setProperty("Item", "Unit", unit);

event.setProperty("Item", "UnitPrice", price);

event.setProperty("Item", "SHOPID", shopid);

}

}

After that we have change the capturer-handler in the XCM for

the new class value com.irs.isa.eventlistener.Z1_BusinessEventTealeafCapturer. We

have closed all services and then restart, and now we do not

receive any informations from ISA in Tealeaf files.

Help required,

Regards