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


001:        /**
002:         *  $Id: UWCABApplicationHelper.java,v 1.8 2005/09/21 10:40:19 dg154973 Exp $
003:         *  Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use of this
004:         *  product is subject to license terms. Federal Acquisitions: Commercial
005:         *  Software -- Government Users Subject to Standard License Terms and
006:         *  Conditions. Sun, Sun Microsystems, the Sun logo, and iPlanet are trademarks
007:         *  or registered trademarks of Sun Microsystems, Inc. in the United States and
008:         *  other countries.
009:         */package com.sun.portal.providers.ab;
010:
011:        import java.io.BufferedReader;
012:        import java.io.InputStreamReader;
013:        import java.io.IOException;
014:        import java.io.UnsupportedEncodingException;
015:        import java.net.MalformedURLException;
016:        import java.net.HttpURLConnection;
017:        import java.net.URL;
018:        import java.net.URLEncoder;
019:        import java.util.Date;
020:        import java.util.Enumeration;
021:        import java.util.Properties;
022:        import java.util.Hashtable;
023:        import java.util.List;
024:        import java.util.Map;
025:        import java.util.Map.Entry;
026:        import java.util.Set;
027:        import java.util.StringTokenizer;
028:        import java.util.Iterator;
029:        import java.util.ResourceBundle;
030:        import java.util.logging.Logger;
031:        import java.util.logging.Level;
032:        import javax.servlet.http.HttpServletRequest;
033:        import javax.servlet.http.HttpServletResponse;
034:        import com.sun.ssoadapter.SSOAdapter;
035:        import com.sun.ssoadapter.SSOAdapterException;
036:        import com.sun.ssoadapter.SSOAdapterFactory;
037:        import com.sun.portal.providers.ProviderEditUtility;
038:        import com.sun.portal.providers.context.ProviderContext;
039:        import com.sun.portal.providers.context.ProviderContextException;
040:        import com.sun.portal.providers.ProviderException;
041:        import com.sun.portal.providers.Provider;
042:        import com.sun.portal.providers.ProfileProviderAdapter;
043:        import com.sun.portal.providers.ApplicationHelper;
044:        import com.sun.portal.log.common.PortalLogger;
045:        import com.iplanet.sso.SSOToken;
046:        import com.iplanet.sso.SSOException;
047:
048:        /**
049:         *  Application helper for the the UWC's AB functionailty
050:         *
051:         *@author     byork
052:         *@created    March 21, 2003
053:         */
054:        public class UWCABApplicationHelper extends ApplicationHelper implements 
055:                AddressBookApplicationHelper {
056:            ProviderContext pc = null;
057:            Properties ssoProps = null;
058:            protected String appName = "";
059:            public AddressBookProvider provider = null;
060:            public SSOAdapter ssoAdapter = null;
061:            public String charset = null;
062:
063:            // Create a logger for this class
064:            private static Logger debugLogger = PortalLogger
065:                    .getLogger(UWCABApplicationHelper.class);
066:
067:            /**
068:             * Initialize AddressBookApplicationHelper.
069:             *
070:             * @param provider    AddressBook
071:             * @param ssoAdapter  Used to identify the SSOAdapter
072:             */
073:            public void init(AddressBookProvider provider, SSOAdapter ssoAdapter)
074:                    throws Exception {
075:                super .init((ProfileProviderAdapter) provider, ssoAdapter);
076:                if (provider != null) {
077:                    pc = provider.getProviderContext();
078:                    this .provider = provider;
079:                }
080:                if (ssoAdapter != null) {
081:                    ssoProps = ssoAdapter.getProperties();
082:                    this .ssoAdapter = ssoAdapter;
083:                }
084:                SSOToken token = ssoAdapter.getSSOToken();
085:                charset = token.getProperty("CharSet");
086:                debugLogger.log(Level.FINER, "PSAC_CSPPA0027", charset);
087:            }
088:
089:            /**
090:             * Returns the Application Start URL.  Since the UWC relies on IS SSO for its
091:             * own functionality we can safely assume IS will handle all SSO tasks and
092:             * we just need to return the start URL.
093:             *
094:             * http://<hostname>:<port>/<contexturi>/?gotoUri=/abclient/AddressBook
095:             *
096:             * @param provider  AddressBookProvider
097:             * @param request   HttpServletRequest
098:             * @return url to access application
099:             */
100:            public String getStartURL(AddressBookProvider provider,
101:                    HttpServletRequest request) {
102:                StringBuffer clientURL = new StringBuffer();
103:                String abURL = "/?gotoUri=/abclient/AddressBook";
104:                String host = ssoProps.getProperty("host");
105:                String port = ssoProps.getProperty("clientPort", "80");
106:                String uwcContext = ssoProps.getProperty("uwcContext");
107:                String protocol = ssoProps
108:                        .getProperty("clientProtocol", "http");
109:                clientURL.append(protocol + "://" + host + ":" + port);
110:                if (uwcContext == null) {
111:                    debugLogger.fine("PSAC_CSPPA0062");
112:                    uwcContext = "/";
113:                }
114:                if (uwcContext != null) {
115:                    if (uwcContext.substring(0).equals("/"))
116:                        clientURL.append(uwcContext);
117:                    else
118:                        clientURL.append("/" + uwcContext);
119:                }
120:                clientURL.append(abURL);
121:                return clientURL.toString();
122:            }
123:
124:            /**
125:             * Returns the contents of the AddressBookProviders edit page
126:             */
127:            public StringBuffer getAppPrefsEdit(AddressBookProvider aprov,
128:                    HttpServletRequest req, HttpServletResponse res) {
129:                setEditContainer(aprov.editContainer);
130:                setContainerName(aprov.containerName);
131:                setTargetProvider(aprov.targetProvider);
132:                return super .getAppPrefsEdit((Provider) aprov, req, res);
133:            }
134:
135:            /**
136:             * Processes values returned from the AddressBookProvider edit page
137:             */
138:            public URL processAppPrefsEdit(AddressBookProvider aprov,
139:                    HttpServletRequest req, HttpServletResponse res)
140:                    throws ProviderException {
141:                setEditContainer(aprov.editContainer);
142:                setTargetProvider(aprov.targetProvider);
143:                setContainerName(aprov.containerName);
144:                return super .processAppPrefsEdit((Provider) aprov, req, res);
145:            }
146:
147:            /**
148:             *  Implementation of abstract ApplicationHelper method
149:             *
150:             *@param  req    servlet request
151:             *@return The String representing an URL to get to the edit page for DP
152:             *        properties
153:             */
154:
155:            public String getAppHelperEditLink(HttpServletRequest req,
156:                    ProviderContext pc) {
157:
158:                Hashtable tagTable = new Hashtable();
159:                StringBuffer link = new StringBuffer();
160:                try {
161:                    link.append(pc.getDesktopURL(req));
162:                } catch (Exception e) {
163:                    return "";
164:                }
165:                link.append("?action=edit&provider=" + provider.editContainer);
166:                link.append("&targetprovider=" + provider.targetProvider);
167:                link.append("&containerName=" + provider.containerName);
168:                link.append("&appPref=" + this .getName());
169:
170:                tagTable.put("editLink", link.toString());
171:                String content = null;
172:
173:                try {
174:                    String fontTag = pc.getStringProperty(provider.getName(),
175:                            "fontFace1", "Sans-serif");
176:                    tagTable.put("iwtDesktop-fontFace1", fontTag);
177:                    content = pc.getTemplate(provider.getName(),
178:                            "edit-link.template", tagTable).toString();
179:                    debugLogger.log(Level.FINER, "PSAC_CSPPA0041", content
180:                            .toString());
181:                } catch (Exception e) {
182:                    debugLogger.log(Level.INFO, "PSAC_CSPPA0042", e);
183:                    content = "";
184:                }
185:
186:                debugLogger.log(Level.FINER, "PSAC_CSPPA0043", content
187:                        .toString());
188:
189:                return content;
190:            }
191:
192:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.