Changeset 36648 for main/trunk/greenstone3/src/java
- Timestamp:
- 2022-09-21T09:43:32+12:00 (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/PageAction.java
r36641 r36648 5 5 6 6 import org.apache.log4j.Logger; 7 import org.greenstone.gsdl3.core.MessageRouter; 7 8 import org.greenstone.gsdl3.service.CollectionGroups; 8 9 import org.greenstone.gsdl3.util.GSParams; … … 31 32 protected String groupInfoServiceName = null; 32 33 34 public boolean configure() { 35 36 // work out if we have a collection group service or not 37 if (this.mr instanceof MessageRouter && ((MessageRouter)this.mr).pingModule(CollectionGroups.GROUP_CONTENT_SERVICE)) { 38 this.groupInfoServiceName = CollectionGroups.GROUP_CONTENT_SERVICE; 39 } else { 40 this.groupInfoServiceName = "NO_GROUPS"; 41 } 42 43 44 return true; 45 } 46 33 47 public Node process(Node message_node) 34 48 … … 130 144 } 131 145 132 // is this collection part of a group?133 String group = (String) params.get(GSParams.GROUP);134 if (group != null && !group.equals("")) {135 // ...yes it is. get the group path info136 Element group_info_response = getGroupInfo(group, userContext);137 Element path_list = (Element) GSXML.getChildByTagName(group_info_response,138 GSXML.PATH_ELEM + GSXML.LIST_MODIFIER);139 if (path_list != null) {140 response.appendChild(response.getOwnerDocument().importNode(path_list, true));141 }142 }143 144 146 if (page_name.equals(ABOUT_PAGE)) { 145 147 // get service descriptions. Actually only want displayItems, but get everything for now … … 181 183 182 184 UserContext userContext = new UserContext(request); 185 186 183 187 // first, get the message router info 184 188 Element info_message = doc.createElement(GSXML.MESSAGE_ELEM); … … 187 191 Element param_list_element = doc.createElement(GSXML.PARAM_ELEM + GSXML.LIST_MODIFIER); 188 192 info_request.appendChild(param_list_element); 189 //Describe params without collectionlist. Collectionlist provided by CollectionGroup service 193 190 194 GSXML.addParameterToList(param_list_element, GSXML.SUBSET_PARAM, GSXML.CLUSTER_ELEM + GSXML.LIST_MODIFIER); 191 195 GSXML.addParameterToList(param_list_element, GSXML.SUBSET_PARAM, GSXML.SERVICE_ELEM + GSXML.LIST_MODIFIER); … … 193 197 GSXML.addParameterToList(param_list_element, GSXML.SUBSET_PARAM, GSXML.METADATA_ELEM + GSXML.LIST_MODIFIER); 194 198 GSXML.addParameterToList(param_list_element, GSXML.SUBSET_PARAM, GSXML.DISPLAY_TEXT_ELEM + GSXML.LIST_MODIFIER); 199 200 // are we using collection groups? 201 // if not, get the coll list from MR 202 if (this.groupInfoServiceName.equals ("NO_GROUPS")) { 203 GSXML.addParameterToList(param_list_element, GSXML.SUBSET_PARAM, GSXML.COLLECTION_ELEM + GSXML.LIST_MODIFIER); 204 } 195 205 info_message.appendChild(info_request); 196 206 //Send request to message router … … 221 231 } 222 232 223 // if we haven't done so already, check for group info type service 224 if (this.groupInfoServiceName == null) { 225 Element groupInfoService = GSXML.getNamedElement(resp_service_list, GSXML.SERVICE_ELEM, GSXML.NAME_ATT, CollectionGroups.GROUP_CONTENT_SERVICE); 226 227 if (groupInfoService != null) { 228 this.groupInfoServiceName = CollectionGroups.GROUP_CONTENT_SERVICE; 229 } else { 230 this.groupInfoServiceName = "NO_GROUPS"; 231 } 232 } 233 233 // if we are using the group service, get all the group info now 234 234 if (!this.groupInfoServiceName.equals("NO_GROUPS")) { 235 235 String group = null; … … 265 265 } 266 266 267 } else {268 269 //TODO: if no groups, then add the param into main request and get it with the other stuff.270 // don't need to do a separate request.271 // If no service with type SERVICE_TYPE_GROUPINFO could be provided272 // request message router for all available collections273 GSXML.addParameterToList(param_list_element, GSXML.SUBSET_PARAM,274 GSXML.COLLECTION_ELEM + GSXML.LIST_MODIFIER);275 info_response_message = (Element) this.mr.process(info_message);276 277 if (info_response_message == null) {278 logger.error(" couldn't query the message router!");279 return null;280 }281 info_response = (Element) GSXML.getChildByTagName(info_response_message, GSXML.RESPONSE_ELEM);282 if (info_response == null) {283 logger.error("couldn't query the message router!");284 return null;285 }286 267 } 287 268
Note:
See TracChangeset
for help on using the changeset viewer.