Changeset 19668

Show
Ignore:
Timestamp:
29.05.2009 12:37:08 (10 years ago)
Author:
ak19
Message:

Not working. Changes made for collectiongroup.

Location:
gli/branches/glicolgroup/src/org/greenstone/gatherer
Files:
13 modified

Legend:

Unmodified
Added
Removed
  • gli/branches/glicolgroup/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java

    r18686 r19668  
    36973697         
    36983698        // If we're using the Local Library we must release the collection before writing to the collect.cfg file 
    3699         String collection_name = Gatherer.c_man.getCollection ().getName (); 
     3699        String collection_name = Gatherer.c_man.getCollection().getGroupQualifiedName(true); 
    37003700        boolean collection_released = false; 
    37013701        if (Gatherer.c_man.built () && LocalLibraryServer.isRunning () == true) { 
     
    37863786         
    37873787        // If we're using the Local Library we must release the collection before writing to the collect.cfg file 
    3788         String collection_name = CollectionManager.getLoadedCollectionName (); 
     3788        String collection_name = CollectionManager.getLoadedGroupQualifiedCollectionName(true); 
    37893789        boolean collection_released = false; 
    37903790        if (Gatherer.c_man.built () && LocalLibraryServer.isRunning () == true) { 
  • gli/branches/glicolgroup/src/org/greenstone/gatherer/cdm/GeneralManager.java

    r19225 r19668  
    369369                if (Gatherer.isGsdlRemote) { 
    370370                Gatherer.remoteGreenstoneServer.uploadCollectionFile( 
    371                                    CollectionManager.getLoadedCollectionName(), collection_image_file); 
     371                                   CollectionManager.getLoadedGroupQualifiedCollectionName(true), collection_image_file); 
    372372                } 
    373373            } 
  • gli/branches/glicolgroup/src/org/greenstone/gatherer/cdm/MacrosManager.java

    r18412 r19668  
    221221        // Users need to wait until the upload has finished before pressing Preview Collection! 
    222222        if (Gatherer.isGsdlRemote) { 
    223             Gatherer.remoteGreenstoneServer.uploadCollectionFile(CollectionManager.getLoadedCollectionName(), extra_dm_file); 
     223            Gatherer.remoteGreenstoneServer.uploadCollectionFile(CollectionManager.getLoadedGroupQualifiedCollectionName(true), extra_dm_file); 
    224224        } 
    225225        } 
  • gli/branches/glicolgroup/src/org/greenstone/gatherer/collection/BasicCollectionConfiguration.java

    r19220 r19668  
    257257     
    258258    } 
     259 
     260    /** This current file is in .../<col_name>/etc/collect.cfg. This method returns .../<col_name> 
     261     * @return the short name of this collection as a String 
     262     */ 
     263    public String getCollectionPath() { 
     264    return file.getParentFile().getParentFile().getAbsolutePath(); 
     265    } 
     266 
    259267     
    260268    /** set the site for this coll */ 
  • gli/branches/glicolgroup/src/org/greenstone/gatherer/collection/CollectionManager.java

    r19430 r19668  
    398398    // Remove the lock file on the server 
    399399    if (Gatherer.isGsdlRemote) { 
    400         Gatherer.remoteGreenstoneServer.deleteCollectionFile(collection.getName(), lock_file); 
     400        Gatherer.remoteGreenstoneServer.deleteCollectionFile(collection.getGroupQualifiedName(true), lock_file); 
    401401    } 
    402402 
     
    572572 
    573573        // for remote case, scheduling causes an Exception on creating a new collection that  
    574         // can't be recovered from. For GS3, it doesn't work since it it trying to access etc/main.cfg 
     574        // can't be recovered from. For GS3, it doesn't work since it is trying to access etc/main.cfg 
    575575        if (canDoScheduling()) { 
    576576        scheduling(); 
     
    583583        // Import default metadata sets, if any 
    584584        // for (int i = 0; metadata_sets != null && i < metadata_sets.size(); i++) { 
    585         // importMetadataSet((MetadataSet) metadata_sets.get(i)); 
     585        // importMetadataSet((MetadataSecollection_namet) metadata_sets.get(i)); 
    586586        // } 
    587587 
     
    11061106        // If we're using a remote Greenstone server, upload the metadata file 
    11071107        if (Gatherer.isGsdlRemote) { 
    1108             Gatherer.remoteGreenstoneServer.uploadCollectionFile(collection.getName(), metadata_set_file); 
     1108            Gatherer.remoteGreenstoneServer.uploadCollectionFile(collection.getGroupQualifiedName(true), metadata_set_file); 
    11091109        } 
    11101110        } 
     
    11691169    { 
    11701170    DebugStream.println("Loading collection " + location + "..."); 
     1171    System.err.println("*** Loading collection " + location + "..."); 
    11711172 
    11721173    if (Gatherer.isGsdlRemote) { 
    1173         String collection_name = location.substring(location.lastIndexOf(File.separator) + 1, location.length() - ".col".length()); 
     1174        //String collection_name = location.substring(location.lastIndexOf(File.separator) + 1, location.length() - ".col".length()); 
     1175        String collection_name = location.substring(0, location.lastIndexOf(File.separator)); 
     1176        collection_name = Gatherer.remoteGreenstoneServer.getPathRelativeToDirectory(new File(collection_name), getDefaultCollectDirectory()); 
    11741177        if (Gatherer.remoteGreenstoneServer.downloadCollection(collection_name).equals("")) { 
    11751178        return; 
     
    16701673        // If we're using a remote Greenstone server, delete the metadata file on the server 
    16711674        if (Gatherer.isGsdlRemote) { 
    1672         Gatherer.remoteGreenstoneServer.deleteCollectionFile(collection.getName(), metadata_set_file); 
     1675        Gatherer.remoteGreenstoneServer.deleteCollectionFile(collection.getGroupQualifiedName(true), metadata_set_file); 
    16731676        } 
    16741677    } 
     
    18061809        if (Gatherer.isGsdlRemote) { 
    18071810            Gatherer.remoteGreenstoneServer.deleteCollectionFile( 
    1808                              collection.getName(), new File(getLoadedCollectionIndexDirectoryPath())); 
    1809             Gatherer.remoteGreenstoneServer.moveCollectionFile(collection.getName(),  
     1811                             collection.getGroupQualifiedName(true), new File(getLoadedCollectionIndexDirectoryPath())); 
     1812            Gatherer.remoteGreenstoneServer.moveCollectionFile(collection.getGroupQualifiedName(true),  
    18101813                    new File(getLoadedCollectionBuildingDirectoryPath()), new File(getLoadedCollectionIndexDirectoryPath())); 
    18111814        } 
  • gli/branches/glicolgroup/src/org/greenstone/gatherer/greenstone/LocalLibraryServer.java

    r19585 r19668  
    378378     * in an independently launched GSI (one not launched by GLI). */ 
    379379    static public boolean isURLPending() { 
    380     /*if(Configuration.library_url != null) { 
    381         System.err.println("**** Configuration.library_url: " + Configuration.library_url ); 
    382         return false; // don't need to do anything as we already have the url 
    383         }*/ 
    384380 
    385381    llssite_cfg_file.load(true); // don't force reload, load only if modified 
     
    426422        Configuration.library_url = new URL(url); 
    427423        running = true; 
     424        // Run the server interface 
     425        //Gatherer.spawnApplication(local_library_server_command, ID); 
    428426        } 
    429427        catch (MalformedURLException exception) { 
  • gli/branches/glicolgroup/src/org/greenstone/gatherer/gui/DeleteCollectionPrompt.java

    r19272 r19668  
    293293            details.setCaretPosition(0); 
    294294        } else { // trying to delete the collection that is open at present 
    295             // add a tooltip saying to the confirmation checkbox saying that the current collection can't be deleted  
     295            // add a tooltip to the confirmation checkbox saying that the current collection can't be deleted  
    296296            String tooltip = Dictionary.get("DeleteCollectionPrompt.Cannot_Delete_Open_Collection_Tooltip",  
    297297                            collection.getName()); 
  • gli/branches/glicolgroup/src/org/greenstone/gatherer/gui/ExplodeMetadataDatabasePrompt.java

    r18917 r19668  
    356356            Utility.delete(metadata_file.getParentFile()); 
    357357            Gatherer.remoteGreenstoneServer.downloadCollectionFile( 
    358                              CollectionManager.getLoadedCollectionName(), metadata_file.getParentFile()); 
     358                             CollectionManager.getLoadedGroupQualifiedCollectionName(true), metadata_file.getParentFile()); 
    359359        } 
    360360 
  • gli/branches/glicolgroup/src/org/greenstone/gatherer/gui/Preferences.java

    r19438 r19668  
    10321032            if (Gatherer.c_man.getCollection()!=null){ 
    10331033            File lock_file = new File(Gatherer.c_man.getLoadedCollectionDirectoryPath() + "gli.lck"); 
    1034             Gatherer.remoteGreenstoneServer.deleteCollectionFile(Gatherer.c_man.getLoadedCollectionName(),lock_file); 
     1034            Gatherer.remoteGreenstoneServer.deleteCollectionFile(Gatherer.c_man.getLoadedGroupQualifiedCollectionName(true),lock_file); 
    10351035            Gatherer.g_man.closeCurrentCollection(); 
    10361036            } 
  • gli/branches/glicolgroup/src/org/greenstone/gatherer/gui/ReplaceSrcDocWithHtmlPrompt.java

    r18645 r19668  
    394394            // into the import directory on the client side 
    395395            Gatherer.remoteGreenstoneServer.downloadCollectionFile( 
    396                           CollectionManager.getLoadedCollectionName(), 
     396                          CollectionManager.getLoadedGroupQualifiedCollectionName(true), 
    397397                          new File(srcdoc_files[i].getParentFile(), htmlFile)); 
    398398             
     
    401401             
    402402            // If an associated_folder by such a name exists, download it 
    403             if(Gatherer.remoteGreenstoneServer.exists(CollectionManager.getLoadedCollectionName(), assoc_folder)) { 
     403            if(Gatherer.remoteGreenstoneServer.exists(CollectionManager.getLoadedGroupQualifiedCollectionName(true), assoc_folder)) { 
    404404                Gatherer.remoteGreenstoneServer.downloadCollectionFile( 
    405                                     CollectionManager.getLoadedCollectionName(), assoc_folder); 
     405                                    CollectionManager.getLoadedGroupQualifiedCollectionName(true), assoc_folder); 
    406406            } 
    407407            } 
  • gli/branches/glicolgroup/src/org/greenstone/gatherer/metadata/MetadataXMLFileManager.java

    r17612 r19668  
    369369        // Upload the files modified since last time, then reset the list 
    370370        Gatherer.remoteGreenstoneServer.uploadCollectionFiles( 
    371                   CollectionManager.getLoadedCollectionName(), (File[]) modified_metadata_xml_files.toArray(new File[0])); 
     371                  CollectionManager.getLoadedGroupQualifiedCollectionName(true), (File[]) modified_metadata_xml_files.toArray(new File[0])); 
    372372        modified_metadata_xml_files.clear(); 
    373373    } 
  • gli/branches/glicolgroup/src/org/greenstone/gatherer/metadata/ProfileXMLFile.java

    r17612 r19668  
    110110    // This is inefficient but for simplicity we'll just upload the file every time it is changed 
    111111    if (Gatherer.isGsdlRemote) { 
    112         Gatherer.remoteGreenstoneServer.uploadCollectionFile(CollectionManager.getLoadedCollectionName(), this); 
     112        Gatherer.remoteGreenstoneServer.uploadCollectionFile(CollectionManager.getLoadedGroupQualifiedCollectionName(true), this); 
    113113    } 
    114114 
  • gli/branches/glicolgroup/src/org/greenstone/gatherer/remote/RemoteGreenstoneServerAction.java

    r19231 r19668  
    109109    public DeleteCollectionAction(String collection_name) 
    110110    { 
    111         this.collection_name = collection_name; 
     111        this.collection_name = collection_name; //.replace('/', File.separatorChar); // if colgroup contained url slashes 
    112112    } 
    113113 
     
    137137    public DeleteCollectionFileAction(String collection_name, File collection_file) 
    138138    { 
    139         this.collection_name = collection_name; 
     139        this.collection_name = collection_name; //.replace('/', File.separatorChar); // if colgroup contained url slashes 
    140140        this.collection_file = collection_file; 
    141141    } 
     
    146146        String collection_directory_path = CollectionManager.getCollectionDirectoryPath(collection_name); 
    147147        String collection_file_relative_path = remote.getPathRelativeToDirectory(collection_file, collection_directory_path); 
     148        System.err.println("**** DeleteCollectionFile.\n\tcol_file: "+collection_file + "\n\t" + collection_directory_path); 
     149 
    148150        collection_file_relative_path = collection_file_relative_path.replaceAll((Utility.isWindows() ? "\\\\" : "\\/"), "|"); 
    149151        progress_bar.setAction("Deleting collection file " + collection_file_relative_path + "..."); 
     
    176178    { 
    177179        progress_bar.setAction("Downloading remote collection " + collection_name + "..."); 
     180        System.err.println("*** RGSAction.DownloadCollectionAction, col_name: " + collection_name); 
    178181 
    179182        String download_collection_command = "cmd=download-collection"; 
     
    613616    public UploadFilesIntoCollectionAction(String collection_name, File[] source_files, File target_collection_directory) 
    614617    { 
    615         this.collection_name = collection_name; 
     618        this.collection_name = collection_name; //.replace('/', File.separatorChar); // if colgroup contained url slashes 
    616619        this.source_files = source_files; 
    617620        this.target_collection_directory = target_collection_directory;