Changeset 3909
- Timestamp:
- 2003-03-19T14:20:52+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/ServiceRack.java
r3900 r3909 82 82 description */ 83 83 protected HashMap service_info_map_ = null; 84 /** XML element for stylesheet requests - map of service name to format 85 elem */ 86 protected HashMap format_info_map_ = null; 84 87 85 88 /** sets the cluster name */ … … 108 111 short_service_info_ = doc_.createElement(GSXML.SERVICE_ELEM+GSXML.LIST_MODIFIER); 109 112 service_info_map_ = new HashMap(); 113 format_info_map_ = new HashMap(); 110 114 } 111 115 … … 165 169 } 166 170 171 } else if (type.equals(GSXML.REQUEST_TYPE_FORMAT)) { 172 Element response = processFormat(request); 173 mainResult.appendChild(doc_.importNode(response, true)); 174 175 167 176 } else { 168 177 // other type of request, must be processed by the subclass - … … 257 266 } 258 267 268 /** process method for stylesheet requests 269 */ 270 protected Element processFormat(Element request) { 271 Element response = doc_.createElement(GSXML.RESPONSE_ELEM); 272 response.setAttribute(GSXML.TYPE_ATT, GSXML.REQUEST_TYPE_FORMAT); 273 274 String to = GSPath.getFirstLink(request.getAttribute(GSXML.TO_ATT)); 275 276 if (to.equals("")) { // serviceRack query - is this appropriate?? 277 return response; 278 } 279 280 281 // describe a particular service 282 if (format_info_map_.containsKey(to)) { 283 response.appendChild(getServiceFormat(to)); 284 response.setAttribute(GSXML.FROM_ATT, to); 285 return response; 286 } 287 // else error in to field 288 System.err.println("ServiceRack describe request: no format info for "+to+"."); 289 return response; 290 } 291 259 292 // the following two should be overwritten for info with any language stuff in it 260 293 /** returns the service list for the subclass */ … … 263 296 return short_service_info_; 264 297 } 265 298 266 299 /** returns a specific service description */ 267 300 protected Element getServiceDescription(String service, String lang) { … … 273 306 } 274 307 308 275 309 /** adds the display element into the description - appends to the root for now, but may do something fancy later */ 276 310 protected boolean addServiceDisplay(Element descript, Element display) { … … 282 316 } 283 317 318 protected Element getServiceFormat(String service) { 319 Element format = (Element)((Element)format_info_map_.get(service)).cloneNode(true); 320 return format; 321 } 284 322 /** creates a display element containing all the text strings needed to display the service page, in the language specified */ 285 323 abstract protected Element createServiceDisplay(String service, String lang);
Note:
See TracChangeset
for help on using the changeset viewer.