Changeset 5208
- Timestamp:
- 2003-08-19T15:37:16+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfiguration.java
r5164 r5208 906 906 String name = (String) names.next(); 907 907 String value = (String) arguments.get(name); // Can be null 908 // The metadata argument gets added as the content attribute909 if(name.equals(METADATA_ARGUMENT) && value != null) {910 // The metadata argument must be the fully qualified name of a metadata element, so if it doesn't yet have a namespace, append the extracted metadata namespace.911 if(value.indexOf(MSMUtils.NS_SEP) == -1) {912 value = Utility.EXTRACTED_METADATA_NAMESPACE + MSMUtils.NS_SEP + value;913 }914 //command_element.setAttribute(CONTENT_ATTRIBUTE, value);915 }916 908 // Everything else is an Option Element 917 909 Element option_element = document.createElement(OPTION_ELEMENT); 918 910 option_element.setAttribute(NAME_ATTRIBUTE, name.substring(1)); 919 911 if(value != null) { 912 // Remove any speech marks appended in strings containing whitespace 913 if(value.startsWith(QUOTE_CHARACTER) && value.endsWith(QUOTE_CHARACTER)) { 914 value = value.substring(1, value.length() - 1); 915 } 916 // The metadata argument gets added as the content attribute 917 if(name.equals(METADATA_ARGUMENT) && value != null) { 918 // The metadata argument must be the fully qualified name of a metadata element, so if it doesn't yet have a namespace, append the extracted metadata namespace. 919 if(value.indexOf(MSMUtils.NS_SEP) == -1) { 920 value = Utility.EXTRACTED_METADATA_NAMESPACE + MSMUtils.NS_SEP + value; 921 } 922 //command_element.setAttribute(CONTENT_ATTRIBUTE, value); 923 } 920 924 MSMUtils.setValue(option_element, value); 921 925 } … … 1172 1176 command_element = document.createElement(COLLECTIONMETADATA_PUBLIC_ELEMENT); 1173 1177 } 1174 if(command_element != null ) {1178 if(command_element != null && value_str != null) { 1175 1179 command_element.setAttribute(NAME_ATTRIBUTE, name_str); 1176 1180 command_element.setAttribute(LANGUAGE_ATTRIBUTE, ENGLISH_LANGUAGE_STR); 1177 1181 command_element.setAttribute(SPECIAL_ATTRIBUTE, TRUE_STR); 1182 if(value_str.startsWith(QUOTE_CHARACTER) && value_str.endsWith(QUOTE_CHARACTER)) { 1183 value_str = value_str.substring(1, value_str.length() - 1); 1184 } 1178 1185 MSMUtils.setValue(command_element, value_str); 1179 1186 } … … 1216 1223 option_element.setAttribute(CUSTOM_ATTRIBUTE, TRUE_STR); // All arguments are considered to be custom until matched against base plugins arguments 1217 1224 if(value != null) { 1225 // Remove any speech marks appended in strings containing whitespace 1226 if(value.startsWith(QUOTE_CHARACTER) && value.endsWith(QUOTE_CHARACTER)) { 1227 value = value.substring(1, value.length() - 1); 1228 } 1218 1229 if(name.equals(METADATA_ARGUMENT)) { 1219 1230 // The metadata argument must be the fully qualified name of a metadata element, so if it doesn't yet have a namespace, append the extracted metadata namespace.
Note:
See TracChangeset
for help on using the changeset viewer.