Source Code Cross Referenced for WizardPageDefinitionController.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/WizardPageDefinitionController.java $
003:         * $Id:WizardPageDefinitionController.java 9134 2006-05-08 20:28:42Z chmaurer@iupui.edu $
004:         ***********************************************************************************
005:         *
006:         * Copyright (c) 2005, 2006 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.HashSet;
024:        import java.util.List;
025:        import java.util.Map;
026:        import java.util.Iterator;
027:
028:        import org.sakaiproject.metaobj.utils.mvc.intf.CancelableController;
029:        import org.sakaiproject.tool.cover.ToolManager;
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.ScaffoldingCell;
034:        import org.theospi.portfolio.matrix.model.WizardPage;
035:        import org.theospi.portfolio.matrix.model.WizardPageDefinition;
036:        import org.theospi.portfolio.wizard.WizardFunctionConstants;
037:        import org.theospi.portfolio.wizard.model.WizardPageSequence;
038:
039:        /**
040:         * Created by IntelliJ IDEA.
041:         * User: John Ellis
042:         * Date: Jan 18, 2006
043:         * Time: 3:18:48 PM
044:         * To change this template use File | Settings | File Templates.
045:         */
046:        public class WizardPageDefinitionController extends
047:                EditScaffoldingCellController implements  CancelableController {
048:
049:            private List pageList = null;
050:
051:            /* (non-Javadoc)
052:             * @see org.theospi.utils.mvc.intf.FormController#referenceData(java.util.Map, java.lang.Object, org.springframework.validation.Errors)
053:             */
054:            public Map referenceData(Map request, Object command, Errors errors) {
055:                Map model = super .referenceData(request, command, errors);
056:
057:                ScaffoldingCell sCell = (ScaffoldingCell) command;
058:
059:                boolean wizardPublished = false;
060:
061:                if (sCell.getWizardPageDefinition() != null
062:                        && getWizardManager() != null)
063:                    if (sCell.getWizardPageDefinition().getId() != null) {
064:                        WizardPageSequence wps = getWizardManager()
065:                                .getWizardPageSeqByDef(
066:                                        sCell.getWizardPageDefinition().getId());
067:                        if (wps.getCategory() != null)
068:                            if (wps.getCategory().getWizard() != null)
069:                                wizardPublished = wps.getCategory().getWizard()
070:                                        .isPublished();
071:                    }
072:
073:                model.put("wizardPublished", new Boolean(wizardPublished));
074:                model.put("isPageUsed", wizardPublished
075:                        && isPageUsed(sCell.getWizardPageDefinition()));
076:                model.put("helperPage", "true");
077:                model.put("isWizard", "true");
078:                model.put("pageTitleKey", "title_editWizardPage");
079:                model.put("pageInstructionsKey",
080:                        "instructions_wizardPageSettings");
081:                return model;
082:            }
083:
084:            public Object fillBackingObject(Object incomingModel, Map request,
085:                    Map session, Map application) throws Exception {
086:                Object pages = session.get(WizardPageHelper.WIZARD_PAGE);
087:
088:                WizardPageDefinition page = null;
089:                if (pages instanceof  WizardPageDefinition) {
090:                    pageList = new ArrayList();
091:                    pageList.add(pages);
092:                }
093:                if (pages instanceof  List) {
094:                    pageList = (List) pages;
095:                }
096:
097:                page = (WizardPageDefinition) pageList.get(0);
098:
099:                session.remove(WizardPageHelper.CANCELED);
100:                page.setSiteId(ToolManager.getCurrentPlacement().getContext());
101:                ScaffoldingCell cell = new ScaffoldingCell();
102:                cell.setWizardPageDefinition(page);
103:                if (page.getId() == null) {
104:                    cell.setId(page.getNewId());
105:                } else {
106:                    cell.setId(page.getId());
107:                }
108:                EditedScaffoldingStorage sessionBean = new EditedScaffoldingStorage(
109:                        cell);
110:                session
111:                        .put(
112:                                EditedScaffoldingStorage.EDITED_SCAFFOLDING_STORAGE_SESSION_KEY,
113:                                sessionBean);
114:                checkForGuidance(session, cell);
115:                return cell;
116:            }
117:
118:            public ModelAndView handleRequest(Object requestModel, Map request,
119:                    Map session, Map application, Errors errors) {
120:                return super .handleRequest(requestModel, request, session,
121:                        application, errors); //To change body of overridden methods use File | Settings | File Templates.
122:            }
123:
124:            protected boolean isPublished(ScaffoldingCell scaffoldingCell) {
125:                return false;
126:            }
127:
128:            /**
129:             ** Determine if any completed wizard page has been 'used'
130:             ** (containing reflections,feedback,evaluations and/or added form items)
131:             */
132:            protected boolean isPageUsed(WizardPageDefinition pagedef) {
133:                if (pagedef == null)
134:                    return false;
135:
136:                List pageList = getMatrixManager().getPagesByPageDef(
137:                        pagedef.getId());
138:                for (Iterator pageIt = pageList.iterator(); pageIt.hasNext();) {
139:                    WizardPage wizardPage = (WizardPage) pageIt.next();
140:                    String pageId = wizardPage.getId().getValue();
141:
142:                    if (wizardPage.getReflections() != null
143:                            && wizardPage.getReflections().size() > 0)
144:                        return true;
145:                    if (wizardPage.getPageForms() != null
146:                            && wizardPage.getPageForms().size() > 0)
147:                        return true;
148:                    if (wizardPage.getFeedback() != null
149:                            && wizardPage.getFeedback().size() > 0)
150:                        return true;
151:                    if (wizardPage.getAttachments() != null
152:                            && wizardPage.getAttachments().size() > 0)
153:                        return true;
154:                    if (getReviewManager().getReviewsByParent(pageId) != null
155:                            && getReviewManager().getReviewsByParent(pageId)
156:                                    .size() > 0)
157:                        return true;
158:                }
159:                return false;
160:            }
161:
162:            protected void saveScaffoldingCell(Map request,
163:                    ScaffoldingCell scaffoldingCell) {
164:                // do nothing... let caller deal with it...
165:                scaffoldingCell.getWizardPageDefinition().setEvalWorkflows(
166:                        new HashSet(super .createEvalWorkflows(scaffoldingCell
167:                                .getWizardPageDefinition())));
168:            }
169:
170:            protected void prepareModelWithScaffoldingId(Map model,
171:                    ScaffoldingCell scaffoldingCell) {
172:                // do nothing... don't care about scaffolding id
173:            }
174:
175:            public boolean isCancel(Map request) {
176:                Object cancel = request.get("canceling");
177:                if (cancel == null) {
178:                    return false;
179:                }
180:                return cancel.equals("true");
181:            }
182:
183:            public ModelAndView processCancel(Map request, Map session,
184:                    Map application, Object command, Errors errors)
185:                    throws Exception {
186:                if (getTaggingManager().isTaggable()) {
187:                    session.remove(PROVIDERS_PARAM);
188:                }
189:                return new ModelAndView("return", WizardPageHelper.CANCELED,
190:                        "true");
191:            }
192:
193:            protected String getGuidanceViewPermission() {
194:                return WizardFunctionConstants.VIEW_WIZARDPAGE_GUIDANCE;
195:            }
196:
197:            protected String getGuidanceEditPermission() {
198:                return WizardFunctionConstants.EDIT_WIZARDPAGE_GUIDANCE;
199:            }
200:
201:            protected String getGuidanceTitle() {
202:                return "Guidance for Wizard Page";
203:            }
204:
205:            protected String getStyleReturnView() {
206:                return "page";
207:            }
208:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.