Changeset 24132
- Timestamp:
- 2011-06-09T14:39:46+12:00 (12 years ago)
- Location:
- main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/action/FormatAction.java
r24007 r24132 114 114 //String style = stylesheetFile(String gsdl3_home, String site_name, String collection, String interface_name, ArrayList base_interfaces, String filename); 115 115 //Document style_doc = this.converter.getDOM(new File(style), "UTF-8"); //"/home/sam/greenstone3/web/interfaces/oran/transform/formatString.xsl"), "UTF-8"); /*************************/ 116 Document style_doc = this.converter.getDOM(new File("/ home/sam/greenstone3/web/interfaces/oran/transform/formatString.xsl"), "UTF-8"); /*************************/116 Document style_doc = this.converter.getDOM(new File("/research/sjb48/greenstone3/web/interfaces/oran/transform/formatString.xsl"), "UTF-8"); /*************************/ 117 117 118 118 if(style_doc == null) -
main/branches/64_bit_Greenstone/greenstone3/src/java/org/greenstone/gsdl3/collection/Collection.java
r24007 r24132 33 33 import java.io.File; 34 34 import java.util.HashMap; 35 import java.util.*; 35 36 36 37 import javax.xml.parsers.DocumentBuilder; … … 471 472 int index; 472 473 Element elem; 474 // Try importing entire tree to this.doc so we can add and remove children at ease 475 //Node current_node = this.doc.importNode(GSXML.getChildByTagName(config, "CollectionConfig"),true); 473 476 Node current_node = GSXML.getChildByTagName(config, "CollectionConfig"); 474 477 NodeList current_node_list; 475 478 479 logger.error("Service is "+service); 480 476 481 if(service.equals("ClassifierBrowse")) 477 482 { … … 480 485 // default is <browse><format> 481 486 487 logger.error("Looking for browse"); 482 488 current_node = GSXML.getChildByTagName(current_node, "browse"); 483 489 … … 485 491 if(classifier != null) 486 492 { 493 logger.error("Classifier is not null"); 494 logger.error("Classifier is "+classifier); 487 495 current_node_list = GSXML.getChildrenByTagName(current_node, "classifier"); 488 496 index = Integer.parseInt(classifier.substring(2)) - 1; 497 logger.error("classifier index is "+index); 489 498 // index should be given by X-1 490 499 current_node = current_node_list.item(index); 491 current_node = GSXML.getChildByTagName(current_node, "format"); 500 // what if classifier does not have a format tag? 501 if(GSXML.getChildByTagName(current_node, "format") == null) 502 { 503 logger.error("ERROR: classifier does not have a format child"); 504 // well then create a format tag 505 Element format_tag = config.createElement("format"); 506 current_node = (Node) current_node.appendChild(format_tag); 507 //current_node = (Node) format_tag; 508 } 509 510 else{ 511 current_node = GSXML.getChildByTagName(current_node, "format"); 512 } 492 513 } 493 514 else{ 515 logger.error("Classifier is null"); 494 516 current_node = GSXML.getChildByTagName(current_node, "format"); 495 517 } … … 498 520 { 499 521 // look in <format> with no attributes 522 logger.error("I presume this is search"); 500 523 501 524 current_node_list = GSXML.getChildrenByTagName(current_node, "search"); … … 532 555 { 533 556 //if(transformed.getNodeType() == Node.DOCUMENT_NODE) 534 //transformed = ((Document)transformed).getDocumentElement();535 logger.error("Node type: "+current_node_list.item(k).getNodeType());557 //transformed = ((Document)transformed).getDocumentElement(); 558 //logger.error("Node type: "+current_node_list.item(k).getNodeType()); 536 559 if(current_node_list.item(k).getNodeType() != Node.PROCESSING_INSTRUCTION_NODE) 537 current_node = elem.appendChild(this.doc.importNode(current_node_list.item(k),true));560 elem.appendChild(config.importNode(current_node_list.item(k),true)); 538 561 } 539 562 … … 546 569 // Now convert config document to string for writing to file 547 570 String new_config = this.converter.getString(config); 571 572 new_config = StringUtils.replace(new_config, "<", "<"); 573 new_config = StringUtils.replace(new_config, ">", ">"); 574 new_config = StringUtils.replace(new_config, """, "\""); 548 575 549 576 // Write to file (not original! for now)
Note:
See TracChangeset
for help on using the changeset viewer.