org.mmbase.servlet
Class ImageServlet

Package class diagram package ImageServlet
java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.mmbase.servlet.MMBaseServlet
              extended by org.mmbase.servlet.BridgeServlet
                  extended by org.mmbase.servlet.HandleServlet
                      extended by org.mmbase.servlet.ImageServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig, MMBaseStarter

public class ImageServlet
extends HandleServlet

ImageServlet handles nodes as images. If you want to convert an image (resize it, turn it, change its colors etc) then you want to serve an 'icaches' node ('icaches' are cached conversions of images), which you have to create yourself before calling this servlet. The cache() function of Images can be used for this. An URL can be gotten with cachepath().

Since:
MMBase-1.6
Version:
$Id: ImageServlet.java 44572 2011-01-06 08:56:39Z michiel $
Author:
Michiel Meeuwissen
See Also:
AbstractImages, Images.executeFunction(org.mmbase.module.core.MMObjectNode, java.lang.String, java.util.List), AttachmentServlet, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.mmbase.servlet.BridgeServlet
BridgeServlet.QueryParts
 
Field Summary
 
Fields inherited from class org.mmbase.servlet.HandleServlet
legalizeFileName
 
Fields inherited from class org.mmbase.servlet.BridgeServlet
FILE_PATTERN, MESSAGE_ATTRIBUTE
 
Fields inherited from class org.mmbase.servlet.MMBaseServlet
mmbase, retryAfter
 
Constructor Summary
ImageServlet()
           
 
Method Summary
protected  Node desperatelyGetNode(Cloud cloud, String nodeIdentifier)
          Overridden to support 'title aliases'.
protected  Map<String,Integer> getAssociations()
           
protected  Cloud getClassCloud()
           
protected  String getMimeType(Node node)
          Forces download in browsers.
protected  Node getServedNode(BridgeServlet.QueryParts query, Node node)
          ImageServlet can serve a icache node in stead (using the 'extra parameters)'
 String getServletInfo()
           
 void init()
          Takes care of the 'expire' init-parameter.
protected  boolean setContent(BridgeServlet.QueryParts query, Node node, String mimeType)
          Content-Disposition header Sets the content disposition header.
 
Methods inherited from class org.mmbase.servlet.HandleServlet
doGet, getContentDisposition, getFileName, getSize, main, sendBytes, sendBytes, setCacheControl, setExpires
 
Methods inherited from class org.mmbase.servlet.BridgeServlet
, findCloud, getAnonymousCloud, getCloud, getCloudName, getLastModified, getNode, readQuery, readQuery, readQueryFromRequestURI, readServletPath
 
Methods inherited from class org.mmbase.servlet.MMBaseServlet
associateMapping, checkInited, decRefCount, destroy, getBasePath, getMMBase, getRequestURL, getServletByAssociation, getServletByMapping, getServletMappings, getServletMappingsByAssociation, incRefCount, service, setInitException, setMMBase
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageServlet

public ImageServlet()
Method Detail

init

public void init()
          throws ServletException
Description copied from class: HandleServlet
Takes care of the 'expire' init-parameter.

Overrides:
init in class HandleServlet
Throws:
ServletException

getClassCloud

protected final Cloud getClassCloud()
Overrides:
getClassCloud in class HandleServlet

getServletInfo

public String getServletInfo()
Specified by:
getServletInfo in interface Servlet
Overrides:
getServletInfo in class MMBaseServlet

getAssociations

protected Map<String,Integer> getAssociations()
Overrides:
getAssociations in class HandleServlet

getMimeType

protected String getMimeType(Node node)
Description copied from class: HandleServlet
Forces download in browsers. This is overriden in several extensions.

Overrides:
getMimeType in class HandleServlet

setContent

protected boolean setContent(BridgeServlet.QueryParts query,
                             Node node,
                             String mimeType)
                      throws IOException
Content-Disposition header Sets the content disposition header.

Overrides:
setContent in class HandleServlet
Returns:
true on success
Throws:
IOException

getServedNode

protected Node getServedNode(BridgeServlet.QueryParts query,
                             Node node)
                      throws IOException
ImageServlet can serve a icache node in stead (using the 'extra parameters)'

Overrides:
getServedNode in class BridgeServlet
Throws:
IOException
Since:
MMBase-1.7.4

desperatelyGetNode

protected Node desperatelyGetNode(Cloud cloud,
                                  String nodeIdentifier)
Overridden to support 'title aliases'.

Overrides:
desperatelyGetNode in class BridgeServlet
Since:
MMBase-1.7.5


MMBase2 Resources 2.0-SNAPSHOT - 2013-03-30T06:37