001: /*
002: * (C) Copyright 2000 - 2003 Nabh Information Systems, Inc.
003: *
004: * This program is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU General Public License
006: * as published by the Free Software Foundation; either version 2
007: * of the License, or (at your option) any later version.
008: *
009: * This program is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: * GNU General Public License for more details.
013: *
014: * You should have received a copy of the GNU General Public License
015: * along with this program; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
017: *
018: */
019:
020: package com.nabhinc.portal.container;
021:
022: import java.io.Serializable;
023: import java.util.Enumeration;
024: import java.util.Hashtable;
025: import java.util.Vector;
026:
027: import javax.portlet.PortalContext;
028:
029: /**
030: *
031: *
032: * @author Padmanabh dabke
033: * (c) 2003 Nabh Information Systems, Inc. All Rights Reserved.
034: */
035: public class PortalContextImpl implements PortalContext, Serializable {
036:
037: private static final long serialVersionUID = 5415702113535457035L;
038:
039: protected String pciPortalInfo = "Nabh Stringbeans";
040:
041: protected Hashtable pciProperties = new Hashtable();
042:
043: protected Vector pciSupportedPortletModes = new Vector();
044:
045: protected Vector pciSupportedWindowStates = new Vector();
046:
047: /* (non-Javadoc)
048: * @see javax.portlet.PortalContext#getProperty(java.lang.String)
049: */
050: public String getProperty(String name) {
051: return (String) pciProperties.get(name);
052: }
053:
054: @SuppressWarnings("unchecked")
055: public void setProperty(String name, String value) {
056: pciProperties.put(name, value);
057: }
058:
059: /* (non-Javadoc)
060: * @see javax.portlet.PortalContext#getPropertyNames()
061: */
062: public Enumeration getPropertyNames() {
063: return pciProperties.keys();
064: }
065:
066: /* (non-Javadoc)
067: * @see javax.portlet.PortalContext#getSupportedPortletModes()
068: */
069: public Enumeration getSupportedPortletModes() {
070: return pciSupportedPortletModes.elements();
071: }
072:
073: @SuppressWarnings("unchecked")
074: public void addSupportedPortletMode(String mode) {
075: if (!pciSupportedPortletModes.contains(mode))
076: pciSupportedPortletModes.addElement(mode);
077: }
078:
079: /* (non-Javadoc)
080: * @see javax.portlet.PortalContext#getSupportedWindowStates()
081: */
082: public Enumeration getSupportedWindowStates() {
083: return pciSupportedWindowStates.elements();
084: }
085:
086: @SuppressWarnings("unchecked")
087: public void addSupportedWindowState(String stateSpec) {
088: if (!pciSupportedWindowStates.contains(stateSpec))
089: pciSupportedWindowStates.addElement(stateSpec);
090: }
091:
092: /* (non-Javadoc)
093: * @see javax.portlet.PortalContext#getPortalInfo()
094: */
095: public String getPortalInfo() {
096: return pciPortalInfo;
097: }
098:
099: public void setPortalInfo(String newInfo) {
100: pciPortalInfo = newInfo;
101: }
102:
103: }
|