Changeset 3443 for trunk/gsdl3/src/java/org/greenstone/gsdl3/action
- Timestamp:
- 2002-10-04T13:21:34+12:00 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/action/AppletAction.java
r3441 r3443 5 5 // XML classes 6 6 import org.w3c.dom.Node; 7 import org.w3c.dom.NodeList; 7 8 import org.w3c.dom.Document; 8 9 import org.w3c.dom.Element; … … 78 79 79 80 page.appendChild(doc_.importNode(request, true)); 81 80 82 // add in the applet info 81 82 //page.appendChild(doc_.importNode(GSXML.getNodeByPath(mr_response, "response/service/applet"), true)); 83 page.appendChild(doc_.importNode(GSXML.getNodeByPath(mr_response, "response/service/applet"), true)); 83 Element app_desc = (Element)doc_.importNode(GSXML.getNodeByPath(mr_response, "response/service/applet"), true); 84 // must look through the applet description and see if there is a param called library. if so, add the value to be the current library name 85 86 addLibraryName(app_desc, config_.library_name_); 87 page.appendChild(app_desc); 84 88 return transformer_.transform(stylesheet, page); 85 89 } … … 111 115 } 112 116 } 117 118 /** this method looks through the PARAMs of the applet description for 119 * one with the name 'library'. If its found, it sets the value to be 120 * library_name 121 */ 122 protected void addLibraryName(Element description, String library_name) { 123 124 Node child = description.getFirstChild(); 125 while (child != null) { 126 if (child.getNodeType() == Node.ELEMENT_NODE) { 127 String param = child.getNodeName(); 128 if (param.equals("PARAM")||param.equals("param")) { 129 String name = ((Element)child).getAttribute("NAME"); 130 if (name == null || name.equals("")) { 131 // somethings wrong!! 132 } else if (name.equals("library")) { 133 ((Element)child).setAttribute("VALUE", library_name); 134 break; 135 } 136 137 } 138 } 139 child = child.getNextSibling(); 140 } 141 } 142 113 143 }
Note:
See TracChangeset
for help on using the changeset viewer.