Changeset 6371
- Timestamp:
- 2004-01-09T12:28:36+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/action/BrowseAction.java
r5401 r6371 10 10 11 11 import java.util.HashMap; 12 import java.util.HashSet; 12 13 import java.util.Vector; 13 14 import java.io.File; 14 15 16 //NOTE: this class not used at present!!!!! 15 17 /** action for classifier browsing */ 16 18 public class BrowseAction extends Action { … … 57 59 58 60 String lang = request.getAttribute(GSXML.LANG_ATT); 61 String uid = request.getAttribute(GSXML.USER_ID_ATT); 59 62 String to = GSPath.appendLink(collection, service_name); 60 63 … … 64 67 65 68 Element info_message = this.doc.createElement(GSXML.MESSAGE_ELEM); 66 Element info_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_DESCRIBE, to, lang );69 Element info_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_DESCRIBE, to, lang, uid); 67 70 info_message.appendChild(info_request); 68 71 69 72 // also get the format stuff now if there is some 70 Element format_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_FORMAT, to, lang );73 Element format_request = GSXML.createBasicRequest(this.doc, GSXML.REQUEST_TYPE_FORMAT, to, lang, uid); 71 74 info_message.appendChild(format_request); 72 75 // process the requests … … 99 102 // the id of the classifier is the top id of the selected node 100 103 String top_id = OID.getTop(classifier_node); 104 105 HashSet metadata_names = new HashSet(); 101 106 102 107 // add the format info into the response … … 105 110 // find the one for the classifier we are in 106 111 Element this_format = GSXML.getNamedElement(format_elem, GSXML.CLASSIFIER_ELEM, GSXML.NAME_ATT, top_id); 112 if (this_format == null) { 113 this_format = (Element)GSXML.getChildByTagName(format_elem, GSXML.DEFAULT_ELEM); 114 } 107 115 if (this_format != null) { 108 116 Element new_format = GSXML.duplicateWithNewName(this.doc, this_format, GSXML.FORMAT_ELEM, false); … … 111 119 112 120 page_response.appendChild(new_format); 113 } 114 } 115 121 extractMetadataNames(new_format, metadata_names); 122 } 123 } 124 125 System.out.println("extracted meta names, "+metadata_names.toString()); 116 126 // get the browse structure for the selected node 117 127 Element classify_message = this.doc.createElement(GSXML.MESSAGE_ELEM); … … 205 215 // should be based on info sent in from the recept, and the 206 216 // format stuff 207 Element cl_param_list = this.doc.createElement(GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER); 208 Element p = this.doc.createElement(GSXML.PARAM_ELEM); 209 cl_param_list.appendChild(p); 210 p.setAttribute(GSXML.NAME_ATT, "metadata"); 211 p.setAttribute(GSXML.VALUE_ATT, "all"); 217 Element cl_param_list = null; 218 if (metadata_names.isEmpty()) { 219 cl_param_list = this.doc.createElement(GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER); 220 Element p = this.doc.createElement(GSXML.PARAM_ELEM); 221 cl_param_list.appendChild(p); 222 p.setAttribute(GSXML.NAME_ATT, "metadata"); 223 p.setAttribute(GSXML.VALUE_ATT, "Title"); 224 } else { 225 cl_param_list = createMetadataParamList(metadata_names); 226 } 227 212 228 cl_meta_request.appendChild(cl_param_list); 213 229
Note:
See TracChangeset
for help on using the changeset viewer.