Source Code Cross Referenced for SubscriptionsAdminServiceViewBean.java in  » Portal » Open-Portal » com » sun » portal » subscriptions » admin » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » Open Portal » com.sun.portal.subscriptions.admin 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2001 Sun Microsystems, Inc.  All rights reserved.
003:         * PROPRIETARY/CONFIDENTIAL.  Use of this product is subject to license terms.
004:         */
005:
006:        package com.sun.portal.subscriptions.admin;
007:
008:        import java.util.*;
009:        import java.util.logging.Level;
010:        import java.util.logging.Logger;
011:
012:        import javax.servlet.http.HttpServletRequest;
013:
014:        import com.iplanet.jato.view.View;
015:        import com.iplanet.jato.view.html.StaticTextField;
016:        import com.iplanet.jato.CompleteRequestException;
017:        import com.iplanet.jato.view.event.DisplayEvent;
018:        import com.iplanet.jato.view.event.ChildDisplayEvent;
019:        import com.iplanet.jato.view.event.RequestInvocationEvent;
020:        import com.iplanet.jato.model.ModelControlException;
021:        import com.iplanet.jato.view.html.RadioButtonGroup;
022:        import com.iplanet.jato.view.html.OptionList;
023:        import com.iplanet.jato.view.html.TextField;
024:
025:        import com.iplanet.am.console.base.AMMessageViewBean;
026:        import com.iplanet.am.console.base.model.AMConsoleException;
027:        import com.iplanet.am.console.service.SMDataViewBean;
028:        import com.iplanet.am.console.service.model.SMDataModel;
029:        import com.iplanet.am.console.components.view.html.DynamicGUI;
030:        import com.iplanet.am.console.components.view.html.DynamicGUIComp;
031:        import com.iplanet.am.console.components.view.html.MessageBox;
032:        import com.iplanet.am.console.components.view.html.IPlanetButton;
033:
034:        import com.sun.portal.subscriptions.admin.model.SubscriptionsAdminServiceModelImpl;
035:        import com.sun.portal.log.common.PortalLogger;
036:
037:        public class SubscriptionsAdminServiceViewBean extends SMDataViewBean {
038:            public static final String PAGE_NAME = "SubscriptionsAdminService";
039:
040:            public static final String DEFAULT_DISPLAY_URL = "/ps/subsadmin/SubscriptionsAdminService.jsp";
041:            public static final String CHILD_TITLE = "title";
042:            public static final String CHILD_SUBS_DESCRIPTION = "subs.description";
043:            public static final String CHILD_PROF_DESCRIPTION = "prof.description";
044:            public static final String START_VIEW = "StartProfiler";
045:            public static final String STOP_VIEW = "StopProfiler";
046:
047:            // used for debugging
048:            public static final String CLASS_NAME = "SubscriptionsAdminServiceViewBean.";
049:            public static final String GET_MODEL = CLASS_NAME + "getModel(): ";
050:            private static ResourceBundle rb = null;
051:            public SMDataModel model = null;
052:            public String organization = null;
053:            private static Logger logger = PortalLogger
054:                    .getLogger(SubscriptionsAdminServiceViewBean.class);
055:
056:            public SubscriptionsAdminServiceViewBean() {
057:                super (PAGE_NAME);
058:                setDefaultDisplayURL(DEFAULT_DISPLAY_URL);
059:                registerChildren();
060:            }
061:
062:            public void registerChildren() {
063:                registerChild(CHILD_TITLE, StaticTextField.class);
064:                registerChild(CHILD_SUBS_DESCRIPTION, StaticTextField.class);
065:                super .registerChildren();
066:            }
067:
068:            /**
069:             * creates child view/component
070:             *
071:             * @param name of view/component
072:             * @return child view/component
073:             */
074:            protected View createChild(String name) {
075:                if (name.equals(CHILD_SUBS_DESCRIPTION)) {
076:                    return new StaticTextField(this , CHILD_SUBS_DESCRIPTION,
077:                            getLocalizedString(CHILD_SUBS_DESCRIPTION));
078:                } else if (name.equals(START_VIEW)) {
079:                    return new ScheduleView(this , START_VIEW);
080:                } else if (name.equals(STOP_VIEW)) {
081:                    return new ScheduleView(this , STOP_VIEW);
082:                } else if (name.equals(CHILD_TITLE)) {
083:                    return new StaticTextField(this , CHILD_TITLE,
084:                            getLocalizedString(CHILD_TITLE));
085:                } else if (name.equals(ORG_DATA_VIEW)) {
086:                    return new SubscriptionsAdminServiceView(this ,
087:                            ORG_DATA_VIEW, SMDataModel.ORG_TYPE);
088:                } else {
089:                    logger.log(Level.WARNING, "PSSS_CSPSA0001", name);
090:                    return super .createChild(name);
091:                }
092:            }
093:
094:            public void beginDisplay(DisplayEvent event)
095:                    throws ModelControlException {
096:                model = getModel();
097:                super .beginDisplay(event);
098:            }
099:
100:            /**
101:             * Handles the Submit button click event.
102:             *
103:             * @param event The Request Invocation Event
104:             * @overrides handleSubmitButtonRequest in SMDataViewBean
105:             */
106:            public void handleBtnSaveRequest(RequestInvocationEvent event)
107:                    throws ModelControlException {
108:                try {
109:                    if (isTemplate()) {
110:                        ScheduleView child = (ScheduleView) getChild(this .START_VIEW);
111:                        child.store();
112:                        child = (ScheduleView) getChild(this .STOP_VIEW);
113:                        child.store();
114:                    }
115:                    model.process();
116:                } catch (AMConsoleException amce) {
117:                    logger.log(Level.SEVERE, "PSSS_CSPSA0005");
118:                }
119:                super .handleBtnSaveRequest(event);
120:            }
121:
122:            public void handleBtnResetRequest(RequestInvocationEvent event)
123:                    throws ModelControlException {
124:                if (isTemplate()) {
125:                    ScheduleView child = (ScheduleView) getChild(this .START_VIEW);
126:                    child.reset();
127:                    child = (ScheduleView) getChild(this .STOP_VIEW);
128:                    child.reset();
129:                }
130:                super .handleBtnResetRequest(event);
131:            }
132:
133:            public void handleDeleteButtonRequest(RequestInvocationEvent event)
134:                    throws ModelControlException {
135:                if (isTemplate()) {
136:                    ScheduleView child = (ScheduleView) getChild(this .START_VIEW);
137:                    child.delete();
138:                    child = (ScheduleView) getChild(this .STOP_VIEW);
139:                    child.delete();
140:                }
141:                super .handleDeleteButtonRequest(event);
142:            }
143:
144:            /**
145:             * Creates and returns the model instance. This method is an implementation
146:             * of the SMData interface. It is called by the DesktopAdminServiceView.
147:             *
148:             * @return Instance of model
149:             */
150:            public SMDataModel getModel() {
151:                if (model == null) {
152:                    HttpServletRequest req = getRequestContext().getRequest();
153:                    String locationDN = req.getParameter("Location");
154:
155:                    if (locationDN != null) {
156:                        setPageSessionAttribute(CONSOLE_LOCATION_DN, locationDN);
157:                    } else {
158:                        locationDN = (String) getPageSessionAttribute(CONSOLE_LOCATION_DN);
159:                    }
160:                    String svcName = getServiceName();
161:
162:                    //if svcName not in either, then its an error.
163:                    if (svcName != null && svcName.length() > 0) {
164:                        model = new SubscriptionsAdminServiceModelImpl(
165:                                req,
166:                                SubscriptionsAdminConstants.RESOURCE_BUNDLE_FILE,
167:                                getPageSessionAttributes(), svcName,
168:                                isTemplate());
169:                    }
170:                    if (svcName == null || model == null) {
171:                        //No model, so get debug and send error.
172:                        AMMessageViewBean vb = (AMMessageViewBean) getViewBean(com.iplanet.am.console.base.AMMessageViewBean.class);
173:                        //Localization not possible as model creation has failed.
174:                        vb.setTitle("Error - ");
175:                        vb
176:                                .setMessage("An error occurred while processing this request."
177:                                        + " Please contact your administrator.");
178:                        vb.forwardTo(getRequestContext());
179:                        throw new CompleteRequestException();
180:                    }
181:                    try {
182:                        ((SubscriptionsAdminServiceModelImpl) model)
183:                                .initData(locationDN);
184:                    } catch (Exception e) {
185:                        if (logger.isLoggable(Level.SEVERE))
186:                            logger.log(Level.SEVERE, "PSSS_CSPSA0002", e);
187:                    }
188:                }
189:                return model;
190:            }
191:
192:            public String getLocalizedString(String key) {
193:                try {
194:                    return model.getLocalizedString(key);
195:                } catch (MissingResourceException e) {
196:                    if (logger.isLoggable(Level.SEVERE))
197:                        logger
198:                                .log(
199:                                        Level.SEVERE,
200:                                        "PSSS_CSPSA0003",
201:                                        SubscriptionsAdminConstants.RESOURCE_BUNDLE_FILE);
202:                    return key;
203:                } catch (Exception e) {
204:
205:                    String[] param = { key,
206:                            SubscriptionsAdminConstants.RESOURCE_BUNDLE_FILE };
207:
208:                    if (logger.isLoggable(Level.SEVERE))
209:                        logger.log(Level.SEVERE, "PSSS_CSPSA0004", param);
210:                    return key;
211:                }
212:            }
213:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.