org.sourcejammer.project.view
Class MasterControlProgram

java.lang.Object
  |
  +--org.sourcejammer.project.view.MasterControlProgram
All Implemented Interfaces:
org.sourcejammer.project.view.SJRequestParams, org.sourcejammer.project.view.SJResponseParams

public class MasterControlProgram
extends java.lang.Object
implements org.sourcejammer.project.view.SJResponseParams, org.sourcejammer.project.view.SJRequestParams

Title: $FileName: MasterControlProgram.java$

Version:
$VerNum: 18$
Author:
$AuthorName: Rob MacGrogan$

$Description: $
$KeyWordsOff: $

This is a central clearing house for commands sent to SourceJammer from remote clients. All methods are static. Clients can use SOAP to call methods in this Class, which deals with all the server-side objects.

Nested Class Summary
private static class MasterControlProgram.Messages
           
 
Field Summary
 
Fields inherited from interface org.sourcejammer.project.view.SJResponseParams
DOWNLOAD_FILE_IDENTIFIER, FILE, NODE_UNIQUE_ID, OBJECT_ARRAY, PROJECT, res_ARCHIVE_PROPERTIES, res_BINARY_ZIPPED, SJ_PATH_TO_LABEL_ROOT
 
Fields inherited from interface org.sourcejammer.project.view.SJRequestParams
ARCHIVE_PROPERTIES, BINARY_ZIPPED, CHECK_OUT_PATH, COMMENT, EXCLUDE_FILE, FILE_PROPERTIES, FILE_UPLOAD_ID, 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, REQUESTED_EOL_TYPE, REQUESTED_NODE_NAME, REQUESTED_NODE_UNIQUE_ID, SECONDARY_VERSION_NUMBER, VERSION_NUMBER, ZIP_BINARIES_LARGER_THAN
 
Constructor Summary
private MasterControlProgram()
           
 
Method Summary
static org.sourcejammer.project.view.SJResponse addArchive(org.sourcejammer.project.view.SJRequest request)
           
static org.sourcejammer.project.view.SJResponse addFile(org.sourcejammer.project.view.SJRequest request)
          Adds a new file.
static org.sourcejammer.project.view.SJResponse addProject(org.sourcejammer.project.view.SJRequest request)
          Adds a new project.
static org.sourcejammer.project.view.SJResponse addToArchiveControllerUsers(org.sourcejammer.project.view.SJRequest request)
          Add user to controller users list for an archive.

Required SJRequest Params:
   newUserName -- user name of user being added to controller users list.
static org.sourcejammer.project.view.SJResponse addToArchiveUsers(org.sourcejammer.project.view.SJRequest request)
          Add user to users list for an archive.

Required SJRequest Params:
   newUserName -- user name of user being added to controller users list.
static org.sourcejammer.project.view.SJResponse addUser(org.sourcejammer.project.view.SJRequest request)
           
private static void buildSpecificVersionSource(Archive oArchive, long fileID, int iRequestedEOLType, int iVersion, java.io.File flTarget)
          Rebuilds the specified source for the specified version (iVersion) of the specified file (ndFile).
private static void buildSpecificVersionSource(Archive oArchive, long fileID, int iRequestedEOLType, long lVersionID, java.io.File flTarget)
          Rebuilds the specified source for the specified version (iVersion) of the specified file (ndFile).
static org.sourcejammer.project.view.SJResponse changeFileDescription(org.sourcejammer.project.view.SJRequest request)
          Adds a new project.
static org.sourcejammer.project.view.SJResponse changePassword(org.sourcejammer.project.view.SJRequest request)
          Change a user's password.
static org.sourcejammer.project.view.SJResponse checkInFile(org.sourcejammer.project.view.SJRequest request)
          Check in a file.
static org.sourcejammer.project.view.SJResponse checkOutFile(org.sourcejammer.project.view.SJRequest request)
          Check out a file.
private static long checkSession(org.sourcejammer.project.view.SJRequest request, Archive arch)
          Checks users login status.
private static long checkSessionAdminRequired(org.sourcejammer.project.view.SJRequest request)
          Checks users login status.
