source: trunk/gsdl3/src/java/org/greenstone/gsdl3/util/ConfigVars.java@ 3571

Last change on this file since 3571 was 3512, checked in by kjdon, 22 years ago

all modules now talk the same messages; all xml elems and atts have been made constants and moved to GSXML.java; SOAPCommunicator can be used outside a MessageRouter

  • Property svn:keywords set to Author Date Id Revision
File size: 1.5 KB
Line 
1package org.greenstone.gsdl3.util;
2
3import org.w3c.dom.Document;
4import org.w3c.dom.Element;
5
6/** holds all the site setup variables
7 * includes a method to represent them as an XML node
8 *
9 * is this only applicable to the servlet type interface? should this
10 * be called ServletConfigVars? or WebServletVars?
11 */
12public class ConfigVars {
13
14 /** the name that has been given to the servlet thats running eg library
15 * not needed for other types of clients*/
16 public String library_name_=null;
17 /** the gsdl home directory
18 * where the sites and interfaces directories live */
19 public String gsdl3_home_ = null;
20 /** the name of the current site */
21 public String site_name_=null;
22 /** the name of the current interface */
23 public String interface_name_=null;
24 /** the xml <config> element containing all the variables */
25 public Element config_xml_ = null;
26
27 /** creates the <config> Element containting all the variables*/
28 public void createXML() {
29
30 XMLConverter converter = new XMLConverter();
31 Document doc = converter.newDOM();
32
33 config_xml_ = doc.createElement(GSXML.CONFIGURATION_ELEM);
34
35 Element e;
36 e = GSXML.createTextElement(doc, "library_name", library_name_);
37 config_xml_.appendChild(e);
38 e = GSXML.createTextElement(doc, "gsdl3_home", gsdl3_home_);
39 config_xml_.appendChild(e);
40 e = GSXML.createTextElement(doc, "site_name", site_name_);
41 config_xml_.appendChild(e);
42 e = GSXML.createTextElement(doc, "interface_name", interface_name_);
43 config_xml_.appendChild(e);
44 }
45}
46
Note: See TracBrowser for help on using the repository browser.