Changeset 29284
- Timestamp:
- 2014-09-15T14:38:50+12:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/cdm/CollectionConfigXMLReadWrite.java
r29221 r29284 56 56 57 57 // a list of all known top level elements 58 static final private String known_element_names_array[] = { StaticStrings.METADATALIST_STR, StaticStrings.DISPLAYITEMLIST_STR, StaticStrings.FORMAT_STR, StaticStrings.SEARCH_STR, StaticStrings.INFODB_STR, StaticStrings.BROWSE_STR, StaticStrings.IMPORT_STR, StaticStrings.DISPLAY_STR, StaticStrings.REPLACELISTREF_STR, StaticStrings.REPLACELIST_STR, StaticStrings.SERVICE_RACK_LIST_ELEMENT };58 static final private String known_element_names_array[] = { StaticStrings.SECURITY_STR, StaticStrings.METADATALIST_STR, StaticStrings.DISPLAYITEMLIST_STR, StaticStrings.FORMAT_STR, StaticStrings.SEARCH_STR, StaticStrings.INFODB_STR, StaticStrings.BROWSE_STR, StaticStrings.IMPORT_STR, StaticStrings.IMPORT_OPTION_STR, StaticStrings.BUILD_OPTION_STR, StaticStrings.DISPLAY_STR, StaticStrings.REPLACELISTREF_STR, StaticStrings.REPLACELIST_STR, StaticStrings.SERVICE_RACK_LIST_ELEMENT }; 59 59 static final private Set known_element_names = new HashSet(Arrays.asList(known_element_names_array)); 60 60 … … 600 600 601 601 // Transform plugins (pluginListNode) of collectionConfig.xml into the internal structure (i.e. Document to) 602 static private void doPlugin (Document to, Node pluginListNode)602 static private void doPlugins(Document to, Node pluginListNode) 603 603 { 604 604 Element toElement = to.getDocumentElement(); … … 1414 1414 } 1415 1415 1416 static private void convertSecurity(Document from, Document to) 1417 { 1418 Node security = XMLTools.getChildByTagNameIndexed(from.getDocumentElement(), StaticStrings.SECURITY_STR, 0); 1419 if (security != null) 1420 { 1421 Element to_element = XMLTools.duplicateElement(to, (Element) security, true); 1422 to.getDocumentElement().appendChild(to_element); 1423 1424 } 1425 } 1416 1426 static private void convertMetadataList(Document from, Document to) 1417 1427 { … … 1599 1609 1600 1610 // Convert plugins in the internal(i.e. Document from) to collectionconfig.xml (i.e. Document to) 1601 static private void convertPlugin (Document from, Document to)1611 static private void convertPlugins(Document from, Document to) 1602 1612 { 1603 1613 Element import_element = to.createElement(StaticStrings.IMPORT_STR); … … 2658 2668 Element toElement = dOc.getDocumentElement(); 2659 2669 2670 // security element. For now, we just save as is, as you can't edit this in GLI. 2671 Node securityNode = XMLTools.getChildByTagNameIndexed(fromElement, StaticStrings.SECURITY_STR,0); 2672 // just save for now 2673 if (securityNode != null) { 2674 Element to_element = XMLTools.duplicateElement(dOc, (Element) securityNode, true); 2675 toElement.appendChild(to_element); 2676 } 2660 2677 // It's deliberately set that 'creator', 'maintainer', and 'public' are only in English (as they are just names). 2661 2678 // So the following ArrayList have only one element. … … 2703 2720 { 2704 2721 2705 doPlugin (dOc, pluginListNode);2722 doPlugins(dOc, pluginListNode); 2706 2723 } 2707 2724 … … 2748 2765 } 2749 2766 2750 if(buildtype_value.equalsIgnoreCase("solr") ) {2767 if(buildtype_value.equalsIgnoreCase("solr") || buildtype_value.equalsIgnoreCase("lucene")) { 2751 2768 doSolrFacetsAndSorts(dOc, searchNode); // <facet><displayItem /></facet> and <sort><displayItem /></sort> 2769 // lucene will only have sort elements 2752 2770 } 2753 2771 … … 2846 2864 Document skeleton = XMLTools.parseXMLFile("xml/CollectionConfig.xml", true); 2847 2865 //Element internal = dOc.getDocumentElement(); 2866 convertSecurity(dOc, skeleton); 2848 2867 convertMetadataList(dOc, skeleton); 2849 2868 convertDisplayItemList(dOc, skeleton); … … 2853 2872 convertIndex(dOc, skeleton); 2854 2873 convertSolrFacetsAndSorts(dOc, skeleton); 2855 convertPlugin (dOc, skeleton);//also do the plugout element2874 convertPlugins(dOc, skeleton);//also do the plugout element 2856 2875 convertClassifier(dOc, skeleton); 2857 2876 convertSubcollectionIndexes(dOc, skeleton);
Note:
See TracChangeset
for help on using the changeset viewer.