org.sourcejammer.project.controller
Class RemoverRestorer

java.lang.Object
  |
  +--org.sourcejammer.project.controller.RemoverRestorer

public class RemoverRestorer
extends java.lang.Object

Title: $FileName: RemoverRestorer.java$

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

$Description: Manages removing and restoring files and projects.$
$KeyWordsOff: $

Field Summary
private  ArchiveInfoFlex moArchive
           
private  NodeLibrary moLibrary
           
private  Archive parentArchve
           
private  org.sourcejammer.project.view.SJRequest request
           
private  org.sourcejammer.project.view.SJResponse response
           
 
Constructor Summary
RemoverRestorer(NodeLibrary lib, ArchiveInfoFlex archive, Archive parentArchive)
          If request and response are null, you'd better know what you're doing.
RemoverRestorer(NodeLibrary lib, ArchiveInfoFlex archive, Archive parentArchive, org.sourcejammer.project.view.SJRequest request, org.sourcejammer.project.view.SJResponse response)
           
 
Method Summary
 boolean childFileCheckedOut(long projectID)
           
 void deleteNode(long parentID, int index, boolean permenantlyDeleteAllShares)
          Delete a File or Project.
private  boolean isFileShared(FileNode file)
           
private  void removeAllFiles(long projectID, boolean removeFromAllParents)
          Loops through all sub projects.
 void removeFile(long fileID)
          Remove file from all parents.
private  void removeFile(long parentID, FileNode ndFile)
           
 void removeFile(long parentID, long fileID)
          Remove specified file from specified project.
 void removeProject(long projectID)
          Remove the project.
private  void removeProject(long projectID, boolean removeFilesFromAllParents)
          Remove specified project from the project hierarchy.
 void removeProject(long parentID, long projectID)
          Just removes the project from its parent.
private  void restoreAllFiles(long projectID)
          Loops through all sub projects.
 void restoreRemovedNode(long parentID, java.lang.String newName, int index)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

moLibrary

private NodeLibrary moLibrary

moArchive

private ArchiveInfoFlex moArchive

response

private org.sourcejammer.project.view.SJResponse response

request

private org.sourcejammer.project.view.SJRequest request

parentArchve

private Archive parentArchve
Constructor Detail

RemoverRestorer

public RemoverRestorer(NodeLibrary lib,
                       ArchiveInfoFlex archive,
                       Archive parentArchive,
                       org.sourcejammer.project.view.SJRequest request,
                       org.sourcejammer.project.view.SJResponse response)

RemoverRestorer

public RemoverRestorer(NodeLibrary lib,
                       ArchiveInfoFlex archive,
                       Archive parentArchive)
If request and response are null, you'd better know what you're doing.

Method Detail

removeFile

private void removeFile(long parentID,
                        FileNode ndFile)
                 throws FileAccessException,
                        ProjectDoesNotExistException,
                        FileDoesNotExistException,
                        SecurityException
FileAccessException
ProjectDoesNotExistException
FileDoesNotExistException
SecurityException

removeFile

public void removeFile(long fileID)
                throws FileAccessException,
                       ProjectDoesNotExistException,
                       FileDoesNotExistException,
                       SecurityException
Remove file from all parents.

FileAccessException
ProjectDoesNotExistException
FileDoesNotExistException
SecurityException

isFileShared

private boolean isFileShared(FileNode file)

deleteNode

public void deleteNode(long parentID,
                       int index,
                       boolean permenantlyDeleteAllShares)
                throws ProjectDoesNotExistException,
                       SecurityException,
                       FileAccessException,
                       org.sourcejammer.project.NodeDoesNotExistException,
                       FileDoesNotExistException
Delete a File or Project.

Parameters:
parentID - -- id of parent project from which File or Project has been removed.
index - -- removed index in parent Project of File/Project to be deleted.
ProjectDoesNotExistException
SecurityException
FileAccessException
org.sourcejammer.project.NodeDoesNotExistException
FileDoesNotExistException

removeFile

public void removeFile(long parentID,
                       long fileID)
                throws FileAccessException,
                       ProjectDoesNotExistException,
                       FileDoesNotExistException,
                       SecurityException
Remove specified file from specified project.

FileAccessException
ProjectDoesNotExistException
FileDoesNotExistException
SecurityException

removeProject

public void removeProject(long projectID)
                   throws FileAccessException,
                          ProjectDoesNotExistException,
                          SecurityException
Remove the project. Also, removes all shares of files within the project and any sub projects from all parents.

FileAccessException
ProjectDoesNotExistException
SecurityException

removeProject

public void removeProject(long parentID,
                          long projectID)
                   throws FileAccessException,
                          ProjectDoesNotExistException,
                          SecurityException
Just removes the project from its parent. Any shared subfiles are not removed from other parents.

FileAccessException
ProjectDoesNotExistException
SecurityException

removeProject

private void removeProject(long projectID,
                           boolean removeFilesFromAllParents)
                    throws FileAccessException,
                           ProjectDoesNotExistException,
                           SecurityException
Remove specified project from the project hierarchy.

FileAccessException
ProjectDoesNotExistException
SecurityException

restoreRemovedNode

public void restoreRemovedNode(long parentID,
                               java.lang.String newName,
                               int index)
                        throws FileAccessException,
                               ProjectDoesNotExistException,
                               FileDoesNotExistException,
                               org.sourcejammer.project.NodeDoesNotExistException,
                               org.sourcejammer.project.NodeExistsException,
                               SecurityException
FileAccessException
ProjectDoesNotExistException
FileDoesNotExistException
org.sourcejammer.project.NodeDoesNotExistException
org.sourcejammer.project.NodeExistsException
SecurityException

childFileCheckedOut

public boolean childFileCheckedOut(long projectID)
                            throws FileAccessException,
                                   ProjectDoesNotExistException,
                                   SecurityException
FileAccessException
ProjectDoesNotExistException
SecurityException

restoreAllFiles

private void restoreAllFiles(long projectID)
                      throws FileAccessException,
                             SecurityException,
                             ProjectDoesNotExistException
Loops through all sub projects. For each file in the project, moves the project id from removed parents to "parents" list.

FileAccessException
SecurityException
ProjectDoesNotExistException

removeAllFiles

private void removeAllFiles(long projectID,
                            boolean removeFromAllParents)
                     throws FileAccessException,
                            SecurityException,
                            ProjectDoesNotExistException
Loops through all sub projects. For each file in the project, moves the project id to the "removed parents" list.

FileAccessException
SecurityException
ProjectDoesNotExistException


Copyright 2003 Soucejammer project.