Changeset 31867
- Timestamp:
- 2017-08-10T14:19:33+12:00 (6 years ago)
- Location:
- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/AbstractBrowse.java
r30634 r31867 79 79 protected AbstractBrowse() 80 80 { 81 81 82 } 82 83 … … 566 567 Node parentNode = current.getParentNode(); 567 568 568 if (parentNode == null )569 if (parentNode == null || !parentNode.getNodeName().equals(GSXML.CLASS_NODE_ELEM)) 569 570 { 570 continue; 571 String this_style = getThisType(current.getAttribute(GSXML.NODE_ID_ATT)); 572 if (this_style != null) { 573 current.setAttribute(GSXML.CLASSIFIER_STYLE_ATT, this_style); 571 574 } 572 575 } 576 else { 573 577 Element parent = (Element) parentNode; 574 578 String childType = parent.getAttribute(GSXML.CHILD_TYPE_ATT); … … 579 583 580 584 current.setAttribute(GSXML.CLASSIFIER_STYLE_ATT, childType); 585 } 581 586 } 582 587 } // if want structure … … 775 780 /** Gets the type of list a classifier is (e.g. VList or HList) */ 776 781 abstract protected String getChildType(String node_id); 777 782 783 /** Gets the type of list this current node is part of */ 784 abstract protected String getThisType(String node_id); 778 785 /** 779 786 * returns the document type of the doc that the specified node belongs to. -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2Browse.java
r29990 r31867 51 51 public GS2Browse() 52 52 { 53 this.macro_resolver = new GS2MacroResolver( this.coll_db, this.class_loader);53 this.macro_resolver = new GS2MacroResolver(); 54 54 } 55 55 … … 118 118 } 119 119 this.gs_doc = gs_doc_db; 120 121 // we need to set the database for our GS2 macro resolver 122 GS2MacroResolver gs2_macro_resolver = (GS2MacroResolver) this.macro_resolver; 123 gs2_macro_resolver.setDB(this.coll_db); 124 // set the class loader in case we have collection specific properties files 125 gs2_macro_resolver.setClassLoader(this.class_loader); 120 126 121 127 … … 139 145 } 140 146 141 147 /** the type of a node is the same as teh child type of its parent */ 148 protected String getThisType(String node_id) { 149 String parent_id = OID.getParent(node_id); 150 if (parent_id.equals(node_id)) { 151 return null; // no parent so doesn't have a thistype 152 } 153 DBInfo info = this.coll_db.getInfo(parent_id); 154 if (info == null) 155 { 156 return null; 157 } 158 return info.getInfo("childtype"); 159 } 142 160 143 161
Note:
See TracChangeset
for help on using the changeset viewer.