Source Code Cross Referenced for GatewayDeleteViewBean.java in  » Portal » Open-Portal » com » sun » portal » rproxy » 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.rproxy.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:        package com.sun.portal.rproxy.admin;
006:
007:        import javax.servlet.http.HttpServletRequest;
008:
009:        import com.iplanet.am.console.base.AMViewBeanBase;
010:        import com.iplanet.am.console.components.view.html.MessageBox;
011:        import com.iplanet.jato.NavigationException;
012:        import com.iplanet.jato.RequestContext;
013:        import com.iplanet.jato.model.ModelControlException;
014:        import com.iplanet.jato.view.View;
015:        import com.iplanet.jato.view.ViewBean;
016:        import com.iplanet.jato.view.event.DisplayEvent;
017:        import com.iplanet.jato.view.html.StaticTextField;
018:        import com.sun.portal.rproxy.admin.model.GatewayModel;
019:        import com.sun.portal.rproxy.admin.model.GatewayModelImpl;
020:
021:        /**
022:         * The viewbean that provides the delete gateway profile functionality.
023:         */
024:        public class GatewayDeleteViewBean extends AMViewBeanBase {
025:
026:            public static final String PAGE_NAME = "GatewayDelete";
027:
028:            public static final String DEFAULT_DISPLAY_URL = "/ps/gwadmin/GatewayDelete.jsp";
029:
030:            public static final String CHILD_CC_MSGBOX = "ccMessageBox";
031:
032:            public static final String LBL_DELETE_TITLE = "titleDeleteGateway";
033:
034:            private GatewayModel model = null;
035:
036:            private GatewayAdminModelManager modelManager = null;
037:
038:            /**
039:             * Default constructor
040:             * 
041:             */
042:            public GatewayDeleteViewBean() {
043:                super (PAGE_NAME);
044:                setDefaultDisplayURL(DEFAULT_DISPLAY_URL);
045:                registerChildren();
046:            }
047:
048:            /**
049:             * Creates the child view objects for this viewbean.
050:             * 
051:             * @param name
052:             *            the name of the child view object to be created.
053:             * @return the child view object.
054:             */
055:            protected View createChild(String name) {
056:                if (name.equals(LBL_DELETE_TITLE)) {
057:                    return new StaticTextField(this , LBL_DELETE_TITLE,
058:                            modelManager.getString("delete.profile.label"));
059:                } else if (name.equals(CHILD_CC_MSGBOX)) {
060:                    return new MessageBox(this , CHILD_CC_MSGBOX, "");
061:                } else {
062:                    throw new IllegalArgumentException(name);
063:                }
064:            }
065:
066:            /**
067:             * To register all the child view objects and their classes.
068:             */
069:            protected void registerChildren() {
070:                registerChild(LBL_DELETE_TITLE, StaticTextField.class);
071:                registerChild(CHILD_CC_MSGBOX, MessageBox.class);
072:            }
073:
074:            public void beginDisplay(DisplayEvent event)
075:                    throws ModelControlException {
076:                getModel();
077:                getGWModelMgr();
078:                setDisplayFieldValue(HELP_DOC_URL, modelManager
079:                        .getString(GatewayAdminService.SRA_BASE_HLP_URL));
080:                setDisplayFieldValue(HELP_ANCHOR_TAG, model
081:                        .getHelpAnchorTag(GatewayAdminService.SRA_GW_HLP_URL));
082:            }
083:
084:            public void forwardTo(RequestContext reqContext)
085:                    throws NavigationException {
086:                setRequestContext(reqContext);
087:                MessageBox msgbox = (MessageBox) getDisplayField(CHILD_CC_MSGBOX);
088:                getModel();
089:                GatewayAdminModelManager gwMgr = getGWModelMgr();
090:                String[] profileNames = gwMgr
091:                        .getFromSession(GatewaySelectViewBean.SELECT_GATEWAY_SESSION_INFO);
092:
093:                try {
094:                    model.deleteConfig(profileNames);
095:                    ViewBean vb = getViewBean(GatewaySelectViewBean.class);
096:                    vb.forwardTo(reqContext);
097:                } catch (Exception e) {
098:
099:                    /* Display an error msgbox when excetion occurres */
100:                    getGWModelMgr();
101:                    if ((profileNames != null) && (profileNames.length > 0)) {
102:                        StringBuffer sb = new StringBuffer("<ul>");
103:                        for (int i = 0; i < profileNames.length; i++) {
104:                            sb.append("<li>");
105:                            sb.append((String) profileNames[i]);
106:                            sb.append("</li>");
107:                        }
108:                        sb.append("</ul>");
109:                        msgbox.setType(MessageBox.TYPE_ERROR);
110:                        msgbox.setTitle(modelManager
111:                                .getString("deleteprofileerrormsgbox.title")
112:                                + e.getMessage());
113:                        msgbox.setMessage(sb.toString());
114:                        msgbox.setVisible(true);
115:                        msgbox.addButton(modelManager
116:                                .getString("deleteprofilerrormsgbox.oklabel"),
117:                                getModuleURL() + "/"
118:                                        + GatewaySelectViewBean.PAGE_NAME);
119:                    }
120:                }
121:            }
122:
123:            /**
124:             * Deletes the selected gateway profile(s) after the model executes.
125:             * 
126:             * @param model
127:             *            the model object that just finish execution.
128:             * @param context
129:             *            the execution context
130:             */
131:
132:            /*
133:             * public void afterModelExecutes(Model model, int context) { if ((model
134:             * instanceof GatewayModel) && (context ==
135:             * WebActionHandler.RETRIEVE_CONTEXT)) { MessageBox msgbox = (MessageBox)
136:             * getDisplayField(CHILD_CC_MSGBOX); GatewayModel dmodel = (GatewayModel)
137:             * model; GatewayAdminModelManager gwMgr = getGWModelMgr(); String[]
138:             * profileNames = gwMgr.getFromSession(
139:             * GatewaySelectViewBean.SELECT_GATEWAY_SESSION_INFO);
140:             * 
141:             * try { dmodel.deleteConfig(profileNames);
142:             * 
143:             * ViewBean vb = getViewBean(GatewaySelectViewBean.class);
144:             * vb.forwardTo(getRequestContext()); } catch (Exception e) {
145:             * 
146:             * getGWModelMgr(); if ((profileNames != null) && (profileNames.length > 0)) {
147:             * StringBuffer sb = new StringBuffer(" <ul> "); for (int i = 0; i <
148:             * profileNames.length; i++) { sb.append(" <li> ");
149:             * sb.append((String)profileNames[i]); sb.append(" </li> "); } sb.append("
150:             * </ul> "); msgbox.setType(MessageBox.TYPE_ERROR); msgbox.setTitle(
151:             * modelManager.getString("deleteprofileerrormsgbox.title") +
152:             * e.getMessage()); msgbox.setMessage(sb.toString());
153:             * msgbox.setVisible(true);
154:             * msgbox.addButton(modelManager.getString("deleteprofilerrormsgbox.oklabel"),
155:             * getModuleURL()+"/"+GatewaySelectViewBean.PAGE_NAME); } } } }
156:             */
157:            public GatewayAdminModelManager getGWModelMgr() {
158:                if (modelManager == null) {
159:                    modelManager = (GatewayAdminModelManager) getRequestContext()
160:                            .getModelManager();
161:                }
162:                return modelManager;
163:            }
164:
165:            /**
166:             * Returns the model object for the delete gateway profile UI.
167:             * 
168:             * @return the model object for the delete gateway profile UI.
169:             */
170:            public GatewayModel getModel() {
171:                if (model == null) {
172:                    HttpServletRequest req = getRequestContext().getRequest();
173:                    model = new GatewayModelImpl(req);
174:                }
175:                /*
176:                 * try { model = (GatewayModel)getRequestContext()
177:                 * .getModelManager().getModel(GatewayModelImpl.class); } catch
178:                 * (Throwable t) { }
179:                 * 
180:                 * model.setValue(GatewayAdminModelManager.SRAP_GATEWAY_MODEL_MGR_KEY,
181:                 * getGWModelMgr());
182:                 * model.setValue(GatewaySelectModel.SRAP_GATEWAY_ADMIN_REQ_OBJ_KEY,
183:                 * getRequestContext().getRequest());
184:                 */
185:                return model;
186:            }
187:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.