org.mycore.datamodel.ifs
Class MCRFileNodeServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.mycore.frontend.servlets.MCRServlet
              extended by org.mycore.datamodel.ifs.MCRFileNodeServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class MCRFileNodeServlet
extends MCRServlet

This servlet delivers the contents of an MCRFilesystemNode to the client browser. If the node is a ordinary MCRFile, the contents of that file will be sent to the browser. If the node is an MCRFile with a MCRAudioVideoExtender, the message that starts the associated streaming player will be delivered. If the node is a MCRDirectory, the contents of that directory will be forwareded to MCRLayoutService as XML data to display a detailed directory listing.

Version:
$Revision: 15202 $ $Date: 2008-01-14 11:02:17 +0000 (Mo, 14 Jan 2008) $
Author:
Frank Lützenkirchen, Jens Kupferschmidt, Thomas Scheffler (yagee)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mycore.frontend.servlets.MCRServlet
BASE_URL_ATTRIBUTE, trustedProxies
 
Constructor Summary
MCRFileNodeServlet()
           
 
Method Summary
 void doGetPost(MCRServletJob job)
          Handles the HTTP request
protected  void errorPage(HttpServletRequest req, HttpServletResponse res, int error, String msg, Exception ex, boolean xmlstyle)
          Forwards the error to generate the output
protected  long getLastModified(HttpServletRequest request)
          allows browser to cache requests.
protected static String getOwnerID(HttpServletRequest request)
           
protected  void layoutDirectory(HttpServletRequest req, HttpServletResponse res, Document jdom)
          Called to layout the directory structure
 
Methods inherited from class org.mycore.frontend.servlets.MCRServlet
buildRedirectURL, doGet, doGet, doPost, doPost, generateActiveLinkErrorpage, generateErrorPage, getBaseURL, getLayoutService, getProperty, getRemoteAddr, getServletBaseURL, getSession, handleException, init, initTrustedProxies, render, reportException, think
 
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

MCRFileNodeServlet

public MCRFileNodeServlet()
Method Detail

getLastModified

protected long getLastModified(HttpServletRequest request)
Description copied from class: MCRServlet
allows browser to cache requests. This method is usefull as it allows browsers to cache content that is not changed. Please overwrite this method in every Servlet that depends on "remote" data.

Overrides:
getLastModified in class MCRServlet

doGetPost

public void doGetPost(MCRServletJob job)
               throws IOException
Handles the HTTP request

Overrides:
doGetPost in class MCRServlet
Throws:
IOException

getOwnerID

protected static String getOwnerID(HttpServletRequest request)

layoutDirectory

protected void layoutDirectory(HttpServletRequest req,
                               HttpServletResponse res,
                               Document jdom)
                        throws IOException
Called to layout the directory structure

Parameters:
req - the html request
res - the html response
jdom - the jdom document
Throws:
IOException
See Also:
in JSPDocportal

errorPage

protected void errorPage(HttpServletRequest req,
                         HttpServletResponse res,
                         int error,
                         String msg,
                         Exception ex,
                         boolean xmlstyle)
                  throws IOException
Forwards the error to generate the output

Throws:
IOException
See Also:
overwritten in jspdocportal