Source Code Cross Referenced for StartingGroupListView.java in  » Portal » Open-Portal » com » sun » portal » search » 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.search.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.search.admin;
007:
008:        import java.io.IOException;
009:        import java.util.StringTokenizer;
010:        import java.util.logging.Logger;
011:        import java.util.logging.Level;
012:        import java.net.URL;
013:
014:        import com.iplanet.jato.view.RequestHandlingTiledViewBase;
015:        import com.iplanet.jato.view.View;
016:        import com.iplanet.jato.view.ViewBean;
017:        import com.iplanet.jato.view.ViewBeanBase;
018:        import com.iplanet.jato.view.TiledView;
019:        import com.iplanet.jato.RequestHandler;
020:        import com.iplanet.jato.model.*;
021:        import com.iplanet.jato.view.event.DisplayEvent;
022:        import com.iplanet.jato.view.event.RequestInvocationEvent;
023:        import com.iplanet.jato.view.event.TiledViewRequestInvocationEvent;
024:        import com.iplanet.jato.view.event.ChildDisplayEvent;
025:        import com.iplanet.jato.view.html.StaticTextField;
026:        import com.iplanet.jato.view.html.ComboBox;
027:        import com.iplanet.jato.view.html.TextField;
028:        import com.iplanet.jato.view.html.CheckBox;
029:        import com.iplanet.jato.view.html.OptionList;
030:        import javax.servlet.http.HttpServletRequest;
031:        import javax.servlet.http.HttpServletResponse;
032:
033:        import com.iplanet.am.console.components.view.html.IPlanetButton;
034:
035:        import com.sun.portal.search.admin.model.StartingGroupListModel;
036:        import com.sun.portal.log.common.PortalLogger;
037:
038:        /**
039:         * This view uses model of type StartingGroupListModel to display a starting
040:         * points tiled view in Site Definition Page
041:         */
042:        public class StartingGroupListView extends RequestHandlingTiledViewBase
043:                implements  TiledView, RequestHandler {
044:            public static final String URL_TEXT = "url";
045:            public static final String DEPTH_COMBO = "depth";
046:            public static final String DEL_CHECKBOX = "Delete";
047:            public static final String DEL_STARTING_BUTTON = "DelStarting";
048:            public String rulesetID = null;
049:
050:            // Create a Logger for this class
051:            private static Logger debugLogger = PortalLogger
052:                    .getLogger(StartingGroupListView.class);
053:
054:            //    private MenuListModel model = null;
055:
056:            public StartingGroupListView(View parent, String name) {
057:                super (parent, name);
058:                setPrimaryModelClass(StartingGroupListModel.class);
059:                //        setPrimaryModel((DatasetModel) getDefaultModel());
060:                registerChildren();
061:            }
062:
063:            protected void registerChildren() {
064:                registerChild(URL_TEXT, TextField.class);
065:                registerChild(DEPTH_COMBO, ComboBox.class);
066:                registerChild(DEL_CHECKBOX, CheckBox.class);
067:                registerChild(DEL_STARTING_BUTTON, IPlanetButton.class);
068:            }
069:
070:            protected View createChild(String name) {
071:                CSViewBeanBase pvb = (CSViewBeanBase) getParentViewBean();
072:                if (name.equals(URL_TEXT)) {
073:                    return new TextField(this , getModel(), URL_TEXT,
074:                            StartingGroupListModel.FIELD_URL, "", null);
075:                }
076:                if (name.equals(DEPTH_COMBO)) {
077:                    ComboBox child = new ComboBox(this , getModel(),
078:                            DEPTH_COMBO, StartingGroupListModel.FIELD_DEPTH,
079:                            "", null);
080:                    OptionList depthOptions = new OptionList(pvb
081:                            .getLocalizedStringArray(
082:                                    "sites.depth.options.label", ","), // labels
083:                            pvb.getLocalizedStringArray(
084:                                    "sites.depth.options.value", ",")); // values
085:                    child.setOptions(depthOptions);
086:                    return child;
087:                }
088:                if (name.equals(DEL_CHECKBOX)) {
089:                    return new CheckBox(this , getModel(), DEL_CHECKBOX,
090:                            StartingGroupListModel.FIELD_DELETE, "true",
091:                            "false", false, null);
092:                }
093:                if (name.equals(DEL_STARTING_BUTTON)) {
094:                    return new IPlanetButton(this , DEL_STARTING_BUTTON, pvb
095:                            .getLocalizedString("delete.text"));
096:                }
097:                throw new IllegalArgumentException("Invalid child name: "
098:                        + name);
099:            }
100:
101:            /**
102:             *
103:             *
104:             */
105:            public void beginDisplay(DisplayEvent event)
106:                    throws ModelControlException {
107:                // Ensure the primary model is non-null; if null, it would cause
108:                // havoc with the various methods dependent on the primary model
109:                StartingGroupListModel model = (StartingGroupListModel) getPrimaryModel();
110:                if (model == null) {
111:                    debugLogger.finer("PSSH_CSPSA0023");
112:                    throw new ModelControlException("Primary model is null");
113:                }
114:
115:                // The model will be executed automatically here by the base class
116:                super .beginDisplay(event);
117:
118:                resetTileIndex();
119:            }
120:
121:            public boolean beginDelStartingDisplay(ChildDisplayEvent event)
122:                    throws ModelControlException {
123:                return (getModel().getSize() > 1);
124:            }
125:
126:            /**
127:             *
128:             *
129:             */
130:            public StartingGroupListModel getModel() {
131:                return (StartingGroupListModel) getRequestContext()
132:                        .getModelManager().getModel(
133:                                StartingGroupListModel.class);
134:            }
135:
136:            /**
137:             *
138:             *
139:             */
140:            public Model[] getWebActionModels(int modelType) {
141:                // Mark the BasicCustomModel instance we're bound to as auto-retrieving.
142:                // This means it will automatically be executed via its retrieve()
143:                // method when the tiled view begins display.
144:                StartingGroupListModel model = getModel();
145:
146:                switch (modelType) {
147:                case MODEL_TYPE_RETRIEVE:
148:                    debugLogger.finer("PSSH_CSPSA0036");
149:                    if (this .getParentViewBean().getPageSessionAttribute(
150:                            "retrieved") == null) {
151:                        debugLogger.finer("PSSH_CSPSA0116");
152:                        model.setID(this .rulesetID);
153:                    }
154:                    return new Model[] { model };
155:                case MODEL_TYPE_UPDATE:
156:                    debugLogger.finer("PSSH_CSPSA0037");
157:                    model.setID(this .rulesetID);
158:                    return new Model[] { model };
159:                case MODEL_TYPE_INSERT:
160:                    debugLogger.finer("PSSH_CSPSA0038");
161:                    return new Model[] { model };
162:                case MODEL_TYPE_DELETE:
163:                    debugLogger.finer("PSSH_CSPSA0039");
164:                    return new Model[] { model };
165:                }
166:
167:                return new Model[0];
168:            }
169:
170:            public void handleDelStartingRequest(RequestInvocationEvent event)
171:                    throws ModelControlException {
172:                getParentViewBean()
173:                        .setPageSessionAttribute("retrieved", "true");
174:                StartingGroupListModel model = getModel();
175:                TiledViewRequestInvocationEvent tiledEvent = (TiledViewRequestInvocationEvent) event;
176:                int selRow = tiledEvent.getTileNumber();
177:                model.setDelIndex(selRow);
178:                try {
179:                    ModelExecutionContext modExe = new ModelExecutionContextBase(
180:                            ModelExecutionContext.OPERATION_DELETE);
181:                    executeAutoDeletingModels(modExe);
182:                } catch (ModelControlException e) {
183:                    debugLogger.log(Level.INFO, "PSSH_CSPSA0010", e
184:                            .getMessage());
185:                }
186:                ViewBean viewBean = getParentViewBean();
187:                viewBean.forwardTo(getRequestContext());
188:            }
189:
190:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.