Source Code Cross Referenced for JSSeedData.java in  » Portal » jetspeed-2.1.3 » org » apache » jetspeed » serializer » objects » 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.serializer.objects 
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:
018:        package org.apache.jetspeed.serializer.objects;
019:
020:        import org.apache.commons.lang.StringEscapeUtils;
021:
022:        import javolution.xml.XMLFormat;
023:        import javolution.xml.stream.XMLStreamException;
024:
025:        public class JSSeedData extends JSSnapshot {
026:
027:            public static final int softwareVersion = 1;
028:
029:            public static final int softwareSubVersion = 0;
030:
031:            private String encryption;
032:
033:            private JSMimeTypes mimeTypes;
034:
035:            private JSMediaTypes mediaTypes;
036:
037:            private JSClients clients;
038:
039:            private JSCapabilities capabilities;
040:
041:            private JSRoles roles;
042:
043:            private JSGroups groups;
044:
045:            private JSUsers users;
046:
047:            private JSPermissions permissions;
048:
049:            private JSProfilingRules rules;
050:
051:            private String defaultRule;
052:
053:            /**
054:             * check the software version and subvversion against the saved
055:             * version...and verify whether it is compatible...
056:             * 
057:             * @return the current software can process this file
058:             */
059:            public boolean checkVersion() {
060:                return true;
061:            }
062:
063:            /**
064:             * @return Returns the softwareSubVersion.
065:             */
066:            public int getSoftwareSubVersion() {
067:                return softwareSubVersion;
068:            }
069:
070:            /**
071:             * @return Returns the softwareVersion.
072:             */
073:            public int getSoftwareVersion() {
074:                return softwareVersion;
075:            }
076:
077:            public JSSeedData() {
078:                super ();
079:                System.out.println("JSSeedData Class created");
080:            }
081:
082:            public JSSeedData(String name) {
083:                super ();
084:
085:                mimeTypes = new JSMimeTypes();
086:                mediaTypes = new JSMediaTypes();
087:                clients = new JSClients();
088:                capabilities = new JSCapabilities();
089:                roles = new JSRoles();
090:                groups = new JSGroups();
091:                users = new JSUsers();
092:                permissions = new JSPermissions();
093:                rules = new JSProfilingRules();
094:            }
095:
096:            /***************************************************************************
097:             * SERIALIZER
098:             */
099:            protected static final XMLFormat XML = new XMLFormat(
100:                    JSSeedData.class) {
101:
102:                public void write(Object o, OutputElement xml)
103:                        throws XMLStreamException {
104:
105:                    try {
106:
107:                        JSSnapshot.XML.write(o, xml);
108:
109:                        JSSeedData g = (JSSeedData) o;
110:
111:                        xml.add(g.getDefaultRule(), "default_rule",
112:                                String.class);
113:
114:                        xml.add(g.encryption, "encryption", String.class);
115:
116:                        /** implicitly named (through binding) fields here */
117:
118:                        xml.add(g.getMimeTypes());
119:                        xml.add(g.getMediaTypes());
120:                        xml.add(g.getCapabilities());
121:                        xml.add(g.getClients());
122:
123:                        xml.add(g.getRoles());
124:                        xml.add(g.getGroups());
125:                        xml.add(g.getUsers());
126:
127:                        xml.add(g.getPermissions());
128:                        xml.add(g.getRules());
129:
130:                    } catch (Exception e) {
131:                        e.printStackTrace();
132:                    }
133:                }
134:
135:                public void read(InputElement xml, Object o) {
136:                    try {
137:                        JSSnapshot.XML.read(xml, o); // Calls parent read.
138:                        JSSeedData g = (JSSeedData) o;
139:                        Object o1 = xml.get("default_rule", String.class);
140:                        if (o1 instanceof  String)
141:                            g.defaultRule = StringEscapeUtils
142:                                    .unescapeHtml((String) o1);
143:                        o1 = xml.get("encryption", String.class);
144:                        if (o1 instanceof  String)
145:                            g.encryption = StringEscapeUtils
146:                                    .unescapeHtml((String) o1);
147:
148:                        while (xml.hasNext()) {
149:                            o1 = xml.getNext(); // mime
150:
151:                            if (o1 instanceof  JSMimeTypes)
152:                                g.mimeTypes = (JSMimeTypes) o1;
153:                            else if (o1 instanceof  JSMediaTypes)
154:                                g.mediaTypes = (JSMediaTypes) o1;
155:                            else if (o1 instanceof  JSClients)
156:                                g.clients = (JSClients) o1;
157:                            else if (o1 instanceof  JSCapabilities)
158:                                g.capabilities = (JSCapabilities) o1;
159:                            else if (o1 instanceof  JSRoles)
160:                                g.roles = (JSRoles) o1;
161:                            else if (o1 instanceof  JSGroups)
162:                                g.groups = (JSGroups) o1;
163:                            else if (o1 instanceof  JSUsers)
164:                                g.users = (JSUsers) o1;
165:                            else if (o1 instanceof  JSPermissions)
166:                                g.permissions = (JSPermissions) o1;
167:                            else if (o1 instanceof  JSProfilingRules)
168:                                g.rules = (JSProfilingRules) o1;
169:                        }
170:                    } catch (Exception e) {
171:                        e.printStackTrace();
172:                    }
173:                }
174:            };
175:
176:            /**
177:             * @return Returns the groups.
178:             */
179:            public JSGroups getGroups() {
180:                return groups;
181:            }
182:
183:            /**
184:             * @param groups
185:             *            The groups to set.
186:             */
187:            public void setGroups(JSGroups groups) {
188:                this .groups = groups;
189:            }
190:
191:            /**
192:             * @return Returns the roles.
193:             */
194:            public JSRoles getRoles() {
195:                return roles;
196:            }
197:
198:            /**
199:             * @param roles
200:             *            The roles to set.
201:             */
202:            public void setRoles(JSRoles roles) {
203:                this .roles = roles;
204:            }
205:
206:            /**
207:             * @return Returns the roles.
208:             */
209:            public JSUsers getUsers() {
210:                return users;
211:            }
212:
213:            /**
214:             * @return Returns the encryption.
215:             */
216:            public String getEncryption() {
217:                return encryption;
218:            }
219:
220:            /**
221:             * @param encryption
222:             *            The encryption to set.
223:             */
224:            public void setEncryption(String encryption) {
225:                this .encryption = encryption;
226:            }
227:
228:            /**
229:             * @return Returns the capabilities.
230:             */
231:            public JSCapabilities getCapabilities() {
232:                return capabilities;
233:            }
234:
235:            /**
236:             * @param capabilities
237:             *            The capabilities to set.
238:             */
239:            public void setCapabilities(JSCapabilities capabilities) {
240:                this .capabilities = capabilities;
241:            }
242:
243:            /**
244:             * @return Returns the clients.
245:             */
246:            public JSClients getClients() {
247:                return clients;
248:            }
249:
250:            /**
251:             * @param clients
252:             *            The clients to set.
253:             */
254:            public void setClients(JSClients clients) {
255:                this .clients = clients;
256:            }
257:
258:            /**
259:             * @return Returns the mediaTypes.
260:             */
261:            public JSMediaTypes getMediaTypes() {
262:                return mediaTypes;
263:            }
264:
265:            /**
266:             * @param mediaTypes
267:             *            The mediaTypes to set.
268:             */
269:            public void setMediaTypes(JSMediaTypes mediaTypes) {
270:                this .mediaTypes = mediaTypes;
271:            }
272:
273:            /**
274:             * @return Returns the mimeTypes.
275:             */
276:            public JSMimeTypes getMimeTypes() {
277:                return mimeTypes;
278:            }
279:
280:            /**
281:             * @param mimeTypes
282:             *            The mimeTypes to set.
283:             */
284:            public void setMimeTypes(JSMimeTypes mimeTypes) {
285:                this .mimeTypes = mimeTypes;
286:            }
287:
288:            /**
289:             * @param users
290:             *            The users to set.
291:             */
292:            public void setUsers(JSUsers users) {
293:                this .users = users;
294:            }
295:
296:            /**
297:             * @return Returns the permissions.
298:             */
299:            public JSPermissions getPermissions() {
300:                return permissions;
301:            }
302:
303:            /**
304:             * @param permissions
305:             *            The permissions to set.
306:             */
307:            public void setPermissions(JSPermissions permissions) {
308:                this .permissions = permissions;
309:            }
310:
311:            /**
312:             * @return Returns the rules.
313:             */
314:            public JSProfilingRules getRules() {
315:                return rules;
316:            }
317:
318:            /**
319:             * @param rules
320:             *            The rules to set.
321:             */
322:            public void setRules(JSProfilingRules rules) {
323:                this .rules = rules;
324:            }
325:
326:            /**
327:             * @return Returns the defaultRule.
328:             */
329:            public String getDefaultRule() {
330:                return defaultRule;
331:            }
332:
333:            /**
334:             * @param defaultRule
335:             *            The defaultRule to set.
336:             */
337:            public void setDefaultRule(String defaultRule) {
338:                this.defaultRule = defaultRule;
339:            }
340:
341:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.