Changeset 3998
- Timestamp:
- 2003-03-26T12:13:33+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/action/BrowseAction.java
r3988 r3998 53 53 54 54 // the first part of the data for the page is the cgi-params 55 // Element page_request = GSXML.duplicateWithNewName(doc_, request, "pageRequest", true); 56 // page.appendChild(page_request); 57 Element cgi_request = (Element)doc_.importNode(request, true); 58 page.appendChild(cgi_request); 59 55 Element page_request = GSXML.duplicateWithNewName(doc_, request, GSXML.PAGE_REQUEST_ELEM, true); 56 page.appendChild(page_request); 57 60 58 // extract the params from the cgi-request, and check that we have a coll specified 61 59 Element cgi_paramList = (Element)GSXML.getChildByTagName(request, GSXML.PARAM_ELEM+GSXML.LIST_MODIFIER); … … 70 68 } 71 69 70 // the main response for the page is in a pageResponse element 71 Element page_response = doc_.createElement(GSXML.PAGE_RESPONSE_ELEM); 72 page.appendChild(page_response); 73 72 74 String lang = request.getAttribute(GSXML.LANG_ATT); 73 75 String to = GSPath.appendLink(collection, service_name); … … 80 82 Element info_request = GSXML.createBasicRequest(doc_, GSXML.REQUEST_TYPE_DESCRIBE, to, lang); 81 83 info_message.appendChild(info_request); 82 84 85 // also get the collection description (should be just metadata?) for the http address stuff 86 Element coll_info_request = GSXML.createBasicRequest(doc_, GSXML.REQUEST_TYPE_DESCRIBE, collection, lang); 87 info_message.appendChild(coll_info_request); 83 88 // also get the format stuff now if there is some 84 89 Element format_request = GSXML.createBasicRequest(doc_, GSXML.REQUEST_TYPE_FORMAT, to, lang); 85 90 info_message.appendChild(format_request); 86 91 // process the requests 92 87 93 Element info_response = (Element) mr_.process(info_message); 88 94 89 // get out the description 90 String path = GSPath.appendLink(GSXML.RESPONSE_ELEM, GSXML.SERVICE_ELEM); 91 Element description = (Element)doc_.importNode(GSXML.getNodeByPath(info_response, path), true); 92 page.appendChild(description); 93 94 Element format_response = (Element)info_response.getElementsByTagName(GSXML.RESPONSE_ELEM).item(1); // the second response 95 96 // the main response for the page is in a response element 97 Element response = doc_.createElement(GSXML.RESPONSE_ELEM); 98 page.appendChild(response); 99 95 // the three responses 96 NodeList responses = info_response.getElementsByTagName(GSXML.RESPONSE_ELEM); 97 Element service_response = (Element)responses.item(0); 98 Element coll_response = (Element)responses.item(1); 99 Element format_response = (Element)responses.item(2); 100 101 Element service_description = (Element)GSXML.getChildByTagName(service_response, GSXML.SERVICE_ELEM); 102 page_response.appendChild(doc_.importNode(service_description, true)); 103 104 Element coll_description = (Element)GSXML.getChildByTagName(coll_response, GSXML.COLLECTION_ELEM); 105 page_response.appendChild(doc_.importNode(coll_description, true)); 106 107 100 108 // get the node that the user has clicked on 101 109 String classifier_node = (String)params.get(CLASSIFIER_ARG); … … 110 118 // create a classifier elem to return in the page 111 119 Element page_classifier = doc_.createElement(GSXML.CLASSIFIER_ELEM); 112 response.appendChild(page_classifier);120 page_response.appendChild(page_classifier); 113 121 114 122 // the id of the classifier is the top id of the selected node … … 149 157 Element classify_response = (Element)mr_.process(classify_message); 150 158 // get the structure element 151 path = GSPath.appendLink(GSXML.RESPONSE_ELEM, GSXML.CLASS_NODE_ELEM+GSXML.LIST_MODIFIER);159 String path = GSPath.appendLink(GSXML.RESPONSE_ELEM, GSXML.CLASS_NODE_ELEM+GSXML.LIST_MODIFIER); 152 160 path = GSPath.appendLink(path, GSXML.CLASS_NODE_ELEM); 153 161 path = GSPath.appendLink(path, GSXML.NODE_STRUCTURE_ELEM);
Note:
See TracChangeset
for help on using the changeset viewer.