Changeset 13860
- Timestamp:
- 2007-02-05T17:13:25+13:00 (17 years ago)
- Location:
- trunk/gsdl3/src/java/org/greenstone/gsdl3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/collection/Collection.java
r13830 r13860 48 48 static Logger logger = Logger.getLogger(org.greenstone.gsdl3.collection.Collection.class.getName()); 49 49 50 /** is this collection public or private */ 51 protected boolean is_public = true; 50 52 protected XMLTransformer transformer = null; 51 53 /** same as setClusterName */ … … 93 95 94 96 } 97 98 public boolean isPublic() { 99 return is_public; 100 } 95 101 /** 96 102 * load in the collection config file into a DOM Element … … 153 159 resolveMacros(display_list); 154 160 addDisplayItems(display_list); 161 } 162 163 // check whether we are public or not 164 if (meta_list != null) { 165 Element meta_elem = (Element) GSXML.getNamedElement(metadata_list, GSXML.METADATA_ELEM, GSXML.NAME_ATT, "public"); 166 if (meta_elem != null) { 167 String value = GSXML.getValue(meta_elem).toLowerCase().trim(); 168 if (value.equals("false")) { 169 is_public = false; 170 } 171 } 155 172 } 156 173 return true; -
trunk/gsdl3/src/java/org/greenstone/gsdl3/core/MessageRouter.java
r13850 r13860 774 774 logger.info("Activating collection: "+col_name+"."); 775 775 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 File collectionConfig_file= new File(GSFile.collectionConfigFile(this.site_home, col_name)); 779 if (!collectionConfig_file.exists() ) { 780 System.err.println("MessageRouter: site collection config file: "+collectionConfig_file.getPath()+" not found!"); 781 return false; 782 } 783 784 Document collectionConfig_doc = this.converter.getDOM(collectionConfig_file); 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 } 801 802 // now we need to look for the etc/collectionInit.xml file, and see what sort of Collection to load 776 // Look for the etc/collectionInit.xml file, and see what sort of Collection to load 803 777 Collection c = null; 804 778 File init_file = new File(GSFile.collectionInitFile(this.site_home, col_name)); … … 820 794 } 821 795 } 822 if (c==null) { // we haven't found an pther classname to use796 if (c==null) { // we haven't found another classname to use 823 797 c = new Collection(); 824 798 } … … 834 808 this.module_map.put(col_name, c); 835 809 836 if( is_public) {810 if(c.isPublic()) { 837 811 // only public collections will appear on the home page 838 812 // add short description_ to collection_list_
Note:
See TracChangeset
for help on using the changeset viewer.