org.outerj.daisy.httpconnector.handlers
Class AbstractDocumentHandler

java.lang.Object
  extended by org.outerj.daisy.httpconnector.handlers.AbstractDocumentHandler
All Implemented Interfaces:
RequestHandler
Direct Known Subclasses:
DocumentHandler, DocumentsHandler

public abstract class AbstractDocumentHandler
extends java.lang.Object
implements RequestHandler


Field Summary
protected  org.apache.avalon.framework.logger.Logger requestErrorLogger
           
protected  int uploadMaxSize
           
protected  java.lang.String uploadTempdir
           
protected  int uploadThreshold
           
 
Constructor Summary
AbstractDocumentHandler(org.apache.avalon.framework.logger.Logger requestErrorLogger, int uploadThreshold, int uploadMaxSize, java.lang.String uploadTempdir)
           
 
Method Summary
protected  org.apache.commons.fileupload.FileItem getItemByName(java.util.List items, java.lang.String name)
           
protected  java.util.List parseMultipartRequest(org.mortbay.http.HttpRequest request, org.mortbay.http.HttpResponse response)
          Parses a multipart/form-data request and returns the list of items in it.
protected  void updateDocument(org.outerj.daisy.repository.Document document, org.outerx.daisy.x10.DocumentDocument.Document documentXml, java.util.List uploadedItems, org.mortbay.http.HttpResponse response, org.outerj.daisy.repository.Repository repository)
          Updates a Document object based on XML data and other uploaded data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.outerj.daisy.httpconnector.RequestHandler
getPathPattern, handleRequest
 

Field Detail

requestErrorLogger

protected final org.apache.avalon.framework.logger.Logger requestErrorLogger

uploadThreshold

protected final int uploadThreshold

uploadMaxSize

protected final int uploadMaxSize

uploadTempdir

protected final java.lang.String uploadTempdir
Constructor Detail

AbstractDocumentHandler

public AbstractDocumentHandler(org.apache.avalon.framework.logger.Logger requestErrorLogger,
                               int uploadThreshold,
                               int uploadMaxSize,
                               java.lang.String uploadTempdir)
Method Detail

updateDocument

protected void updateDocument(org.outerj.daisy.repository.Document document,
                              org.outerx.daisy.x10.DocumentDocument.Document documentXml,
                              java.util.List uploadedItems,
                              org.mortbay.http.HttpResponse response,
                              org.outerj.daisy.repository.Repository repository)
                       throws org.outerj.daisy.repository.RepositoryException,
                              org.outerj.daisy.repository.DocumentTypeInconsistencyException,
                              java.io.IOException,
                              org.outerj.daisy.httpconnector.BadRequestException
Updates a Document object based on XML data and other uploaded data.

Throws:
org.outerj.daisy.repository.RepositoryException
org.outerj.daisy.repository.DocumentTypeInconsistencyException
java.io.IOException
org.outerj.daisy.httpconnector.BadRequestException

parseMultipartRequest

protected java.util.List parseMultipartRequest(org.mortbay.http.HttpRequest request,
                                               org.mortbay.http.HttpResponse response)
                                        throws java.io.IOException,
                                               org.outerj.daisy.httpconnector.BadRequestException
Parses a multipart/form-data request and returns the list of items in it.

In case something is wrong, an error response is send to the client and null is returned.

Throws:
java.io.IOException
org.outerj.daisy.httpconnector.BadRequestException

getItemByName

protected org.apache.commons.fileupload.FileItem getItemByName(java.util.List items,
                                                               java.lang.String name)


Copyright © -2012 . All Rights Reserved.