01: /* Copyright 2004 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05:
06: package org.jasig.portal.container.services.information;
07:
08: import java.util.Arrays;
09: import java.util.Collection;
10: import java.util.HashMap;
11: import java.util.Map;
12:
13: import javax.portlet.PortletMode;
14: import javax.portlet.WindowState;
15:
16: import org.apache.pluto.services.information.PortalContextProvider;
17: import org.jasig.portal.Version;
18:
19: /**
20: * Implementation of Apache Pluto object model.
21: * @author Ken Weiner, kweiner@unicon.net
22: * @version $Revision: 35333 $
23: */
24: public class PortalContextProviderImpl implements PortalContextProvider {
25:
26: public static final WindowState EXCLUSIVE = new WindowState(
27: "exclusive");
28:
29: private Map properties = null;
30: private PortletMode[] supportedPortletModes = null;
31: private WindowState[] supportedWindowStates = null;
32: private String portalInfo = null;
33:
34: public PortalContextProviderImpl() {
35: properties = new HashMap();
36: // Should read these from a properties file
37: supportedPortletModes = new PortletMode[] { PortletMode.VIEW,
38: PortletMode.EDIT, PortletMode.HELP };
39: supportedWindowStates = new WindowState[] { WindowState.NORMAL,
40: WindowState.MAXIMIZED, WindowState.MINIMIZED, EXCLUSIVE };
41: portalInfo = Version.getProduct() + "/" + Version.getVersion();
42: }
43:
44: // PortalContextProvider methods
45:
46: public String getProperty(String name) {
47: return (String) properties.get(name);
48: }
49:
50: public Collection getPropertyNames() {
51: return properties.keySet();
52: }
53:
54: public Collection getSupportedPortletModes() {
55: return Arrays.asList(supportedPortletModes);
56: }
57:
58: public Collection getSupportedWindowStates() {
59: return Arrays.asList(supportedWindowStates);
60: }
61:
62: public String getPortalInfo() {
63: return portalInfo;
64: }
65:
66: }
|