Source Code Cross Referenced for MasterScreen.java in  » J2EE » Enhydra-Demos » org » enhydra » barracuda » config » 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 » J2EE » Enhydra Demos » org.enhydra.barracuda.config 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Enhydra Java Application Server Project
003:         * 
004:         * The contents of this file are subject to the Enhydra Public License
005:         * Version 1.1 (the "License"); you may not use this file except in
006:         * compliance with the License. You may obtain a copy of the License on
007:         * the Enhydra web site (http://www.enhydra.org/).
008:         * 
009:         * Software distributed under the License is distributed on an "AS IS"
010:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 
011:         * the License for the specific terms governing rights and limitations
012:         * under the License.
013:         * 
014:         * The Initial Developer of the Enhydra Application Server is Lutris
015:         * Technologies, Inc. The Enhydra Application Server and portions created
016:         * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
017:         * All Rights Reserved.
018:         * 
019:         * Contributor(s):
020:         * 
021:         * $Id: MasterScreen.java,v 1.1 2006-09-11 12:30:02 sinisa Exp $
022:         */
023:        package org.enhydra.barracuda.config;
024:
025:        import java.io.*;
026:        import java.util.*;
027:        import java.lang.ref.*;
028:        import java.net.*;
029:        import javax.servlet.*;
030:        import javax.servlet.http.*;
031:
032:        import org.apache.log4j.*;
033:        import org.w3c.dom.*;
034:        import org.w3c.dom.html.*;
035:
036:        import org.enhydra.barracuda.config.events.*;
037:        import org.enhydra.barracuda.config.xmlc.*;
038:        import org.barracudamvc.core.comp.*;
039:        import org.barracudamvc.core.event.*;
040:        import org.barracudamvc.core.event.helper.*;
041:        import org.barracudamvc.core.forms.*;
042:        import org.barracudamvc.core.util.dom.*;
043:        import org.barracudamvc.core.util.srv.*;
044:        import org.barracudamvc.core.view.*;
045:        import org.barracudamvc.plankton.data.*;
046:        import org.barracudamvc.plankton.http.*;
047:
048:        /**
049:         * This class represents the master Barracuda config screen. It is stored 
050:         * in the users session on a per-locale basis, and is used kind of as a 
051:         * master repository for objects that make up the system.
052:         */
053:        public class MasterScreen {
054:
055:            //public constants
056:            protected static final Logger logger = Logger
057:                    .getLogger(MasterScreen.class.getName());
058:            public static final String KEY = MasterScreen.class.getName()
059:                    + ".Key";
060:
061:            public Document dom = null;
062:            public EventGateway egRoot = null;
063:            public BComponent bcRoot = null;
064:            public TabsModel tabsModel = null;
065:            public TemplateModel masterModel = null;
066:            public TemplateModel compModel = null;
067:            public TemplateModel dataModel = null;
068:            public TemplateModel domModel = null;
069:            public TemplateModel eventModel = null;
070:            public TemplateModel formsModel = null;
071:            public TemplateModel utilModel = null;
072:            public TemplateModel viewModel = null;
073:            public Locale locale = null;
074:
075:            //------------------- MasterScreen ---------------------------
076:            public MasterScreen(EventGateway iegRoot, Locale ilocale) {
077:                if (logger.isDebugEnabled())
078:                    logger.debug("Creating new ConfigScreen object");
079:
080:                //save a copy of the locale
081:                egRoot = iegRoot;
082:                locale = ilocale;
083:
084:                //load the localized DOM template
085:                try {
086:                    dom = DefaultDOMLoader.getGlobalInstance().getDOM(
087:                            ConfigHTML.class, locale);
088:                } catch (IOException e) {
089:                    logger.fatal("Fatal Error loading DOM template:", e);
090:                }
091:
092:                //create the root component
093:                bcRoot = new BComponent();
094:
095:                //create the tab template
096:                BTemplate btTabs = new BTemplate();
097:                bcRoot.addChild(btTabs);
098:                //...create the views (we're storing directives in separate file)
099:                try {
100:                    Properties props = new Properties();
101:                    props.load(this .getClass().getResourceAsStream(
102:                            "Config.directives"));
103:                    Node node = dom.getElementById("ConfigTabs");
104:                    TemplateView tv = new DefaultTemplateView(node, "id",
105:                            new MapStateMap(props));
106:                    btTabs.addView(tv);
107:                } catch (IOException e) {
108:                    logger.fatal("Fatal err loading properties file:", e);
109:                }
110:                //...create the models
111:                //......Master model
112:                MasterConfig masterConfig = (MasterConfig) SimpleServiceFinder
113:                        .findInstance(MasterConfig.class, egRoot,
114:                                SimpleServiceFinder.DOWNSTREAM);
115:                if (masterConfig != null) {
116:                    masterModel = masterConfig.getModel();
117:                    btTabs.addModel(masterModel);
118:                }
119:                //......Tabs model
120:                tabsModel = new TabsModel(btTabs);
121:                btTabs.addModel(tabsModel);
122:                //......Comp screen model
123:                CompConfig compConfig = (CompConfig) SimpleServiceFinder
124:                        .findInstance(CompConfig.class, egRoot,
125:                                SimpleServiceFinder.DOWNSTREAM);
126:                if (compConfig != null) {
127:                    compModel = compConfig.getModel();
128:                    btTabs.addModel(compModel);
129:                }
130:                //......Data screen model
131:                DataConfig dataConfig = (DataConfig) SimpleServiceFinder
132:                        .findInstance(DataConfig.class, egRoot,
133:                                SimpleServiceFinder.DOWNSTREAM);
134:                if (dataConfig != null) {
135:                    dataModel = dataConfig.getModel();
136:                    btTabs.addModel(dataModel);
137:                }
138:                //......Dom screen model
139:                DomConfig domConfig = (DomConfig) SimpleServiceFinder
140:                        .findInstance(DomConfig.class, egRoot,
141:                                SimpleServiceFinder.DOWNSTREAM);
142:                if (domConfig != null) {
143:                    domModel = domConfig.getModel();
144:                    btTabs.addModel(domModel);
145:                }
146:                //......Event screen model
147:                EventConfig eventConfig = (EventConfig) SimpleServiceFinder
148:                        .findInstance(EventConfig.class, egRoot,
149:                                SimpleServiceFinder.DOWNSTREAM);
150:                if (eventConfig != null) {
151:                    eventModel = eventConfig.getModel();
152:                    btTabs.addModel(eventModel);
153:                }
154:                //......Forms screen model
155:                FormsConfig formsConfig = (FormsConfig) SimpleServiceFinder
156:                        .findInstance(FormsConfig.class, egRoot,
157:                                SimpleServiceFinder.DOWNSTREAM);
158:                if (formsConfig != null) {
159:                    formsModel = formsConfig.getModel();
160:                    btTabs.addModel(formsModel);
161:                }
162:                //......Util screen model
163:                UtilConfig utilConfig = (UtilConfig) SimpleServiceFinder
164:                        .findInstance(UtilConfig.class, egRoot,
165:                                SimpleServiceFinder.DOWNSTREAM);
166:                if (utilConfig != null) {
167:                    utilModel = utilConfig.getModel();
168:                    btTabs.addModel(utilModel);
169:                }
170:                //......View screen model
171:                ViewConfig viewConfig = (ViewConfig) SimpleServiceFinder
172:                        .findInstance(ViewConfig.class, egRoot,
173:                                SimpleServiceFinder.DOWNSTREAM);
174:                if (viewConfig != null) {
175:                    viewModel = viewConfig.getModel();
176:                    btTabs.addModel(viewModel);
177:                }
178:            }
179:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.