Changeset 13837 for trunk/gsdl3/src
- Timestamp:
- 2007-01-31T16:33:12+13:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/core/MessageRouter.java
r13209 r13837 98 98 protected XMLConverter converter=null; 99 99 100 101 100 //*************************************************************** 102 101 // public methods … … 774 773 775 774 logger.info("Activating collection: "+col_name+"."); 776 775 776 // now we need to look at the etc/collectionConfigure.xml file, and see whether the collection is public 777 String public_info="false"; 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 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 800 777 801 // now we need to look for the etc/collectionInit.xml file, and see what sort of Collection to load 778 802 Collection c = null; 779 803 File init_file = new File(GSFile.collectionInitFile(this.site_home, col_name)); 804 780 805 if (init_file.exists()) { 781 806 Document init_doc = this.converter.getDOM(init_file); … … 807 832 // add to list of collections 808 833 this.module_map.put(col_name, c); 809 //add short description_ to collection_list_ 810 Element e = this.doc.createElement(GSXML.COLLECTION_ELEM); 811 e.setAttribute(GSXML.NAME_ATT, col_name); 812 this.collection_list.appendChild(e); 834 public_info=public_info.toLowerCase().trim(); 835 if(public_info.equals("true")){ 836 //add short description_ to collection_list_ 837 Element e = this.doc.createElement(GSXML.COLLECTION_ELEM); 838 e.setAttribute(GSXML.NAME_ATT, col_name); 839 this.collection_list.appendChild(e); 840 }else{ 841 return false; 842 } 813 843 return true; 814 844 } else { … … 817 847 return false; 818 848 } 819 820 849 } 821 850
Note:
See TracChangeset
for help on using the changeset viewer.