01: /*
02: * Copyright 2002 Sun Microsystems, Inc. All
03: * rights reserved. Use of this product is subject
04: * to license terms. Federal Acquisitions:
05: * Commercial Software -- Government Users
06: * Subject to Standard License Terms and
07: * Conditions.
08: *
09: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
10: * are trademarks or registered trademarks of Sun Microsystems,
11: * Inc. in the United States and other countries.
12: */
13:
14: package com.sun.portal.container.portlet.impl;
15:
16: import javax.servlet.http.HttpServletRequest;
17: import javax.servlet.ServletContext;
18: import javax.portlet.PortletPreferences;
19:
20: import com.sun.portal.portlet.impl.DPPortletPreferencesImpl;
21: import com.sun.portal.providers.context.ProviderContext;
22: import com.sun.portal.container.portlet.PreferenceManager;
23: import com.sun.portal.container.ContainerRequest;
24: import com.sun.portal.portletcontainercommon.PortletContainerConstants;
25:
26: import java.util.logging.Logger;
27:
28: public class PreferenceManagerImpl implements PreferenceManager {
29:
30: private static Logger _logger;
31:
32: public void init(ServletContext sc) {
33: // Should not used, logging through logging framework - RFE 4837084
34: }
35:
36: public void destroy(ServletContext sc) {
37: // Should not used, logging through logging framework - RFE 4837084
38: // _logger = null;
39: }
40:
41: public PortletPreferences getPortletPreferences(
42: ContainerRequest request) {
43:
44: HttpServletRequest req = request.getHttpServletRequest();
45: String entityID = request.getEntityID();
46:
47: ProviderContext pc = (ProviderContext) req
48: .getAttribute(PortletContainerConstants.PROVIDER_CONTEXT);
49: String channel = PortletContainerUtility
50: .getChannelNameFromEntityID(entityID);
51: boolean isReadOnly = request.getIsReadOnly();
52: return new DPPortletPreferencesImpl(req, pc, channel,
53: isReadOnly, _logger);
54: }
55: }
|