Source Code Cross Referenced for MobileAppAttributeHandlerRegistry.java in  » Portal » Open-Portal » com » sun » portal » wireless » admin » 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.portal.wireless.admin 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Created on Mar 16, 2005
003:         */
004:        package com.sun.portal.wireless.admin;
005:
006:        import java.util.HashMap;
007:        import java.util.Iterator;
008:        import java.util.Map;
009:
010:        import com.sun.portal.admin.common.AttributeInfo;
011:
012:        /**
013:         * Registry for MobileAppAttributeHandler implementation instances.
014:         * 
015:         * @author ashwin.mathew@sun.com
016:         */
017:        public class MobileAppAttributeHandlerRegistry {
018:
019:            // Map of MobileAppAttribute instances for services, 
020:            // keyed by user-friendly name
021:            private static HashMap mailAttrMap = new HashMap();
022:            private static HashMap calendarAttrMap = new HashMap();
023:            private static HashMap addressBookAttrMap = new HashMap();
024:            private static HashMap faxAttrMap = new HashMap();
025:
026:            public static void registerHandler(MobileAppAttributeHandler handler) {
027:                if (handler.getService().equals(
028:                        MobileAppAttributeHandler.SUN_MOBILE_APP_MAIL_SERVICE)) {
029:                    mailAttrMap.put(
030:                            handler.getUserFriendlyName().toLowerCase(),
031:                            handler);
032:                } else if (handler
033:                        .getService()
034:                        .equals(
035:                                MobileAppAttributeHandler.SUN_MOBILE_APP_CALENDAR_SERVICE)) {
036:                    calendarAttrMap.put(handler.getUserFriendlyName()
037:                            .toLowerCase(), handler);
038:                } else if (handler
039:                        .getService()
040:                        .equals(
041:                                MobileAppAttributeHandler.SUN_MOBILE_APP_ADDRESS_BOOK_SERVICE)) {
042:                    addressBookAttrMap.put(handler.getUserFriendlyName()
043:                            .toLowerCase(), handler);
044:                } else if (handler.getService().equals(
045:                        MobileAppAttributeHandler.SUN_MOBILE_APP_FAX_SERVICE)) {
046:                    faxAttrMap.put(handler.getUserFriendlyName().toLowerCase(),
047:                            handler);
048:                }
049:            }
050:
051:            public static MobileAppAttributeHandler findHandler(
052:                    String userFriendlyName, String componentName) {
053:                MobileAppAttributeHandler handler = null;
054:
055:                if (componentName
056:                        .equals(MobileAppAttributeHandler.SUN_MOBILE_APP_MAIL_SERVICE)) {
057:                    handler = (MobileAppAttributeHandler) mailAttrMap
058:                            .get(userFriendlyName.toLowerCase());
059:                } else if (componentName
060:                        .equals(MobileAppAttributeHandler.SUN_MOBILE_APP_CALENDAR_SERVICE)) {
061:                    handler = (MobileAppAttributeHandler) calendarAttrMap
062:                            .get(userFriendlyName.toLowerCase());
063:                } else if (componentName
064:                        .equals(MobileAppAttributeHandler.SUN_MOBILE_APP_ADDRESS_BOOK_SERVICE)) {
065:                    handler = (MobileAppAttributeHandler) addressBookAttrMap
066:                            .get(userFriendlyName.toLowerCase());
067:                } else if (componentName
068:                        .equals(MobileAppAttributeHandler.SUN_MOBILE_APP_FAX_SERVICE)) {
069:                    handler = (MobileAppAttributeHandler) faxAttrMap
070:                            .get(userFriendlyName.toLowerCase());
071:                }
072:
073:                return handler;
074:            }
075:
076:            public static Map listAttributes(String componentName) {
077:                HashMap attrMap = null;
078:
079:                if (componentName
080:                        .equals(MobileAppAttributeHandler.SUN_MOBILE_APP_MAIL_SERVICE)) {
081:                    attrMap = mailAttrMap;
082:                } else if (componentName
083:                        .equals(MobileAppAttributeHandler.SUN_MOBILE_APP_CALENDAR_SERVICE)) {
084:                    attrMap = calendarAttrMap;
085:                } else if (componentName
086:                        .equals(MobileAppAttributeHandler.SUN_MOBILE_APP_ADDRESS_BOOK_SERVICE)) {
087:                    attrMap = addressBookAttrMap;
088:                } else if (componentName
089:                        .equals(MobileAppAttributeHandler.SUN_MOBILE_APP_FAX_SERVICE)) {
090:                    attrMap = faxAttrMap;
091:                }
092:
093:                return listAttributes(attrMap);
094:            }
095:
096:            private static Map listAttributes(HashMap attrMap) {
097:                Map attrList = new HashMap();
098:
099:                Iterator keys = attrMap.keySet().iterator();
100:                while (keys.hasNext()) {
101:                    String key = (String) keys.next();
102:                    MobileAppAttributeHandler handler = (MobileAppAttributeHandler) attrMap
103:                            .get(key);
104:
105:                    attrList.put(handler.getUserFriendlyName(), handler
106:                            .getAttributeInfoList());
107:                }
108:
109:                return attrList;
110:            }
111:
112:            // Register all the attribute handlers
113:            static {
114:                // Mail attributes
115:
116:                registerHandler(new DefaultPipeMobileAppAttributeHandler(
117:                        MobileAppAttributeHandler.SUN_MOBILE_APP_MAIL_SERVICE,
118:                        "sunMobileAppMailJspNumFolders", "foldersPerPage",
119:                        MobileAppAttributeHandler.SCOPE_GLOBAL,
120:                        AttributeInfo.LIST_STRING,
121:                        AttributeInfo.SINGLE_NUMERIC, AttributeInfo.READ_WRITE));
122:
123:                registerHandler(new DefaultPipeMobileAppAttributeHandler(
124:                        MobileAppAttributeHandler.SUN_MOBILE_APP_MAIL_SERVICE,
125:                        "sunMobileAppMailJspInboxNumLines",
126:                        "inboxLinesPerPage",
127:                        MobileAppAttributeHandler.SCOPE_GLOBAL,
128:                        AttributeInfo.LIST_STRING,
129:                        AttributeInfo.SINGLE_NUMERIC, AttributeInfo.READ_WRITE));
130:
131:                registerHandler(new DefaultPipeMobileAppAttributeHandler(
132:                        MobileAppAttributeHandler.SUN_MOBILE_APP_MAIL_SERVICE,
133:                        "sunMobileAppMailJspMsgNumLines",
134:                        "messageLinesPerPage",
135:                        MobileAppAttributeHandler.SCOPE_GLOBAL,
136:                        AttributeInfo.LIST_STRING,
137:                        AttributeInfo.SINGLE_NUMERIC, AttributeInfo.READ_WRITE));
138:
139:                registerHandler(new DefaultPipeMobileAppAttributeHandler(
140:                        MobileAppAttributeHandler.SUN_MOBILE_APP_MAIL_SERVICE,
141:                        "sunMobileAppMailJspFromLength", "fromHeaderLength",
142:                        MobileAppAttributeHandler.SCOPE_GLOBAL,
143:                        AttributeInfo.LIST_STRING,
144:                        AttributeInfo.SINGLE_NUMERIC, AttributeInfo.READ_WRITE));
145:
146:                registerHandler(new DefaultPipeMobileAppAttributeHandler(
147:                        MobileAppAttributeHandler.SUN_MOBILE_APP_MAIL_SERVICE,
148:                        "sunMobileAppMailJspSubjectLength",
149:                        "subjectHeaderLength",
150:                        MobileAppAttributeHandler.SCOPE_GLOBAL,
151:                        AttributeInfo.LIST_STRING,
152:                        AttributeInfo.SINGLE_NUMERIC, AttributeInfo.READ_WRITE));
153:
154:                registerHandler(new DefaultMobileAppAttributeHandler(
155:                        MobileAppAttributeHandler.SUN_MOBILE_APP_MAIL_SERVICE,
156:                        "sunMobileAppMailOutboundMailCharset",
157:                        "outboundMailCharsets",
158:                        MobileAppAttributeHandler.SCOPE_GLOBAL,
159:                        AttributeInfo.LIST_STRING, AttributeInfo.LIST_STRING,
160:                        AttributeInfo.READ_WRITE));
161:
162:                registerHandler(new DefaultMobileAppAttributeHandler(
163:                        MobileAppAttributeHandler.SUN_MOBILE_APP_MAIL_SERVICE,
164:                        "sunMobileAppMailDefaultMailDomain",
165:                        "defaultMailDomain",
166:                        MobileAppAttributeHandler.SCOPE_ORGANIZATION,
167:                        AttributeInfo.SINGLE_STRING,
168:                        AttributeInfo.SINGLE_STRING, AttributeInfo.READ_WRITE));
169:
170:                registerHandler(new DefaultMobileAppAttributeHandler(
171:                        MobileAppAttributeHandler.SUN_MOBILE_APP_MAIL_SERVICE,
172:                        "sunMobileAppMailSignature", "emailSignature",
173:                        MobileAppAttributeHandler.SCOPE_USER,
174:                        AttributeInfo.SINGLE_STRING,
175:                        AttributeInfo.SINGLE_STRING, AttributeInfo.READ_WRITE));
176:
177:                registerHandler(new PredefinedRepliesMobileAppAttributeHandler(
178:                        MobileAppAttributeHandler.SUN_MOBILE_APP_MAIL_SERVICE,
179:                        "sunMobileAppMailPredefinedReplies",
180:                        "predefinedReplies",
181:                        MobileAppAttributeHandler.SCOPE_USER,
182:                        AttributeInfo.LIST_STRING, AttributeInfo.LIST_STRING,
183:                        AttributeInfo.READ_WRITE));
184:
185:                // The next two should be ConfigURL attr handlers, at the user level
186:                registerHandler(new DefaultMobileAppAttributeHandler(
187:                        MobileAppAttributeHandler.SUN_MOBILE_APP_MAIL_SERVICE,
188:                        "sunMobileAppMailConfig", "sentFolderCopy",
189:                        MobileAppAttributeHandler.SCOPE_GLOBAL,
190:                        AttributeInfo.LIST_STRING,
191:                        AttributeInfo.SINGLE_BOOLEAN, AttributeInfo.READ_WRITE));
192:
193:                registerHandler(new DefaultMobileAppAttributeHandler(
194:                        MobileAppAttributeHandler.SUN_MOBILE_APP_MAIL_SERVICE,
195:                        "sunMobileAppMailConfig", "fromAddress",
196:                        MobileAppAttributeHandler.SCOPE_GLOBAL,
197:                        AttributeInfo.LIST_STRING, AttributeInfo.SINGLE_STRING,
198:                        AttributeInfo.READ_WRITE));
199:
200:                /* Doesn't make sense to support these via CLI
201:                registerHandler(new DefaultMobileAppAttributeHandler(
202:                        MobileAppAttributeHandler.SUN_MOBILE_APP_MAIL_SERVICE ,
203:                        "sunMobileAppMailViewClients", 
204:                        "perClientViews", 
205:                        MobileAppAttributeHandler.SCOPE_USER,
206:                        AttributeInfo.LIST_STRING,
207:                        AttributeInfo.READ_WRITE));
208:                
209:                registerHandler(new DefaultMobileAppAttributeHandler(
210:                        MobileAppAttributeHandler.SUN_MOBILE_APP_MAIL_SERVICE ,
211:                        "sunMobileAppMailViews", 
212:                        "views", 
213:                        MobileAppAttributeHandler.SCOPE_USER,
214:                        AttributeInfo.LIST_STRING,
215:                        AttributeInfo.READ_WRITE));
216:                
217:                registerHandler(new DefaultMobileAppAttributeHandler(
218:                        MobileAppAttributeHandler.SUN_MOBILE_APP_MAIL_SERVICE ,
219:                        "sunMobileAppMailViewRules", 
220:                        "viewRules", 
221:                        MobileAppAttributeHandler.SCOPE_USER,
222:                        AttributeInfo.LIST_STRING,
223:                        AttributeInfo.READ_WRITE));*/
224:
225:                // Calendar attributes
226:                registerHandler(new DefaultPipeMobileAppAttributeHandler(
227:                        MobileAppAttributeHandler.SUN_MOBILE_APP_CALENDAR_SERVICE,
228:                        "sunMobileAppCalendarJspCalendarNumLines",
229:                        "displayCalendarsPerPage",
230:                        MobileAppAttributeHandler.SCOPE_GLOBAL,
231:                        AttributeInfo.LIST_STRING,
232:                        AttributeInfo.SINGLE_NUMERIC, AttributeInfo.READ_WRITE));
233:
234:                registerHandler(new DefaultPipeMobileAppAttributeHandler(
235:                        MobileAppAttributeHandler.SUN_MOBILE_APP_CALENDAR_SERVICE,
236:                        "sunMobileAppCalendarJspEventNumLines",
237:                        "eventsPerPage",
238:                        MobileAppAttributeHandler.SCOPE_GLOBAL,
239:                        AttributeInfo.LIST_STRING,
240:                        AttributeInfo.SINGLE_NUMERIC, AttributeInfo.READ_WRITE));
241:
242:                registerHandler(new DefaultPipeMobileAppAttributeHandler(
243:                        MobileAppAttributeHandler.SUN_MOBILE_APP_CALENDAR_SERVICE,
244:                        "sunMobileAppCalendarJspSummaryLength",
245:                        "eventSummaryLength",
246:                        MobileAppAttributeHandler.SCOPE_GLOBAL,
247:                        AttributeInfo.LIST_STRING,
248:                        AttributeInfo.SINGLE_NUMERIC, AttributeInfo.READ_WRITE));
249:
250:                registerHandler(new DefaultPipeMobileAppAttributeHandler(
251:                        MobileAppAttributeHandler.SUN_MOBILE_APP_CALENDAR_SERVICE,
252:                        "sunMobileAppCalendarJspLocationLength",
253:                        "eventLocationLength",
254:                        MobileAppAttributeHandler.SCOPE_GLOBAL,
255:                        AttributeInfo.LIST_STRING,
256:                        AttributeInfo.SINGLE_NUMERIC, AttributeInfo.READ_WRITE));
257:
258:                registerHandler(new DefaultPipeMobileAppAttributeHandler(
259:                        MobileAppAttributeHandler.SUN_MOBILE_APP_CALENDAR_SERVICE,
260:                        "sunMobileAppCalendarJspDescLength",
261:                        "eventDescriptionLength",
262:                        MobileAppAttributeHandler.SCOPE_GLOBAL,
263:                        AttributeInfo.LIST_STRING,
264:                        AttributeInfo.SINGLE_NUMERIC, AttributeInfo.READ_WRITE));
265:
266:                // Address Book attributes
267:
268:                registerHandler(new DefaultPipeMobileAppAttributeHandler(
269:                        MobileAppAttributeHandler.SUN_MOBILE_APP_ADDRESS_BOOK_SERVICE,
270:                        "sunMobileAppABJspAbNumLines", "displayLinesPerPage",
271:                        MobileAppAttributeHandler.SCOPE_GLOBAL,
272:                        AttributeInfo.LIST_STRING,
273:                        AttributeInfo.SINGLE_NUMERIC, AttributeInfo.READ_WRITE));
274:
275:                // These two are URL config sorts as well, at the user level
276:                registerHandler(new DefaultMobileAppAttributeHandler(
277:                        MobileAppAttributeHandler.SUN_MOBILE_APP_ADDRESS_BOOK_SERVICE,
278:                        "sunMobileAppABConfig", "sortBy",
279:                        MobileAppAttributeHandler.SCOPE_GLOBAL,
280:                        AttributeInfo.LIST_STRING, AttributeInfo.SINGLE_STRING,
281:                        AttributeInfo.READ_WRITE));
282:
283:                registerHandler(new DefaultMobileAppAttributeHandler(
284:                        MobileAppAttributeHandler.SUN_MOBILE_APP_ADDRESS_BOOK_SERVICE,
285:                        "sunMobileAppABConfig", "sortOrder",
286:                        MobileAppAttributeHandler.SCOPE_GLOBAL,
287:                        AttributeInfo.LIST_STRING, AttributeInfo.SINGLE_STRING,
288:                        AttributeInfo.READ_WRITE));
289:
290:                // Fax attributes
291:
292:                registerHandler(new DefaultMobileAppAttributeHandler(
293:                        MobileAppAttributeHandler.SUN_MOBILE_APP_FAX_SERVICE,
294:                        "sunPortalFaxServiceProviderMailId",
295:                        "faxServiceProviderMailId",
296:                        MobileAppAttributeHandler.SCOPE_ORGANIZATION,
297:                        AttributeInfo.LIST_STRING, AttributeInfo.SINGLE_STRING,
298:                        AttributeInfo.READ_WRITE));
299:
300:                registerHandler(new DefaultMobileAppAttributeHandler(
301:                        MobileAppAttributeHandler.SUN_MOBILE_APP_FAX_SERVICE,
302:                        "sunPortalFaxFromAddress", "faxFromAddress",
303:                        MobileAppAttributeHandler.SCOPE_ORGANIZATION,
304:                        AttributeInfo.LIST_STRING, AttributeInfo.SINGLE_STRING,
305:                        AttributeInfo.READ_WRITE));
306:
307:                registerHandler(new DefaultMobileAppAttributeHandler(
308:                        MobileAppAttributeHandler.SUN_MOBILE_APP_FAX_SERVICE,
309:                        "sunPortalFaxSubject", "faxSubject",
310:                        MobileAppAttributeHandler.SCOPE_ORGANIZATION,
311:                        AttributeInfo.LIST_STRING, AttributeInfo.SINGLE_STRING,
312:                        AttributeInfo.READ_WRITE));
313:            }
314:
315:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.