01: /*
02: * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05: package com.sun.portal.portletappengine.ubt;
06:
07: import com.sun.portal.ubt.UBTLogRecord;
08: import com.sun.portal.ubt.UBTLogField;
09: import com.sun.portal.ubt.UBTEvent;
10: import com.sun.portal.portletcontainercommon.PortletContainerRequest;
11: import com.sun.portal.portletcontainercommon.PortletContainerResponse;
12: import com.sun.portal.portletappengine.PortletAppEngineConstants;
13:
14: import javax.servlet.http.HttpServletRequest;
15: import javax.servlet.http.HttpServletResponse;
16: import java.util.logging.Level;
17:
18: public class PortletLogRecord extends UBTLogRecord {
19: PortletContainerRequest portletRequest;
20: PortletContainerResponse portletResponse;
21:
22: public PortletLogRecord(final UBTEvent event,
23: final HttpServletRequest req,
24: final HttpServletResponse res,
25: final PortletContainerRequest portletRequest,
26: final PortletContainerResponse portletResponse) {
27: super (event, req, res, portletRequest.getUserID());
28: this .portletRequest = portletRequest;
29: this .portletResponse = portletResponse;
30: }
31:
32: protected void fillTable() {
33: super .fillTable();
34: try {
35: if (portletRequest != null) {
36: this
37: .putIntoTable(
38: UBTLogField.ACTION,
39: request
40: .getAttribute(PortletAppEngineConstants.CURRENT_ACTION));
41: this
42: .putIntoTable(
43: UBTLogField.CHANNEL_NAME,
44: portletRequest
45: .getPortletPreferences()
46: .getValue(
47: "_channel",
48: portletRequest
49: .getPortletName()));
50: this .putIntoTable(UBTLogField.COMP_NAME, "Portlet"); //portletRequest.getPortletName());
51: this .putIntoTable(UBTLogField.MODE, portletRequest
52: .getChannelMode());
53: this .putIntoTable(UBTLogField.WINDOW_STATE,
54: portletRequest.getWindowState());
55: this .putIntoTable(UBTLogField.ENTITY_ID, portletRequest
56: .getEntityID());
57: }
58: } catch (Exception e) {
59: }
60: }
61: }
|