Ignore:
Timestamp:
2010-07-15T22:10:59+12:00 (14 years ago)
Author:
ak19
Message:

Getting collectgroup to work for a remote Greenstone server. Need to update gliserver.pl still to work with the collectgroup changes. 1. GLI side changes: no longer does the collectdir parameter to import and build include the colgroup at the end, it is now back to being everything upto the GS collect dir. Instead, the loaded collection is colgroup/subcolname. 2. Changed CollectionManager.getLoadedCollectionName() to return (colgroup/)subcolname instead of the subcolname excluding groupname. 3. This required changes in other classes, including replacing unnecessary explicit calls to getLoadedGroupQualifiedCollectionName(). 4. Added another variant: getLoadedCollectionName(boolean). If the parameter is true, it will put a url style slash between colgroup and subcolname, otherwise use the OS dependent FileSeparator. 5. Changes to RemoteGreenstoneServer to pass the group/subcol as the collectionname to gliserver.pl, with a vertical bar separator. 6. Minor changes like: WorkspaceTreeNode now knows not to load a collection group if it's already in the loaded collection (previously handed only sub collection name), removed old debugging statements and unused import statements.

Location:
main/trunk/gli/src/org/greenstone/gatherer/file
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/file/FileManager.java

    r19239 r22410  
    171171        file_queue.addJob(id, source, source_nodes, target, target_node, type);
    172172        if (Gatherer.isGsdlRemote) {
    173             String collection_name = CollectionManager.getLoadedGroupQualifiedCollectionName(true);
     173            String collection_name = CollectionManager.getLoadedCollectionName();
    174174
    175175            // Perform the appropriate action based on the job type (RemoteGreenstoneServer will queue)
     
    274274        if (file.getAbsolutePath().startsWith(Gatherer.getCollectDirectoryPath()) && file.length() == 0) {
    275275            if (Gatherer.remoteGreenstoneServer.downloadCollectionFile(
    276                                  CollectionManager.getLoadedGroupQualifiedCollectionName(true), file).equals("")) {
     276                                 CollectionManager.getLoadedCollectionName(), file).equals("")) {
    277277            // Something has gone wrong downloading the file
    278278            return;
     
    350350                if (Gatherer.isGsdlRemote) {
    351351                Gatherer.remoteGreenstoneServer.uploadCollectionFile(
    352                                          CollectionManager.getLoadedGroupQualifiedCollectionName(true), folder_file);
     352                                         CollectionManager.getLoadedCollectionName(), folder_file);
    353353                }
    354354            }
     
    357357                if (Gatherer.isGsdlRemote) {
    358358                Gatherer.remoteGreenstoneServer.newCollectionDirectory(
    359                                          CollectionManager.getLoadedGroupQualifiedCollectionName(true), folder_file);
     359                                         CollectionManager.getLoadedCollectionName(), folder_file);
    360360                }
    361361            }
     
    418418        if (Gatherer.isGsdlRemote) {
    419419            Gatherer.remoteGreenstoneServer.moveCollectionFile(
    420                              CollectionManager.getLoadedGroupQualifiedCollectionName(true), collection_file, new_collection_file);
     420                             CollectionManager.getLoadedCollectionName(), collection_file, new_collection_file);
    421421        }
    422422        }
     
    467467        file_queue.addJob(System.currentTimeMillis(), Gatherer.g_man.gather_pane.workspace_tree, new FileNode[] { source_node }, collection_tree, (FileNode)collection_tree_node.getParent(),  FileJob.COPY_FILE_ONLY);
    468468        if (Gatherer.isGsdlRemote) {
    469         String collection_name = CollectionManager.getLoadedGroupQualifiedCollectionName(true);
     469        String collection_name = CollectionManager.getLoadedCollectionName();
    470470        Gatherer.remoteGreenstoneServer.deleteCollectionFile(collection_name, collection_tree_node.getFile());
    471471        Gatherer.remoteGreenstoneServer.uploadFilesIntoCollection(collection_name, new File[] { new_file }, target_directory);
  • main/trunk/gli/src/org/greenstone/gatherer/file/WorkspaceTree.java

    r22342 r22410  
    169169        // If the specified folder is open, it must be refreshed
    170170        if (tree_node_path_str.equals(folder_path_str)) {
    171         System.err.println("Must refresh node " + tree_node_path_str + "!");
     171        //System.err.println("Must refresh node " + tree_node_path_str + "!");
    172172        ((WorkspaceTreeModel) getModel()).refresh(expanded_tree_path);
    173173        }
  • main/trunk/gli/src/org/greenstone/gatherer/file/WorkspaceTreeNode.java

    r19235 r22410  
    168168             
    169169              // One last piece of magic so we can determine the current collection
    170               // I don't think this will work properly with groups,
    171               // as it may give a false positive??
    172               collection_root.is_in_loaded_collection = cols[i].getName().equals(CollectionManager.getLoadedCollectionName());
     170              // Now made to work with collection groups
     171              String groupQualifiedColName = cols[i].getName();
     172              if(is_group_node) { // then title would have stored the colgroup name
     173                  groupQualifiedColName = title + File.separator + cols[i].getName();
     174              }
     175              collection_root.is_in_loaded_collection = groupQualifiedColName.equals(CollectionManager.getLoadedCollectionName());
    173176              child_nodes.add(collection_root);
    174177            }
Note: See TracChangeset for help on using the changeset viewer.