Changeset 22410 for main/trunk
- Timestamp:
- 2010-07-15T22:10:59+12:00 (14 years ago)
- Location:
- main/trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/cdm/ClassifierManager.java
r18571 r22410 44 44 import org.greenstone.gatherer.gui.GComboBox; 45 45 import org.greenstone.gatherer.gui.GLIButton; 46 import org.greenstone.gatherer.remote.RemoteGreenstoneServer;47 46 import org.greenstone.gatherer.util.JarTools; 48 47 import org.greenstone.gatherer.util.StaticStrings; -
main/trunk/gli/src/org/greenstone/gatherer/cdm/GeneralManager.java
r19225 r22410 441 441 // Set the title 442 442 String collection_title = name_textfield.getText(); 443 String collection_name = CollectionManager.getLoaded GroupQualifiedCollectionName(true);443 String collection_name = CollectionManager.getLoadedCollectionName(true); 444 444 Gatherer.g_man.setTitle(collection_title, collection_name); 445 445 collection_name_collectionmeta.setValue(collection_title); -
main/trunk/gli/src/org/greenstone/gatherer/cdm/PluginManager.java
r18588 r22410 49 49 import org.greenstone.gatherer.gui.ModalDialog; 50 50 import org.greenstone.gatherer.gui.WarningDialog; 51 import org.greenstone.gatherer.remote.RemoteGreenstoneServer;52 51 import org.greenstone.gatherer.util.JarTools; 53 52 import org.greenstone.gatherer.util.StaticStrings; -
main/trunk/gli/src/org/greenstone/gatherer/cdm/SuperCollectionManager.java
r19224 r22410 210 210 { 211 211 collection_checklist_model = new ArrayList(); 212 current_coll_name = CollectionManager.getLoaded GroupQualifiedCollectionName(true);212 current_coll_name = CollectionManager.getLoadedCollectionName(true); 213 213 File collect_directory = new File(Gatherer.getCollectDirectoryPath()); 214 214 add_collections_to_model(collect_directory); -
main/trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r22359 r22410 212 212 if(!Gatherer.isGsdlRemote) { 213 213 command_parts_list.add("-collectdir"); 214 command_parts_list.add(getCollectDirectory()); 214 command_parts_list.add(getCollectDirectory()); // <../collect/> 215 215 } 216 216 … … 220 220 } 221 221 222 command_parts_list.add(collection.get Name());222 command_parts_list.add(collection.getGroupQualifiedName(false)); // (colgroup/)colname 223 223 224 224 // Run the buildcol.pl and … … 270 270 } 271 271 272 import_list.add(collection.get Name());272 import_list.add(collection.getGroupQualifiedName(false)); // (colgroup/)colname 273 273 274 274 String[] import_parts = (String[]) import_list.toArray(new String[0]); … … 311 311 } 312 312 313 build_list.add(collection.get Name());313 build_list.add(collection.getGroupQualifiedName(false)); // (colgroup/)colname 314 314 315 315 //build actual string … … 413 413 // Remove the lock file on the server 414 414 if (Gatherer.isGsdlRemote) { 415 Gatherer.remoteGreenstoneServer.deleteCollectionFile(collection.get Name(), lock_file);415 Gatherer.remoteGreenstoneServer.deleteCollectionFile(collection.getGroupQualifiedName(false), lock_file); 416 416 } 417 417 … … 442 442 // command_parts_list.add("-collectdir"); 443 443 // command_parts_list.add(getCollectDirectory()); 444 // command_parts_list.add(collection.get Name());444 // command_parts_list.add(collection.getGroupQualifiedName(false)); // (colgroup/)colname 445 445 // 446 446 // // Run the convert_coll_from_gs2.pl command … … 936 936 937 937 938 /** Returns the name of the loaded collection. 938 /** Returns the (group-qualified) name of the loaded collection with 939 * OS-dependent file separator. 939 940 */ 940 941 static public String getLoadedCollectionName() 941 942 { 943 return CollectionManager.getLoadedCollectionName(false); 944 } 945 946 /** Returns the (group-qualified) name of the loaded collection with 947 * OS-dependent space separator. 948 * @url true if url-type forward slashes, false if OS-dependent filesystem slashes. 949 */ 950 static public String getLoadedCollectionName(boolean url) 951 { 942 952 if (collection != null) { 943 return collection.getName(); 953 //return collection.getName(); 954 return collection.getGroupQualifiedName(url); 944 955 } 945 956 … … 1087 1098 } 1088 1099 1089 command_parts_list.add(collection.get Name());1100 command_parts_list.add(collection.getGroupQualifiedName(false)); // (colgroup/)colname 1090 1101 1091 1102 // Run the import.pl command … … 1120 1131 // If we're using a remote Greenstone server, upload the metadata file 1121 1132 if (Gatherer.isGsdlRemote) { 1122 Gatherer.remoteGreenstoneServer.uploadCollectionFile(collection.get Name(), metadata_set_file);1133 Gatherer.remoteGreenstoneServer.uploadCollectionFile(collection.getGroupQualifiedName(false), metadata_set_file); 1123 1134 } 1124 1135 } … … 1703 1714 // If we're using a remote Greenstone server, delete the metadata file on the server 1704 1715 if (Gatherer.isGsdlRemote) { 1705 Gatherer.remoteGreenstoneServer.deleteCollectionFile(collection.get Name(), metadata_set_file);1716 Gatherer.remoteGreenstoneServer.deleteCollectionFile(collection.getGroupQualifiedName(false), metadata_set_file); 1706 1717 } 1707 1718 } … … 1789 1800 // used as arg in the perl scripts 1790 1801 private String getCollectDirectory() { 1802 return Gatherer.getCollectDirectoryPath(); 1791 1803 1792 String collect_dir = collection.getCollectionDirectory().getParentFile().getPath(); 1793 return collect_dir; 1804 // the following will stick any colgroup at the end of the collect directory, making it no longer 1805 // possible to get the real collect dir in a general manner if this were located outside greenstone 1806 //String collect_dir = collection.getCollectionDirectory().getParentFile().getPath(); 1807 //return collect_dir; 1794 1808 } 1795 1809 … … 1844 1858 if (Gatherer.isGsdlRemote) { 1845 1859 Gatherer.remoteGreenstoneServer.deleteCollectionFile( 1846 collection.get Name(), new File(getLoadedCollectionIndexDirectoryPath()));1847 Gatherer.remoteGreenstoneServer.moveCollectionFile(collection.get Name(),1860 collection.getGroupQualifiedName(false), new File(getLoadedCollectionIndexDirectoryPath())); 1861 Gatherer.remoteGreenstoneServer.moveCollectionFile(collection.getGroupQualifiedName(false), 1848 1862 new File(getLoadedCollectionBuildingDirectoryPath()), new File(getLoadedCollectionIndexDirectoryPath())); 1849 1863 } -
main/trunk/gli/src/org/greenstone/gatherer/file/FileManager.java
r19239 r22410 171 171 file_queue.addJob(id, source, source_nodes, target, target_node, type); 172 172 if (Gatherer.isGsdlRemote) { 173 String collection_name = CollectionManager.getLoaded GroupQualifiedCollectionName(true);173 String collection_name = CollectionManager.getLoadedCollectionName(); 174 174 175 175 // Perform the appropriate action based on the job type (RemoteGreenstoneServer will queue) … … 274 274 if (file.getAbsolutePath().startsWith(Gatherer.getCollectDirectoryPath()) && file.length() == 0) { 275 275 if (Gatherer.remoteGreenstoneServer.downloadCollectionFile( 276 CollectionManager.getLoaded GroupQualifiedCollectionName(true), file).equals("")) {276 CollectionManager.getLoadedCollectionName(), file).equals("")) { 277 277 // Something has gone wrong downloading the file 278 278 return; … … 350 350 if (Gatherer.isGsdlRemote) { 351 351 Gatherer.remoteGreenstoneServer.uploadCollectionFile( 352 CollectionManager.getLoaded GroupQualifiedCollectionName(true), folder_file);352 CollectionManager.getLoadedCollectionName(), folder_file); 353 353 } 354 354 } … … 357 357 if (Gatherer.isGsdlRemote) { 358 358 Gatherer.remoteGreenstoneServer.newCollectionDirectory( 359 CollectionManager.getLoaded GroupQualifiedCollectionName(true), folder_file);359 CollectionManager.getLoadedCollectionName(), folder_file); 360 360 } 361 361 } … … 418 418 if (Gatherer.isGsdlRemote) { 419 419 Gatherer.remoteGreenstoneServer.moveCollectionFile( 420 CollectionManager.getLoaded GroupQualifiedCollectionName(true), collection_file, new_collection_file);420 CollectionManager.getLoadedCollectionName(), collection_file, new_collection_file); 421 421 } 422 422 } … … 467 467 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); 468 468 if (Gatherer.isGsdlRemote) { 469 String collection_name = CollectionManager.getLoaded GroupQualifiedCollectionName(true);469 String collection_name = CollectionManager.getLoadedCollectionName(); 470 470 Gatherer.remoteGreenstoneServer.deleteCollectionFile(collection_name, collection_tree_node.getFile()); 471 471 Gatherer.remoteGreenstoneServer.uploadFilesIntoCollection(collection_name, new File[] { new_file }, target_directory); -
main/trunk/gli/src/org/greenstone/gatherer/file/WorkspaceTree.java
r22342 r22410 169 169 // If the specified folder is open, it must be refreshed 170 170 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 + "!"); 172 172 ((WorkspaceTreeModel) getModel()).refresh(expanded_tree_path); 173 173 } -
main/trunk/gli/src/org/greenstone/gatherer/file/WorkspaceTreeNode.java
r19235 r22410 168 168 169 169 // 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()); 173 176 child_nodes.add(collection_root); 174 177 } -
main/trunk/gli/src/org/greenstone/gatherer/gui/PreviewButton.java
r21587 r22410 77 77 // we could be working with standalone collections or collection groups 78 78 // so getting a collection-name may have a collection group prefix 79 // This means CollectionManager.getLoadedCollectionName() is no longer sufficient80 String collGroupWithName = CollectionManager.getLoaded GroupQualifiedCollectionName(true);79 // This means CollectionManager.getLoadedCollectionName() needs to (and does) return (colgroup/)subcolname 80 String collGroupWithName = CollectionManager.getLoadedCollectionName(true); 81 81 82 82 // set up the home page for the current collection -
main/trunk/gli/src/org/greenstone/gatherer/gui/WriteCDImagePrompt.java
r22361 r22410 546 546 547 547 // Find the size of the "etc", "images" and "index" directories of the collection 548 String collection_directory_path = CollectionManager.getCollectionDirectoryPath(collection.getShortName()); 548 String collection_directory_path = CollectionManager.getCollectionDirectoryPath(collection.getShortName()); // (colgroup/)subcol 549 549 File etc_directory = new File(collection_directory_path + "etc"); 550 550 File images_directory = new File(collection_directory_path + "images"); -
main/trunk/gli/src/org/greenstone/gatherer/remote/RemoteGreenstoneServerAction.java
r19231 r22410 118 118 119 119 String delete_collection_command = "cmd=delete-collection"; 120 delete_collection_command += "&c=" + URLEncoder.encode(collection_name , "UTF-8");120 delete_collection_command += "&c=" + URLEncoder.encode(collection_name.replace(File.separatorChar, '|'), "UTF-8"); 121 121 action_output = remote.sendCommandToServer(delete_collection_command, null); 122 122 } … … 150 150 151 151 String delete_collection_file_command = "cmd=delete-collection-file"; 152 delete_collection_file_command += "&c=" + URLEncoder.encode(collection_name , "UTF-8");152 delete_collection_file_command += "&c=" + URLEncoder.encode(collection_name.replace(File.separatorChar, '|'), "UTF-8"); 153 153 delete_collection_file_command += "&file=" + Base64.encodeBytes(collection_file_relative_path.getBytes()); 154 154 action_output = remote.sendCommandToServer(delete_collection_file_command, null); … … 178 178 179 179 String download_collection_command = "cmd=download-collection"; 180 download_collection_command += "&c=" + URLEncoder.encode(collection_name , "UTF-8");180 download_collection_command += "&c=" + URLEncoder.encode(collection_name.replace(File.separatorChar, '|'), "UTF-8"); 181 181 download_collection_command += "&lr=" + remote.lang_region; 182 182 String zip_file_path = Gatherer.getCollectDirectoryPath() + collection_name + ".zip"; … … 213 213 214 214 String download_collection_archives_command = "cmd=download-collection-archives"; 215 download_collection_archives_command += "&c=" + URLEncoder.encode(collection_name , "UTF-8");215 download_collection_archives_command += "&c=" + URLEncoder.encode(collection_name.replace(File.separatorChar, '|'), "UTF-8"); 216 216 download_collection_archives_command += "&lr=" + remote.lang_region; 217 217 String zip_file_path = Gatherer.getCollectDirectoryPath() + collection_name + "-archives.zip"; … … 310 310 311 311 String file_exists_command = "cmd=file-exists"; 312 file_exists_command += "&c=" + URLEncoder.encode(collection_name , "UTF-8");312 file_exists_command += "&c=" + URLEncoder.encode(collection_name.replace(File.separatorChar, '|'), "UTF-8"); 313 313 // base64 encode the filename to preserve special characters 314 314 file_exists_command += "&file=" + Base64.encodeBytes(collection_file_relative_path.getBytes()); … … 347 347 348 348 String download_collection_file_command = "cmd=download-collection-file"; 349 download_collection_file_command += "&c=" + URLEncoder.encode(collection_name , "UTF-8");349 download_collection_file_command += "&c=" + URLEncoder.encode(collection_name.replace(File.separatorChar, '|'), "UTF-8"); 350 350 download_collection_file_command += "&file=" + URLEncoder.encode(collection_file_relative_path, "UTF-8"); 351 351 download_collection_file_command += "&lr=" + remote.lang_region; … … 470 470 471 471 String move_collection_file_command = "cmd=move-collection-file"; 472 move_collection_file_command += "&c=" + URLEncoder.encode(collection_name , "UTF-8");472 move_collection_file_command += "&c=" + URLEncoder.encode(collection_name.replace(File.separatorChar, '|'), "UTF-8"); 473 473 move_collection_file_command += "&source=" + Base64.encodeBytes(source_collection_file_relative_path.getBytes()); 474 474 move_collection_file_command += "&target=" + Base64.encodeBytes(target_collection_file_relative_path.getBytes()); … … 507 507 508 508 String new_collection_directory_command = "cmd=new-collection-directory"; 509 new_collection_directory_command += "&c=" + URLEncoder.encode(collection_name , "UTF-8");509 new_collection_directory_command += "&c=" + URLEncoder.encode(collection_name.replace(File.separatorChar, '|'), "UTF-8"); 510 510 new_collection_directory_command += "&directory=" + URLEncoder.encode(new_collection_directory_relative_path, "UTF-8"); 511 511 action_output = remote.sendCommandToServer(new_collection_directory_command, null); … … 541 541 542 542 String run_script_command = "cmd=run-script"; 543 run_script_command += "&c=" + URLEncoder.encode(collection_name , "UTF-8");543 run_script_command += "&c=" + URLEncoder.encode(collection_name.replace(File.separatorChar, '|'), "UTF-8"); 544 544 run_script_command += "&script=" + script_name; 545 545 run_script_command += "&language=" + Configuration.getLanguage(); … … 588 588 // Upload the zip file 589 589 String upload_collection_file_command = "cmd=upload-collection-file"; 590 upload_collection_file_command += "&c=" + URLEncoder.encode(collection_name , "UTF-8");590 upload_collection_file_command += "&c=" + URLEncoder.encode(collection_name.replace(File.separatorChar, '|'), "UTF-8"); 591 591 upload_collection_file_command += "&file=" + URLEncoder.encode(zip_file_name, "UTF-8"); 592 592 upload_collection_file_command += "&directory="; … … 643 643 644 644 String upload_collection_file_command = "cmd=upload-collection-file"; 645 upload_collection_file_command += "&c=" + URLEncoder.encode(collection_name , "UTF-8");645 upload_collection_file_command += "&c=" + URLEncoder.encode(collection_name.replace(File.separatorChar, '|'), "UTF-8"); 646 646 upload_collection_file_command += "&file=" + URLEncoder.encode(zip_file_name, "UTF-8"); 647 647 upload_collection_file_command += "&directory=" + URLEncoder.encode(target_collection_directory_relative_path, "UTF-8");
Note:
See TracChangeset
for help on using the changeset viewer.