KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > portletcontainer > impl > portletAPIImp > PortalContextImp


1 /**
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved.
3  * Please look at license.txt in info directory for more license detail.
4  **/

5
6 /**
7  * Created by The eXo Platform SARL
8  * Author : Mestrallet Benjamin
9  * benjmestrallet@users.sourceforge.net
10  * Date: Jul 29, 2003
11  * Time: 6:15:45 PM
12  */

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 JavaDoc;
19 import java.util.HashMap JavaDoc;
20 import java.util.Map JavaDoc;
21 import java.util.Vector JavaDoc;
22
23 public class PortalContextImp implements PortalContext {
24
25   private Map JavaDoc properties = new HashMap JavaDoc();
26     private PortletContainerConf conf;
27
28   public PortalContextImp(PortletContainerConf conf) {
29     properties = conf.getProperties();
30         this.conf = conf;
31   }
32
33   public String JavaDoc getProperty(String JavaDoc s) {
34     return (String JavaDoc) properties.get(s);
35   }
36
37   public Enumeration JavaDoc getPropertyNames() {
38     return new Vector JavaDoc(properties.keySet()).elements();
39   }
40
41   public Enumeration JavaDoc getProperties(String JavaDoc s) {
42     return (Enumeration JavaDoc) properties.get(s);
43   }
44
45   public void addProperty(String JavaDoc s, Object JavaDoc o) {
46     properties.put(s, o);
47   }
48
49   public Enumeration JavaDoc getSupportedPortletModes() {
50         return conf.getSupportedPortletModes();
51   }
52
53   public Enumeration JavaDoc getSupportedWindowStates() {
54     return conf.getSupportedWindowStates();
55   }
56
57   public String JavaDoc getPortalInfo() {
58     String JavaDoc name = conf.getPortletContainerName();
59     int major = conf.getMajorVersion();
60     int minor = conf.getMinorVersion();
61     return name + major + "." + minor;
62   }
63
64 }
65
Popular Tags