Changeset 13850
- Timestamp:
- 2007-02-05T15:06:31+13:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/core/MessageRouter.java
r13837 r13850 774 774 logger.info("Activating collection: "+col_name+"."); 775 775 776 // now we need to look at the etc/collectionConfig ure.xml file, and see whether the collection is public777 String public_info="false";776 // now we need to look at the etc/collectionConfig.xml file, and see whether the collection is public 777 boolean is_public = true; // public unless state otherwise 778 778 File collectionConfig_file= new File(GSFile.collectionConfigFile(this.site_home, col_name)); 779 779 if (!collectionConfig_file.exists() ) { … … 783 783 784 784 Document collectionConfig_doc = this.converter.getDOM(collectionConfig_file); 785 Element collectionConfig_info = collectionConfig_doc.getDocumentElement(); 786 787 NodeList metadateList_node_list=null; 788 if (collectionConfig_info!=null){ 789 metadateList_node_list = collectionConfig_info.getElementsByTagName(GSXML.METADATA_ELEM); 790 } 791 792 for (int i=0; i<metadateList_node_list.getLength(); i++) { 793 Element opt = (Element)metadateList_node_list.item(i); 794 String name = opt.getAttribute(GSXML.NAME_ATT); 795 if (name.equals("public")) { 796 public_info = GSXML.getValue(opt); 797 } 798 } 799 785 if (collectionConfig_doc != null) { 786 Element collectionConfig_info = collectionConfig_doc.getDocumentElement(); 787 788 if (collectionConfig_info!=null){ 789 Element metadata_list = (Element) GSXML.getChildByTagName(collectionConfig_info,GSXML.METADATA_ELEM + GSXML.LIST_MODIFIER); 790 if (metadata_list != null) { 791 Element meta_elem = (Element) GSXML.getNamedElement(metadata_list, GSXML.METADATA_ELEM, GSXML.NAME_ATT, "public"); 792 if (meta_elem != null) { 793 String value = GSXML.getValue(meta_elem).toLowerCase().trim(); 794 if (value.equals("false")) { 795 is_public = false; 796 } 797 } 798 } 799 } 800 } 800 801 801 802 // now we need to look for the etc/collectionInit.xml file, and see what sort of Collection to load … … 832 833 // add to list of collections 833 834 this.module_map.put(col_name, c); 834 public_info=public_info.toLowerCase().trim(); 835 if(public_info.equals("true")){ 836 //add short description_ to collection_list_ 835 836 if(is_public) { 837 // only public collections will appear on the home page 838 // add short description_ to collection_list_ 837 839 Element e = this.doc.createElement(GSXML.COLLECTION_ELEM); 838 840 e.setAttribute(GSXML.NAME_ATT, col_name); 839 841 this.collection_list.appendChild(e); 840 }else{ 841 return false; 842 } 842 } 843 843 return true; 844 844 } else {
Note:
See TracChangeset
for help on using the changeset viewer.