1 32 33 package com.knowgate.http.portlets; 34 35 import java.io.InputStream ; 36 37 import java.net.URL ; 38 39 import java.util.Set ; 40 import java.util.Hashtable ; 41 import java.util.Properties ; 42 import java.util.Enumeration ; 43 44 import javax.portlet.PortletContext; 45 import javax.portlet.PortletRequestDispatcher; 46 47 import com.knowgate.debug.*; 48 49 53 54 public class HipergatePortletContext implements PortletContext { 55 56 private Hashtable oAttribs; 57 private Properties oParams; 58 59 public HipergatePortletContext() { 60 oAttribs = new Hashtable (); 61 oParams = new Properties (); 62 } 63 64 public Object getAttribute (String sAttributeName) { 65 return oAttribs.get(sAttributeName); 66 } 67 68 public Enumeration getAttributeNames () { 69 return oAttribs.keys(); 70 } 71 72 public String getInitParameter(String sParameterName) { 73 return oParams.getProperty(sParameterName); 74 } 75 76 public Enumeration getInitParameterNames() { 77 return oParams.keys(); 78 } 79 80 public int getMajorVersion() { 81 return 1; 82 } 83 84 public int getMinorVersion() { 85 return 0; 86 } 87 88 public String getMimeType(String sFile) { 89 throw new UnsupportedOperationException ("Method getMimeType() not implemented by HipergatePortletContext"); 90 } 91 92 public PortletRequestDispatcher getNamedDispatcher(String sName) { 93 throw new UnsupportedOperationException ("Method getNamedDispatcher() not implemented by HipergatePortletContext"); 94 } 95 96 public PortletRequestDispatcher getRequestDispatcher(String sPath) { 97 throw new UnsupportedOperationException ("Method getRequestDispatcher() not implemented by HipergatePortletContext"); 98 } 99 100 public String getPortletContextName() { 101 throw new UnsupportedOperationException ("Method getPortletContextName() not implemented by HipergatePortletContext"); 102 } 103 104 public String getRealPath(String sPath) { 105 throw new UnsupportedOperationException ("Method getRealPath() not implemented by HipergatePortletContext"); 106 } 107 108 public URL getResource(String sPath) { 109 throw new UnsupportedOperationException ("Method getResource() not implemented by HipergatePortletContext"); 110 } 111 112 public Set getResourcePaths (String sPath) { 113 throw new UnsupportedOperationException ("Method getResourcePaths() not implemented by HipergatePortletContext"); 114 } 115 116 public InputStream getResourceAsStream(String sPath) { 117 throw new UnsupportedOperationException ("Method getResourceAsStream() not implemented by HipergatePortletContext"); 118 } 119 120 public String getServerInfo() { 121 return "hipergate Portlet Container Emulator"; 122 } 123 124 public void log (String sMsg) { 125 DebugFile.writeln(sMsg); 126 } 127 128 public void log (String sMsg, Throwable oXcpt) { 129 DebugFile.writeln(sMsg); 130 new ErrorHandler(oXcpt); 131 } 132 133 public void removeAttribute (String sName) { 134 oAttribs.remove(sName); 135 } 136 137 public void setAttribute (String sName, Object oAttr) { 138 oAttribs.put(sName, oAttr); 139 } 140 } 141 | Popular Tags |