Source Code Cross Referenced for NewDocumentWizard.java in  » Content-Management-System » hippo-cms » nl » hippo » cms » wizard » 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 » Content Management System » hippo cms » nl.hippo.cms.wizard 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package nl.hippo.cms.wizard;
002:
003:        import java.util.HashMap;
004:        import java.util.Iterator;
005:
006:        import nl.hippo.cms.wizard.components.AbstractComponentContainer;
007:        import nl.hippo.cms.wizard.components.Component;
008:        import nl.hippo.cms.wizard.components.Configuration;
009:        import nl.hippo.cms.wizard.engines.Engine;
010:
011:        import org.springframework.web.context.WebApplicationContext;
012:
013:        /**
014:         * Root component for the wizard model. Holds an OrderedMap of Configurations which
015:         * are displayed as tabs.
016:         * 
017:         * @author a.bogaart@hippo.nl
018:         * 
019:         */
020:
021:        public class NewDocumentWizard extends AbstractComponentContainer
022:                implements  Wizard {
023:
024:            public static final String TYPE = "wizard";
025:
026:            private String resultAction = Constants.WIZARD_DEFAULT_RESULT_ACTION;
027:
028:            /**
029:             * Default Constructor
030:             */
031:            public NewDocumentWizard() throws Exception {
032:                this (Constants.WIZARD_DEFAULT_ID);
033:            }
034:
035:            /**
036:             * Configure Wizard with an id
037:             * 
038:             * @param id
039:             * @throws Exception 
040:             */
041:            public NewDocumentWizard(String id) throws Exception {
042:                super ();
043:                Configuration conf = new Configuration(new HashMap());
044:                conf.add(Constants.ID_ATTRIBUTE_NAME, id);
045:                configure(conf);
046:            }
047:
048:            public void configure(Configuration config) throws Exception {
049:                super .configure(config);
050:                if (config.get(Constants.DEFAULT_RESULT_ACTION_ATTRIBUTE_NAME) != null) {
051:                    resultAction = config
052:                            .get(Constants.DEFAULT_RESULT_ACTION_ATTRIBUTE_NAME);
053:                }
054:            }
055:
056:            /* (non-Javadoc)
057:             * @see nl.hippo.cms.wizard.Wizard#getResultAction()
058:             */
059:            public String getResultAction() {
060:                return resultAction;
061:            }
062:
063:            /* (non-Javadoc)
064:             * @see nl.hippo.cms.wizard.Wizard#setResultAction(String resultAction)
065:             */
066:            public void setResultAction(String resultAction) {
067:                this .resultAction = resultAction;
068:            }
069:
070:            //Override
071:            /**
072:             * Cforms stores the value of the current tab as an int, describing it's index in the OrderedMap.
073:             * @return Component  reference to current component in focus, or null if not found
074:             */
075:            public Component getCurrentComponent() {
076:                Integer integer = new Integer(getCurrent());
077:                int count = integer.intValue();
078:                int forCount = 0;
079:                Iterator it = components.values().iterator();
080:                while (it.hasNext()) {
081:                    Engine engine = (Engine) it.next();
082:                    if (count == forCount) {
083:                        return engine;
084:                    }
085:                    forCount++;
086:                }
087:                return null;
088:            }
089:
090:            //@Override
091:            /**
092:             * We can't have an empty or null value as initial state since this will break the behaviour of the
093:             * ResetOldResourceDropdown form event, so return 0 instead.
094:             */
095:            public String getCurrent() {
096:                String current = super .getCurrent();
097:                if (current == null || current.equals("")) {
098:                    return "0";
099:                }
100:                return current;
101:            }
102:
103:            //Override
104:            /* (non-Javadoc)
105:             * @see nl.hippo.cms.wizard.components.Component#fillResult(nl.hippo.cms.wizard.WizardResult, org.springframework.web.context.WebApplicationContext)
106:             */
107:            public void fillResult(WizardResult result,
108:                    WebApplicationContext model) throws Exception {
109:                Engine currentEngine = (Engine) getCurrentComponent();
110:                if (currentEngine == null) {
111:                    throw new Exception(
112:                            "No engine has been used, currentEngine is null.");
113:                }
114:                currentEngine.fillResult(result, model);
115:                result.setResultAction(resultAction);
116:            }
117:
118:            /* (non-Javadoc)
119:             * @see nl.hippo.cms.wizard.component.Component#getType()
120:             */
121:            public String getType() {
122:                return TYPE;
123:            }
124:
125:            /**
126:             * Different reset behaviour for the tabs, use super call to auto reset Resources but save tab state
127:             */
128:            //@Override
129:            public void reset() {
130:                String current = getCurrent();
131:                super.reset();
132:                setCurrent(current);
133:            }
134:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.