- Timestamp:
- 2002-10-04T13:21:34+12:00 (22 years ago)
- Location:
- trunk/gsdl3/src/java/org/greenstone/gsdl3
- Files:
-
- 2 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 } -
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/PhindService.java
r3434 r3443 72 72 // add in the applet info for the phind applet 73 73 // need to make this dynamic - library names etc 74 String app_info = "<applet CODEBASE='/gsdl3/lib/java' CODE='org.greenstone.applet.phind.Phind.class' ARCHIVE='phind.jar, xercesImpl.jar, gsdl3.jar, jaxp.jar, xml-apis.jar' WIDTH='500' HEIGHT='400'><PARAM NAME='library' VALUE='/gsdl3/library'/> <PARAM NAME='phindcgi' VALUE='/gsdl3/library?a=a&sa=r&sn=Phind'/>"; 74 // change the applet params - have a single param with the library name 75 // this is left blank at this end, and must be filled in by applet action - if the library name is not needed, this param is left out 76 // phindcgi param now is not complete - library must be prepended to it. 77 String app_info = "<applet CODEBASE='lib/java' CODE='org.greenstone.applet.phind.Phind.class' ARCHIVE='phind.jar, xercesImpl.jar, gsdl3.jar, jaxp.jar, xml-apis.jar' WIDTH='500' HEIGHT='400'><PARAM NAME='library' VALUE=''/> <PARAM NAME='phindcgi' VALUE='?a=a&sa=r&sn=Phind'/>"; 75 78 app_info +="<PARAM NAME='collection' VALUE='"; 76 79 app_info += collection_name_; 77 app_info += "'/> <PARAM NAME='classifier' VALUE='1'/> <PARAM NAME='orientation' VALUE='vertical'/> <PARAM NAME='depth' VALUE='2'/> <PARAM NAME='resultorder' VALUE='L,l,E,e,D,d'/> <PARAM NAME='backdrop' VALUE=' /gsdl3/interfaces/default/images/phindbg1.jpg'/><PARAM NAME='fontsize' VALUE='10'/> <PARAM NAME='blocksize' VALUE='10'/>The Phind java applet.</applet>";80 app_info += "'/> <PARAM NAME='classifier' VALUE='1'/> <PARAM NAME='orientation' VALUE='vertical'/> <PARAM NAME='depth' VALUE='2'/> <PARAM NAME='resultorder' VALUE='L,l,E,e,D,d'/> <PARAM NAME='backdrop' VALUE='interfaces/default/images/phindbg1.jpg'/><PARAM NAME='fontsize' VALUE='10'/> <PARAM NAME='blocksize' VALUE='10'/>The Phind java applet.</applet>"; 78 81 79 82 Document dom = converter_.getDOM(app_info); … … 112 115 String phind_index = (String)params.get("pc"); 113 116 // the location of the mgpp database files 114 basepath_ = GSFile.phindBase Path(site_home_, collection_name_, phind_index);117 basepath_ = GSFile.phindBaseDir(site_home_, collection_name_, phind_index); 115 118 116 119 // the result element
Note:
See TracChangeset
for help on using the changeset viewer.