dekoh.portal.servlet
Class AppIconServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
dekoh.portal.util.FileServer
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 : http://localhost/dekohportal/appicon/photos serves the large icon supplied by photos
application.
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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AppIconServlet
public AppIconServlet()
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 nameappContextPath - context path of deployed application for which icon is being soughtsize - 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)
© 2009 Pramati Technologies - Dekoh - Portal for Developers