- Timestamp:
- 2011-06-27T11:08:35+12:00 (13 years ago)
- Location:
- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/Collection.java
r24135 r24203 359 359 response.setAttribute(GSXML.TYPE_ATT, type); 360 360 361 logger.error("Collection received a message, attempting to process"); 362 361 363 if (type.equals(GSXML.REQUEST_TYPE_FORMAT_STRING)) { 362 364 logger.error("Received format string request"); … … 501 503 if(GSXML.getChildByTagName(current_node, "format") == null) 502 504 { 503 logger.error("ERROR: classifierdoes not have a format child");505 logger.error("ERROR: valid classifier but does not have a format child"); 504 506 // well then create a format tag 505 507 Element format_tag = config.createElement("format"); … … 511 513 current_node = GSXML.getChildByTagName(current_node, "format"); 512 514 } 515 513 516 } 514 517 else{ 515 518 logger.error("Classifier is null"); 519 // To support all classifiers, set classifier to null? There is the chance here that the format tag does not exist 520 if(GSXML.getChildByTagName(current_node, "format") == null) 521 { 522 logger.error("ERROR: classifier does not have a format child"); 523 // well then create a format tag 524 Element format_tag = config.createElement("format"); 525 current_node = (Node) current_node.appendChild(format_tag); 526 //current_node = (Node) format_tag; 527 } 528 else 529 current_node = GSXML.getChildByTagName(current_node, "format"); 530 } 531 } 532 else if(service.equals("AllClassifierBrowse")) 533 { 534 logger.error("Looking for browse"); 535 current_node = GSXML.getChildByTagName(current_node, "browse"); 536 if(GSXML.getChildByTagName(current_node, "format") == null) 537 { 538 logger.error("ERROR AllClassifierBrowse: all classifiers do not have a format child"); 539 // well then create a format tag 540 Element format_tag = config.createElement("format"); 541 current_node = (Node) current_node.appendChild(format_tag); 542 //current_node = (Node) format_tag; 543 } 544 else 516 545 current_node = GSXML.getChildByTagName(current_node, "format"); 517 }518 546 } 519 547 else … … 536 564 elem = (Element) current_node; 537 565 538 logger.error(" Current_node = " + elem.getNodeName());566 logger.error("*Current_node = " + elem.getNodeName()); 539 567 540 568 // seems we want to remove current child/ren and replace with format_statement's child/ren? … … 542 570 // remove existing 543 571 current_node_list = elem.getChildNodes(); 572 logger.error("About to remove old children"); 544 573 for(k=0; k<current_node_list.getLength(); k++) 545 574 { 546 575 current_node = elem.removeChild(current_node_list.item(k)); 547 576 } 577 578 logger.error("old nodes removed"); 548 579 549 580 // append new but we have a string! … … 560 591 elem.appendChild(config.importNode(current_node_list.item(k),true)); 561 592 } 593 logger.error("new nodes added"); 562 594 563 595 //String text = GSXML.getNodeText(elem); … … 568 600 569 601 // Now convert config document to string for writing to file 602 logger.error("Convert config to string"); 570 603 String new_config = this.converter.getString(config); 571 604 … … 578 611 writer.write(new_config); 579 612 writer.close(); 613 logger.error("All is happy with collection"); 580 614 581 615 } catch( Exception ex ) { -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/collection/ServiceCluster.java
r23489 r24203 388 388 public Node process(Node message_node) { 389 389 390 logger.error("ServiceCluster is processing a message"); 391 390 392 Element message = this.converter.nodeToElement(message_node); 391 393 … … 417 419 } else { // the request is for one of my services 418 420 String service = GSPath.getFirstLink(to); 421 logger.error(service+" specified!"); 419 422 420 423 if (!this.service_map.containsKey(service)) { … … 467 470 protected Element processMessage(Element request) { 468 471 472 logger.error("ServiceCluster is processing an element request"); 469 473 Element response = this.doc.createElement(GSXML.RESPONSE_ELEM); 470 474 response.setAttribute(GSXML.FROM_ATT, this.cluster_name);
Note:
See TracChangeset
for help on using the changeset viewer.