org.sourcejammer.web.servlet
Class BrowseArchiveController

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--org.sourcejammer.web.servlet.BrowseArchiveController
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, org.sourcejammer.project.view.SJRequestParams, org.sourcejammer.project.view.SJResponseParams

public class BrowseArchiveController
extends javax.servlet.http.HttpServlet
implements org.sourcejammer.project.view.SJRequestParams, org.sourcejammer.project.view.SJResponseParams

Title: SourceJammer 1.1 Description: Copyright: Copyright (c) 2001 Company: SourceJammer

Version:
1.0
Author:
Robert MacGrogan
See Also:
Serialized Form

Nested Class Summary
private static class BrowseArchiveController.Commands
           
static class BrowseArchiveController.Params
           
private static class BrowseArchiveController.SessionParams
           
private static class BrowseArchiveController.URLs
           
 
Field Summary
static java.lang.String BINARY_MIME_TYPE
           
static java.lang.String ERROR_PAGE
           
static java.lang.String EXCEPTION_ATTR_NAME
           
private  javax.servlet.ServletConfig mConfig
           
 
Fields inherited from class javax.servlet.http.HttpServlet
 
Fields inherited from class javax.servlet.GenericServlet
 
Fields inherited from interface org.sourcejammer.project.view.SJRequestParams
ARCHIVE_PROPERTIES, BINARY_ZIPPED, CHECK_OUT_PATH, COMMENT, EXCLUDE_FILE, FILE_PROPERTIES, FILE_UPLOAD_ID, IDENTIFIER, IS_BRANCH_AFTER_CHECKIN, IS_BUILD_CHANGELIST, NEW_ARCHIVE_IMPLEMENTATION, NEW_ARCHIVE_NAME, NEW_ARCHIVE_ROOT_PATH, NEW_PARENT_NODE_UNIQUE_ID, NEW_USER_ADMIN, NEW_USER_FULL_NAME, NEW_USER_NAME, NEW_USER_PASSWORD, PARENT_NODE_NAME, PARENT_NODE_UNIQUE_ID, PLUGIN_NAME, RECURSIVE, REQUESTED_EOL_TYPE, REQUESTED_NODE_NAME, REQUESTED_NODE_UNIQUE_ID, SECONDARY_VERSION_NUMBER, VERSION_NUMBER, ZIP_BINARIES_LARGER_THAN
 
Fields inherited from interface org.sourcejammer.project.view.SJResponseParams
BOOLEAN_QUERY_RESULT, BRANCHES, DOWNLOAD_FILE_IDENTIFIER, FILE, IS_CHECKED_OUT, IS_SHARED, NEW_FILE_ID, NODE_UNIQUE_ID, OBJECT_ARRAY, PROJECT, res_ARCHIVE_PROPERTIES, res_BINARY_ZIPPED, res_PARENT_NODE_UNIQUE_ID, SJ_PATH_TO_LABEL_ROOT
 
Constructor Summary
BrowseArchiveController()
           
 
Method Summary
protected  java.lang.String connectToArchive(javax.servlet.http.HttpServletRequest request)
          Called by post() to connect to an archive as anon user.
protected  void displayException(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Exception ex)
          Forwards to the error page, which displays info about the Exception.
protected  java.lang.String displayFile(javax.servlet.http.HttpServletRequest request)
          Displays info about a file on the file page.
protected  java.lang.String displayProject(javax.servlet.http.HttpServletRequest request)
          Displays info about a project in the project page.
protected  java.lang.String displayProject(javax.servlet.http.HttpServletRequest request, long lProjectID, int iParentIndex)
          Gets Project from the server.
protected  java.lang.String displayProjectParent(javax.servlet.http.HttpServletRequest request)
          Displays info about a parent of the current project in the project page.
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  void forward(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String location)
          Forwards control to the specified page.
protected  org.sourcejammer.project.view.SJRequest getBaseRequest(javax.servlet.http.HttpServletRequest request)
          Returns a SJRequest object with initial parameters set.
