Source Code Cross Referenced for NetletAdminServiceView.java in  » Portal » Open-Portal » com » sun » portal » netlet » 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.netlet.admin 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /** 
002:         * Copyright 2002 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:         *
013:         * @ Author Bhavanishankar
014:         */package com.sun.portal.netlet.admin;
015:
016:        // JDK classes
017:
018:        import java.util.ArrayList;
019:        import java.util.List;
020:        import java.util.Set;
021:
022:        import javax.servlet.http.HttpServletRequest;
023:
024:        import com.iplanet.am.console.components.view.html.DynamicGUI;
025:        import com.iplanet.am.console.components.view.html.DynamicGUIComp;
026:        import com.iplanet.jato.RequestHandler;
027:        import com.iplanet.jato.model.DatasetModel;
028:        import com.iplanet.jato.model.ModelControlException;
029:        import com.iplanet.jato.view.RequestHandlingTiledViewBase;
030:        import com.iplanet.jato.view.TiledView;
031:        import com.iplanet.jato.view.View;
032:        import com.iplanet.jato.view.event.DisplayEvent;
033:        import com.sun.portal.netlet.admin.model.NetletAdminServiceModel;
034:
035:        public class NetletAdminServiceView extends
036:                RequestHandlingTiledViewBase implements  TiledView,
037:                RequestHandler {
038:
039:            public static final String CC_ATTR_SET = "ccAttrSet";
040:
041:            public static final String ADD_BTN = "add.button";
042:
043:            public static final String REMOVE_BTN = "remove.button";
044:
045:            private NetletAdminServiceModel model = null;
046:
047:            private NetletAdminModelManager modelManager = null;
048:
049:            private int viewType = 0;
050:
051:            /*
052:             * @param parent The reference of the parent container @param name The name
053:             * of this view.
054:             */
055:            public NetletAdminServiceView(View parent, String name, int type) {
056:                super (parent, name);
057:                viewType = type;
058:                setPrimaryModel((DatasetModel) getDefaultModel());
059:                registerChild(CC_ATTR_SET, DynamicGUIComp.class);
060:            }
061:
062:            protected View createChild(String name) {
063:                if (name.equals(CC_ATTR_SET)) {
064:                    return new DynamicGUIComp(this , CC_ATTR_SET, null);
065:                } else {
066:                    throw new IllegalArgumentException("Invalid child name: "
067:                            + name);
068:                }
069:            }
070:
071:            public void beginDisplay(DisplayEvent event)
072:                    throws ModelControlException {
073:                getPrimaryModel().setSize(getModel().getSize(viewType));
074:            }
075:
076:            protected NetletAdminServiceModel getModel() {
077:                if (model == null) {
078:                    NetletAdminService viewBean = (NetletAdminService) getParentViewBean();
079:                    model = viewBean.getModel();
080:                }
081:                return model;
082:            }
083:
084:            public NetletAdminModelManager getNetletModelMgr() {
085:                if (modelManager == null) {
086:                    modelManager = (NetletAdminModelManager) getRequestContext()
087:                            .getModelManager();
088:                }
089:                return modelManager;
090:            }
091:
092:            public boolean nextTile() throws ModelControlException {
093:                boolean movedToRow = super .nextTile();
094:                NetletAdminServiceModel m = getModel();
095:                getNetletModelMgr();
096:                boolean success = m.setCurrentRow(viewType, getTileIndex());
097:                if (movedToRow && success) {
098:                    DynamicGUI dg = null;
099:                    // DynamicGUIComp dgc = (DynamicGUIComp)getChild(CC_ATTR_SET);
100:                    String name = m.getAttrName();
101:                    // String label = m.getDynamicGUI().getLabel();
102:                    // boolean required = false;
103:                    // int attrType = m.getDynamicGUI().getType();
104:                    // int attrSyntax = m.getAttrSyntax();
105:                    // Set values = m.getAttrValues();
106:
107:                    /*
108:                     * Skip one tile if it is netlet rule
109:                     */
110:                    if (name.equals("sunPortalNetletRules")) {
111:                        movedToRow = super .nextTile();
112:                        success = m.setCurrentRow(viewType, getTileIndex());
113:                        if (movedToRow && success) {
114:                            name = m.getAttrName();
115:                            // label = m.getDynamicGUI().getLabel();
116:                            // attrType = m.getDynamicGUI().getType();
117:                            // attrSyntax = m.getAttrSyntax();
118:                            // values = m.getAttrValues();
119:                        } else {
120:                            return movedToRow;
121:                        }
122:                    }
123:                    //
124:                    dg = m.getDynamicGUI();
125:                    if (dg.getType() == DynamicGUI.TYPE_LIST) {
126:                        dg.setAddButtonStr(modelManager.getString(ADD_BTN));
127:                        dg.setRemoveButtonStr(modelManager
128:                                .getString(REMOVE_BTN));
129:                    }
130:
131:                    /*
132:                     * if (attrType == DynamicGUI.TYPE_SINGLE) { if (attrSyntax ==
133:                     * DynamicGUI.SYNTAX_BOOLEAN) { String trueValue =
134:                     * m.getDynamicGUI().getTrueValue(); String falseValue =
135:                     * m.getDynamicGUI().getFalseValue(); String value = ""; if (values !=
136:                     * null) { value = (String)values.iterator().next(); } dg = new
137:                     * DynamicGUI(name, label, required, attrType, attrSyntax,
138:                     * trueValue, falseValue, value); } else { dg = new DynamicGUI(name,
139:                     * label, required, attrType, attrSyntax, values); } } else if
140:                     * (attrType == DynamicGUI.TYPE_SINGLE_CHOICE || attrType ==
141:                     * DynamicGUI.TYPE_MULTIPLE_CHOICE ) { //String[] choices =
142:                     * m.getDynamicGUI().getAttrChoices(); //OptionList optionList = new
143:                     * OptionList(choices, choices); OptionList optionList =
144:                     * m.getDynamicGUI().getOptions(); dg = new DynamicGUI(name, label,
145:                     * required, attrType, attrSyntax, values, optionList); } else if
146:                     * (attrType == DynamicGUI.TYPE_LIST) { dg = new DynamicGUI(name,
147:                     * label, required, attrType, attrSyntax, values);
148:                     * dg.setAddButtonStr(modelManager.getString(ADD_BTN));
149:                     * dg.setRemoveButtonStr(modelManager.getString(REMOVE_BTN)); }
150:                     */
151:                    setDisplayFieldValue(CC_ATTR_SET, dg);
152:                }
153:                return movedToRow;
154:            }
155:
156:            /**
157:             * re-creates dynamic gui components for saving purposes
158:             * 
159:             * @return dynamic gui components for action value
160:             */
161:
162:            public List getDynamicCompList(int netletrulesIndex) {
163:                List dynamicGUIs = new ArrayList(10);
164:                HttpServletRequest req = getRequestContext().getRequest();
165:
166:                int count = 0;
167:                while (true) {
168:
169:                    /*
170:                     * Skip if it is the index of Netlet rule Because it is not a
171:                     * DynamicGUI type.
172:                     */
173:                    if (count == netletrulesIndex) {
174:                        count++;
175:                        continue;
176:                    }
177:                    DynamicGUI dGUI = DynamicGUIComp.createDynamicGUI(req,
178:                            getQualifiedName(), CC_ATTR_SET, count++);
179:
180:                    if (dGUI != null) {
181:                        dynamicGUIs.add(dGUI);
182:                    } else {
183:                        break;
184:                    }
185:                }
186:                return dynamicGUIs;
187:            }
188:
189:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.