private static long checkSessionAllowAnon(org.sourcejammer.project.view.SJRequest request, Archive arch)
          Checks user's login status.
private static long checkSessionArchUserRequired(org.sourcejammer.project.view.SJRequest request, Archive arch)
          Checks users login status.
private static long checkSessionControllerRequired(org.sourcejammer.project.view.SJRequest request, Archive arch)
          Checks users login status.
static org.sourcejammer.project.view.SJResponse connect(org.sourcejammer.project.view.SJRequest request)
          Returns response with welcome message and session id.
static org.sourcejammer.project.view.SJResponse copyFile(org.sourcejammer.project.view.SJRequest request)
          Copies a file.
static org.sourcejammer.project.view.SJResponse copyProject(org.sourcejammer.project.view.SJRequest request)
          Copies a project.
static org.sourcejammer.project.view.SJResponse deleteArchive(org.sourcejammer.project.view.SJRequest request)
          Permanently deletes an archive.

Required SJRequest Params:
   newArchiveName -- name of archive to be deleted.
static org.sourcejammer.project.view.SJResponse disconnect(org.sourcejammer.project.view.SJRequest request)
          Logs user out.
private static Archive getArchive(java.lang.String archiveName)
           
static ArchiveInfoFlex getArchiveInfo(java.lang.String archiveName)
           
static org.sourcejammer.project.view.SJResponse getArchiveNames(org.sourcejammer.project.view.SJRequest request)
          Return a list of archives available on this server.

Required SJRequest Params:
   newArchiveName -- name of archive to be deleted.
static org.sourcejammer.project.view.SJResponse getArchiveProperties(org.sourcejammer.project.view.SJRequest request)
           
static org.sourcejammer.project.view.SJResponse getArchiveUserList(org.sourcejammer.project.view.SJRequest request)
           
static org.sourcejammer.project.view.SJResponse getChangeList(org.sourcejammer.project.view.SJRequest request)
          Builds a change list and returns download id.
static org.sourcejammer.project.view.SJResponse getCompleteUserList(org.sourcejammer.project.view.SJRequest request)
           
static org.sourcejammer.project.view.SJResponse getControllerUserList(org.sourcejammer.project.view.SJRequest request)
           
static org.sourcejammer.project.view.SJResponse getFileInfo(org.sourcejammer.project.view.SJRequest request)
          Gets information about a file.
static org.sourcejammer.project.view.SJResponse getFileLatestVersion(org.sourcejammer.project.view.SJRequest request)
          Gets latest version of a file.
static org.sourcejammer.project.view.SJResponse getFileLatestVersionID(org.sourcejammer.project.view.SJRequest request)
          Gets unique ID of latest version of a file.

Required SJRequest Params:
   requestedNodeUniqueID -- id of file.
static org.sourcejammer.project.view.SJResponse getFileVersion(org.sourcejammer.project.view.SJRequest request)
          Gets a previous version of a file.
static org.sourcejammer.project.view.SJResponse getLabelContentList(org.sourcejammer.project.view.SJRequest request)
          Gets info about all file/versions in a label.

Required SJRequest Params:
   requestedNodeUniqueID -- id of the label.
   versionNumber -- Version number (NOT unique ID) of the label requested.
Info about response:
   nodeUniqueID -- Unique Id of root project of the label.
   objectArray -- Array of LabelVersionMappingBeans, one for each file in the label.
static org.sourcejammer.project.view.SJResponse getLabelList(org.sourcejammer.project.view.SJRequest request)
          Deprecated.  
static org.sourcejammer.project.view.SJResponse getProjectInfo(org.sourcejammer.project.view.SJRequest request)
          Gets information about a project.
static org.sourcejammer.project.view.SJResponse getUniqueIDFromPath(org.sourcejammer.project.view.SJRequest request)
          Returns the node unique ID from a path and parent node id.

Required SJRequest Params:
   requestedNodeUniqueID -- id of the parent project.
   requestedNodeName -- Path.
private static boolean isAdminOrControllerSession(org.sourcejammer.project.view.SJRequest request, Archive arch)
           
private static boolean isAdminSession(org.sourcejammer.project.view.SJRequest request)
           
