001: /**
002: * Copyright 2005 Sun Microsystems, Inc. All
003: * rights reserved. Use of this product is subject
004: * to license terms. Federal Acquisitions:
005: * Commercial Software -- Government Users
006: * Subject to Standard License Terms and
007: * Conditions.
008: *
009: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
010: * are trademarks or registered trademarks of Sun Microsystems,
011: * Inc. in the United States and other countries.
012: */package com.sun.portal.admin.console.ubt.bean;
013:
014: import com.sun.portal.admin.console.ubt.data.UBTResourceBundle;
015:
016: /**
017: *
018: */
019: public class UBTEventBean {
020: private String id;
021: private String level;
022: private String detail;
023: private String eventProp;
024:
025: public String getEventProp() {
026: return eventProp;
027: }
028:
029: public void setEventProp(String eventProp) {
030: this .eventProp = eventProp;
031: }
032:
033: public String getDetail() {
034: return detail;
035: }
036:
037: public void setDetail(String detail) {
038: this .detail = detail;
039: }
040:
041: public UBTEventBean(String id, String level, String detail) {
042: this .id = id;
043: this .level = level;
044: this .detail = detail;
045: this .eventProp = EVENT_LEVEL_PROP_PREFIX + this .id
046: + EVENT_LEVEL_PROP_SUFFIX;
047: }
048:
049: public String getId() {
050: return id;
051: }
052:
053: public void setId(String id) {
054: this .id = id;
055: this .eventProp = EVENT_LEVEL_PROP_PREFIX + this .id
056: + EVENT_LEVEL_PROP_SUFFIX;
057: }
058:
059: public String getLevel() {
060: return level;
061: }
062:
063: public void setLevel(String level) {
064: this .level = level;
065: }
066:
067: public static final String USER_CLICK_CHN = "USER_CLICK_CHN";
068: public static final String USER_CLICK_EX_LINK = "USER_CLICK_EX_LINK";
069: public static final String PROVIDER_RENDER_FRESH = "PROVIDER_RENDER_FRESH";
070: public static final String PROVIDER_RENDER_CACHE = "PROVIDER_RENDER_CACHE";
071: public static final String PROCESS_EDIT = "PROCESS_EDIT";
072: public static final String SESSION_START = "SESSION_START";
073: public static final String SESSION_TERMINATE = "SESSION_TERMINATE";
074: public static final String PORLET_RENDER = "PORTLET_RENDER";
075: public static final String PORTLET_ACTION = "PORTLET_ACTION";
076:
077: public static final String EVENT_NAME_RESOURCE_PREFIX = "ubtsettings.eventlevelsettings.event.";
078: public static final String EVENT_LEVEL_PROP_PREFIX = "ubt.event.";
079: public static final String EVENT_LEVEL_PROP_SUFFIX = ".level";
080: private static String[] supportedEventProps = new String[9];
081: static {
082: supportedEventProps = new String[] {
083: EVENT_LEVEL_PROP_PREFIX + USER_CLICK_CHN
084: + EVENT_LEVEL_PROP_SUFFIX,
085: EVENT_LEVEL_PROP_PREFIX + USER_CLICK_EX_LINK
086: + EVENT_LEVEL_PROP_SUFFIX,
087: EVENT_LEVEL_PROP_PREFIX + PROVIDER_RENDER_FRESH
088: + EVENT_LEVEL_PROP_SUFFIX,
089: EVENT_LEVEL_PROP_PREFIX + PROVIDER_RENDER_CACHE
090: + EVENT_LEVEL_PROP_SUFFIX,
091: EVENT_LEVEL_PROP_PREFIX + PROCESS_EDIT
092: + EVENT_LEVEL_PROP_SUFFIX,
093: EVENT_LEVEL_PROP_PREFIX + SESSION_START
094: + EVENT_LEVEL_PROP_SUFFIX,
095: EVENT_LEVEL_PROP_PREFIX + SESSION_TERMINATE
096: + EVENT_LEVEL_PROP_SUFFIX,
097: EVENT_LEVEL_PROP_PREFIX + PORLET_RENDER
098: + EVENT_LEVEL_PROP_SUFFIX,
099: EVENT_LEVEL_PROP_PREFIX + PORTLET_ACTION
100: + EVENT_LEVEL_PROP_SUFFIX };
101: }
102:
103: public static UBTEventBean getInstance(String id, String level) {
104: return new UBTEventBean(id, level, getDetailLocal(id));
105: }
106:
107: private static String getDetailLocal(String id) {
108: return UBTResourceBundle.getProperty(EVENT_NAME_RESOURCE_PREFIX
109: + id);
110: }
111:
112: public static String[] getSupportedEventProps() {
113: return supportedEventProps;
114: }
115: }
|