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.ubt.report.client.UBTReportSaver;
015: import com.sun.portal.admin.console.ubt.data.UBTResourceBundle;
016:
017: /**
018: *
019: */
020: public class Report {
021: //title keys
022: public static String PORTAL_USER_IDENTITY_KEY = "UserIdetity";
023: public static String PORTAL_USER_CUSTOMIZATION_KEY = "CustomizationTitle";
024: public static String PORTAL_CONTAINER_RENDER_KEY = "ContainerRenderTitle";
025: public static String PORTAL_CHANNEL_RENDER_KEY = "ChannelRenderTitle";
026: public static String PORTLET_RENDER_KEY = "PortletRenderTitle";
027: public static String PORTAL_USER_LOGIN_KEY = "UserLoginTitle";
028: public static String PORTAL_CONTAINER_CUSTOMIZATION_KEY = "ContainerCustomizationTitle";
029: public static String PORTLET_ACTIONS_KEY = "PortletActionsTitle";
030: //description keys
031: public static String PORTAL_USER_IDENTITY_DESC_KEY = "PortalUserIdentityDescription";
032: public static String PORTAL_USER_CUSTOMIZATION_DESC_KEY = "PortalUserCustomizationDescription";
033: public static String PORTAL_CONTAINER_RENDER_DESC_KEY = "ContainerRenderDescription";
034: public static String PORTAL_CHANNEL_RENDER_DESC_KEY = "ChannelRenderDescription";
035: public static String PORTLET_RENDER_DESC_KEY = "PortletRenderDescription";
036: public static String PORTAL_USER_LOGIN_DESC_KEY = "UserLoginDescription";
037: public static String PORTAL_CONTAINER_CUSTOMIZATION_DESC_KEY = "PortalContainerCustomizationDescription";
038: public static String PORTLET_ACTIONS_DESC_KEY = "PortletActionsDescription";
039:
040: private String description;
041: private String shortName;
042: private String longName;
043: private String format = UBTReportSaver.DEFAULT_FORMAT;
044:
045: public Report() {
046:
047: }
048:
049: public String getDescription() {
050: return description;
051: }
052:
053: public void setDescription(String description) {
054: this .description = description;
055: }
056:
057: public String getShortName() {
058: return shortName;
059: }
060:
061: public void setShortName(String shortName) {
062: this .shortName = shortName;
063: }
064:
065: static Report getInstance(String name) {
066: Report report = new Report();
067: report.setShortName(name);
068: report.setLongName(getReportLongName(name));
069: report.setDescription(getReportDesciption(name));
070: return report;
071: }
072:
073: private static String getReportDesciption(String name) {
074: String val = "";
075: if (name.equals(UBTReportsBean.PORTAL_CHANNEL_RENDER)) {
076: val = UBTResourceBundle
077: .getReportProperty(PORTAL_CHANNEL_RENDER_DESC_KEY);
078: } else if (name
079: .equals(UBTReportsBean.PORTAL_CONTAINER_CUSTOMIZATION)) {
080: val = UBTResourceBundle
081: .getReportProperty(PORTAL_CONTAINER_CUSTOMIZATION_DESC_KEY);
082: } else if (name.equals(UBTReportsBean.PORTAL_CONTAINER_RENDER)) {
083: val = UBTResourceBundle
084: .getReportProperty(PORTAL_CONTAINER_RENDER_DESC_KEY);
085: } else if (name
086: .equals(UBTReportsBean.PORTAL_USER_CUSTOMIZATION)) {
087: val = UBTResourceBundle
088: .getReportProperty(PORTAL_USER_CUSTOMIZATION_DESC_KEY);
089: } else if (name.equals(UBTReportsBean.PORTAL_USER_IDENTITY)) {
090: val = UBTResourceBundle
091: .getReportProperty(PORTAL_USER_IDENTITY_DESC_KEY);
092: } else if (name.equals(UBTReportsBean.PORTAL_USER_LOGIN)) {
093: val = UBTResourceBundle
094: .getReportProperty(PORTAL_USER_LOGIN_DESC_KEY);
095: } else if (name.equals(UBTReportsBean.PORTLET_ACTIONS)) {
096: val = UBTResourceBundle
097: .getReportProperty(PORTLET_ACTIONS_DESC_KEY);
098: } else if (name.equals(UBTReportsBean.PORTLET_RENDER)) {
099: val = UBTResourceBundle
100: .getReportProperty(PORTLET_RENDER_DESC_KEY);
101: }
102: return val;
103: }
104:
105: private static String getReportLongName(String name) {
106: String val = name;
107: if (name.equals(UBTReportsBean.PORTAL_CHANNEL_RENDER)) {
108: val = UBTResourceBundle
109: .getReportProperty(PORTAL_CHANNEL_RENDER_KEY);
110: } else if (name
111: .equals(UBTReportsBean.PORTAL_CONTAINER_CUSTOMIZATION)) {
112: val = UBTResourceBundle
113: .getReportProperty(PORTAL_CONTAINER_CUSTOMIZATION_KEY);
114: } else if (name.equals(UBTReportsBean.PORTAL_CONTAINER_RENDER)) {
115: val = UBTResourceBundle
116: .getReportProperty(PORTAL_CONTAINER_RENDER_KEY);
117: } else if (name
118: .equals(UBTReportsBean.PORTAL_USER_CUSTOMIZATION)) {
119: val = UBTResourceBundle
120: .getReportProperty(PORTAL_USER_CUSTOMIZATION_KEY);
121: } else if (name.equals(UBTReportsBean.PORTAL_USER_IDENTITY)) {
122: val = UBTResourceBundle
123: .getReportProperty(PORTAL_USER_IDENTITY_KEY);
124: } else if (name.equals(UBTReportsBean.PORTAL_USER_LOGIN)) {
125: val = UBTResourceBundle
126: .getReportProperty(PORTAL_USER_LOGIN_KEY);
127: } else if (name.equals(UBTReportsBean.PORTLET_ACTIONS)) {
128: val = UBTResourceBundle
129: .getReportProperty(PORTLET_ACTIONS_KEY);
130: } else if (name.equals(UBTReportsBean.PORTLET_RENDER)) {
131: val = UBTResourceBundle
132: .getReportProperty(PORTLET_RENDER_KEY);
133: }
134: return val;
135: }
136:
137: public String getLongName() {
138: return longName;
139: }
140:
141: public void setLongName(String longName) {
142: this .longName = longName;
143: }
144:
145: public String getFormat() {
146: return format;
147: }
148:
149: public void setFormat(String format) {
150: this.format = format;
151: }
152:
153: }
|