|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--net.sf.jportlet.impl.PortletContextImpl
Implementation of net.fs.jportlet.portlet.PortletContext
| Constructor Summary | |
PortletContextImpl(net.sf.jportlet.portlet.application.PortletProxy proxy,
net.sf.jportlet.portlet.application.PortletApplication application,
javax.servlet.ServletContext servletContext)
|
|
| Method Summary | |
net.sf.jportlet.portlet.application.PortletApplication |
getApplication()
|
java.lang.Object |
getAttribute(java.lang.String name)
|
java.util.Enumeration |
getAttributeNames()
|
javax.servlet.ServletContext |
getContext(java.lang.String name)
Not supported function. |
java.lang.String |
getInitParameter(java.lang.String name)
|
java.util.Enumeration |
getInitParameterNames()
|
net.sf.jportlet.portlet.PortletLog |
getLog()
Returns the portlet log which allows the portlet to write debug, informational, warning, or error messages to a log |
int |
getMajorVersion()
|
java.lang.String |
getMimeType(java.lang.String file)
|
int |
getMinorVersion()
|
javax.servlet.RequestDispatcher |
getNamedDispatcher(java.lang.String name)
Not supported function. |
java.lang.String |
getRealPath(java.lang.String path)
|
javax.servlet.RequestDispatcher |
getRequestDispatcher(java.lang.String path)
Not supported function. |
java.net.URL |
getResource(java.lang.String path)
|
java.io.InputStream |
getResourceAsStream(java.lang.String path)
|
java.io.InputStream |
getResourceAsStream(java.lang.String path,
net.sf.jportlet.portlet.Client client)
Returns the resource located at the given path (inside the portlet context) as an InputStream for a given client device
, or null if the resource not found. |
java.io.InputStream |
getResourceAsStream(java.lang.String path,
net.sf.jportlet.portlet.Client client,
java.util.Locale locale)
Returns the resource located at the given path (inside the portlet context) as an java.io.InputStream for a given client device
and Locale, or null if the resource not found. |
java.lang.String |
getResourcePath(java.lang.String path,
net.sf.jportlet.portlet.Client client)
Return the path of a resource for a given client device , or null if the resource not found. |
java.lang.String |
getResourcePath(java.lang.String path,
net.sf.jportlet.portlet.Client client,
java.util.Locale locale)
Return the path of a resource for a given client device and Locale, or null if the resource not found. |
java.util.Set |
getResourcePaths(java.lang.String path)
|
java.lang.String |
getServerInfo()
|
net.sf.jportlet.service.PortletService |
getService(java.lang.String name)
This function looks up a portlet service with the given classname. |
javax.servlet.Servlet |
getServlet(java.lang.String arg0)
|
javax.servlet.ServletContext |
getServletContext()
|
java.lang.String |
getServletContextName()
|
java.util.Enumeration |
getServletNames()
|
java.util.Enumeration |
getServlets()
|
java.lang.String |
getText(java.lang.String key,
java.util.Locale locale)
Returns the localized text resource with the given key and using the given locale. |
void |
include(java.lang.String path,
net.sf.jportlet.portlet.PortletRequest request,
net.sf.jportlet.portlet.PortletResponse response)
Allows the portlet to render a resource as specified by the given path (inside the portlet context). |
void |
log(java.lang.Exception cause,
java.lang.String message)
|
void |
log(java.lang.String message)
|
void |
log(java.lang.String message,
java.lang.Throwable cause)
|
void |
removeAttribute(java.lang.String name)
|
void |
send(java.lang.String portletName,
java.lang.Object message,
net.sf.jportlet.portlet.PortletRequest request,
net.sf.jportlet.portlet.PortletResponse response)
Send a message to a portlet. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PortletContextImpl(net.sf.jportlet.portlet.application.PortletProxy proxy,
net.sf.jportlet.portlet.application.PortletApplication application,
javax.servlet.ServletContext servletContext)
| Method Detail |
public java.lang.Object getAttribute(java.lang.String name)
getAttribute in interface PortletContextServletContext.getAttribute(java.lang.String)public java.util.Enumeration getAttributeNames()
getAttributeNames in interface PortletContextServletContext.getAttributeNames()public javax.servlet.ServletContext getContext(java.lang.String name)
RuntimeException
getContext in interface javax.servlet.ServletContextjava.lang.RuntimeExceptionServletContext.getContext(java.lang.String)public java.lang.String getInitParameter(java.lang.String name)
getInitParameter in interface PortletContextServletContext.getInitParameter(java.lang.String)public java.util.Enumeration getInitParameterNames()
getInitParameterNames in interface PortletContextServletContext.getInitParameterNames()public net.sf.jportlet.portlet.PortletLog getLog()
PortletContext
getLog in interface PortletContextPortletContext.getLog()public int getMajorVersion()
getMajorVersion in interface javax.servlet.ServletContextServletContext.getMajorVersion()public java.lang.String getMimeType(java.lang.String file)
getMimeType in interface javax.servlet.ServletContextServletContext.getMimeType(java.lang.String)public int getMinorVersion()
getMinorVersion in interface javax.servlet.ServletContextServletContext.getMinorVersion()public javax.servlet.RequestDispatcher getNamedDispatcher(java.lang.String name)
RuntimeException
getNamedDispatcher in interface javax.servlet.ServletContextjava.lang.RuntimeExceptionServletContext.getNamedDispatcher(java.lang.String)public java.lang.String getRealPath(java.lang.String path)
getRealPath in interface javax.servlet.ServletContextServletContext.getRealPath(java.lang.String)public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String path)
RuntimeException
getRequestDispatcher in interface javax.servlet.ServletContextjava.lang.RuntimeExceptionServletContext.getRequestDispatcher(java.lang.String)
public java.net.URL getResource(java.lang.String path)
throws java.net.MalformedURLException
getResource in interface javax.servlet.ServletContextjava.net.MalformedURLExceptionServletContext.getResource(java.lang.String)public java.io.InputStream getResourceAsStream(java.lang.String path)
getResourceAsStream in interface javax.servlet.ServletContextServletContext.getResourceAsStream(java.lang.String)
public java.io.InputStream getResourceAsStream(java.lang.String path,
net.sf.jportlet.portlet.Client client)
PortletContextInputStream for a given client device
, or null if the resource not found.
The resource are always searched first from the portlet classpath, and
if not found, it will be searched from the portlet web module.
For example, if a web-browser request to the portlet
com.foo.MyPortlet named myportlet the resource /template.vm,
This function will search the following files until it found it:
getResourceAsStream in interface PortletContextpath - Path of the requested resourceclient - Information about the client device
PortletContext.getResourceAsStream(java.lang.String, net.sf.jportlet.portlet.Client)
public java.io.InputStream getResourceAsStream(java.lang.String path,
net.sf.jportlet.portlet.Client client,
java.util.Locale locale)
PortletContextjava.io.InputStream for a given client device
and Locale, or null if the resource not found.
The resource are always searched first from the portlet classpath, and
if not found, it will be searched from the portlet web module.
For example, if a web-browser from US request to the portlet
com.foo.MyPortlet named myportlet the resource /template.vm,
This function will search the following files until it found it:
getResourceAsStream in interface PortletContextpath - resource pathclient - clientlocale - locale
PortletContext.getResourceAsStream(java.lang.String, net.sf.jportlet.portlet.Client, java.util.Locale)public java.util.Set getResourcePaths(java.lang.String path)
getResourcePaths in interface javax.servlet.ServletContextServletContext.getResourcePaths(java.lang.String)public java.lang.String getServerInfo()
getServerInfo in interface javax.servlet.ServletContextServletContext.getServerInfo()
public net.sf.jportlet.service.PortletService getService(java.lang.String name)
throws PortletServiceUnavailableException,
PortletServiceNotFoundException
PortletContext
getService in interface PortletContextname - name of the service
PortletServiceNotFoundException - if the service not found
PortletServiceUnavailableException - if an exception has occurrred that interferes with the portlet service's normal initializationPortletContext.getService(java.lang.String)
public javax.servlet.Servlet getServlet(java.lang.String arg0)
throws javax.servlet.ServletException
getServlet in interface javax.servlet.ServletContextjavax.servlet.ServletExceptionServletContext.getServlet(java.lang.String)public java.lang.String getServletContextName()
getServletContextName in interface javax.servlet.ServletContextServletContext.getServletContextName()public java.util.Enumeration getServletNames()
getServletNames in interface javax.servlet.ServletContextServletContext.getServletNames()public java.util.Enumeration getServlets()
getServlets in interface javax.servlet.ServletContextServletContext.getServlets()
public java.lang.String getText(java.lang.String key,
java.util.Locale locale)
PortletContextCLASSPATH has
to contain a resource bundle with the same name (including the package)
as the portlet
getText in interface PortletContextkey - key of the textlocale - target locale
PortletContext.getText(java.lang.String, java.util.Locale)
public void include(java.lang.String path,
net.sf.jportlet.portlet.PortletRequest request,
net.sf.jportlet.portlet.PortletResponse response)
throws PortletException,
java.io.IOException
PortletContext
For example, For the portlet com.foo.MyPortlet named myportlet,
a file /template.vm will be searched for
in the following order, when accessing via HTML-Browser:
include in interface PortletContextpath - path of the file to includerequest - request of the portletresponse - response of the portlet
PortletException - if any other error
java.io.IOException - if any IO errorPortletContext.include(java.lang.String, net.sf.jportlet.portlet.PortletRequest, net.sf.jportlet.portlet.PortletResponse)
public void log(java.lang.Exception cause,
java.lang.String message)
log in interface javax.servlet.ServletContextServletContext.log(java.lang.Exception, java.lang.String)public void log(java.lang.String message)
log in interface javax.servlet.ServletContextServletContext.log(java.lang.String)
public void log(java.lang.String message,
java.lang.Throwable cause)
log in interface javax.servlet.ServletContextServletContext.log(java.lang.String, java.lang.Throwable)public void removeAttribute(java.lang.String name)
removeAttribute in interface PortletContextServletContext.removeAttribute(java.lang.String)
public void setAttribute(java.lang.String name,
java.lang.Object value)
setAttribute in interface PortletContextServletContext.setAttribute(java.lang.String, java.lang.Object)
public void send(java.lang.String portletName,
java.lang.Object message,
net.sf.jportlet.portlet.PortletRequest request,
net.sf.jportlet.portlet.PortletResponse response)
throws PortletException
PortletContextportletName not specified,
this method will broadcast the message to all portlets
send in interface PortletContextportletName - name of the portletmessage - message to sendrequest - response -
PortletExceptionPortletContext.send(String, Object, PortletRequest, PortletResponse)public net.sf.jportlet.portlet.application.PortletApplication getApplication()
public javax.servlet.ServletContext getServletContext()
public java.lang.String getResourcePath(java.lang.String path,
net.sf.jportlet.portlet.Client client,
java.util.Locale locale)
PortletContextLocale, or null if the resource not found.
See #getResourcePath() to understand how the container find
the requested resource
getResourcePath in interface PortletContextpath - resource pathclient - clientlocale - locale
PortletContext.getResourcePath(java.lang.String, net.sf.jportlet.portlet.Client, java.util.Locale)
public java.lang.String getResourcePath(java.lang.String path,
net.sf.jportlet.portlet.Client client)
PortletContextnull if the resource not found.
See #getResourcePath() to understand how the container find
the requested resource
getResourcePath in interface PortletContextpath - resource pathclient - client
PortletContext.getResourcePath(java.lang.String, net.sf.jportlet.portlet.Client)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||