Source Code Cross Referenced for WebApplicationDefinitionImpl.java in  » Portal » jetspeed-2.1.3 » org » apache » jetspeed » om » servlet » impl » 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 » jetspeed 2.1.3 » org.apache.jetspeed.om.servlet.impl 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:        package org.apache.jetspeed.om.servlet.impl;
018:
019:        import java.io.Serializable;
020:        import java.util.ArrayList;
021:        import java.util.Collection;
022:        import java.util.Locale;
023:
024:        import javax.servlet.ServletContext;
025:
026:        import org.apache.commons.logging.Log;
027:        import org.apache.commons.logging.LogFactory;
028:        import org.apache.jetspeed.om.common.MutableDescription;
029:        import org.apache.jetspeed.om.common.MutableDisplayName;
030:        import org.apache.jetspeed.om.common.servlet.MutableWebApplication;
031:        import org.apache.jetspeed.om.impl.DescriptionImpl;
032:        import org.apache.jetspeed.om.impl.DescriptionSetImpl;
033:        import org.apache.jetspeed.om.impl.DisplayNameSetImpl;
034:        import org.apache.jetspeed.om.impl.WebAppDescriptionImpl;
035:        import org.apache.jetspeed.om.impl.WebAppDisplayNameImpl;
036:        import org.apache.jetspeed.util.JetspeedLocale;
037:        import org.apache.jetspeed.util.JetspeedLongObjectID;
038:        import org.apache.pluto.om.common.Description;
039:        import org.apache.pluto.om.common.DescriptionSet;
040:        import org.apache.pluto.om.common.DisplayName;
041:        import org.apache.pluto.om.common.DisplayNameSet;
042:        import org.apache.pluto.om.common.ObjectID;
043:        import org.apache.pluto.om.common.ParameterSet;
044:        import org.apache.pluto.om.servlet.ServletDefinitionList;
045:        import org.apache.pluto.om.common.SecurityRole;
046:        import org.apache.pluto.om.common.SecurityRoleSet;
047:
048:        /**
049:         * 
050:         * WebApplicationDefinitionImpl
051:         * 
052:         * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
053:         * @version $Id: WebApplicationDefinitionImpl.java 516448 2007-03-09 16:25:47Z ate $
054:         *
055:         */
056:        public class WebApplicationDefinitionImpl implements 
057:                MutableWebApplication, Serializable {
058:            private Long id;
059:            private JetspeedLongObjectID oid;
060:            private Collection displayNames = new ArrayList();
061:            private DisplayNameSetImpl DNCollWrapper = new DisplayNameSetImpl();
062:
063:            private Collection descriptions = new ArrayList();
064:            private DescriptionSetImpl descCollWrapper = new DescriptionSetImpl(
065:                    DescriptionImpl.TYPE_WEB_APP);
066:            private Collection securityRoles = new ArrayList();
067:            private SecurityRoleSetImpl secRolesListWrapper = new SecurityRoleSetImpl();
068:
069:            private String contextRoot;
070:            private ParameterSet initParameters;
071:
072:            private static final Log log = LogFactory
073:                    .getLog(WebApplicationDefinitionImpl.class);
074:
075:            /**
076:             * @see org.apache.pluto.om.servlet.WebApplicationDefinition#getId()
077:             */
078:            public ObjectID getId() {
079:                if (oid == null && id != null) {
080:                    oid = new JetspeedLongObjectID(id);
081:                }
082:                return oid;
083:            }
084:
085:            /**
086:             * @see org.apache.pluto.om.servlet.WebApplicationDefinition#getDisplayName()
087:             */
088:            public DisplayName getDisplayName(Locale locale) {
089:
090:                if (displayNames != null) {
091:                    DNCollWrapper.setInnerCollection(displayNames);
092:                    return DNCollWrapper.get(locale);
093:                }
094:                return null;
095:
096:            }
097:
098:            /**
099:             * @see org.apache.pluto.om.servlet.WebApplicationDefinition#getDescription()
100:             */
101:            public Description getDescription(Locale locale) {
102:                if (descriptions != null) {
103:                    descCollWrapper.setInnerCollection(descriptions);
104:                    return descCollWrapper.get(locale);
105:                }
106:                return null;
107:
108:            }
109:
110:            /**
111:             * @see org.apache.pluto.om.servlet.WebApplicationDefinition#getInitParameterSet()
112:             */
113:            public ParameterSet getInitParameterSet() {
114:                return initParameters;
115:            }
116:
117:            /**
118:             * @see org.apache.pluto.om.servlet.WebApplicationDefinition#getServletDefinitionList()
119:             */
120:            public ServletDefinitionList getServletDefinitionList() {
121:                // TODO Auto-generated method stub
122:                return null;
123:            }
124:
125:            /**
126:             * @see org.apache.pluto.om.servlet.WebApplicationDefinition#getServletContext(javax.servlet.ServletContext)
127:             */
128:            public ServletContext getServletContext(
129:                    ServletContext servletContext) {
130:                // TODO Auto-generated method stub
131:                return null;
132:            }
133:
134:            /**
135:             * @see org.apache.pluto.om.servlet.WebApplicationDefinition#getContextRoot()
136:             */
137:            public String getContextRoot() {
138:                return contextRoot;
139:            }
140:
141:            /**
142:             * @see org.apache.pluto.om.servlet.WebApplicationDefinitionCtrl#setDisplayName(java.lang.String)
143:             */
144:            public void setDisplayNameSet(DisplayNameSet displayNames) {
145:                this .displayNames = ((DisplayNameSetImpl) displayNames)
146:                        .getInnerCollection();
147:            }
148:
149:            /**
150:             * @see org.apache.jetspeed.om.common.servlet.WebApplicationComposite#setContextRoot(java.lang.String)
151:             */
152:            public void setContextRoot(String contextRoot) {
153:                this .contextRoot = contextRoot;
154:            }
155:
156:            /**
157:             * @see org.apache.jetspeed.om.common.servlet.MutableWebApplication#addDescription(java.util.Locale, java.lang.String)
158:             */
159:            public void addDescription(Locale locale, String description) {
160:                if (descriptions == null) {
161:                    descriptions = new ArrayList();
162:                }
163:                descCollWrapper.setInnerCollection(descriptions);
164:                try {
165:                    MutableDescription descObj = new WebAppDescriptionImpl();
166:
167:                    descObj.setLocale(locale);
168:                    descObj.setDescription(description);
169:                    descCollWrapper.addDescription(descObj);
170:                } catch (Exception e) {
171:                    String msg = "Unable to instantiate Description implementor, "
172:                            + e.toString();
173:                    log.error(msg, e);
174:                    throw new IllegalStateException(msg);
175:                }
176:            }
177:
178:            /**
179:             * @see org.apache.jetspeed.om.common.servlet.MutableWebApplication#addDisplayName(java.util.Locale, java.lang.String)
180:             */
181:            public void addDisplayName(Locale locale, String name) {
182:                if (displayNames == null) {
183:                    displayNames = new ArrayList();
184:                }
185:                DNCollWrapper.setInnerCollection(displayNames);
186:                try {
187:                    MutableDisplayName dn = new WebAppDisplayNameImpl();
188:
189:                    dn.setLocale(locale);
190:                    dn.setDisplayName(name);
191:                    DNCollWrapper.addDisplayName(dn);
192:                } catch (Exception e) {
193:                    String msg = "Unable to instantiate DisplayName implementor, "
194:                            + e.toString();
195:                    log.error(msg, e);
196:                    throw new IllegalStateException(msg);
197:                }
198:
199:            }
200:
201:            /**
202:             * @see org.apache.jetspeed.om.common.servlet.MutableWebApplication#setDescriptionSet(org.apache.pluto.om.common.DescriptionSet)
203:             */
204:            public void setDescriptionSet(DescriptionSet descriptions) {
205:                this .descriptions = ((DescriptionSetImpl) descriptions)
206:                        .getInnerCollection();
207:            }
208:
209:            /**
210:             *  Remove when Castor is mapped correctly
211:             * @deprecated
212:             * @return
213:             */
214:            public String getDescription() {
215:                Description desc = getDescription(JetspeedLocale
216:                        .getDefaultLocale());
217:                if (desc != null) {
218:                    return desc.getDescription();
219:                }
220:                return null;
221:            }
222:
223:            /**
224:             *  Remove when Castor is mapped correctly
225:             * @deprecated
226:             * @param desc
227:             */
228:            public void setDescription(String desc) {
229:                addDescription(JetspeedLocale.getDefaultLocale(), desc);
230:            }
231:
232:            /**
233:             * @see org.apache.pluto.om.servlet.WebApplicationDefinition#getSecurityRoles()
234:             */
235:            public SecurityRoleSet getSecurityRoles() {
236:                secRolesListWrapper.setInnerCollection(securityRoles);
237:                return secRolesListWrapper;
238:            }
239:
240:            /**
241:             * @see org.apache.jetspeed.om.common.servlet.MutableWebApplication#addSecurityRole(org.apache.pluto.om.common.SecurityRole)
242:             */
243:            public void addSecurityRole(SecurityRole securityRole) {
244:                secRolesListWrapper.setInnerCollection(securityRoles);
245:                secRolesListWrapper.add(securityRole);
246:            }
247:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.