Source Code Cross Referenced for SchemaElements.java in  » Portal » Open-Portal » com » sun » ssoadapter » ab » pim » 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 » Open Portal » com.sun.ssoadapter.ab.pim 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * $Id: SchemaElements.java,v 1.2 2003/06/16 15:10:56 byork Exp $
003:         * Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use of this
004:         * product is subject to license terms. Federal Acquisitions:
005:         * Commercial Software -- Government Users Subject to Standard License Terms
006:         * and Conditions.
007:         *
008:         * Sun, Sun Microsystems, the Sun logo, and Sun ONE are trademarks or 
009:         * registered trademarks of Sun Microsystems, Inc. in the United States
010:         * and other countries.
011:         */package com.sun.ssoadapter.ab.pim;
012:
013:        import java.util.Map;
014:        import java.util.HashMap;
015:        import java.util.List;
016:        import java.util.ArrayList;
017:        import java.util.Enumeration;
018:        import java.util.StringTokenizer;
019:        import java.util.ResourceBundle;
020:
021:        import java.util.MissingResourceException;
022:
023:        public class SchemaElements implements  JPimABConstants {
024:            //
025:            // Contains schema elements common to Entry & PimAddressEntryElement
026:            // Key: Entry PropertyName, Value: PimAddressEntryElement PropertyName
027:            //
028:            private static Map caseExactCommonMap = new HashMap();
029:
030:            //
031:            // Stores the common PropertyNames in LowerCase.
032:            //
033:            private static Map caseInsensitiveCommonMap = new HashMap();
034:
035:            // 
036:            // Utility member to store all the common PropertyNames as array
037:            //
038:            private static Object[] caseExactCommonArray = null;
039:
040:            // 
041:            // Utility member to store all the AEFilterPropertyNames as array
042:            // = (caseExactCommonArray - PIM_AELEMENTS_NOT_SET)
043:            //
044:            private static String[] aePropertyNames = null;
045:
046:            //
047:            // Contains elements present only in PimAddressEntryElement or only
048:            // in Entry object.
049:            //
050:            private static Map exclusiveElementsOnlyMap = new HashMap();
051:
052:            //
053:            // Contains schema elements common to Group & PimAddressEntryElement
054:            // Key: Group PropertyName, Value: PimAddressEntryElement PropertyName
055:            //
056:            private static Map caseExactCommonGroupMap = new HashMap();
057:
058:            //
059:            // Stores the common PropertyNames in LowerCase.
060:            //
061:            private static Map caseInsensitiveCommonGroupMap = new HashMap();
062:
063:            // 
064:            // Utility member to store all the common PropertyNames as array
065:            //
066:            private static Object[] caseExactCommonGroupArray = null;
067:
068:            //
069:            // Contains elements present only in PimAddressEntryElement or only
070:            // in Group object.
071:            //
072:            private static Map exclusiveElementsOnlyGroupMap = new HashMap();
073:
074:            static {
075:                ResourceBundle resource = null;
076:                List removeForAEItems = new ArrayList();
077:
078:                //
079:                // Load the Common elements, Entry only elements & Pim only elements
080:                //
081:                try {
082:                    resource = ResourceBundle
083:                            .getBundle(ENTRY_PIM_ELEMENTS_FILE);
084:                    Enumeration keys = resource.getKeys();
085:                    while (keys.hasMoreElements()) {
086:                        String name = (String) keys.nextElement();
087:                        String value = (String) resource.getString(name);
088:
089:                        name = name.trim();
090:                        value = value.trim();
091:
092:                        if (value.equals(""))
093:                            continue; // dont add in empty values
094:
095:                        if (name.equals(ENTRY_ELEMENTS_ONLY_KEY)
096:                                || name.equals(PIM_ELEMENTS_ONLY_KEY)) {
097:                            StringTokenizer st = new StringTokenizer(value);
098:                            String[] arr = new String[st.countTokens()];
099:                            for (int i = 0; st.hasMoreTokens(); i++) {
100:                                arr[i] = st.nextToken();
101:                            }
102:                            exclusiveElementsOnlyMap.put(name, arr); // put an Array
103:                        } else if (name.equals(PIM_AELEMENTS_NOT_SET)) {
104:                            removeForAEItems.add(value);
105:                        } else {
106:                            caseExactCommonMap.put(name, value);
107:                            caseInsensitiveCommonMap.put(name.toLowerCase(),
108:                                    value);
109:                        }
110:                    }
111:
112:                    if (caseExactCommonMap != null) {
113:                        caseExactCommonArray = caseExactCommonMap.keySet()
114:                                .toArray();
115:
116:                        // properties not settable on AEItemFilter
117:                        int size = caseExactCommonArray.length
118:                                - removeForAEItems.size();
119:                        aePropertyNames = new String[size];
120:                        for (int i = 0, j = 0; i < caseExactCommonArray.length; i++) {
121:                            String prop = (String) caseExactCommonArray[i];
122:                            if (!removeForAEItems.contains(prop))
123:                                aePropertyNames[j++] = prop;
124:                        }
125:                    }
126:                } catch (MissingResourceException mre) {
127:                    caseExactCommonMap = null;
128:                    caseInsensitiveCommonMap = null;
129:                    exclusiveElementsOnlyMap = null;
130:                    caseExactCommonArray = null;
131:                }
132:
133:                //
134:                // Load the Common elements, Group only elements & Pim only elements
135:                //
136:                try {
137:                    resource = ResourceBundle
138:                            .getBundle(GROUP_PIM_ELEMENTS_FILE);
139:                    Enumeration keys = resource.getKeys();
140:                    while (keys.hasMoreElements()) {
141:                        String name = (String) keys.nextElement();
142:                        String value = (String) resource.getString(name);
143:
144:                        name = name.trim();
145:                        value = value.trim();
146:
147:                        if (value.equals(""))
148:                            continue; // dont add in empty values
149:
150:                        if (name.equals(GROUP_ELEMENTS_ONLY_KEY)
151:                                || name.equals(PIM_ELEMENTS_ONLY_KEY)) {
152:                            StringTokenizer st = new StringTokenizer(value);
153:                            String[] arr = new String[st.countTokens()];
154:                            for (int i = 0; st.hasMoreTokens(); i++) {
155:                                arr[i] = st.nextToken();
156:                            }
157:                            exclusiveElementsOnlyGroupMap.put(name, arr); // put an Array
158:                        } else {
159:                            caseExactCommonGroupMap.put(name, value);
160:                            caseInsensitiveCommonGroupMap.put(name
161:                                    .toLowerCase(), value);
162:                        }
163:                    }
164:
165:                    if (caseExactCommonGroupMap != null) {
166:                        caseExactCommonGroupArray = caseExactCommonGroupMap
167:                                .keySet().toArray();
168:                    }
169:                } catch (MissingResourceException mre) {
170:                    caseExactCommonGroupMap = null;
171:                    caseInsensitiveCommonGroupMap = null;
172:                    exclusiveElementsOnlyGroupMap = null;
173:                    caseExactCommonGroupArray = null;
174:                }
175:            }
176:
177:            /**
178:             * Gets the pimElement (Alligo - Exchange/Notes) name corresponding
179:             * to the Entry ElementName (JABAPI). Since the entryElementName
180:             * can be in any case, use the caseInsensitive Map
181:             */
182:
183:            public String getPimElementName(String entryElementName) {
184:                String name = entryElementName.toLowerCase();
185:                String pimName = (String) caseInsensitiveCommonMap.get(name);
186:
187:                return pimName;
188:            }
189:
190:            /**
191:             * @return String Array of schema elements only in JABAPIs Entry object
192:             */
193:            public String[] getEntryOnlySchemaElements() {
194:                String[] arr = (String[]) exclusiveElementsOnlyMap
195:                        .get(ENTRY_ELEMENTS_ONLY_KEY);
196:                return (arr);
197:            }
198:
199:            /**
200:             * @return String Array of schema elements only in 
201:             * PimAddressEntryElement object.
202:             */
203:            public String[] getPimOnlySchemaElements() {
204:                String[] arr = (String[]) exclusiveElementsOnlyMap
205:                        .get(PIM_ELEMENTS_ONLY_KEY);
206:                return (arr);
207:            }
208:
209:            /**
210:             * @return the Array of property names that can be set on the
211:             * PimAddressEntryItemFilter.
212:             */
213:            public Object[] getAEFilterPropertyNames() {
214:                return aePropertyNames;
215:            }
216:
217:            /**
218:             * @return the CaseExact property names common to Entry & 
219:             * PimAddressEntryElement
220:             */
221:            public Object[] getAllCommonPropertyNames() {
222:                return caseExactCommonArray;
223:            }
224:
225:            /**
226:             * Gets the pimElement (Alligo - Exchange/Notes) name corresponding
227:             * to the Group Elementname (JABAPI). Since the entryElementName
228:             * can be in any case, use the caseInsensitive Map
229:             */
230:
231:            public String getPimElementNameForGroup(String groupElementName) {
232:                String name = groupElementName.toLowerCase();
233:                String pimName = (String) caseInsensitiveCommonGroupMap
234:                        .get(name);
235:
236:                return pimName;
237:            }
238:
239:            /**
240:             * @return String Array of schema elements only in JABAPIs Group object
241:             */
242:            public String[] getGroupOnlySchemaElements() {
243:                String[] arr = (String[]) exclusiveElementsOnlyGroupMap
244:                        .get(GROUP_ELEMENTS_ONLY_KEY);
245:                return (arr);
246:            }
247:
248:            /**
249:             * @return String Array of schema elements only in 
250:             * PimAddressEntryElement object.
251:             */
252:            public String[] getPimOnlySchemaElementsForGroup() {
253:                String[] arr = (String[]) exclusiveElementsOnlyGroupMap
254:                        .get(PIM_ELEMENTS_ONLY_KEY);
255:                return (arr);
256:            }
257:
258:            /**
259:             * @return the CaseExact property names common to Group & 
260:             * PimAddressEntryElement
261:             */
262:            public Object[] getAllCommonPropertyNamesForGroup() {
263:                return caseExactCommonGroupArray;
264:            }
265:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.