Source Code Cross Referenced for GatewaySelectTiledView.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 java.util.List;
008:        import java.util.Vector;
009:
010:        import javax.servlet.http.HttpServletRequest;
011:
012:        import com.iplanet.jato.RequestHandler;
013:        import com.iplanet.jato.model.DatasetModel;
014:        import com.iplanet.jato.model.ModelControlException;
015:        import com.iplanet.jato.view.RequestHandlingTiledViewBase;
016:        import com.iplanet.jato.view.TiledView;
017:        import com.iplanet.jato.view.View;
018:        import com.iplanet.jato.view.event.DisplayEvent;
019:        import com.iplanet.jato.view.event.RequestInvocationEvent;
020:        import com.iplanet.jato.view.event.TiledViewRequestInvocationEvent;
021:        import com.iplanet.jato.view.html.CheckBox;
022:        import com.iplanet.jato.view.html.HREF;
023:        import com.iplanet.jato.view.html.HiddenField;
024:        import com.iplanet.jato.view.html.StaticTextField;
025:        import com.sun.portal.rproxy.admin.model.GatewayModel;
026:        import com.sun.portal.rproxy.admin.model.GatewayModelImpl;
027:
028:        /**
029:         * The tileview that lists each gateway instance profile in the select gateway
030:         * admin UI. The GatewaySelectViewBean is the parent of this tileview where all
031:         * the tile(s)/gateway instance profile(s) are displayed.
032:         */
033:        public class GatewaySelectTiledView extends
034:                RequestHandlingTiledViewBase implements  TiledView,
035:                RequestHandler {
036:            public static final String CHILD_CB_SELECT_GATEWAY = "cbGatewaySelect";
037:
038:            public static final String CHILD_HREF_TEXT = "hrefText";
039:
040:            public static final String CHILD_HREF_GATEWAY_EDIT = "hrefGatewayEdit";
041:
042:            public static final String CHILD_GATEWAY_PROFILE_NAME = "profileName";
043:
044:            public static final String CHILD_EDIT_LABEL = "editLabel";
045:
046:            /* the maximum number of tiles per page */
047:            private static final int MAX_DISPLAY_TILES = 100;
048:
049:            private GatewayModel model = null;
050:
051:            private GatewayAdminModelManager modelManager = null;
052:
053:            private List configNames = null;
054:
055:            /**
056:             * Default constructor.
057:             * 
058:             * @param parent
059:             *            the parent view of this tileview.
060:             * @param name
061:             *            the name of this tileview.
062:             */
063:            public GatewaySelectTiledView(View parent, String name) {
064:                super (parent, name);
065:                setMaxDisplayTiles(MAX_DISPLAY_TILES);
066:                setPrimaryModel((DatasetModel) getDefaultModel());
067:                // setPrimaryModelClass(GatewayModel.class);
068:                registerChildren();
069:            }
070:
071:            /**
072:             * Register the child objects of the tileview.
073:             */
074:            protected void registerChildren() {
075:                registerChild(CHILD_CB_SELECT_GATEWAY, CheckBox.class);
076:                registerChild(CHILD_HREF_TEXT, StaticTextField.class);
077:                registerChild(CHILD_HREF_GATEWAY_EDIT, HREF.class);
078:                registerChild(CHILD_EDIT_LABEL, StaticTextField.class);
079:                registerChild(CHILD_GATEWAY_PROFILE_NAME, HiddenField.class);
080:            }
081:
082:            /**
083:             * Creates and return the child view objects for the specified name.
084:             * 
085:             * @param name
086:             *            the child view name.
087:             * @return the child view object that corresponds to the given name.
088:             */
089:            protected View createChild(String name) {
090:                getGWModelMgr();
091:                if (name.equals(CHILD_CB_SELECT_GATEWAY)) {
092:                    return new CheckBox(this , CHILD_CB_SELECT_GATEWAY, "true",
093:                            "false", false);
094:                } else if (name.equals(CHILD_HREF_TEXT)) {
095:                    return new StaticTextField(this , CHILD_HREF_TEXT, "");
096:                } else if (name.equals(CHILD_HREF_GATEWAY_EDIT)) {
097:                    return new HREF(this , CHILD_HREF_GATEWAY_EDIT, "");
098:                } else if (name.equals(CHILD_GATEWAY_PROFILE_NAME)) {
099:                    return new HiddenField(this , CHILD_GATEWAY_PROFILE_NAME, "");
100:                } else if (name.equals(CHILD_EDIT_LABEL)) {
101:                    return new StaticTextField(this , CHILD_EDIT_LABEL,
102:                            modelManager.getString("edit.label"));
103:                } else {
104:                    throw new IllegalArgumentException(name);
105:                }
106:            }
107:
108:            /**
109:             * begins displaying page. we set the required information
110:             * 
111:             * @param event
112:             *            display event
113:             * @throws ModelControlException
114:             *             if problem access value of component
115:             */
116:            public void beginDisplay(DisplayEvent event)
117:                    throws ModelControlException {
118:                if (getPrimaryModel() == null) {
119:                    throw new ModelControlException("Primary model is null");
120:                }
121:                getGWModelMgr();
122:                getModel();
123:                configNames = new Vector(model.getConfigNames());
124:                // ruleNames = rwm.getRuleSetNames();
125:
126:                if (model != null) {
127:                    getPrimaryModel().setSize(model.getGatewayProfileCount());
128:                } else {
129:                    getPrimaryModel().setSize(0);
130:                }
131:                super .beginDisplay(event);
132:                resetTileIndex();
133:            }
134:
135:            /**
136:             * Returns the model object for the select gateway UI.
137:             * 
138:             * @return the model object for the select gateway UI.
139:             */
140:            public GatewayModel getModel() {
141:                if (model == null) {
142:                    HttpServletRequest req = getRequestContext().getRequest();
143:                    model = new GatewayModelImpl(req);
144:                }
145:                /*
146:                 * GatewayModel model = (GatewayModel) getRequestContext()
147:                 * .getModelManager().getModel(GatewaySelectModel.class);
148:                 * model.setValue(GatewaySelectModel.SRAP_GATEWAY_ADMIN_REQ_OBJ_KEY,
149:                 * getRequestContext().getRequest());
150:                 * 
151:                 */return model;
152:            }
153:
154:            public void handleHrefGatewayEditRequest(
155:                    RequestInvocationEvent event) throws ModelControlException {
156:
157:                getPrimaryModel().setLocation(
158:                        ((TiledViewRequestInvocationEvent) event)
159:                                .getTileNumber());
160:
161:                GatewayAdminModelManager gwMgr = getGWModelMgr();
162:                gwMgr
163:                        .storeToSession(
164:                                GatewaySelectViewBean.SELECT_GATEWAY_SESSION_INFO,
165:                                new String[] { (String) getDisplayFieldValue(CHILD_HREF_GATEWAY_EDIT) });
166:
167:                /* Forward to the gateway data viewbean. */
168:                Gateway1ViewBean vb = (Gateway1ViewBean) getViewBean(Gateway1ViewBean.class);
169:                vb.forwardTo(getRequestContext());
170:            }
171:
172:            public GatewayAdminModelManager getGWModelMgr() {
173:                if (modelManager == null) {
174:                    GatewaySelectViewBean viewBean = (GatewaySelectViewBean) getParentViewBean();
175:                    modelManager = viewBean.getGWModelMgr();
176:                }
177:                return modelManager;
178:            }
179:
180:            public boolean nextTile() throws ModelControlException {
181:                boolean movedToRow = super .nextTile();
182:                if (movedToRow) {
183:                    String configName = (String) configNames
184:                            .get(getTileIndex());
185:                    setDisplayFieldValue(CHILD_GATEWAY_PROFILE_NAME, configName);
186:                    setDisplayFieldValue(CHILD_HREF_GATEWAY_EDIT, configName);
187:                    setDisplayFieldValue(CHILD_HREF_TEXT, configName);
188:                    setDisplayFieldValue(CHILD_EDIT_LABEL, modelManager
189:                            .getString("edit.label"));
190:                }
191:                return movedToRow;
192:            }
193:
194:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.