Changeset 26333 for main

Show
Ignore:
Timestamp:
17.10.2012 21:05:20 (7 years ago)
Author:
ak19
Message:

1. Introduced new perl script for deleting a fedora collection (g2f-deletecol.pl) because, when deleting a collection that's been ingested into fedora, both the fedora collection file and the documents in the collection (METS files) that have been ingested into fedora need to purged. Also these docs need to be removed from the fedoragsearch index if it gsearch is installed. The command line script does not delete the Greenstone collection directory, that has to be done manually at this stage, since GLI already does that part. 2. FLI calls the new perl script g2f-deletecol.pl when the user chooses to have a collection deleted.

Location:
main/trunk
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java

    r25773 r26333  
    108108    /** The monitor responsible for parsing the scheduler process. */  
    109109    static private GShellProgressMonitor schedule_monitor = null;  
     110    ///** The monitor responsible for parsing the fedora collection delete process. */  
     111    //static private GShellProgressMonitor fedora_coldelete_monitor = null; 
    110112 
    111113    /** The name of the standard lock file. */ 
     
    814816    if (LocalLibraryServer.isRunning() == true) { 
    815817        LocalLibraryServer.releaseCollection(collection_name); 
     818    } 
     819 
     820    // if we're running FLI, it's a fedora collection, and we need to call a special 
     821    // delete script to delete the collection and all its documents from the fedora 
     822    // repository and from fedora-gsearch's index. 
     823    if (Configuration.fedora_info.isActive()) { 
     824 
     825        // Generate the buildcol.pl command 
     826        ArrayList command_parts_list = new ArrayList(); 
     827        if (!Gatherer.isGsdlRemote) { 
     828        command_parts_list.add(Configuration.perl_path); 
     829        command_parts_list.add("-S"); 
     830        } 
     831 
     832        command_parts_list.add(scriptPath + "g2f-deletecol.pl"); 
     833 
     834        command_parts_list.add("-hostname"); 
     835        command_parts_list.add(Configuration.fedora_info.getHostname()); 
     836 
     837        command_parts_list.add("-port"); 
     838        command_parts_list.add(Configuration.fedora_info.getPort()); 
     839 
     840        command_parts_list.add("-username"); 
     841        command_parts_list.add(Configuration.fedora_info.getUsername()); 
     842 
     843        command_parts_list.add("-password"); 
     844        command_parts_list.add(Configuration.fedora_info.getPassword()); 
     845 
     846        command_parts_list.add("-protocol"); 
     847        command_parts_list.add(Configuration.fedora_info.getProtocol()); 
     848 
     849        command_parts_list.add("-gli"); 
     850        command_parts_list.add("-language"); 
     851        command_parts_list.add(Configuration.getLanguage()); 
     852        if(!Gatherer.isGsdlRemote) { 
     853        command_parts_list.add("-collectdir"); 
     854        command_parts_list.add(getCollectDirectory()); // <../collect/> 
     855        } 
     856         
     857        command_parts_list.add(collection_name); 
     858         
     859        // Run the g2f-deletecol.pl to remove the fedora collection 
     860        String[] command_parts = (String[]) command_parts_list.toArray(new String[0]); 
     861        GShell shell = new GShell(command_parts, GShell.DELETE, COLLECT, this, null, GShell.GSHELL_FEDORA_COLDELETE); // fedora_coldelete_monitor set to null 
     862        shell.start(); 
    816863    } 
    817864 
  • main/trunk/gli/src/org/greenstone/gatherer/shell/GShell.java

    r22454 r26333  
    9494    static final public int SRCREPLACE = 7; // for replacing source docs with their html 
    9595    static final public int SCHEDULE = 8; 
     96    static final public int DELETE = 9; 
    9697 
    9798    /** Elements in status type enumeration. */ 
     
    110111    static public String GSHELL_SRCREPLACE = "gshell_srcreplace"; // for replacing source docs with their html versions 
    111112    static public String GSHELL_SCHEDULE = "gshell_schedule";  
     113    static public String GSHELL_FEDORA_COLDELETE = "gshell_fedora_col_delete"; 
    112114 
    113115    /** Determine if the given process is still executing. It does this by attempting to throw an exception - not the most efficient way, but the only one as far as I know