static org.sourcejammer.project.view.SJResponse login(org.sourcejammer.project.view.SJRequest request)
          Logs in user but does not connect to an archive.
static org.sourcejammer.project.view.SJResponse makeLabeledVersion(org.sourcejammer.project.view.SJRequest request)
          Makes a labeled version.

Required SJRequest Params:
   requestedNodeUniqueID -- root project for label.
   requestedNodeName -- Name for the new label.
   comment -- Description of the label.
static org.sourcejammer.project.view.SJResponse moveFile(org.sourcejammer.project.view.SJRequest request)
          Moves a file.
static org.sourcejammer.project.view.SJResponse moveProject(org.sourcejammer.project.view.SJRequest request)
          Moves a project.
static org.sourcejammer.project.view.SJResponse permanentlyDeleteNode(org.sourcejammer.project.view.SJRequest request)
          Permanently deletes a node that was previously removed.

Required SJRequest Params:
   requestedNodeUniqueID -- id of parent project from which the node is to be deleted.
   versionNumber -- The number (index in removed nodes) of the node to delete.
static org.sourcejammer.project.view.SJResponse rebuildLabel(org.sourcejammer.project.view.SJRequest request)
          Automatically creates a new version of the label.

Required SJRequest Params:
   requestedNodeUniqueID -- id of the label.
   parentNodeUniqueID -- id of label's parent project
Info about response:
   nodeUniqueID -- Unique Id of root project of the label.
   objectArray -- Array of LabelVersionMappingBeans, one for each file in the label.
static org.sourcejammer.project.view.SJResponse removeFile(org.sourcejammer.project.view.SJRequest request)
          Remove a file from a project.

Required SJRequest Params:
   requestedNodeUniqueID -- id of file to remove.
   parentNodeUniqueID -- id of parent project.
static org.sourcejammer.project.view.SJResponse removeFromArchiveControllerUsers(org.sourcejammer.project.view.SJRequest request)
          Remove user from controller users list for an archive.

Required SJRequest Params:
   newUserName -- user name of user being added to controller users list.
static org.sourcejammer.project.view.SJResponse removeFromArchiveUsers(org.sourcejammer.project.view.SJRequest request)
          Remove user from users list for an archive.

Required SJRequest Params:
   newUserName -- user name of user being added to controller users list.
static org.sourcejammer.project.view.SJResponse removeProject(org.sourcejammer.project.view.SJRequest request)
          Remove a Project from a project.

Required SJRequest Params:
   requestedNodeUniqueID -- id of project to remove.
   parentNodeUniqueID -- id of parent project.
static org.sourcejammer.project.view.SJResponse removeUser(org.sourcejammer.project.view.SJRequest request)
           
static org.sourcejammer.project.view.SJResponse renameFile(org.sourcejammer.project.view.SJRequest request)
          Change the name of a file.

Required SJRequest Params:
   requestedNodeUniqueID -- id of the file being renamed.
   parentNodeUniqueID -- id of parent project of the file being renamed
   requestedNodeName -- new name for the file
static org.sourcejammer.project.view.SJResponse renameProject(org.sourcejammer.project.view.SJRequest request)
          Change the name of a project.

Required SJRequest Params:
   requestedNodeUniqueID -- id of the project being renamed.
   parentNodeUniqueID -- id of parent project of the project being renamed
   requestedNodeName -- new name for the project
static org.sourcejammer.project.view.SJResponse restoreRemovedNode(org.sourcejammer.project.view.SJRequest request)
          Restored a node that was removed from a project.

Required SJRequest Params:
   requestedNodeUniqueID -- id of parent project that node is to be restored to.
   requestedNodeName -- name to that restore node is to be named, when restored.
   versionNumber -- The number (index) of the node to restore.
static org.sourcejammer.project.view.SJResponse rollBackToVersions(org.sourcejammer.project.view.SJRequest request)
          Rollback a file in the archive to a previous version.

Required SJRequest Params:
   requestedNodeUniqueID -- id of the version to roll back to.
   parentNodeUniqueID -- id of the file being rolled back.
static org.sourcejammer.project.view.SJResponse setArchiveProperties(org.sourcejammer.project.view.SJRequest request)
           
