Source Code Cross Referenced for SubscriptionsAdminServiceView.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.List;
009:        import java.util.ArrayList;
010:        import java.util.Iterator;
011:        import java.util.Set;
012:        import java.util.logging.Level;
013:        import java.util.logging.Logger;
014:        import java.io.UnsupportedEncodingException;
015:        import javax.servlet.http.HttpServletRequest;
016:
017:        import com.iplanet.am.console.components.view.html.IPlanetButton;
018:        import com.iplanet.am.console.components.view.html.DynamicGUI;
019:        import com.iplanet.am.console.components.view.html.DynamicGUIComp;
020:
021:        import com.iplanet.jato.model.ModelControlException;
022:        import com.iplanet.jato.view.View;
023:        import com.iplanet.jato.view.ViewBean;
024:        import com.iplanet.jato.view.event.ChildDisplayEvent;
025:        import com.iplanet.jato.view.event.RequestInvocationEvent;
026:        import com.iplanet.jato.view.html.HREF;
027:        import com.iplanet.jato.view.html.StaticTextField;
028:        import com.iplanet.jato.util.Encoder;
029:
030:        import com.iplanet.am.console.base.AMViewBeanBase;
031:        import com.iplanet.am.console.service.SMDataView;
032:        import com.iplanet.am.console.service.model.SMDataModel;
033:
034:        import com.sun.portal.subscriptions.admin.model.SubscriptionsAdminServiceModelImpl;
035:        import com.sun.portal.subscriptions.admin.SubscriptionsAdminConstants;
036:        import com.sun.portal.log.common.PortalLogger;
037:
038:        public class SubscriptionsAdminServiceView extends SMDataView {
039:            public static final String CHILD_PROF_DESCRIPTION = "prof.description";
040:            public static final String START_VIEW = "StartProfiler";
041:            public static final String STOP_VIEW = "StopProfiler";
042:
043:            private static Logger logger = PortalLogger
044:                    .getLogger(SubscriptionsAdminServiceView.class);
045:            // used for debugging
046:            public static final String CLASS_NAME = "SubscriptionsAdminServiceView.";
047:
048:            /**
049:             * This variable decides the type of view.
050:             * The type which is one of GLOBAL_TYPE, ORG_TYPE, DYNAMIC_TYPE.
051:             */
052:            protected int viewType = 0;
053:
054:            /*
055:             * @param parent The reference of the parent container
056:             * @param name The name of this view.
057:             * @param type The type which is one of GLOBAL_TYPE, ORG_TYPE, DYNAMIC_TYPE.
058:             */
059:            public SubscriptionsAdminServiceView(View parent, String name,
060:                    int type) {
061:                super (parent, name, type);
062:
063:                viewType = type;
064:                registerChildren();
065:            }
066:
067:            public void registerChildren() {
068:                registerChild(CHILD_PROF_DESCRIPTION, StaticTextField.class);
069:                registerChild(START_VIEW, ScheduleView.class);
070:                registerChild(STOP_VIEW, ScheduleView.class);
071:            }
072:
073:            protected View createChild(String name) {
074:                try {
075:                    if (name.equals(CHILD_PROF_DESCRIPTION)) {
076:                        return new StaticTextField(
077:                                this ,
078:                                CHILD_PROF_DESCRIPTION,
079:                                ((SubscriptionsAdminServiceViewBean) getParentViewBean())
080:                                        .getLocalizedString(CHILD_PROF_DESCRIPTION));
081:                    } else if (name.equals(START_VIEW)) {
082:                        return new ScheduleView(this , START_VIEW);
083:                    } else if (name.equals(STOP_VIEW)) {
084:                        return new ScheduleView(this , STOP_VIEW);
085:                    } else {
086:                        if (logger.isLoggable(Level.WARNING))
087:                            logger.log(Level.WARNING, "PSSS_CSPSA0001", name);
088:                        return super .createChild(name);
089:                    }
090:                } catch (Exception e) {
091:                    if (logger.isLoggable(Level.SEVERE))
092:                        logger.log(Level.SEVERE, "failing creating child-"
093:                                + name, e);
094:                    return null;
095:                }
096:            }
097:
098:            /**
099:             * Decides to show the subscriptions service attribute or not.
100:             *
101:             * @return true if the currently logged in user has the privilege to see it.
102:             */
103:            public boolean beginCcAttrSetDisplay(ChildDisplayEvent event)
104:                    throws ModelControlException {
105:
106:                SMDataModel model = getModel();
107:                // Check if it is the display profile attribute
108:                boolean ret = true;
109:                boolean success = model.setCurrentRow(viewType, getTileIndex());
110:                if (success) {
111:                    String attrName = model.getAttrName();
112:                    if (attrName != null
113:                            && attrName
114:                                    .equals(SubscriptionsAdminConstants.START_PROFILER)) {
115:                        ret = false;
116:                    } else if (attrName != null
117:                            && attrName
118:                                    .equals(SubscriptionsAdminConstants.STOP_PROFILER)) {
119:                        ret = false;
120:                    }
121:                }
122:                return (ret);
123:            }
124:
125:            public List getDynamicCompList() {
126:                HttpServletRequest req = getRequestContext().getRequest();
127:                /* This becomes necessary here as the inherited getDynamicCompList can
128:                 * not be used, because it can handle only the dynamic guis and not
129:                 * a mix of dynamic and non-dynamic components. */
130:                int nTiles = getModel().getSize(viewType);
131:
132:                List dynamicGUIs = new ArrayList(nTiles);
133:                int count = 0;
134:                while (count < nTiles) {
135:                    DynamicGUI dGUI = DynamicGUIComp.createDynamicGUI(req,
136:                            getQualifiedName(), CC_ATTR_SET, count++);
137:                    if (dGUI != null) {
138:                        dynamicGUIs.add(dGUI);
139:                    }
140:                }
141:                return dynamicGUIs;
142:            }
143:
144:            public void handleBtnSaveRequest(RequestInvocationEvent event)
145:                    throws ModelControlException {
146:                try {
147:                    ((SubscriptionsAdminServiceViewBean) getParentViewBean())
148:                            .handleBtnSaveRequest(event);
149:                } catch (Exception e) {
150:                    logger.log(Level.SEVERE, "PSSS_CSPSA0005", e);
151:                }
152:            }
153:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.