Dekoh platform API

dekoh.portal.servlet
Class AppIconServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by dekoh.portal.util.FileServer
              extended by dekoh.portal.servlet.AppIconServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class AppIconServlet
extends FileServer

Serves the large icons (32 * 32) and small icons specified in the the deployed web application's web.xml files. In absence of any, supplies a default image.

Sought icon size is passed as value for query string parameter size. Allowed values for this parameter are 'small' and 'large'.

Applications whose context root is specified must be installed. They donot need to be started.

For example URL :

  1. http://localhost/dekohportal/appicon/photos serves the large icon supplied by photos application.

  2. http://localhost/dekohportal/appicon/photos?size=small serves the small icon supplied by photos application.
Use methods AppIconServlet.getAppIconUrl(java.lang.String, java.lang.String, dekoh.portal.servlet.AppIconServlet.IconSize, boolean) to generate URLs that make requests to this servlet.

Since:
Aug 24, 2007
See Also:
Serialized Form

Nested Class Summary
static class AppIconServlet.IconSize
           
 
Field Summary
 
Fields inherited from class dekoh.portal.util.FileServer
FILE_EXT_HEADER, FILE_TO_SERVE, UNKNOWN
 
Constructor Summary
AppIconServlet()
           
 
Method Summary
static String getAppIconUrl(HttpServletRequest request, String appContextPath, AppIconServlet.IconSize size, boolean localRequest)
          Same as calling AppIconServlet.getAppIconUrl(String,String,dekoh.portal.servlet.AppIconServlet.IconSize,boolean)
static String getAppIconUrl(String ownerDekohId, String appContextPath, AppIconServlet.IconSize size, boolean localRequest)
          Gets the http URL pointing to the icon of the application in requested size.
protected  File getRequestedFile(HttpServletRequest request)
          Gets the icon file of requested size.
 void init()
           
 
Methods inherited from class dekoh.portal.util.FileServer
authorizedToAccessCachedCopy, copyStream, doGet, doPost, getLastModified, handleExceptionInLastModified, serveRequestedFile
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppIconServlet

public AppIconServlet()
Method Detail

init

public void init()
          throws ServletException
Overrides:
init in class GenericServlet
Throws:
ServletException

getRequestedFile

protected File getRequestedFile(HttpServletRequest request)
Gets the icon file of requested size.

Specified by:
getRequestedFile in class FileServer
Parameters:
request - servlet request
Returns:
null if no application with context path in the request is deployed on this dekoh installation.

getAppIconUrl

public static String getAppIconUrl(String ownerDekohId,
                                   String appContextPath,
                                   AppIconServlet.IconSize size,
                                   boolean localRequest)
Gets the http URL pointing to the icon of the application in requested size.

Parameters:
ownerDekohId - use DekohNetworkRequestHelper.getOwner(request) to get the owner dekoh user name
appContextPath - context path of deployed application for which icon is being sought
size -
localRequest -
Returns:
URL to deployed application icon. If no application by given context path is deployed on the target, the URL returned by this method will return 404.
Throws:
NullPointerException - if appContextPath, or ownderDekohId is null

getAppIconUrl

public static String getAppIconUrl(HttpServletRequest request,
                                   String appContextPath,
                                   AppIconServlet.IconSize size,
                                   boolean localRequest)
Same as calling AppIconServlet.getAppIconUrl(String,String,dekoh.portal.servlet.AppIconServlet.IconSize,boolean)


Dekoh platform API

© 2009 Pramati Technologies - Dekoh - Portal for Developers