static org.sourcejammer.project.view.SJResponse setUserAdmin(org.sourcejammer.project.view.SJRequest request)
          Set a user's admin status.

Required SJRequest Params:
   newUserName -- User name of user being modified.
   newUserAdmin -- If true, user is set as admin.
static org.sourcejammer.project.view.SJResponse undoCheckOut(org.sourcejammer.project.view.SJRequest request)
          Undo check out of a checked out file.
private static long unzipTempFile(long tempFileID)
           
static org.sourcejammer.project.view.SJResponse viewRemovedNodes(org.sourcejammer.project.view.SJRequest request)
          View info about nodes removed from a project.

Required SJRequest Params:
   requestedNodeUniqueID -- id of project whose removed nodes are to be returned.
static org.sourcejammer.project.view.SJResponse viewVersionComment(org.sourcejammer.project.view.SJRequest request)
          Returns comment for a version.

Required SJRequest Params:
   requestedNodeUniqueID -- id of version.
private static byte[] zipBinaryIfRequired(byte[] file, org.sourcejammer.project.view.SJRequest request, org.sourcejammer.project.view.SJResponse response, java.lang.String fileName)
           
private static long zipTempFileIfRequired(long lTempFileId, org.sourcejammer.project.view.SJRequest request, org.sourcejammer.project.view.SJResponse response, java.lang.String fileName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MasterControlProgram

private MasterControlProgram()
Method Detail

getArchiveInfo

public static ArchiveInfoFlex getArchiveInfo(java.lang.String archiveName)
                                      throws FileAccessException
FileAccessException

login

public static org.sourcejammer.project.view.SJResponse login(org.sourcejammer.project.view.SJRequest request)
Logs in user but does not connect to an archive.


changePassword

public static org.sourcejammer.project.view.SJResponse changePassword(org.sourcejammer.project.view.SJRequest request)
Change a user's password.


connect

public static org.sourcejammer.project.view.SJResponse connect(org.sourcejammer.project.view.SJRequest request)
Returns response with welcome message and session id. Request must include user name and password.


getArchive

private static Archive getArchive(java.lang.String archiveName)
                           throws FileAccessException
FileAccessException

disconnect

public static org.sourcejammer.project.view.SJResponse disconnect(org.sourcejammer.project.view.SJRequest request)
Logs user out.


addProject

public static org.sourcejammer.project.view.SJResponse addProject(org.sourcejammer.project.view.SJRequest request)
Adds a new project.

Required SJRequest Params:
   requestedNodeUniqueID -- id of parent project for new project.
   requestedNodeName -- name of new project.


moveFile

public static org.sourcejammer.project.view.SJResponse moveFile(org.sourcejammer.project.view.SJRequest request)
Moves a file.

Required SJRequest Params:
   requestedNodeUniqueID -- id of file to be moved.
   parentNodeUniqueID -- id of current parent project of file.
   newParentNodeUniqueID -- id of new parent project for file.


copyProject

public static org.sourcejammer.project.view.SJResponse copyProject(org.sourcejammer.project.view.SJRequest request)
Copies a project.

Required SJRequest Params:
   requestedNodeUniqueID -- id of project to be copied.
   requestedNodeName -- Name for project after it is copied.
   parentNodeUniqueID -- id of current parent project of file.
   newParentNodeUniqueID -- id of new parent project for file.


moveProject

public static org.sourcejammer.project.view.SJResponse moveProject(org.sourcejammer.project.view.SJRequest request)
Moves a project.

Required SJRequest Params:
   requestedNodeUniqueID -- id of project to be copied.
   requestedNodeName -- new name for project after being moved.
   parentNodeUniqueID -- id of current parent project of file.
   newParentNodeUniqueID -- id of new parent project for file.


copyFile

public static org.sourcejammer.project.view.SJResponse copyFile(org.sourcejammer.project.view.SJRequest request)
Copies a file.

Required SJRequest Params:
   requestedNodeUniqueID -- id of file to be moved.
   parentNodeUniqueID -- id of current parent project of file.
   newParentNodeUniqueID -- id of new parent project for file.


addFile

public static org.sourcejammer.project.view.SJResponse addFile(org.sourcejammer.project.view.SJRequest request)
Adds a new file.

Note: Call Uploader first to send file and get uploadFileID

Required SJRequest Params:
   requestedNodeUniqueID -- id of parent project for new file.
   requestedNodeName -- name of new file.
   fileUploadID -- ID of the file uploaded using Uploader.
   isBinaryZipped -- true if binary file is zipped.
   comment -- file description.
   fileProperties -- FileProperties object with info about file.
   userName -- Name of user adding file.


changeFileDescription

public static org.sourcejammer.project.view.SJResponse changeFileDescription(org.sourcejammer.project.view.SJRequest request)
Adds a new project.

Required SJRequest Params:
   requestedNodeUniqueID -- id of file.
   comment -- new description.


checkOutFile

public static org.sourcejammer.project.view.SJResponse checkOutFile(org.sourcejammer.project.view.SJRequest request)
Check out a file.

Required SJRequest Params:
   requestedNodeUniqueID -- id of file to be checked out.
   userName -- user name of current user.
   checkOutPath -- full path to which user is checking out file.
   requestedEOLType -- EOL type requested.


deleteArchive

public static org.sourcejammer.project.view.SJResponse deleteArchive(org.sourcejammer.project.view.SJRequest request)
Permanently deletes an archive.

Required SJRequest Params:
   newArchiveName -- name of archive to be deleted.


getArchiveNames

public static org.sourcejammer.project.view.SJResponse getArchiveNames(org.sourcejammer.project.view.SJRequest request)
Return a list of archives available on this server.

Required SJRequest Params:
   newArchiveName -- name of archive to be deleted.


checkInFile

public static org.sourcejammer.project.view.SJResponse checkInFile(org.sourcejammer.project.view.SJRequest request)
Check in a file.

Required SJRequest Params:
   requestedNodeUniqueID -- id of file to be checked in.
   userName -- user name of current user.
   comment -- new version comment.
   fileUploadID -- Upload id from Uploader.
   isBinaryZipped -- true if binary file is zipped.


getProjectInfo

public static org.sourcejammer.project.view.SJResponse getProjectInfo(org.sourcejammer.project.view.SJRequest request)
Gets information about a project.

Required SJRequest Params:
   requestedNodeUniqueID -- id of project.


getFileInfo

public static org.sourcejammer.project.view.SJResponse getFileInfo(org.sourcejammer.project.view.SJRequest request)
Gets information about a file.

Required SJRequest Params:
   requestedNodeUniqueID -- id of file.


getFileLatestVersionID

public static org.sourcejammer.project.view.SJResponse getFileLatestVersionID(org.sourcejammer.project.view.SJRequest request)
Gets unique ID of latest version of a file.

Required SJRequest Params:
   requestedNodeUniqueID -- id of file.


getFileLatestVersion

public static org.sourcejammer.project.view.SJResponse getFileLatestVersion(org.sourcejammer.project.view.SJRequest request)
Gets latest version of a file.

Note: Returns DownloadFileIdentifier object that can be used with Downloader to download the actual file.

Required SJRequest Params:
   requestedNodeUniqueID -- id of file.
   requestedEOLType -- EOL type requested.


getFileVersion

public static org.sourcejammer.project.view.SJResponse getFileVersion(org.sourcejammer.project.view.SJRequest request)
Gets a previous version of a file.

Required SJRequest Params:
   requestedNodeUniqueID -- id of file.
   requestedEOLType -- EOL type requested.
   versionNumber -- Version number (NOT unique ID) of the file requested.


getChangeList

public static org.sourcejammer.project.view.SJResponse getChangeList(org.sourcejammer.project.view.SJRequest request)
Builds a change list and returns download id. Required SJRequest Params:
   requestedNodeUniqueID -- id of label.
   versionNumber -- Version number (NOT unique ID) of newer label version.
   2ndVersionNumber -- Version number (NOT unique ID) of older label version.
   requestedEOLType -- EOL to use in change list


makeLabeledVersion

public static org.sourcejammer.project.view.SJResponse makeLabeledVersion(org.sourcejammer.project.view.SJRequest request)
Makes a labeled version.

Required SJRequest Params:
   requestedNodeUniqueID -- root project for label.
   requestedNodeName -- Name for the new label.
   comment -- Description of the label.


getLabelContentList

public static org.sourcejammer.project.view.SJResponse getLabelContentList(org.sourcejammer.project.view.SJRequest request)
Gets info about all file/versions in a label.

Required SJRequest Params:
   requestedNodeUniqueID -- id of the label.
   versionNumber -- Version number (NOT unique ID) of the label requested.
Info about response:
   nodeUniqueID -- Unique Id of root project of the label.
   objectArray -- Array of LabelVersionMappingBeans, one for each file in the label.


undoCheckOut

public static org.sourcejammer.project.view.SJResponse undoCheckOut(org.sourcejammer.project.view.SJRequest request)
Undo check out of a checked out file. User must be user who checked out file.

Required SJRequest Params:
   requestedNodeUniqueID -- id of file to un-check out.


removeFile

public static org.sourcejammer.project.view.SJResponse removeFile(org.sourcejammer.project.view.SJRequest request)
Remove a file from a project.

Required SJRequest Params:
   requestedNodeUniqueID -- id of file to remove.
   parentNodeUniqueID -- id of parent project.


removeProject

public static org.sourcejammer.project.view.SJResponse removeProject(org.sourcejammer.project.view.SJRequest request)
Remove a Project from a project.

Required SJRequest Params:
   requestedNodeUniqueID -- id of project to remove.
   parentNodeUniqueID -- id of parent project.


viewVersionComment

public static org.sourcejammer.project.view.SJResponse viewVersionComment(org.sourcejammer.project.view.SJRequest request)
Returns comment for a version.

Required SJRequest Params:
   requestedNodeUniqueID -- id of version.


viewRemovedNodes

public static org.sourcejammer.project.view.SJResponse viewRemovedNodes(org.sourcejammer.project.view.SJRequest request)
View info about nodes removed from a project.

Required SJRequest Params:
   requestedNodeUniqueID -- id of project whose removed nodes are to be returned.


restoreRemovedNode

public static org.sourcejammer.project.view.SJResponse restoreRemovedNode(org.sourcejammer.project.view.SJRequest request)
Restored a node that was removed from a project.

Required SJRequest Params:
   requestedNodeUniqueID -- id of parent project that node is to be restored to.
   requestedNodeName -- name to that restore node is to be named, when restored.
   versionNumber -- The number (index) of the node to restore.


addArchive

public static org.sourcejammer.project.view.SJResponse addArchive(org.sourcejammer.project.view.SJRequest request)

getCompleteUserList

public static org.sourcejammer.project.view.SJResponse getCompleteUserList(org.sourcejammer.project.view.SJRequest request)

getControllerUserList

public static org.sourcejammer.project.view.SJResponse getControllerUserList(org.sourcejammer.project.view.SJRequest request)

getArchiveUserList

public static org.sourcejammer.project.view.SJResponse getArchiveUserList(org.sourcejammer.project.view.SJRequest request)

setUserAdmin

public static org.sourcejammer.project.view.SJResponse setUserAdmin(org.sourcejammer.project.view.SJRequest request)
Set a user's admin status.

Required SJRequest Params:
   newUserName -- User name of user being modified.
   newUserAdmin -- If true, user is set as admin. If false, user is set as non-admin.


addUser

public static org.sourcejammer.project.view.SJResponse addUser(org.sourcejammer.project.view.SJRequest request)

removeUser

public static org.sourcejammer.project.view.SJResponse removeUser(org.sourcejammer.project.view.SJRequest request)

permanentlyDeleteNode

public static org.sourcejammer.project.view.SJResponse permanentlyDeleteNode(org.sourcejammer.project.view.SJRequest request)
Permanently deletes a node that was previously removed.

Required SJRequest Params:
   requestedNodeUniqueID -- id of parent project from which the node is to be deleted.
   versionNumber -- The number (index in removed nodes) of the node to delete.


getUniqueIDFromPath

public static org.sourcejammer.project.view.SJResponse getUniqueIDFromPath(org.sourcejammer.project.view.SJRequest request)
Returns the node unique ID from a path and parent node id.

Required SJRequest Params:
   requestedNodeUniqueID -- id of the parent project.
   requestedNodeName -- Path.


rollBackToVersions

public static org.sourcejammer.project.view.SJResponse rollBackToVersions(org.sourcejammer.project.view.SJRequest request)
Rollback a file in the archive to a previous version.

Required SJRequest Params:
   requestedNodeUniqueID -- id of the version to roll back to.
   parentNodeUniqueID -- id of the file being rolled back.


setArchiveProperties

public static org.sourcejammer.project.view.SJResponse setArchiveProperties(org.sourcejammer.project.view.SJRequest request)

getArchiveProperties

public static org.sourcejammer.project.view.SJResponse getArchiveProperties(org.sourcejammer.project.view.SJRequest request)

addToArchiveControllerUsers

public static org.sourcejammer.project.view.SJResponse addToArchiveControllerUsers(org.sourcejammer.project.view.SJRequest request)
Add user to controller users list for an archive.

Required SJRequest Params:
   newUserName -- user name of user being added to controller users list.


removeFromArchiveControllerUsers

public static org.sourcejammer.project.view.SJResponse removeFromArchiveControllerUsers(org.sourcejammer.project.view.SJRequest request)
Remove user from controller users list for an archive.

Required SJRequest Params:
   newUserName -- user name of user being added to controller users list.


addToArchiveUsers

public static org.sourcejammer.project.view.SJResponse addToArchiveUsers(org.sourcejammer.project.view.SJRequest request)
Add user to users list for an archive.

Required SJRequest Params:
   newUserName -- user name of user being added to controller users list.


removeFromArchiveUsers

public static org.sourcejammer.project.view.SJResponse removeFromArchiveUsers(org.sourcejammer.project.view.SJRequest request)
Remove user from users list for an archive.

Required SJRequest Params:
   newUserName -- user name of user being added to controller users list.


renameFile

public static org.sourcejammer.project.view.SJResponse renameFile(org.sourcejammer.project.view.SJRequest request)
Change the name of a file.

Required SJRequest Params:
   requestedNodeUniqueID -- id of the file being renamed.
   parentNodeUniqueID -- id of parent project of the file being renamed
   requestedNodeName -- new name for the file


renameProject

public static org.sourcejammer.project.view.SJResponse renameProject(org.sourcejammer.project.view.SJRequest request)
Change the name of a project.

Required SJRequest Params:
   requestedNodeUniqueID -- id of the project being renamed.
   parentNodeUniqueID -- id of parent project of the project being renamed
   requestedNodeName -- new name for the project


rebuildLabel

public static org.sourcejammer.project.view.SJResponse rebuildLabel(org.sourcejammer.project.view.SJRequest request)
Automatically creates a new version of the label.

Required SJRequest Params:
   requestedNodeUniqueID -- id of the label.
   parentNodeUniqueID -- id of label's parent project
Info about response:
   nodeUniqueID -- Unique Id of root project of the label.
   objectArray -- Array of LabelVersionMappingBeans, one for each file in the label.


getLabelList

public static org.sourcejammer.project.view.SJResponse getLabelList(org.sourcejammer.project.view.SJRequest request)
Deprecated.  

Gets a list of labels available in the archive.


zipTempFileIfRequired

private static long zipTempFileIfRequired(long lTempFileId,
                                          org.sourcejammer.project.view.SJRequest request,
                                          org.sourcejammer.project.view.SJResponse response,
                                          java.lang.String fileName)
                                   throws java.io.IOException
java.io.IOException

zipBinaryIfRequired

private static byte[] zipBinaryIfRequired(byte[] file,
                                          org.sourcejammer.project.view.SJRequest request,
                                          org.sourcejammer.project.view.SJResponse response,
                                          java.lang.String fileName)
                                   throws java.io.IOException
java.io.IOException

checkSessionAllowAnon

private static long checkSessionAllowAnon(org.sourcejammer.project.view.SJRequest request,
                                          Archive arch)
                                   throws NoSuchSessionException,
                                          UserDoesNotExistException,
                                          InvalidPasswordException,
                                          SecurityException
Checks user's login status. Allows anonymous logins to pass through without throwing an exception.

NoSuchSessionException
UserDoesNotExistException
InvalidPasswordException
SecurityException

checkSessionAdminRequired

private static long checkSessionAdminRequired(org.sourcejammer.project.view.SJRequest request)
                                       throws NoSuchSessionException,
                                              UserDoesNotExistException,
                                              InvalidPasswordException,
                                              SecurityException
Checks users login status. Throws exception if user can't be logged in, or if user is not admin.

NoSuchSessionException
UserDoesNotExistException
InvalidPasswordException
SecurityException

checkSessionControllerRequired

private static long checkSessionControllerRequired(org.sourcejammer.project.view.SJRequest request,
                                                   Archive arch)
                                            throws NoSuchSessionException,
                                                   UserDoesNotExistException,
                                                   InvalidPasswordException,
                                                   SecurityException
Checks users login status. Throws exception if user can't be logged in, or if user is not a controller of this archive or admin.

NoSuchSessionException
UserDoesNotExistException
InvalidPasswordException
SecurityException

isAdminOrControllerSession

private static boolean isAdminOrControllerSession(org.sourcejammer.project.view.SJRequest request,
                                                  Archive arch)

isAdminSession

private static boolean isAdminSession(org.sourcejammer.project.view.SJRequest request)

checkSessionArchUserRequired

private static long checkSessionArchUserRequired(org.sourcejammer.project.view.SJRequest request,
                                                 Archive arch)
                                          throws NoSuchSessionException,
                                                 UserDoesNotExistException,
                                                 InvalidPasswordException,
                                                 SecurityException
Checks users login status. Throws exception if user can't be logged in, or if user is not a registered user or controller of this archive or admin.

NoSuchSessionException
UserDoesNotExistException
InvalidPasswordException
SecurityException

checkSession

private static long checkSession(org.sourcejammer.project.view.SJRequest request,
                                 Archive arch)
                          throws NoSuchSessionException,
                                 UserDoesNotExistException,
                                 InvalidPasswordException,
                                 SecurityException
Checks users login status. Throws exception if user can't be logged in, or if user is logged in as anonymous user or if archive is restricted and user is not admin, controller, or archive user.

NoSuchSessionException
UserDoesNotExistException
InvalidPasswordException
SecurityException

buildSpecificVersionSource

private static void buildSpecificVersionSource(Archive oArchive,
                                               long fileID,
                                               int iRequestedEOLType,
                                               int iVersion,
                                               java.io.File flTarget)
                                        throws FileAccessException,
                                               InvalidSourceException,
                                               java.io.IOException,
                                               ProjectDoesNotExistException,
                                               EndOfSourceException,
                                               FileDoesNotExistException,
                                               TextFileException,
                                               NoSuchVersionException,
                                               WrongFileTypeException,
                                               SecurityException
Rebuilds the specified source for the specified version (iVersion) of the specified file (ndFile).

FileAccessException
InvalidSourceException
java.io.IOException
ProjectDoesNotExistException
EndOfSourceException
FileDoesNotExistException
TextFileException
NoSuchVersionException
WrongFileTypeException
SecurityException

buildSpecificVersionSource

private static void buildSpecificVersionSource(Archive oArchive,
                                               long fileID,
                                               int iRequestedEOLType,
                                               long lVersionID,
                                               java.io.File flTarget)
                                        throws FileAccessException,
                                               InvalidSourceException,
                                               java.io.IOException,
                                               ProjectDoesNotExistException,
                                               EndOfSourceException,
                                               FileDoesNotExistException,
                                               TextFileException,
                                               NoSuchVersionException,
                                               WrongFileTypeException,
                                               SecurityException
Rebuilds the specified source for the specified version (iVersion) of the specified file (ndFile).

FileAccessException
InvalidSourceException
java.io.IOException
ProjectDoesNotExistException
EndOfSourceException
FileDoesNotExistException
TextFileException
NoSuchVersionException
WrongFileTypeException
SecurityException

unzipTempFile

private static long unzipTempFile(long tempFileID)
                           throws java.io.IOException
java.io.IOException


Copyright 2003 Soucejammer project.