1 5 6 13 package org.exoplatform.services.portletcontainer.impl.portletAPIImp; 14 15 16 import javax.portlet.PortalContext; 17 import org.exoplatform.services.portletcontainer.impl.PortletContainerConf; 18 import java.util.Enumeration ; 19 import java.util.HashMap ; 20 import java.util.Map ; 21 import java.util.Vector ; 22 23 public class PortalContextImp implements PortalContext { 24 25 private Map properties = new HashMap (); 26 private PortletContainerConf conf; 27 28 public PortalContextImp(PortletContainerConf conf) { 29 properties = conf.getProperties(); 30 this.conf = conf; 31 } 32 33 public String getProperty(String s) { 34 return (String ) properties.get(s); 35 } 36 37 public Enumeration getPropertyNames() { 38 return new Vector (properties.keySet()).elements(); 39 } 40 41 public Enumeration getProperties(String s) { 42 return (Enumeration ) properties.get(s); 43 } 44 45 public void addProperty(String s, Object o) { 46 properties.put(s, o); 47 } 48 49 public Enumeration getSupportedPortletModes() { 50 return conf.getSupportedPortletModes(); 51 } 52 53 public Enumeration getSupportedWindowStates() { 54 return conf.getSupportedWindowStates(); 55 } 56 57 public String getPortalInfo() { 58 String name = conf.getPortletContainerName(); 59 int major = conf.getMajorVersion(); 60 int minor = conf.getMinorVersion(); 61 return name + major + "." + minor; 62 } 63 64 } 65 | Popular Tags |