protected  void getFile(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Downloads the requested file to the user's web browser.
protected  void getFileVersion(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Downloads the requested file version to the user's web browser.
protected  WebProjectPathElement getPathElement(org.sourcejammer.project.view.Project proj)
          Returns a new WebProjectPathElement based on the Project passed in.
 void init(javax.servlet.ServletConfig config)
          Initialize global variables and load the configuration information.
protected  void process(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Processes both post and get requests.
protected  void sendFile(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.File fl, java.lang.String fileName)
          Sends the file as the response to the user's browser.
protected  void showFile(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doOptions, doPut, doTrace, getLastModified, 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
 

Field Detail

mConfig

private javax.servlet.ServletConfig mConfig

BINARY_MIME_TYPE

public static final java.lang.String BINARY_MIME_TYPE
See Also:
Constant Field Values

EXCEPTION_ATTR_NAME

public static final java.lang.String EXCEPTION_ATTR_NAME
See Also:
Constant Field Values

ERROR_PAGE

public static final java.lang.String ERROR_PAGE
See Also:
Constant Field Values
Constructor Detail

BrowseArchiveController

public BrowseArchiveController()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Initialize global variables and load the configuration information.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
config - configuration data for the servlet from the web.xml file.
Throws:
javax.servlet.ServletException - thrown when there is an exception processing the configuration data.

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws javax.servlet.ServletException,
                  java.io.IOException
Overrides:
doGet in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
java.io.IOException

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws javax.servlet.ServletException,
                   java.io.IOException
Overrides:
doPost in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
java.io.IOException

process

protected void process(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response)
                throws javax.servlet.ServletException,
                       java.io.IOException
Processes both post and get requests.

javax.servlet.ServletException
java.io.IOException

showFile

protected void showFile(javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response)
                 throws javax.servlet.ServletException,
                        java.io.IOException,
                        EndOfSourceException
javax.servlet.ServletException
java.io.IOException
EndOfSourceException

connectToArchive

protected java.lang.String connectToArchive(javax.servlet.http.HttpServletRequest request)
                                     throws javax.servlet.ServletException,
                                            org.sourcejammer.project.NodeExistsException
Called by post() to connect to an archive as anon user.

javax.servlet.ServletException
org.sourcejammer.project.NodeExistsException

getPathElement

protected WebProjectPathElement getPathElement(org.sourcejammer.project.view.Project proj)
Returns a new WebProjectPathElement based on the Project passed in.


displayProjectParent

protected java.lang.String displayProjectParent(javax.servlet.http.HttpServletRequest request)
                                         throws javax.servlet.ServletException,
                                                org.sourcejammer.project.NodeExistsException
Displays info about a parent of the current project in the project page.

javax.servlet.ServletException
org.sourcejammer.project.NodeExistsException

displayProject

protected java.lang.String displayProject(javax.servlet.http.HttpServletRequest request)
                                   throws javax.servlet.ServletException,
                                          org.sourcejammer.project.NodeExistsException
Displays info about a project in the project page.

javax.servlet.ServletException
org.sourcejammer.project.NodeExistsException

displayProject

protected java.lang.String displayProject(javax.servlet.http.HttpServletRequest request,
                                          long lProjectID,
                                          int iParentIndex)
                                   throws javax.servlet.ServletException,
                                          org.sourcejammer.project.NodeExistsException
Gets Project from the server.

javax.servlet.ServletException
org.sourcejammer.project.NodeExistsException

displayFile

protected java.lang.String displayFile(javax.servlet.http.HttpServletRequest request)
                                throws javax.servlet.ServletException,
                                       org.sourcejammer.project.NodeExistsException
Displays info about a file on the file page.

javax.servlet.ServletException
org.sourcejammer.project.NodeExistsException

getBaseRequest

protected org.sourcejammer.project.view.SJRequest getBaseRequest(javax.servlet.http.HttpServletRequest request)
Returns a SJRequest object with initial parameters set.


displayException

protected void displayException(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                java.lang.Exception ex)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Forwards to the error page, which displays info about the Exception.

javax.servlet.ServletException
java.io.IOException

getFile

protected void getFile(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response)
                throws javax.servlet.ServletException,
                       java.io.IOException
Downloads the requested file to the user's web browser.

javax.servlet.ServletException
java.io.IOException

getFileVersion

protected void getFileVersion(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
                       throws javax.servlet.ServletException,
                              java.io.IOException
Downloads the requested file version to the user's web browser.

javax.servlet.ServletException
java.io.IOException

forward

protected void forward(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response,
                       java.lang.String location)
                throws javax.servlet.ServletException,
                       java.io.IOException
Forwards control to the specified page.

javax.servlet.ServletException
java.io.IOException

sendFile

protected void sendFile(javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response,
                        java.io.File fl,
                        java.lang.String fileName)
                 throws java.io.IOException
Sends the file as the response to the user's browser.

java.io.IOException


Copyright 2003 Soucejammer project.