Changeset 10205
- Timestamp:
- 2005-07-04T17:14:06+12:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r10006 r10205 310 310 311 311 // Create the new collection. 312 makeCollection( description, email, name, title);312 makeCollection(name, email); 313 313 progress.setProgress(1); 314 314 … … 400 400 collection.cdm = new CollectionDesignManager(new File(getCollectionConfigFilePath())); 401 401 402 // We always set title and description here rather than calling mkcol.pl with Unicode arguments 403 CollectionMeta collection_name_collectionmeta = collection.cdm.collectionmeta_manager.getMetadatum(StaticStrings.COLLECTIONMETADATA_COLLECTIONNAME_STR); 404 collection_name_collectionmeta.setValue(title); 405 CollectionMeta collection_extra_collectionmeta = collection.cdm.collectionmeta_manager.getMetadatum(StaticStrings.COLLECTIONMETADATA_COLLECTIONEXTRA_STR); 406 collection_extra_collectionmeta.setValue(description); 407 402 408 // Now that we have a CDM, update several settings, such as if we created this collection by basing it on another, set it as public automatically 403 409 if (base_collection_directory != null) { … … 410 416 maintainer_collectionmeta = null; 411 417 412 // Update the collection title413 CollectionMeta collection_name_collectionmeta = collection.cdm.collectionmeta_manager.getMetadatum(StaticStrings.COLLECTIONMETADATA_COLLECTIONNAME_STR);414 collection_name_collectionmeta.setValue(title);415 collection_name_collectionmeta = null;416 417 // And now the description418 CollectionMeta collection_extra_collectionmeta = collection.cdm.collectionmeta_manager.getMetadatum(StaticStrings.COLLECTIONMETADATA_COLLECTIONEXTRA_STR);419 collection_extra_collectionmeta.setValue(description);420 collection_extra_collectionmeta = null;421 422 418 // All collections based on others are automatically public 423 419 CollectionMeta public_collectionmeta = new CollectionMeta(collection.cdm.collect_config.getPublic()); … … 434 430 } 435 431 432 collection.cdm.save(); 436 433 progress.setProgress(3); 437 434 … … 901 898 902 899 903 private void makeCollection(String description, String email, String name, String title) { 904 // Encode the description so it is safe to write to shell 905 if(Utility.isWindows()) { 906 description = Codec.transform(description, Codec.TEXT_TO_SHELL_WINDOWS); 907 } 908 else { 909 description = Codec.transform(description, Codec.TEXT_TO_SHELL_UNIX); 910 } 911 900 private void makeCollection(String name, String email) 901 { 912 902 // Generate the mkcol.pl command 913 903 ArrayList command_parts_list = new ArrayList(); … … 923 913 command_parts_list.add((Gatherer.isGsdlRemote) ? "false" : "true"); 924 914 925 if (title != null && !title.equals("")) {926 command_parts_list.add("-title");927 command_parts_list.add(title);928 }929 915 if (email != null && !email.equals("")) { 930 916 command_parts_list.add("-creator"); 931 917 command_parts_list.add(email); 932 }933 if (description != null && !description.equals("")) {934 command_parts_list.add("-about");935 command_parts_list.add(description);936 918 } 937 919
Note:
See TracChangeset
for help on using the changeset viewer.