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


001:        /**
002:         * $Id: MAJspCalendarAppHelper.java,v 1.9 2005/09/21 10:48:21 dg154973 Exp $
003:         * Copyright 2002 Sun Microsystems, Inc. All
004:         * rights reserved. Use of this product is subject
005:         * to license terms. Federal Acquisitions:
006:         * Commercial Software -- Government Users
007:         * Subject to Standard License Terms and
008:         * Conditions.
009:         *
010:         * Sun, Sun Microsystems, the Sun logo, and iPlanet
011:         * are trademarks or registered trademarks of Sun Microsystems,
012:         * Inc. in the United States and other countries.
013:         */package com.sun.portal.wireless.providers.calendar;
014:
015:        import java.net.URL;
016:        import java.net.MalformedURLException;
017:        import java.util.*;
018:        import java.util.logging.Level;
019:        import java.util.logging.Logger;
020:
021:        import javax.servlet.http.HttpServletRequest;
022:        import javax.servlet.http.HttpServletResponse;
023:
024:        import com.sun.comclient.calendar.VEvent;
025:        import com.sun.comclient.calendar.VTodo;
026:
027:        import com.iplanet.sso.*;
028:
029:        import com.sun.ssoadapter.SSOAdapter;
030:
031:        import com.sun.portal.providers.calendar.CalendarApplicationHelper;
032:        import com.sun.portal.providers.calendar.CalendarProvider;
033:        import com.sun.portal.providers.context.ProviderContext;
034:        import com.sun.portal.providers.ProviderEditUtility;
035:
036:        import com.sun.portal.wireless.taglibs.dispatcher.*;
037:        import com.sun.mobile.util.*;
038:        import com.sun.portal.log.common.PortalLogger;
039:
040:        /**
041:         * This class implements the CalendarApplicationHelper interface.
042:         * <p>This CalendarApplicationHelper implementation consumes the following
043:         *    Configuration properties:
044:         * <ul>
045:         * </ul>
046:         *
047:         * @version 1.0
048:         *
049:         */
050:
051:        public class MAJspCalendarAppHelper implements 
052:                CalendarApplicationHelper {
053:
054:            public SSOAdapter ssoAdapter = null;
055:            public Properties adapterProperties = null;
056:            private CalendarProvider provider = null;
057:            protected String appName = "";
058:            private static Logger logger = PortalLogger
059:                    .getLogger(MAJspCalendarAppHelper.class);
060:
061:            /**
062:             * Initialize MAMailAppHelper.
063:             *
064:             * @param ssoAdapter  SSOAdapter object
065:             */
066:            public void init(CalendarProvider provider, SSOAdapter ssoAdapter) {
067:                this .provider = provider;
068:                this .ssoAdapter = ssoAdapter;
069:                this .adapterProperties = ssoAdapter.getProperties();
070:            }
071:
072:            /**
073:             * Returns a client URL, if supported by the service.
074:             */
075:            public String getStartURL(CalendarProvider provider,
076:                    HttpServletRequest request) {
077:                return getApplicationURL(provider, request);
078:            }
079:
080:            /**
081:             */
082:            private String getApplicationURL(CalendarProvider provider,
083:                    HttpServletRequest request) {
084:
085:                String appURL = null;
086:                SSOToken token;
087:
088:                try {
089:                    SSOTokenManager tokenManager = SSOTokenManager
090:                            .getInstance();
091:                    token = tokenManager.createSSOToken(request);
092:
093:                    appURL = "/jsp/default/launchCal.jsp"
094:                            + "?ci="
095:                            + ContentUtils.rfc2396Escape("", ssoAdapter
096:                                    .getName());
097:
098:                    Compressor compressor = Compressor.getCompressor(token);
099:
100:                    appURL = request.getContextPath()
101:                            + compressor.compressURL(appURL);
102:
103:                    appURL = token.encodeURL(appURL);
104:
105:                } catch (Exception e) {
106:                    return null;
107:                }
108:
109:                return appURL;
110:            }
111:
112:            public String getEventURL(CalendarProvider provider,
113:                    HttpServletRequest request, VEvent event) throws Exception {
114:                return null;
115:            }
116:
117:            public String getTaskURL(CalendarProvider provider,
118:                    HttpServletRequest request, VTodo task) throws Exception {
119:                return null;
120:            }
121:
122:            public StringBuffer getAppPrefsEdit(CalendarProvider aprov,
123:                    HttpServletRequest req, HttpServletResponse res) {
124:                return null;
125:            }
126:
127:            public URL processAppPrefsEdit(CalendarProvider aprov,
128:                    HttpServletRequest req, HttpServletResponse res) {
129:                return null;
130:            }
131:
132:            /**
133:             * Returns a HTML link containing encoding specific for the app helper
134:             */
135:
136:            public String getAppHelperEditLink(HttpServletRequest req,
137:                    ProviderContext pc) {
138:
139:                Hashtable tagTable = new Hashtable();
140:                StringBuffer link = new StringBuffer();
141:                try {
142:                    link.append(pc.getDesktopURL(req));
143:                } catch (Exception e) {
144:                    return "";
145:                }
146:                link.append("?action=edit&provider=");
147:                link.append(ProviderEditUtility.getRequestParameter("provider",
148:                        req));
149:                link.append("&targetprovider=" + provider.getName());
150:                link.append("&containerName=");
151:                link.append(ProviderEditUtility.getRequestParameter(
152:                        "containerName", req));
153:                link.append("&appPref=" + this .getName());
154:
155:                tagTable.put("editLink", link.toString());
156:
157:                String content = null;
158:
159:                try {
160:                    String fontTag = pc.getStringProperty(provider.getName(),
161:                            "fontFace1", "Sans-serif");
162:                    tagTable.put("iwtDesktop-fontFace1", fontTag);
163:                    content = pc.getTemplate(provider.getName(),
164:                            "ma-edit-link.template", tagTable).toString();
165:                    if (logger.isLoggable(Level.FINEST)) {
166:                        String[] param = { "content", content.toString() };
167:                        logger.log(Level.FINEST, "PSMA_CSPWPCL0001", param);
168:                    }
169:                } catch (Exception e) {
170:                    if (logger.isLoggable(Level.WARNING))
171:                        logger.log(Level.WARNING, "PSMA_CSPWPCL0002", e);
172:                    content = "";
173:                }
174:
175:                if (logger.isLoggable(Level.FINEST))
176:                    logger.log(Level.FINEST, "PSMA_CSPWPCL0003", content
177:                            .toString());
178:
179:                return content;
180:            }
181:
182:            /**
183:             * Sets the App Helpers name
184:             */
185:            public void setName(String name) {
186:                this .appName = name;
187:            }
188:
189:            /**
190:             * Gets the App Helpers name
191:             */
192:            public String getName() {
193:                return this.appName;
194:            }
195:
196:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.