Source Code Cross Referenced for WizardPageController.java in  » ERP-CRM-Financial » sakai » org » theospi » portfolio » matrix » control » 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 » ERP CRM Financial » sakai » org.theospi.portfolio.matrix.control 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**********************************************************************************
002:         * $URL:https://source.sakaiproject.org/svn/osp/trunk/matrix/tool/src/java/org/theospi/portfolio/matrix/control/WizardPageController.java $
003:         * $Id:WizardPageController.java 9134 2006-05-08 20:28:42Z chmaurer@iupui.edu $
004:         ***********************************************************************************
005:         *
006:         * Copyright (c) 2005, 2006, 2007 The Sakai Foundation.
007:         *
008:         * Licensed under the Educational Community License, Version 1.0 (the "License");
009:         * you may not use this file except in compliance with the License.
010:         * You may obtain a copy of the License at
011:         *
012:         *      http://www.opensource.org/licenses/ecl1.php
013:         *
014:         * Unless required by applicable law or agreed to in writing, software
015:         * distributed under the License is distributed on an "AS IS" BASIS,
016:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017:         * See the License for the specific language governing permissions and
018:         * limitations under the License.
019:         *
020:         **********************************************************************************/package org.theospi.portfolio.matrix.control;
021:
022:        import java.util.ArrayList;
023:        import java.util.List;
024:        import java.util.Map;
025:
026:        import org.sakaiproject.metaobj.shared.model.Agent;
027:        import org.sakaiproject.metaobj.shared.model.Id;
028:        import org.sakaiproject.metaobj.shared.control.ToolFinishedView;
029:        import org.sakaiproject.tool.api.ToolSession;
030:        import org.springframework.validation.Errors;
031:        import org.springframework.web.servlet.ModelAndView;
032:        import org.theospi.portfolio.matrix.WizardPageHelper;
033:        import org.theospi.portfolio.matrix.model.Cell;
034:        import org.theospi.portfolio.matrix.model.ScaffoldingCell;
035:        import org.theospi.portfolio.matrix.model.WizardPage;
036:        import org.theospi.portfolio.matrix.model.WizardPageDefinition;
037:        import org.theospi.portfolio.style.model.Style;
038:        import org.theospi.portfolio.wizard.mgt.WizardManager;
039:        import org.theospi.portfolio.wizard.model.CompletedWizard;
040:        import org.theospi.portfolio.wizard.model.Wizard;
041:        import org.theospi.portfolio.wizard.model.WizardPageSequence;
042:
043:        /**
044:         * openEvaluationPageHierRedirect will put the user here
045:         * 
046:         * Created by IntelliJ IDEA. User: John Ellis Date: Jan 24, 2006 Time: 3:46:49
047:         * PM To change this template use File | Settings | File Templates.
048:         */
049:        public class WizardPageController extends CellController {
050:
051:            private WizardManager wizardManager;
052:
053:            /*
054:             * (non-Javadoc)
055:             * 
056:             * @see org.theospi.utils.mvc.intf.FormController#referenceData(java.util.Map,
057:             *      java.lang.Object, org.springframework.validation.Errors)
058:             */
059:            public Map referenceData(Map request, Object command, Errors errors) {
060:                ToolSession session = getSessionManager()
061:                        .getCurrentToolSession();
062:
063:                Map model = super .referenceData(request, command, errors);
064:                Boolean wizardPreview = Boolean.valueOf((String) request
065:                        .get("wizardPreview"));
066:
067:                Agent owner = (Agent) request
068:                        .get(WizardPageHelper.WIZARD_OWNER);
069:
070:                if (owner == null)
071:                    owner = (Agent) session
072:                            .getAttribute(WizardPageHelper.WIZARD_OWNER);
073:
074:                session.setAttribute(WizardPageHelper.WIZARD_OWNER, owner);
075:
076:                model.put("readOnlyMatrix", super .isReadOnly(owner, null));
077:                model.put("pageTitleKey", "view_wizardPage");
078:                model.put("helperPage", "true");
079:                model.put("isWizard", "true");
080:                model.put("isMatrix", "false");
081:                model.put("categoryTitle", request.get("categoryTitle"));
082:                model.put("wizardTitle", request.get("wizardTitle"));
083:                model
084:                        .put("wizardDescription", request
085:                                .get("wizardDescription"));
086:                return model;
087:            }
088:
089:            /**
090:             * {@inheritDoc}
091:             */
092:            protected Style getDefaultStyle(Id pageId) {
093:                // Get the wizard default style
094:                CompletedWizard cw = getWizardManager()
095:                        .getCompletedWizardByPage(pageId);
096:                return cw.getWizard().getStyle();
097:            }
098:
099:            /**
100:             * {@inheritDoc}
101:             */
102:            protected String[] getObjectMetadata(String pageId, Map request) {
103:                String[] objectMetadata = new String[3];
104:
105:                WizardPage page = getMatrixManager().getWizardPage(
106:                        getIdManager().getId(pageId));
107:                WizardPageSequence seq = wizardManager
108:                        .getWizardPageSeqByDef(page.getPageDefinition().getId());
109:                Wizard wizard = seq.getCategory().getWizard();
110:
111:                objectMetadata[METADATA_ID_INDEX] = wizard.getId().getValue();
112:                objectMetadata[METADATA_TITLE_INDEX] = wizard.getName();
113:                objectMetadata[METADATA_DESC_INDEX] = wizard.getDescription();
114:                return objectMetadata;
115:            }
116:
117:            /**
118:             * If there is a page in the session we want to display that. Otherwise look
119:             * in the request for "page_id" If you are getting the wrong page displayed
120:             * then you should make sure that the appropriate session/request variables
121:             * are set.
122:             * 
123:             * @param incomingModel
124:             * @param request
125:             * @param session
126:             * @param application
127:             * @throws Exception
128:             */
129:            public Object fillBackingObject(Object incomingModel, Map request,
130:                    Map session, Map application) throws Exception {
131:                WizardPage page = (WizardPage) session
132:                        .get(WizardPageHelper.WIZARD_PAGE);
133:                Id pageId = null;
134:                if (page != null)
135:                    pageId = page.getId();
136:                else
137:                    pageId = getIdManager().getId(
138:                            (String) request.get("page_id"));
139:                page = getMatrixManager().getWizardPage(pageId);
140:                session.put(WizardPageHelper.WIZARD_PAGE, page);
141:                session.remove(WizardPageHelper.CANCELED);
142:
143:                Agent owner = (Agent) session
144:                        .get(WizardPageHelper.WIZARD_OWNER);
145:                request.put(WizardPageHelper.WIZARD_OWNER, owner);
146:
147:                WizardPageSequence seq = wizardManager
148:                        .getWizardPageSeqByDef(page.getPageDefinition().getId());
149:                if (seq.getCategory().getParentCategory() != null)
150:                    request.put("categoryTitle", seq.getCategory().getTitle());
151:                else
152:                    request.put("categoryTitle", "");
153:
154:                request.put("wizardPreview", Boolean.toString(seq.getCategory()
155:                        .getWizard().isPreview()));
156:                request.put("wizardTitle", seq.getCategory().getWizard()
157:                        .getName());
158:                request.put("wizardDescription", seq.getCategory().getWizard()
159:                        .getDescription());
160:
161:                Cell cell = createCellWrapper(page);
162:
163:                CellFormBean cellBean = (CellFormBean) incomingModel;
164:                cellBean.setCell(cell);
165:                List nodeList = new ArrayList(getMatrixManager()
166:                        .getPageContents(page));
167:                cellBean.setNodes(nodeList);
168:
169:                return cellBean;
170:            }
171:
172:            public ModelAndView handleRequest(Object requestModel, Map request,
173:                    Map session, Map application, Errors errors) {
174:
175:                String submitWizardAction = (String) request
176:                        .get("submitWizard");
177:
178:                if (submitWizardAction != null) {
179:                    session.put(ToolFinishedView.ALTERNATE_DONE_URL,
180:                            "submitWizard");
181:                    return new ModelAndView("confirmWizard", "", "");
182:                }
183:
184:                return super .handleRequest(requestModel, request, session,
185:                        application, errors);
186:            }
187:
188:            public static Cell createCellWrapper(WizardPage page) {
189:                Cell cell = new Cell();
190:                cell.setWizardPage(page);
191:                if (page.getId() == null) {
192:                    cell.setId(page.getNewId());
193:                } else {
194:                    cell.setId(page.getId());
195:                }
196:
197:                WizardPageDefinition pageDef = page.getPageDefinition();
198:
199:                ScaffoldingCell cellDef = new ScaffoldingCell();
200:                cellDef.setWizardPageDefinition(pageDef);
201:                if (pageDef.getId() == null) {
202:                    cellDef.setId(pageDef.getNewId());
203:                } else {
204:                    cellDef.setId(pageDef.getId());
205:                }
206:
207:                cell.setScaffoldingCell(cellDef);
208:                return cell;
209:            }
210:
211:            public WizardManager getWizardManager() {
212:                return wizardManager;
213:            }
214:
215:            public void setWizardManager(WizardManager wizardManager) {
216:                this.wizardManager = wizardManager;
217:            }
218:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.