|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.wewebu.ow.server.servlets.OwAbstractUpload
com.wewebu.ow.server.servlets.OwMultifileDownload
public class OwMultifileDownload
OwMultifileDownload Servlet provides one or several object contents
for download as a zipped archive or as a single content file depending on the
request and init parameters.
The OwMultifileDownload Servlet processes the request by creating an archive
of folders containing content files and/or other folders. Content files rely on OwContentElement
s.
The created archive can be zipped or served as single file (if and only if it contains a
single content file).
The content archive is folder-structured , can contain multiple entries with the same name
and it is modeled using OwMultifileDownload.OwContentArchiveEntry
objects.
The archive structure is created by the createContentArchive(List, OwMainAppContext)
overridable method.
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
Nested Class Summary | |
---|---|
protected class |
OwMultifileDownload.OwBufferedSingleContentEntry
An archive entry containing a single content file. |
protected static interface |
OwMultifileDownload.OwContentArchiveEntry
A content archive entry. Each entry contains 0 or more files, can be zipped on a ZipOutputStream under
a specified path and can be "served" on a HttpServletResponse . |
protected class |
OwMultifileDownload.OwContentElementEntry
An OwContentElement based implementation of OwMultifileDownload.OwBufferedSingleContentEntry |
protected class |
OwMultifileDownload.OwFolderArchiveEntry
A folder archive entry. |
Field Summary | |
---|---|
static String |
ATTRIBUTE_NAME_FILES_TO_DOWNLOAD
|
Constructor Summary | |
---|---|
OwMultifileDownload()
|
Method Summary | |
---|---|
protected void |
addMultiContentArchiveEntry(OwMultifileDownload.OwFolderArchiveEntry parentFolder_p,
OwObject object_p)
(overridable) Adds an OwMultifileDownload.OwContentArchiveEntry to the specified parent folder for the
specified OwObject . |
protected void |
addSingleContentEntry(OwMultifileDownload.OwFolderArchiveEntry parentFolder_p,
OwObject object_p)
(overridable) Adds an OwMultifileDownload.OwContentArchiveEntry to the specified parent folder for the
specified OwObject . |
protected String |
createArchivedContentFileName(String defaultName_p,
OwContentElement element_p)
(overridable) Creates file names for OwContentElement based folder archive entries |
protected String |
createArchivedObjectFolderName(String objectName_p)
(overridable) Creates folder names for OwObject based folder archive entries |
protected OwMultifileDownload.OwFolderArchiveEntry |
createContentArchive(List<OwObject> objectsToZip_p,
OwMainAppContext context_p)
(overridable) Creates the archive that will be served by processRequest(HttpServletRequest, HttpServletResponse) |
String |
getServletInfo()
Returns a short description of the servlet. |
void |
init(javax.servlet.ServletConfig config_p)
Initializes the servlet. |
protected void |
processRequest(javax.servlet.http.HttpServletRequest request_p,
javax.servlet.http.HttpServletResponse response_p)
Processes requests for both HTTP GET and POST methods. |
Methods inherited from class com.wewebu.ow.server.servlets.OwAbstractUpload |
---|
createFileName, doGet, doPost |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
---|
destroy, 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 |
Field Detail |
---|
public static final String ATTRIBUTE_NAME_FILES_TO_DOWNLOAD
Constructor Detail |
---|
public OwMultifileDownload()
Method Detail |
---|
public String getServletInfo()
getServletInfo
in interface javax.servlet.Servlet
getServletInfo
in class javax.servlet.GenericServlet
public void init(javax.servlet.ServletConfig config_p) throws javax.servlet.ServletException
init
in interface javax.servlet.Servlet
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
protected String createArchivedObjectFolderName(String objectName_p)
OwObject
based folder archive entries
objectName_p
- the name of the object who's content folder is archived
protected String createArchivedContentFileName(String defaultName_p, OwContentElement element_p)
OwContentElement
based folder archive entries
defaultName_p
- file name prefix to be used if no name can be acquired through OwContentElement
's MIME parameterelement_p
- the content element for which the name is generated
protected OwMultifileDownload.OwFolderArchiveEntry createContentArchive(List<OwObject> objectsToZip_p, OwMainAppContext context_p) throws IOException
processRequest(HttpServletRequest, HttpServletResponse)
objectsToZip_p
- the objects that provide content for the returned archivecontext_p
-
IOException
protected void addSingleContentEntry(OwMultifileDownload.OwFolderArchiveEntry parentFolder_p, OwObject object_p) throws Exception
OwMultifileDownload.OwContentArchiveEntry
to the specified parent folder for the
specified OwObject
.
It is assumed that the passed OwObject
contains a single OwContentElement
in its OwContentCollection
.
parentFolder_p
- the folder to add single content entry toobject_p
- single content object
Exception
protected void addMultiContentArchiveEntry(OwMultifileDownload.OwFolderArchiveEntry parentFolder_p, OwObject object_p) throws Exception
OwMultifileDownload.OwContentArchiveEntry
to the specified parent folder for the
specified OwObject
.
It is assumed that the passed OwObject
contains more than one OwContentElement
s in its OwContentCollection
.
parentFolder_p
- the folder to add the multiple content entry toobject_p
- a multiple content object
Exception
protected void processRequest(javax.servlet.http.HttpServletRequest request_p, javax.servlet.http.HttpServletResponse response_p) throws javax.servlet.ServletException, IOException
GET
and POST
methods.
Creates an archive via createContentArchive(List, OwMainAppContext)
and serializes it to
the HttpServletResponse
parameter.
processRequest
in class OwAbstractUpload
request_p
- servlet requestresponse_p
- servlet response
javax.servlet.ServletException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |