Index: /greenstone3/trunk/src/java/org/greenstone/server/BaseProperty.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/server/BaseProperty.java	(revision 18558)
+++ /greenstone3/trunk/src/java/org/greenstone/server/BaseProperty.java	(revision 18558)
@@ -0,0 +1,17 @@
+package org.greenstone.server;
+
+public class BaseProperty {
+
+    public String GSDL_HOME = "gsdl3.home";
+    public String GSDL_VERSION = "gsdl3.version";
+    public String AUTOSTART = "server.auto.start";
+    public String DEFAULT_SERVLET = "server.default.servlet";
+
+    public String WEB_PORT = "tomcat.port";
+
+    public String WIN_9X_OPEN_COMMAND = "command.com /c start %1";
+    public String WIN_OPEN_COMMAND = "cmd.exe /c start \"\" %1";
+    public String MAC_OPEN_COMMAND = "open %1";
+
+    public String BROWSER_PATH = "browser.path";
+}
Index: /greenstone3/trunk/src/java/org/greenstone/server/BaseServer.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/server/BaseServer.java	(revision 18558)
+++ /greenstone3/trunk/src/java/org/greenstone/server/BaseServer.java	(revision 18558)
@@ -0,0 +1,225 @@
+
+package org.greenstone.server;
+
+import java.awt.Dimension;
+import java.awt.Toolkit;
+import java.io.File;
+import java.io.InputStream;
+import java.util.Properties;
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import org.apache.log4j.*;
+
+import org.greenstone.gsdl3.util.Dictionary;
+import org.greenstone.gsdl3.util.GlobalProperties;
+
+public abstract class BaseServer 
+{
+    static protected String START_CMD;
+    static protected String RESTART_CMD;
+    static protected String CONFIGURE_CMD;
+    static protected String STOP_CMD;
+
+    protected static final int SERVER_STARTED = 0;
+    protected static final int SERVER_START_FAILED = 1;
+    protected static final int BROWSER_LAUNCHED = 2;
+    protected static final int BROWSER_LAUNCH_FAILED = 3; 
+    
+    protected int server_state_ = -1;    
+
+    protected boolean configure_required_ = true;
+
+    public static File build_properties_file;
+    protected static Properties build_properties;
+    public static Dictionary dictionary;
+     
+    public static BaseProperty Property;
+
+    protected BaseServerControl server_control_;    
+
+    static protected Logger logger_;
+    
+    public BaseServer(String gsdl_home, String lang)
+    {
+	logger_ = Logger.getLogger(BaseServer.class.getName());
+
+	String build_properties_path=gsdl_home+File.separatorChar+"build.properties";
+	build_properties_file = new File(build_properties_path);
+
+	if (!build_properties_file.exists()) {
+	    logger_.fatal("Can't find build.properties file "+build_properties_path);
+	    System.exit(1);
+	}
+	
+	build_properties = new Properties();
+	reloadBuildProperties();
+	
+	dictionary = new Dictionary("server", lang, this.getClass().getClassLoader());
+
+    }
+
+    public void autoStart()
+    {
+	String auto_start = build_properties.getProperty(BaseServer.Property.AUTOSTART);
+	if (auto_start != null && auto_start.equals("true")) {
+	    restart();
+	}
+	else{
+	    start();
+	}  
+	
+    }
+
+    protected int getServerState()
+    {
+	return server_state_;
+    }
+
+    protected abstract int runTarget(String cmd);
+
+
+    public void reconfigRequired()
+    {
+	configure_required_ = true;
+    }
+
+    public void start() 
+    {
+        int state = -1;
+        server_state_ = -1;
+	server_control_.updateControl();
+
+	server_control_.displayMessage(dictionary.get("ServerControl.Starting"));
+	stop(true); // silent, no messages displayed
+	
+  	// reconfigure if necessary
+        if (configure_required_){
+	    server_control_.displayMessage(dictionary.get("ServerControl.Configuring"));
+	    state = runTarget(CONFIGURE_CMD);
+	    
+	   if (state != RunTarget.SUCCESS){
+	       recordError(CONFIGURE_CMD);
+	   }
+	   GlobalProperties.reload(); // properties file may have changed, so reload it
+	   configure_required_ = false;
+	}
+	else{
+	    recordSuccess(CONFIGURE_CMD); 
+	}
+	
+        state = runTarget(START_CMD);
+	
+	if (state != RunTarget.SUCCESS){
+	    recordError(START_CMD);
+            server_state_ = SERVER_START_FAILED;  
+            
+	}	            
+	else{
+	    recordSuccess(START_CMD); 
+            server_state_ = SERVER_STARTED; 
+       	} 
+
+       	server_control_.updateControl();
+    }
+    
+    protected void recordError(String message){
+        message = dictionary.get("ServerControl.Error",new String[]{message,GlobalProperties.getGSDL3Home()});
+	server_control_.displayMessage(message);
+	logger_.error(dictionary.get("ServerControl.Failed",new String[]{message}));
+    }
+
+
+    protected void recordError(String message, Exception e){
+        message = dictionary.get("ServerControl.Error",new String[]{message,GlobalProperties.getGSDL3Home()});
+	server_control_.displayMessage(message);
+	logger_.error(dictionary.get("ServerControl.Failed",new String[]{message}),e);
+    }
+
+    protected void recordSuccess(String message){
+        message = dictionary.get("ServerControl.Success",new String[]{message});
+	server_control_.displayMessage(message);
+	logger_.info(message);
+    }
+
+   
+    public void launchBrowser() {
+        server_state_ = -1;
+        server_control_.updateControl();   
+        String message = dictionary.get("ServerControl.LaunchingBrowser");
+    	server_control_.displayMessage(message); 
+	String url = GlobalProperties.getGSDL3WebAddress()+ build_properties.getProperty(BaseServer.Property.DEFAULT_SERVLET);
+	BrowserLauncher launcher = new BrowserLauncher(build_properties.getProperty(BaseServer.Property.BROWSER_PATH),url);
+        logger_.info(message);
+
+	launcher.start();
+     
+        //wait for a while
+        while(launcher.getBrowserState() == -1){
+            try{
+		Thread.sleep(3000);
+	    }
+	    catch(Exception e){
+		logger_.error(e);
+	    }
+         } 
+
+	if (launcher.getBrowserState() != BrowserLauncher.LAUNCHSUCCESS ){
+	    recordError(dictionary.get("ServerControl.LaunchBrowser")); 
+	    server_state_ = BROWSER_LAUNCH_FAILED; 
+	}
+	else{
+	    recordSuccess(dictionary.get("ServerControl.LaunchBrowser")); 
+	    server_state_ = BROWSER_LAUNCHED;
+	}    
+        
+	server_control_.updateControl();        
+    }
+    
+    public void restart(){
+	start();       
+        if (server_state_ == SERVER_STARTED){
+	    launchBrowser();
+	}  
+    }
+
+    // Preserving the current behaviour of stop() which is to
+    // display the message on stopping
+    public void stop() {
+	stop(false);
+    }
+
+    public void stop(boolean silent) {
+	if(!silent) {
+	    server_control_.displayMessage(dictionary.get("ServerControl.Stopping"));
+	}
+	int state = runTarget(STOP_CMD);
+	
+        if (state != RunTarget.SUCCESS){
+	    recordError(STOP_CMD);
+	}
+	else{
+	    recordSuccess(STOP_CMD);
+	}
+
+    }
+    
+    public  void reloadBuildProperties() {
+	try {
+	    InputStream in = this.getClass().getClassLoader().getResourceAsStream("build.properties");
+	    
+	    if (in != null) {
+		logger_.info("loading build properties");
+		build_properties.load(in);
+		in.close();
+	    } else {
+		logger_.error("Couldn't load build properties!");
+	    }
+	} catch (Exception e) {
+	    logger_.error("Exception trying to reload build.properties: "+e);
+	}
+	
+    }
+
+}
Index: /greenstone3/trunk/src/java/org/greenstone/server/BaseServerControl.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/server/BaseServerControl.java	(revision 18558)
+++ /greenstone3/trunk/src/java/org/greenstone/server/BaseServerControl.java	(revision 18558)
@@ -0,0 +1,239 @@
+package org.greenstone.server;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.io.File;
+import java.util.ArrayList;
+import javax.swing.*;
+import javax.swing.border.*;
+
+import org.greenstone.gsdl3.util.GlobalProperties;
+
+import org.apache.log4j.*;
+/**
+ * Base class to help start or restart the library server
+ * 
+ */
+public abstract class BaseServerControl extends JFrame {
+
+    static Logger logger = Logger.getLogger(ServerControl.class.getName());
+ 
+    /** The dimension of the frame */
+    static final private Dimension FRAME_SIZE = new Dimension(350, 250);
+
+    Color bg_color = Color.white;    
+    
+    /** some components we need to refer to later */
+    protected JLabel info_label;
+    protected JButton enter_button;
+    protected JMenu fMenu;
+    protected BaseServer server;
+    protected JFrame thisframe;
+    
+    public BaseServerControl(BaseServer server,String frame_title) 
+    {
+	super(frame_title);
+ 
+	this.server = server;
+        thisframe = this;
+
+	setSize(FRAME_SIZE);
+	setDefaultCloseOperation(EXIT_ON_CLOSE);
+	Dimension screen_size = Toolkit.getDefaultToolkit().getScreenSize();
+	setLocation((screen_size.width - FRAME_SIZE.width) / 2,
+		    (screen_size.height - FRAME_SIZE.height) / 2);
+	setBackground(Color.white);
+        addWindowListener(new MyAdapter()); 
+   
+        JPanel title_panel = new JPanel();
+	title_panel.setLayout(new BorderLayout());
+
+        JLabel title_label = new JLabel();
+
+
+        String title = BaseServer.dictionary.get("ServerControl.Title");           
+        title_label.setText(stringToHTML(title)); 
+        title_label.setOpaque(false);	
+	title_label.setHorizontalAlignment(SwingConstants.CENTER);
+        title_label.setFont(new Font("SansSerif",Font.PLAIN,18));
+       
+
+        JLabel version_label = new JLabel();
+        String version = BaseServer.dictionary.get("ServerControl.Version", new String [] {GlobalProperties.getProperty(BaseServer.Property.GSDL_VERSION)}).toLowerCase();
+         
+        version_label.setText(stringToHTML(version)); 
+        version_label.setOpaque(false);	
+	version_label.setHorizontalAlignment(SwingConstants.CENTER);
+        version_label.setFont(new Font("SansSerif",Font.PLAIN,14));
+        
+        title_panel.add(title_label,BorderLayout.CENTER);
+        title_panel.add(version_label,BorderLayout.SOUTH);
+	title_panel.setBackground(bg_color);	
+	title_panel.setBorder(BorderFactory.createEmptyBorder(5,10,5,10));
+
+   	info_label = new JLabel();
+        info_label.setOpaque(false);
+        info_label.setHorizontalAlignment(SwingConstants.LEFT);
+        info_label.setVerticalAlignment(SwingConstants.CENTER);
+        info_label.setFont(new Font("SansSerif",Font.PLAIN,14));
+	info_label.setBorder(BorderFactory.createEmptyBorder(5,10,5,10));	        
+		
+        JPanel button_panel = new JPanel(new FlowLayout(FlowLayout.CENTER));
+	enter_button = new JButton();
+	enter_button.setEnabled(false);
+	enter_button.addActionListener(new EnterButtonListener());
+        enter_button.setText(BaseServer.dictionary.get("ServerControl.EnterLibrary"));
+ 	button_panel.add(enter_button);
+	button_panel.setBackground(bg_color);	
+	button_panel.setBorder(BorderFactory.createEmptyBorder(5,10,5,10));
+
+	getContentPane().setLayout(new BorderLayout());
+	getContentPane().add(title_panel,BorderLayout.NORTH);
+	getContentPane().add(info_label,BorderLayout.CENTER);
+	getContentPane().add(button_panel,BorderLayout.SOUTH);
+	getContentPane().setBackground(bg_color);
+    	setJMenuBar(createMenu());
+	setVisible(true);
+    }
+
+    protected abstract JMenuBar createMenu();
+
+    protected JMenuBar createMenu(JMenuItem iConf) {
+	JMenuBar menuBar = new JMenuBar();
+         fMenu = new JMenu(BaseServer.dictionary.get("ServerControl.Menu.File"));
+	JMenuItem iExit = new JMenuItem(BaseServer.dictionary.get("ServerControl.Menu.Exit"));
+	iExit.setBackground(Color.white);
+	iExit.addActionListener(new ActionListener() {
+		public void actionPerformed(ActionEvent ae) {
+		    Thread runInThread = new Thread(new Runnable(){
+			    public void run(){
+				server.stop();
+			    
+			    }
+			},"stop server");
+		    try{
+                        runInThread.start(); 
+		
+		    }
+		    catch(Exception e){
+			logger.error(e);
+		    }    
+		    thisframe.dispose();
+		}
+	    });
+
+	fMenu.add(iConf);
+	fMenu.add(iExit);
+	fMenu.setEnabled(false);
+	menuBar.add(fMenu);
+	menuBar.setBorder(new BevelBorder(BevelBorder.RAISED));
+	return menuBar;
+    }
+
+    public void updateControl(){
+      	switch (server.getServerState()){
+	case BaseServer.SERVER_STARTED:
+	    {
+		info_label.setText(stringToHTML(BaseServer.dictionary.get("ServerControl.Help_EnterLibrary")));
+		enter_button.setEnabled(true);
+		fMenu.setEnabled(true);
+                break;
+	    }
+	case BaseServer.SERVER_START_FAILED:
+	    {
+		enter_button.setText(stringToHTML(BaseServer.dictionary.get("ServerControl.StartServer")));
+		enter_button.setEnabled(true);
+		fMenu.setEnabled(true);
+		break;	
+	    }
+	case BaseServer.BROWSER_LAUNCHED:
+	    {
+		info_label.setText(stringToHTML(BaseServer.dictionary.get("ServerControl.Help_RestartLibrary")));
+		enter_button.setText(stringToHTML(BaseServer.dictionary.get("ServerControl.RestartLibrary")));
+		thisframe.setState(Frame.ICONIFIED);
+		enter_button.setEnabled(true);
+                fMenu.setEnabled(true);
+		break;
+	    }
+	case BaseServer.BROWSER_LAUNCH_FAILED:
+	    {
+		enter_button.setText(stringToHTML(BaseServer.dictionary.get("ServerControl.EnterLibrary")));
+		enter_button.setEnabled(true);
+		fMenu.setEnabled(true);
+                 break;	
+	    }
+        default:{
+	    enter_button.setEnabled(false);
+	    fMenu.setEnabled(false);
+	}
+	}
+    }
+           
+   
+    public void displayMessage(String message){
+	info_label.setText(stringToHTML("<br>"+message));           
+    }
+    
+    private class MyAdapter extends WindowAdapter{   
+	public void windowClosing(WindowEvent env){
+            Thread runInThread = new Thread(new Runnable(){
+			    public void run(){
+				server.stop();
+				
+			    }
+		},"stop server");
+	    try{
+		runInThread.start(); 
+	    }
+	    catch(Exception e){
+		logger.error(e);
+	    }  
+	    thisframe.dispose();
+	}
+    } 
+
+    private String stringToHTML(String s){
+	return "<html><body>"+s+"</body></html>";	
+    }
+    
+    private class EnterButtonListener
+	implements ActionListener {
+	
+	public void actionPerformed(ActionEvent ev) {
+	    switch (server.getServerState()){
+	    case BaseServer.SERVER_STARTED: case BaseServer.BROWSER_LAUNCH_FAILED:
+		{
+		 Thread runInThread = new Thread(new Runnable(){
+			    public void run(){
+			    server.launchBrowser();
+			    }
+			},"launch browser");
+		    
+		    runInThread.start(); 
+                   break;     
+		}
+	    case BaseServer.SERVER_START_FAILED:
+		{
+		    Thread runInThread = new Thread(new Runnable(){
+			    public void run(){
+				server.start();
+			    }
+			},"start server");
+		    runInThread.start();
+		    break;
+		}  	
+	    case BaseServer.BROWSER_LAUNCHED:
+		{
+		    Thread runInThread = new Thread(new Runnable(){
+			    public void run(){
+				server.restart();
+				  
+			    }
+			},"restart server");
+		    runInThread.start();
+		}  
+	    }   
+	  
+	}
+    }
+}
Index: /greenstone3/trunk/src/java/org/greenstone/server/BaseServerSettings.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/server/BaseServerSettings.java	(revision 18558)
+++ /greenstone3/trunk/src/java/org/greenstone/server/BaseServerSettings.java	(revision 18558)
@@ -0,0 +1,294 @@
+package org.greenstone.server;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import javax.swing.*;
+
+import org.w3c.dom.*;
+
+import org.greenstone.gsdl3.util.GSXML;
+import org.greenstone.gsdl3.util.GlobalProperties;
+import org.greenstone.gsdl3.util.XMLConverter;
+
+import org.apache.log4j.*;
+
+public abstract class BaseServerSettings extends JDialog
+
+{
+
+    static Logger logger = Logger.getLogger(BaseServerSettings.class.getName());
+    static final int DEFPORT = 8080;
+
+    JCheckBox autoEnter;
+    JComboBox servlet_combobox;
+
+    protected JSpinner portNumber_spinner = null;
+    protected JTextField program_path_field = null;
+    protected JButton browse_button = null; 
+    protected JRadioButton default_browser_button = null ;
+    protected JRadioButton other_browser_button = null;
+    protected Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
+
+    static final private Dimension SIZE = new Dimension(300, 350);
+    static final Color bg_color = Color.white; 
+
+    protected int portNum = DEFPORT;
+    protected boolean autoStart = false;
+    protected String servletDefault = null;
+    protected String browserPath = "";
+    protected boolean useDefaultBrowser = true;
+
+    protected HashMap url_mappings = null;
+    protected JDialog self;
+    protected BaseServer server;
+     
+    public BaseServerSettings(BaseServer server) 
+    {
+	super((Frame)null, "", true);
+	this.self = this;
+        this.server = server;
+
+        try {
+	    this.portNum = Integer.parseInt(server.build_properties.getProperty(BaseServer.Property.WEB_PORT));
+	}
+        catch(Exception e){
+	    logger.error(e);
+	} 
+
+        this.browserPath = server.build_properties.getProperty(BaseServer.Property.BROWSER_PATH);
+        
+        if (this.browserPath == null || this.browserPath.equals("")){
+	    useDefaultBrowser = true;
+            this.browserPath = "";
+	}
+	else{
+	    useDefaultBrowser = false;
+	}
+
+	String auto_start_str = server.build_properties.getProperty(BaseServer.Property.AUTOSTART);
+	if ((auto_start_str.trim()).equals("true")) {
+	    this.autoStart = true;
+	} else {
+	    this.autoStart = false;
+	}
+
+	this.servletDefault = server.build_properties.getProperty(BaseServer.Property.DEFAULT_SERVLET).replaceAll("/","");
+
+	setSize(SIZE);
+	setTitle(server.dictionary.get("ServerSettings.Title"));
+
+	setLocation((screen.width - SIZE.width) / 2,
+		    (screen.height - SIZE.height) / 2);
+	setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
+
+	JLabel port_label = new JLabel(BaseServer.dictionary.get("ServerSettings.Tomcat_Port"));
+
+	portNumber_spinner = new JSpinner(new SpinnerNumberModel(portNum,1,65535,1));
+	portNumber_spinner.setEditor(new JSpinner.NumberEditor(portNumber_spinner, "#####")); 
+
+	autoEnter = new JCheckBox(server.dictionary.get("ServerSettings.Auto_Start"));
+	
+	if (autoStart) {
+	    autoEnter.setSelected(true);
+	} else {
+	    autoEnter.setSelected(false);
+	}
+	autoEnter.setBackground(bg_color);
+
+
+	JButton save_button = new JButton(BaseServer.dictionary.get("ServerSettings.OK"));
+	save_button.addActionListener(new SaveActionListener());
+
+	JButton exit_button = new JButton(BaseServer.dictionary.get("ServerSettings.Cancel"));
+	exit_button.addActionListener(new ActionListener() {
+		public void actionPerformed(ActionEvent ev) {
+		    self.dispose();
+		}
+	    });
+
+        JPanel  port_panel = new JPanel();    
+        port_panel.setLayout(new FlowLayout(FlowLayout.LEFT));
+	port_panel.add(port_label);
+	port_panel.add(portNumber_spinner);
+	port_panel.setBackground(bg_color);
+
+	JPanel comb_panel = createServletPanel();
+        
+	JPanel  check_panel = new JPanel(); 
+       	check_panel.setLayout(new FlowLayout(FlowLayout.LEFT));
+        check_panel.add(autoEnter);
+        check_panel.setBackground(bg_color);
+
+	JPanel mid_panel = new JPanel();
+        mid_panel.setLayout(new GridLayout(3,1));
+	mid_panel.add(port_panel);
+	mid_panel.add(check_panel);
+	mid_panel.add(comb_panel);
+	mid_panel.setBackground(bg_color);
+	mid_panel.setBorder(BorderFactory.createEmptyBorder(5,10,5,10));
+
+
+	JPanel browser_panel = new JPanel();
+        browser_panel.setLayout(new GridLayout(4,1));
+        default_browser_button = new JRadioButton(BaseServer.dictionary.get("ServerSettings.DefaultBrowser"));
+        other_browser_button = new JRadioButton(BaseServer.dictionary.get("ServerSettings.OtherBrowser"));
+        other_browser_button.addActionListener(new BrowserSelectionListener());
+        default_browser_button.addActionListener(new BrowserSelectionListener());
+
+	ButtonGroup bg = new ButtonGroup();
+        bg.add(default_browser_button);
+        bg.add(other_browser_button);
+        default_browser_button.setBorder(BorderFactory.createEmptyBorder(5,10,5,0));
+        default_browser_button.setBackground(bg_color);     
+        other_browser_button.setBorder(BorderFactory.createEmptyBorder(5,10,5,0)); 
+        other_browser_button.setBackground(bg_color);
+        JPanel browse_program_panel = new JPanel();     
+        browse_program_panel.setLayout(new BorderLayout());
+        program_path_field = new JTextField(this.browserPath);
+        browse_button = new JButton(BaseServer.dictionary.get("ServerSettings.Browse"));
+	browse_program_panel.add(program_path_field,BorderLayout.CENTER);
+        browse_program_panel.add(browse_button,BorderLayout.EAST);
+        browse_program_panel.setBorder(BorderFactory.createEmptyBorder(5,10,5,0));
+	browse_program_panel.setBackground(bg_color);
+        browser_panel.add(new JLabel(BaseServer.dictionary.get("ServerSettings.ChooseBrowser")));
+        browser_panel.add(default_browser_button);
+	browser_panel.add(other_browser_button);
+        browser_panel.add(browse_program_panel);
+	browser_panel.setBorder(BorderFactory.createEmptyBorder(5,10,5,10));
+        browser_panel.setBackground(bg_color);
+	if (useDefaultBrowser){
+	    default_browser_button.setSelected(true);
+	    program_path_field.setEnabled(false);
+	    browse_button.setEnabled(false); 
+	}
+	else{
+	    other_browser_button.setSelected(true);
+	}
+        browse_button.addActionListener(new BrowseActionListener());       
+        
+        JPanel down_panel = new JPanel();
+	down_panel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
+	down_panel.add(save_button);
+	down_panel.add(exit_button);
+	down_panel.setBackground(bg_color);
+	down_panel.setBorder(BorderFactory.createEmptyBorder(5,10,5,10));
+
+        getContentPane().add(mid_panel, BorderLayout.NORTH);
+        getContentPane().add(browser_panel, BorderLayout.CENTER);
+	getContentPane().add(down_panel, BorderLayout.SOUTH);
+	getContentPane().setBackground(bg_color);
+	setVisible(true);
+    }
+
+
+    protected abstract JPanel createServletPanel();
+
+
+    private class BrowseActionListener 
+ 	implements ActionListener {
+	
+	public void actionPerformed(ActionEvent ev) {
+	    JFileChooser chooser = new JFileChooser();
+           int returnVal = chooser.showOpenDialog(self);        
+	   
+	    if(returnVal == JFileChooser.APPROVE_OPTION) {
+                File program_path = chooser.getSelectedFile();
+		program_path_field.setText(program_path.getPath());
+	    } 
+	}
+
+     }
+
+    private class BrowserSelectionListener 
+ 	implements ActionListener {
+	
+	public void actionPerformed(ActionEvent ev) {
+	    if (default_browser_button.isSelected()){
+		program_path_field.setEnabled(false);
+                browse_button.setEnabled(false);
+	    }
+            else{
+		program_path_field.setEnabled(true);
+                browse_button.setEnabled(true);
+	    }
+	}
+
+     }
+    
+
+    private class SaveActionListener
+	implements ActionListener {
+	
+	public void actionPerformed(ActionEvent ev) {
+	    // save everything to build_properties if things have changed
+	     boolean has_changed = false;
+             boolean require_restart = false;
+	    if (portNum != ((Integer)portNumber_spinner.getValue()).intValue()) {
+		has_changed = true;
+                require_restart = true; 
+                server.reconfigRequired();
+                portNum = ((Integer)portNumber_spinner.getValue()).intValue();
+             	logger.info("port changed, new port is "+portNumber_spinner.getValue());
+	    }
+	    if (autoStart != autoEnter.isSelected()) {
+            	has_changed = true;
+	    }
+	    if (!servletDefault.equals(servlet_combobox.getSelectedItem())) {
+         	has_changed = true;
+                require_restart = true; 
+	    }
+            //changed to use other browser
+            if (useDefaultBrowser && other_browser_button.isSelected()){
+		browserPath = program_path_field.getText();
+		has_changed = true;
+	    } 
+	    //the browser path has been changed 
+	    if ( !useDefaultBrowser && !browserPath.equals(program_path_field.getText())){
+		browserPath = program_path_field.getText();
+		 has_changed = true;
+	    }
+	    
+            //changed to use the default browser
+	    if ( default_browser_button.isSelected() && !useDefaultBrowser){
+		browserPath = "";
+		has_changed = true;
+	    }
+             
+
+	    if (has_changed) {
+		ArrayList oldFileLines = null;
+		ArrayList newFileLines = null;
+		
+		ScriptReadWrite scriptReadWrite = new ScriptReadWrite();
+		oldFileLines = scriptReadWrite.readInFile(BaseServer.build_properties_file);
+		
+		newFileLines = scriptReadWrite.queryReplace(oldFileLines, BaseServer.Property.WEB_PORT, portNum+"");
+		
+		String newAutoEnter = (new Boolean(autoEnter.isSelected())).toString();
+		newFileLines = scriptReadWrite.queryReplace(newFileLines, BaseServer.Property.AUTOSTART, newAutoEnter);
+		
+		String newServletDef = (String) servlet_combobox.getSelectedItem();
+		newFileLines = scriptReadWrite.queryReplace(newFileLines,BaseServer.Property.DEFAULT_SERVLET, (String) url_mappings.get(newServletDef));
+
+		String osName = System.getProperty("os.name");
+                if (osName.startsWith("Windows")){
+		    browserPath = browserPath.replaceAll("\\\\","/");
+		}
+                 newFileLines = scriptReadWrite.queryReplace(newFileLines,BaseServer.Property.BROWSER_PATH, browserPath);
+
+		scriptReadWrite.writeOutFile(BaseServer.build_properties_file,
+					     newFileLines);
+		server.reloadBuildProperties();
+		if (require_restart){
+		    JOptionPane.showMessageDialog(null,server.dictionary.get("ServerSetting.SettingChanged"),"Info", JOptionPane.INFORMATION_MESSAGE);
+		}
+	    } 
+
+	    self.dispose();
+	}
+    }
+
+}
Index: /greenstone3/trunk/src/java/org/greenstone/server/BrowserLauncher.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/server/BrowserLauncher.java	(revision 18557)
+++ /greenstone3/trunk/src/java/org/greenstone/server/BrowserLauncher.java	(revision 18558)
@@ -41,10 +41,10 @@
 	    // we use cmd and start
 	    if (Misc.isWindows9x()) {
-		this.command = StaticStrings.WIN_9X_OPEN_COMMAND;//"command.com /c start \""+url+"\"";
+		this.command = BaseServer.Property.WIN_9X_OPEN_COMMAND;//"command.com /c start \""+url+"\"";
 	    } else {
-		this.command = StaticStrings.WIN_OPEN_COMMAND;//"cmd.exe /c start \"\" \""+url+"\"";
+		this.command = BaseServer.Property.WIN_OPEN_COMMAND;//"cmd.exe /c start \"\" \""+url+"\"";
 	    }
 	} else if (Misc.isMac()) {
-	    this.command = StaticStrings.MAC_OPEN_COMMAND; // "open %1"
+	    this.command = BaseServer.Property.MAC_OPEN_COMMAND; // "open %1"
 	} else {
 	     // we try to look for a browser
Index: /greenstone3/trunk/src/java/org/greenstone/server/RunAnt.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/server/RunAnt.java	(revision 18557)
+++ /greenstone3/trunk/src/java/org/greenstone/server/RunAnt.java	(revision 18558)
@@ -1,64 +1,25 @@
 package org.greenstone.server;
 
-import java.io.IOException;
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
+import org.greenstone.server.RunTarget;
 
-import org.greenstone.server.StreamGobbler;
+public class RunAnt extends RunTarget 
+{
+    public RunAnt()
+    {
+	super();
 
-import org.apache.log4j.*;
-
-public class RunAnt extends Thread {
-    private String antCmd = "";
-    static Logger logger = Logger.getLogger(org.greenstone.server.RunAnt.class.getName());
-    private int state = -1; //success: 0 error: 1    
-    public static int SUCCESS = 0;
-    public static int FAILED = 1; 
-
-    private String antSuccess = "BUILD SUCCESSFUL";
-    private String antFailed = "BUILD FAILED";
-    private String antFinished = "Total time";
-
-    public void run() {
-	 
-	 try {
-	     state = -1;
-	     Runtime run = Runtime.getRuntime();
-             Process process = run.exec(getAntCmd());
-	     BufferedReader br = new BufferedReader(new InputStreamReader(process.getInputStream()));
-	     String line = null;
-             while (!(line = br.readLine()).startsWith(antFinished)){
-                 
-		 if (line.equals(antSuccess)){
-		     state = 0;
-		 }
-     
-		 if (line.equals(antFailed)){
-		     state = 1; 
-                  }
-		 logger.info(line);
-	     }    
-	 } catch (Exception e) {
-	     logger.error(e);
-	     state = 1;
-	 } 
-    }
-  
-    public int getAntState(){
-	return state;     
+	targetSuccess  = "BUILD SUCCESSFUL";
+	targetFailed   = "BUILD FAILED";
+	targetFinished = "Total time";
     }
     
-    public void setAntCmd(String cmd) {
+    public void setTargetCmd(String target) 
+    {
 	String osName = System.getProperty("os.name");
       	if (osName.startsWith("Windows")) {
-	    this.antCmd = "ant.bat " + cmd;
+	    targetCmd = "ant.bat " + target;
 	} else {
-	    this.antCmd = "ant " + cmd;
+	    targetCmd = "ant " + target;
 	}
     }
-
-    public String getAntCmd() {
-	return this.antCmd;
-    }
 }
Index: /greenstone3/trunk/src/java/org/greenstone/server/RunMake.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/server/RunMake.java	(revision 18558)
+++ /greenstone3/trunk/src/java/org/greenstone/server/RunMake.java	(revision 18558)
@@ -0,0 +1,27 @@
+package org.greenstone.server;
+
+import org.greenstone.server.RunTarget;
+
+public class RunMake extends RunTarget 
+{
+
+    public RunMake()
+    {
+	super();
+
+	targetSuccess  = "MAKE SUCCESSFUL";
+	targetFailed   = "MAKE FAILED";
+	targetFinished = "MAKE DONE";
+    }
+
+
+    public void setTargetCmd(String target) 
+    {
+	String osName = System.getProperty("os.name");
+      	if (osName.startsWith("Windows")) {
+	    targetCmd = "fakemake.bat " + target;
+	} else {
+	    targetCmd = "make " + target;
+	}
+    }
+}
Index: /greenstone3/trunk/src/java/org/greenstone/server/RunTarget.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/server/RunTarget.java	(revision 18558)
+++ /greenstone3/trunk/src/java/org/greenstone/server/RunTarget.java	(revision 18558)
@@ -0,0 +1,67 @@
+package org.greenstone.server;
+
+import java.io.IOException;
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import org.greenstone.server.StreamGobbler;
+
+import org.apache.log4j.*;
+
+public abstract class RunTarget extends Thread 
+{
+    protected String targetCmd = "";
+    protected static Logger logger = Logger.getLogger(RunTarget.class.getName());
+
+    protected int state = -1; //success: 0 error: 1    
+    public static int SUCCESS = 0;
+    public static int FAILED  = 1; 
+
+    protected String targetSuccess;
+    protected String targetFailed;
+    protected String targetFinished;
+
+    public void run() 
+    {
+	 
+	 try {
+	     state = -1;
+	     Runtime run = Runtime.getRuntime();
+
+	     String targetCmd = getTargetCmd();
+	     logger.info("Target: " + targetCmd);
+
+             Process process = run.exec(targetCmd);
+	     BufferedReader br = new BufferedReader(new InputStreamReader(process.getInputStream()));
+	     String line = null;
+             while (!(line = br.readLine()).startsWith(targetFinished)){
+                 
+		 if (line.equals(targetSuccess)){
+		     state = 0;
+		 }
+     
+		 if (line.equals(targetFailed)){
+		     state = 1; 
+                  }
+		 logger.info(line);
+	     }    
+	 } catch (Exception e) {
+	     e.printStackTrace();
+	     logger.error(e);
+	     state = 1;
+	 } 
+    }
+  
+    public int getTargetState()
+    {
+	return state;     
+    }
+    
+    public abstract void setTargetCmd(String cmd);
+
+    public String getTargetCmd() 
+    {
+	return this.targetCmd;
+    }
+}
Index: eenstone3/trunk/src/java/org/greenstone/server/Server.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/server/Server.java	(revision 18557)
+++ 	(revision )
@@ -1,238 +1,0 @@
-
-package org.greenstone.server;
-
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.io.File;
-import java.io.InputStream;
-import java.util.Properties;
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
-import org.apache.log4j.*;
-
-import org.greenstone.gsdl3.util.Dictionary;
-import org.greenstone.gsdl3.util.GlobalProperties;
-
-public class Server {
-     /** Ant command for managing Tomcat */
-    static final private String START_CMD = "start";
-    static final private String RESTART_CMD = "restart";
-    static final private String CONFIGURE_CMD = "configure";
-    static final private String STOP_CMD = "stop";
-
-    public static final int SERVER_STARTED = 0;
-    public static final int SERVER_START_FAILED = 1;
-    public static final int BROWSER_LAUNCHED = 2;
-    public static final int BROWSER_LAUNCH_FAILED = 3; 
-    
-    private int server_state = -1;    
-
-    private boolean configure_required = true;
-
-    public static File build_properties_file;
-    public static Properties build_properties;
-    public static Dictionary dictionary;
-     
-    private ServerControl server_control;    
-
-    static Logger logger = Logger.getLogger(org.greenstone.server.Server.class.getName());
-    
-    public Server(String gsdl3_src_home)
-    {
-	
-	String build_properties_path=gsdl3_src_home+File.separatorChar+"build.properties";
-	this.build_properties_file = new File(build_properties_path);
-	if (!this.build_properties_file.exists()) {
-	    logger.fatal("Can't find build.properties file "+build_properties_path);
-	    System.exit(1);
-	}
-	
-	build_properties = new Properties();
-	reloadBuildProperties();
-	
-	// make it dynamic language
-	this.dictionary = new Dictionary("server", "en", this.getClass().getClassLoader());
-	
-	server_control = new ServerControl(this);
-	
-	String auto_start = build_properties.getProperty(StaticStrings.AUTOSTART_PROPERTY);
-	if (auto_start != null && auto_start.equals("true")) {
-	    restart();
-	}
-	else{
-	    start();
-	}  
-         
-   }
-
-    public int getServerState(){
-	return server_state;
-    }
-
-    private int runAnt(String cmd){
-	RunAnt runAnt = new RunAnt();
-	runAnt.setAntCmd(cmd);
-	runAnt.run();
-   	return runAnt.getAntState();
-    }
-
-
-    public void reconfigRequired(){
-	configure_required = true;
-    }
-
-    public void start() {
-        int state = -1;
-        server_state = -1;
-	server_control.updateControl();
-
-	server_control.displayMessage(dictionary.get("ServerControl.Starting"));
-	stop(true); // silent, no messages displayed
-	
-  	// reconfigure if necessary
-        if (configure_required){
-	    server_control.displayMessage(dictionary.get("ServerControl.Configuring"));
-	    state = runAnt(CONFIGURE_CMD);
-	    
-	   if (state != RunAnt.SUCCESS){
-	       recordError(CONFIGURE_CMD);
-	   }
-	   GlobalProperties.reload(); // properties file may have changed, so reload it
-	   configure_required = false;
-	}
-	else{
-	    recordSuccess(CONFIGURE_CMD); 
-	}
-	
-        state = runAnt(START_CMD);
-
-	if (state != RunAnt.SUCCESS){
-	    recordError(START_CMD);
-            server_state = SERVER_START_FAILED;  
-            
-	}	            
-	else{
-	    recordSuccess(START_CMD); 
-            server_state = SERVER_STARTED; 
-       	} 
-
-       	server_control.updateControl();
-    }
-    
-    private void recordError(String message){
-        message = dictionary.get("ServerControl.Error",new String[]{message,GlobalProperties.getGSDL3Home()});
-	server_control.displayMessage(message);
-	logger.error(dictionary.get("ServerControl.Failed",new String[]{message}));
-    }
-
-
-    private void recordError(String message, Exception e){
-        message = dictionary.get("ServerControl.Error",new String[]{message,GlobalProperties.getGSDL3Home()});
-	server_control.displayMessage(message);
-	logger.error(dictionary.get("ServerControl.Failed",new String[]{message}),e);
-    }
-
-    private void recordSuccess(String message){
-        message = dictionary.get("ServerControl.Success",new String[]{message});
-	server_control.displayMessage(message);
-	logger.info(message);
-    }
-
-   
-    public void launchBrowser() {
-        server_state = -1;
-        server_control.updateControl();   
-        String message = dictionary.get("ServerControl.LaunchingBrowser");
-    	server_control.displayMessage(message); 
-	String url = GlobalProperties.getGSDL3WebAddress()+ build_properties.getProperty(StaticStrings.DEFAULT_SERVLET_PROPERTY);
-	BrowserLauncher launcher = new BrowserLauncher(build_properties.getProperty(StaticStrings.BROWSER_PATH),url);
-        logger.info(message);
-
-	launcher.start();
-     
-        //wait for a while
-        while(launcher.getBrowserState() == -1){
-            try{
-		Thread.sleep(3000);
-	    }
-	    catch(Exception e){
-		logger.error(e);
-	    }
-         } 
-
-	if (launcher.getBrowserState() != BrowserLauncher.LAUNCHSUCCESS ){
-	    recordError(dictionary.get("ServerControl.LaunchBrowser")); 
-	    server_state = BROWSER_LAUNCH_FAILED; 
-	}
-	else{
-	    recordSuccess(dictionary.get("ServerControl.LaunchBrowser")); 
-	    server_state = BROWSER_LAUNCHED;
-	}    
-        
-	server_control.updateControl();        
-    }
-    
-    public void restart(){
-	start();       
-        if (server_state == SERVER_STARTED){
-	    launchBrowser();
-	}  
-    }
-
-    // Preserving the current behaviour of stop() which is to
-    // display the message on stopping
-    public void stop() {
-	stop(false);
-    }
-
-    public void stop(boolean silent) {
-	if(!silent) {
-	    server_control.displayMessage(dictionary.get("ServerControl.Stopping"));
-	}
-	int state = runAnt(STOP_CMD);
-	
-        if (state != RunAnt.SUCCESS){
-	    recordError(STOP_CMD);
-	}
-	else{
-	    recordSuccess(STOP_CMD);
-	}
-
-    }
-    
-    public  void reloadBuildProperties() {
-	try {
-	    InputStream in = this.getClass().getClassLoader().getResourceAsStream("build.properties");
-	    
-	    if (in != null) {
-		logger.info("loading build properties");
-		build_properties.load(in);
-		in.close();
-	    } else {
-		logger.error("couldn't load build properties!");
-	    }
-	} catch (Exception e) {
-	    logger.error("Exception trying to reload build.properties: "+e);
-	}
-	
-    }
-
-  
-
-    public static void main (String[] args){
-    	if (args.length != 1) {
-	    System.err.println("Usage: java org.greenstone.server.ServerMain <gsdl3 src home> ");
-	    System.exit(1);
-	}
-	
-	File gsdl3_src_dir = new File(args[0]);
-	if (!gsdl3_src_dir.isDirectory()) {
-	    System.err.println("src directory does not exist!");
-	    System.exit(1);
-	}
-	
-	new Server(args[0]);
-    }
-}
Index: /greenstone3/trunk/src/java/org/greenstone/server/Server2.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/server/Server2.java	(revision 18558)
+++ /greenstone3/trunk/src/java/org/greenstone/server/Server2.java	(revision 18558)
@@ -0,0 +1,56 @@
+
+package org.greenstone.server;
+
+import java.io.File;
+
+import org.greenstone.server.BaseServer;
+import org.greenstone.server.BaseProperty;
+
+public class Server2 extends BaseServer 
+{
+    
+    public Server2(String gsdl2_home, String lang)
+    {
+	super(gsdl2_home,lang);	
+
+	Property = new Server2Property();
+
+	String frame_title = dictionary.get("ServerControl.Frame_Title");
+	server_control_ = new Server2Control(this,frame_title);
+
+	/** Make command tagets for managing Web server */
+	START_CMD     = "web-start";
+	RESTART_CMD   = "web-restart";
+	CONFIGURE_CMD = "web-configure";
+	STOP_CMD      = "web-stop";
+
+	autoStart();
+    }
+
+    protected int runTarget(String cmd)
+    {
+	RunMake runMake = new RunMake();
+	runMake.setTargetCmd(cmd);
+	runMake.run();
+   	return runMake.getTargetState();
+    }
+
+
+    public static void main (String[] args)
+    {
+    	if ((args.length < 1) || (args.length>2)) {
+	    System.err.println("Usage: java org.greenstone.server.Server2 <gsdl2-home-dir> [lang]");
+	    System.exit(1);
+	}
+	
+	String gsdl2_home = args[0];
+	File gsdl2_dir = new File(gsdl2_home);
+	if (!gsdl2_dir.isDirectory()) {
+	    System.err.println("gsdl-home-dir directory does not exist!");
+	    System.exit(1);
+	}
+	
+	String lang = (args.length==2) ? args[1] : "en";
+	new Server2(gsdl2_home,lang);
+    }
+}
Index: /greenstone3/trunk/src/java/org/greenstone/server/Server2Control.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/server/Server2Control.java	(revision 18558)
+++ /greenstone3/trunk/src/java/org/greenstone/server/Server2Control.java	(revision 18558)
@@ -0,0 +1,35 @@
+package org.greenstone.server;
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+
+import org.greenstone.server.BaseServerControl;
+
+/**
+ * This class is to start or restart the Greenstone library server
+ * 
+ */
+
+public class Server2Control extends BaseServerControl 
+{
+    
+    public Server2Control(BaseServer server,String frame_title) 
+    {
+	super(server,frame_title);
+    }
+
+    protected JMenuBar createMenu() 
+    {
+	JMenuItem iConf = new JMenuItem(BaseServer.dictionary.get("ServerControl.Menu.Settings"));
+	iConf.setBackground(Color.white);
+	iConf.addActionListener(new ActionListener() {
+		public void actionPerformed(ActionEvent ae) {
+		    BaseServerSettings serverSetting = new Server2Settings(server);
+		}
+	    });
+
+	return createMenu(iConf);
+    }
+}
+
Index: /greenstone3/trunk/src/java/org/greenstone/server/Server2Property.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/server/Server2Property.java	(revision 18558)
+++ /greenstone3/trunk/src/java/org/greenstone/server/Server2Property.java	(revision 18558)
@@ -0,0 +1,13 @@
+package org.greenstone.server;
+
+import org.greenstone.server.BaseProperty;
+
+public class Server2Property extends BaseProperty 
+{
+    Server2Property()
+    {
+	GSDL_HOME = "gsdl2.home";
+	GSDL_VERSION = "gsdl2.version";
+    }
+
+}
Index: /greenstone3/trunk/src/java/org/greenstone/server/Server2Settings.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/server/Server2Settings.java	(revision 18558)
+++ /greenstone3/trunk/src/java/org/greenstone/server/Server2Settings.java	(revision 18558)
@@ -0,0 +1,21 @@
+package org.greenstone.server;
+
+import javax.swing.*;
+
+
+import org.greenstone.server.BaseServerSettings;
+
+public class Server2Settings extends BaseServerSettings
+
+{
+    public Server2Settings(BaseServer server) 
+    {
+	super(server);
+    }
+
+    protected JPanel createServletPanel()
+    {
+	return null;
+    }
+    
+}
Index: /greenstone3/trunk/src/java/org/greenstone/server/Server3.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/server/Server3.java	(revision 18558)
+++ /greenstone3/trunk/src/java/org/greenstone/server/Server3.java	(revision 18558)
@@ -0,0 +1,55 @@
+
+package org.greenstone.server;
+
+import java.io.File;
+
+import org.greenstone.server.BaseServer;
+import org.greenstone.server.BaseProperty;
+
+public class Server3 extends BaseServer
+{
+    
+    public Server3(String gsdl3_src_home, String lang)
+    {
+	super(gsdl3_src_home,lang);         
+
+	Property = new Server3Property();
+
+	String frame_title = dictionary.get("ServerControl.Frame_Title");
+	server_control_ = new Server3Control(this,frame_title);
+
+	/** Ant command tagets for managing Web server */
+	START_CMD     = "start";
+	RESTART_CMD   = "restart";
+	CONFIGURE_CMD = "configure";
+	STOP_CMD      = "stop";
+
+	autoStart();
+    }
+        
+    protected int runTarget(String cmd)
+    {
+	RunAnt runAnt = new RunAnt();
+	runAnt.setTargetCmd(cmd);
+	runAnt.run();
+   	return runAnt.getTargetState();
+    }
+    
+    public static void main (String[] args) 
+    {
+    	if ((args.length < 1) || (args.length>2)) {
+	    System.err.println("Usage: java org.greenstone.server.Server3 <gsdl3-src-home> [lang]");
+	    System.exit(1);
+	}
+
+	String gsdl3_src_home = args[0];	
+	File gsdl3_src_dir = new File(gsdl3_src_home);
+	if (!gsdl3_src_dir.isDirectory()) {
+	    System.err.println("src directory does not exist!");
+	    System.exit(1);
+	}
+
+	String lang = (args.length==2) ? args[1] : "en";
+	new Server3(gsdl3_src_home,lang);
+    }
+}
Index: /greenstone3/trunk/src/java/org/greenstone/server/Server3Control.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/server/Server3Control.java	(revision 18558)
+++ /greenstone3/trunk/src/java/org/greenstone/server/Server3Control.java	(revision 18558)
@@ -0,0 +1,33 @@
+package org.greenstone.server;
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+
+import org.greenstone.server.BaseServerControl;
+
+/**
+ * This class is to start or restart the Greenstone 3 library server
+ * 
+ */
+public class Server3Control extends BaseServerControl 
+{
+    
+    public Server3Control(BaseServer server,String frame_title) 
+    {
+	super(server,frame_title);
+    }
+
+    protected JMenuBar createMenu() 
+    {
+	JMenuItem iConf = new JMenuItem(BaseServer.dictionary.get("ServerControl.Menu.Settings"));
+	iConf.setBackground(Color.white);
+	iConf.addActionListener(new ActionListener() {
+		public void actionPerformed(ActionEvent ae) {
+		    BaseServerSettings serverSetting = new Server3Settings(server);
+		}
+	    });
+
+	return createMenu(iConf);
+    }
+}
Index: /greenstone3/trunk/src/java/org/greenstone/server/Server3Property.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/server/Server3Property.java	(revision 18558)
+++ /greenstone3/trunk/src/java/org/greenstone/server/Server3Property.java	(revision 18558)
@@ -0,0 +1,13 @@
+package org.greenstone.server;
+
+import org.greenstone.server.BaseProperty;
+
+public class Server3Property extends BaseProperty 
+{
+    Server3Property()
+    {
+	GSDL_HOME = "gsdl3.home";
+	GSDL_VERSION = "gsdl3.version";
+    }
+
+}
Index: /greenstone3/trunk/src/java/org/greenstone/server/Server3Settings.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/server/Server3Settings.java	(revision 18558)
+++ /greenstone3/trunk/src/java/org/greenstone/server/Server3Settings.java	(revision 18558)
@@ -0,0 +1,179 @@
+package org.greenstone.server;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import javax.swing.*;
+
+import org.w3c.dom.*;
+
+import org.greenstone.gsdl3.util.GSXML;
+import org.greenstone.gsdl3.util.GlobalProperties;
+import org.greenstone.gsdl3.util.XMLConverter;
+
+import org.greenstone.server.BaseServerSettings;
+
+public class Server3Settings extends BaseServerSettings
+
+{
+    public Server3Settings(BaseServer server) 
+    {
+	super(server);
+    }
+
+    protected JPanel createServletPanel()
+    {
+
+	JLabel servlet_label = new JLabel(server.dictionary.get("ServerSettings.Servlet"));
+
+	servlet_combobox = new JComboBox();
+	servlet_combobox.setMaximumRowCount(5);
+	servlet_combobox.setBackground(bg_color);
+
+	File web_xml = new File(GlobalProperties.getProperty(BaseServer.Property.GSDL_HOME) + File.separator + "WEB-INF" + File.separator + "web.xml");
+	XMLConverter converter = new XMLConverter();
+	Document web_config = converter.getDOM(web_xml);
+	if (web_config == null) {
+	    logger.error("web.xml is null! "+web_xml.getAbsolutePath());
+	    return null;
+	}
+
+	NodeList servlet_mappings = web_config.getElementsByTagName("servlet-mapping");
+	// make a little map class
+	url_mappings = new HashMap();
+	for (int i = 0; i < servlet_mappings.getLength(); i++) {
+	    Element map = (Element) servlet_mappings.item(i);
+	    Element servlet_name_elem = (Element) GSXML.getChildByTagName(map, "servlet-name");
+	    String name = GSXML.getNodeText(servlet_name_elem);
+	    Element url_pattern_elem = (Element) GSXML.getChildByTagName(map, "url-pattern");
+	    String pattern = GSXML.getNodeText(url_pattern_elem);
+	    // Ignore the Axis servlets
+	    if (!(name.equals("AxisServlet"))) {
+		servlet_combobox.addItem(name.trim());
+		url_mappings.put(name, pattern);
+	    }
+
+	    if (name.equals(servletDefault)) {
+		servlet_combobox.setSelectedItem(name);
+	    }
+	}
+
+
+        JPanel comb_panel = new JPanel();
+	comb_panel.setLayout(new FlowLayout(FlowLayout.LEFT));
+	comb_panel.add(servlet_label);
+	comb_panel.add(servlet_combobox);
+	comb_panel.setBackground(bg_color);
+
+	return comb_panel;
+    }
+
+
+
+    private class BrowseActionListener 
+ 	implements ActionListener {
+	
+	public void actionPerformed(ActionEvent ev) {
+	    JFileChooser chooser = new JFileChooser();
+           int returnVal = chooser.showOpenDialog(self);        
+	   
+	    if(returnVal == JFileChooser.APPROVE_OPTION) {
+                File program_path = chooser.getSelectedFile();
+		program_path_field.setText(program_path.getPath());
+	    } 
+	}
+
+     }
+
+    private class BrowserSelectionListener 
+ 	implements ActionListener {
+	
+	public void actionPerformed(ActionEvent ev) {
+	    if (default_browser_button.isSelected()){
+		program_path_field.setEnabled(false);
+                browse_button.setEnabled(false);
+	    }
+            else{
+		program_path_field.setEnabled(true);
+                browse_button.setEnabled(true);
+	    }
+	}
+
+     }
+    
+
+    private class SaveActionListener
+	implements ActionListener {
+	
+	public void actionPerformed(ActionEvent ev) {
+	    // save everything to build_properties if things have changed
+	     boolean has_changed = false;
+             boolean require_restart = false;
+	    if (portNum != ((Integer)portNumber_spinner.getValue()).intValue()) {
+		has_changed = true;
+                require_restart = true; 
+                server.reconfigRequired();
+                portNum = ((Integer)portNumber_spinner.getValue()).intValue();
+             	logger.info("port changed, new port is "+portNumber_spinner.getValue());
+	    }
+	    if (autoStart != autoEnter.isSelected()) {
+            	has_changed = true;
+	    }
+	    if (!servletDefault.equals(servlet_combobox.getSelectedItem())) {
+         	has_changed = true;
+                require_restart = true; 
+	    }
+            //changed to use other browser
+            if (useDefaultBrowser && other_browser_button.isSelected()){
+		browserPath = program_path_field.getText();
+		has_changed = true;
+	    } 
+	    //the browser path has been changed 
+	    if ( !useDefaultBrowser && !browserPath.equals(program_path_field.getText())){
+		browserPath = program_path_field.getText();
+		 has_changed = true;
+	    }
+	    
+            //changed to use the default browser
+	    if ( default_browser_button.isSelected() && !useDefaultBrowser){
+		browserPath = "";
+		has_changed = true;
+	    }
+             
+
+	    if (has_changed) {
+		ArrayList oldFileLines = null;
+		ArrayList newFileLines = null;
+		
+		ScriptReadWrite scriptReadWrite = new ScriptReadWrite();
+		oldFileLines = scriptReadWrite.readInFile(BaseServer.build_properties_file);
+		
+		newFileLines = scriptReadWrite.queryReplace(oldFileLines, BaseServer.Property.WEB_PORT, portNum+"");
+		
+		String newAutoEnter = (new Boolean(autoEnter.isSelected())).toString();
+		newFileLines = scriptReadWrite.queryReplace(newFileLines, BaseServer.Property.AUTOSTART, newAutoEnter);
+		
+		String newServletDef = (String) servlet_combobox.getSelectedItem();
+		newFileLines = scriptReadWrite.queryReplace(newFileLines,BaseServer.Property.DEFAULT_SERVLET, (String) url_mappings.get(newServletDef));
+
+		String osName = System.getProperty("os.name");
+                if (osName.startsWith("Windows")){
+		    browserPath = browserPath.replaceAll("\\\\","/");
+		}
+                 newFileLines = scriptReadWrite.queryReplace(newFileLines,BaseServer.Property.BROWSER_PATH, browserPath);
+
+		scriptReadWrite.writeOutFile(BaseServer.build_properties_file,
+					     newFileLines);
+		server.reloadBuildProperties();
+		if (require_restart){
+		    JOptionPane.showMessageDialog(null,server.dictionary.get("ServerSetting.SettingChanged"),"Info", JOptionPane.INFORMATION_MESSAGE);
+		}
+	    } 
+
+	    self.dispose();
+	}
+    }
+
+}
Index: eenstone3/trunk/src/java/org/greenstone/server/ServerControl.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/server/ServerControl.java	(revision 18557)
+++ 	(revision )
@@ -1,241 +1,0 @@
-package org.greenstone.server;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.io.File;
-import java.util.ArrayList;
-import javax.swing.*;
-import javax.swing.border.*;
-
-import org.greenstone.gsdl3.util.GlobalProperties;
-
-import org.apache.log4j.*;
-/**
- * This class is to start or restart the library server
- * 
- */
-public class ServerControl extends JFrame {
-
-    static Logger logger = Logger.getLogger(org.greenstone.server.ServerControl.class.getName());
- 
-    /** The dimension of the frame */
-    static final private Dimension FRAME_SIZE = new Dimension(350, 250);
-
-    Color bg_color = Color.white;    
-    
-    /** some components we need to refer to later */
-    private JLabel info_label;
-    private JButton enter_button;
-    private JMenu fMenu;
-    private Server server;
-    private JFrame thisframe;
-    
-    public ServerControl(Server server) {
-	super(Server.dictionary.get("ServerControl.Frame_Title"));
- 
-	this.server = server;
-        thisframe = this;
-
-	setSize(FRAME_SIZE);
-	setDefaultCloseOperation(EXIT_ON_CLOSE);
-	Dimension screen_size = Toolkit.getDefaultToolkit().getScreenSize();
-	setLocation((screen_size.width - FRAME_SIZE.width) / 2,
-		    (screen_size.height - FRAME_SIZE.height) / 2);
-	setBackground(Color.white);
-        addWindowListener(new MyAdapter()); 
-   
-        JPanel title_panel = new JPanel();
-	title_panel.setLayout(new BorderLayout());
-
-        JLabel title_label = new JLabel();
-        String title = Server.dictionary.get("ServerControl.Title");           
-        title_label.setText(stringToHTML(title)); 
-        title_label.setOpaque(false);	
-	title_label.setHorizontalAlignment(SwingConstants.CENTER);
-        title_label.setFont(new Font("SansSerif",Font.PLAIN,18));
-       
-
-        JLabel version_label = new JLabel();
-        String version = Server.dictionary.get("ServerControl.Version", new String [] {GlobalProperties.getProperty(StaticStrings.GSDL3_VERSION_PROPERTY)}).toLowerCase();
-         
-        version_label.setText(stringToHTML(version)); 
-        version_label.setOpaque(false);	
-	version_label.setHorizontalAlignment(SwingConstants.CENTER);
-        version_label.setFont(new Font("SansSerif",Font.PLAIN,14));
-        
-        title_panel.add(title_label,BorderLayout.CENTER);
-        title_panel.add(version_label,BorderLayout.SOUTH);
-	title_panel.setBackground(bg_color);	
-	title_panel.setBorder(BorderFactory.createEmptyBorder(5,10,5,10));
-
-   	info_label = new JLabel();
-        info_label.setOpaque(false);
-        info_label.setHorizontalAlignment(SwingConstants.LEFT);
-        info_label.setVerticalAlignment(SwingConstants.CENTER);
-        info_label.setFont(new Font("SansSerif",Font.PLAIN,14));
-	info_label.setBorder(BorderFactory.createEmptyBorder(5,10,5,10));	        
-		
-        JPanel button_panel = new JPanel(new FlowLayout(FlowLayout.CENTER));
-	enter_button = new JButton();
-	enter_button.setEnabled(false);
-	enter_button.addActionListener(new EnterButtonListener());
-        enter_button.setText(Server.dictionary.get("ServerControl.EnterLibrary"));
- 	button_panel.add(enter_button);
-	button_panel.setBackground(bg_color);	
-	button_panel.setBorder(BorderFactory.createEmptyBorder(5,10,5,10));
-
-	getContentPane().setLayout(new BorderLayout());
-	getContentPane().add(title_panel,BorderLayout.NORTH);
-	getContentPane().add(info_label,BorderLayout.CENTER);
-	getContentPane().add(button_panel,BorderLayout.SOUTH);
-	getContentPane().setBackground(bg_color);
-    	setJMenuBar(createMenu());
-	setVisible(true);
-    }
-
-    protected JMenuBar createMenu() {
-	JMenuBar menuBar = new JMenuBar();
-         fMenu = new JMenu(Server.dictionary.get("ServerControl.Menu.File"));
-	JMenuItem iConf = new JMenuItem(Server.dictionary.get("ServerControl.Menu.Settings"));
-	iConf.setBackground(Color.white);
-	iConf.addActionListener(new ActionListener() {
-		public void actionPerformed(ActionEvent ae) {
-		    ServerSettings serverSetting = new ServerSettings(server);
-		}
-	    });
-	
-	JMenuItem iExit = new JMenuItem(Server.dictionary.get("ServerControl.Menu.Exit"));
-	iExit.setBackground(Color.white);
-	iExit.addActionListener(new ActionListener() {
-		public void actionPerformed(ActionEvent ae) {
-		    Thread runInThread = new Thread(new Runnable(){
-			    public void run(){
-				server.stop();
-			    
-			    }
-			},"stop server");
-		    try{
-                        runInThread.start(); 
-		
-		    }
-		    catch(Exception e){
-			logger.error(e);
-		    }    
-		    thisframe.dispose();
-		}
-	    });
-	fMenu.add(iConf);
-	fMenu.add(iExit);
-	fMenu.setEnabled(false);
-	menuBar.add(fMenu);
-	menuBar.setBorder(new BevelBorder(BevelBorder.RAISED));
-	return menuBar;
-    }
-
-    public void updateControl(){
-      	switch (server.getServerState()){
-	case Server.SERVER_STARTED:
-	    {
-		info_label.setText(stringToHTML(Server.dictionary.get("ServerControl.Help_EnterLibrary")));
-		enter_button.setEnabled(true);
-		fMenu.setEnabled(true);
-                break;
-	    }
-	case Server.SERVER_START_FAILED:
-	    {
-		enter_button.setText(stringToHTML(Server.dictionary.get("ServerControl.StartServer")));
-		enter_button.setEnabled(true);
-		fMenu.setEnabled(true);
-		break;	
-	    }
-	case Server.BROWSER_LAUNCHED:
-	    {
-		info_label.setText(stringToHTML(Server.dictionary.get("ServerControl.Help_RestartLibrary")));
-		enter_button.setText(stringToHTML(Server.dictionary.get("ServerControl.RestartLibrary")));
-		thisframe.setState(Frame.ICONIFIED);
-		enter_button.setEnabled(true);
-                fMenu.setEnabled(true);
-		break;
-	    }
-	case Server.BROWSER_LAUNCH_FAILED:
-	    {
-		enter_button.setText(stringToHTML(Server.dictionary.get("ServerControl.EnterLibrary")));
-		enter_button.setEnabled(true);
-		fMenu.setEnabled(true);
-                 break;	
-	    }
-        default:{
-	    enter_button.setEnabled(false);
-	    fMenu.setEnabled(false);
-	}
-	}
-    }
-           
-   
-    public void displayMessage(String message){
-	info_label.setText(stringToHTML("<br>"+message));           
-    }
-    
-    private class MyAdapter extends WindowAdapter{   
-	public void windowClosing(WindowEvent env){
-            Thread runInThread = new Thread(new Runnable(){
-			    public void run(){
-				server.stop();
-				
-			    }
-		},"stop server");
-	    try{
-		runInThread.start(); 
-	    }
-	    catch(Exception e){
-		logger.error(e);
-	    }  
-	    thisframe.dispose();
-	}
-    } 
-
-    private String stringToHTML(String s){
-	return "<html><body>"+s+"</body></html>";	
-    }
-    
-    private class EnterButtonListener
-	implements ActionListener {
-	
-	public void actionPerformed(ActionEvent ev) {
-	    switch (server.getServerState()){
-	    case Server.SERVER_STARTED: case Server.BROWSER_LAUNCH_FAILED:
-		{
-		 Thread runInThread = new Thread(new Runnable(){
-			    public void run(){
-			    server.launchBrowser();
-			    }
-			},"launch browser");
-		    
-		    runInThread.start(); 
-                   break;     
-		}
-	    case Server.SERVER_START_FAILED:
-		{
-		    Thread runInThread = new Thread(new Runnable(){
-			    public void run(){
-				server.start();
-			    }
-			},"start server");
-		    runInThread.start();
-		    break;
-		}  	
-	    case Server.BROWSER_LAUNCHED:
-		{
-		    Thread runInThread = new Thread(new Runnable(){
-			    public void run(){
-				server.restart();
-				  
-			    }
-			},"restart server");
-		    runInThread.start();
-		}  
-	    }   
-	  
-	}
-    }
-}
Index: eenstone3/trunk/src/java/org/greenstone/server/ServerSettings.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/server/ServerSettings.java	(revision 18557)
+++ 	(revision )
@@ -1,324 +1,0 @@
-package org.greenstone.server;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import javax.swing.*;
-
-import org.w3c.dom.*;
-
-import org.greenstone.gsdl3.util.GSXML;
-import org.greenstone.gsdl3.util.GlobalProperties;
-import org.greenstone.gsdl3.util.XMLConverter;
-
-import org.apache.log4j.*;
-
-public class ServerSettings extends JDialog
-
-{
-
-    static Logger logger = Logger.getLogger(org.greenstone.server.ServerControl.class.getName());
-    static final int DEFPORT = 8080;
-    JCheckBox autoEnter;
-    JComboBox servlet_combobox;
-    private JSpinner portNumber_spinner = null;
-    private JTextField program_path_field = null;
-    private JButton browse_button = null; 
-    private JRadioButton default_browser_button = null ;
-    private JRadioButton other_browser_button = null;
-    private Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
-
-    static final private Dimension SIZE = new Dimension(300, 350);
-    static final Color bg_color = Color.white; 
-    private int portNum = DEFPORT;
-    private boolean autoStart = false;
-    private String servletDefault = null;
-    private String browserPath = "";
-    private boolean useDefaultBrowser = true;
-
-    private HashMap url_mappings = null;
-    private JDialog self;
-    private Server server;
-     
-    public ServerSettings(Server server) {
-	super((Frame)null, "", true);
-	this.self = this;
-        this.server = server;
-
-        try{
-	    this.portNum = Integer.parseInt(server.build_properties.getProperty(StaticStrings.TOMCAT_PORT_PROPERTY));
-	}
-        catch(Exception e){
-	    logger.error(e);
-	} 
-
-        this.browserPath = server.build_properties.getProperty(StaticStrings.BROWSER_PATH);
-        
-        if (this.browserPath == null || this.browserPath.equals("")){
-	    useDefaultBrowser = true;
-            this.browserPath = "";
-	}
-	else{
-	    useDefaultBrowser = false;
-	}
-
-	String auto_start_str = server.build_properties.getProperty(StaticStrings.AUTOSTART_PROPERTY);
-	if ((auto_start_str.trim()).equals("true")) {
-	    this.autoStart = true;
-	} else {
-	    this.autoStart = false;
-	}
-
-	this.servletDefault = server.build_properties.getProperty(StaticStrings.DEFAULT_SERVLET_PROPERTY).replaceAll("/","");
-
-	setSize(SIZE);
-	setTitle(server.dictionary.get("ServerSettings.Title"));
-
-	setLocation((screen.width - SIZE.width) / 2,
-		    (screen.height - SIZE.height) / 2);
-	setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
-
-	JLabel port_label = new JLabel(Server.dictionary.get("ServerSettings.Tomcat_Port"));
-
-	portNumber_spinner = new JSpinner(new SpinnerNumberModel(portNum,1,65535,1));
-	portNumber_spinner.setEditor(new JSpinner.NumberEditor(portNumber_spinner, "#####")); 
-
-	autoEnter = new JCheckBox(server.dictionary.get("ServerSettings.Auto_Start"));
-	
-	if (autoStart) {
-	    autoEnter.setSelected(true);
-	} else {
-	    autoEnter.setSelected(false);
-	}
-	autoEnter.setBackground(bg_color);
-
-	JLabel servlet_label = new JLabel(server.dictionary.get("ServerSettings.Servlet"));
-
-	servlet_combobox = new JComboBox();
-	servlet_combobox.setMaximumRowCount(5);
-	servlet_combobox.setBackground(bg_color);
-
-	File web_xml = new File(GlobalProperties.getProperty(StaticStrings.GSDL3_HOME_PROPERTY) + File.separator + "WEB-INF" + File.separator + "web.xml");
-	XMLConverter converter = new XMLConverter();
-	Document web_config = converter.getDOM(web_xml);
-	if (web_config == null) {
-	    logger.error("web.xml is null! "+web_xml.getAbsolutePath());
-	    return;
-	}
-
-	NodeList servlet_mappings = web_config.getElementsByTagName("servlet-mapping");
-	// make a little map class
-	url_mappings = new HashMap();
-	for (int i = 0; i < servlet_mappings.getLength(); i++) {
-	    Element map = (Element) servlet_mappings.item(i);
-	    Element servlet_name_elem = (Element) GSXML.getChildByTagName(map, "servlet-name");
-	    String name = GSXML.getNodeText(servlet_name_elem);
-	    Element url_pattern_elem = (Element) GSXML.getChildByTagName(map, "url-pattern");
-	    String pattern = GSXML.getNodeText(url_pattern_elem);
-	    // Ignore the Axis servlets
-	    if (!(name.equals("AxisServlet"))) {
-		servlet_combobox.addItem(name.trim());
-		url_mappings.put(name, pattern);
-	    }
-
-	    if (name.equals(servletDefault)) {
-		servlet_combobox.setSelectedItem(name);
-	    }
-	}
-
-	JButton save_button = new JButton(Server.dictionary.get("ServerSettings.OK"));
-	save_button.addActionListener(new SaveActionListener());
-
-	JButton exit_button = new JButton(Server.dictionary.get("ServerSettings.Cancel"));
-	exit_button.addActionListener(new ActionListener() {
-		public void actionPerformed(ActionEvent ev) {
-		    self.dispose();
-		}
-	    });
-
-        JPanel  port_panel = new JPanel();    
-        port_panel.setLayout(new FlowLayout(FlowLayout.LEFT));
-	port_panel.add(port_label);
-	port_panel.add(portNumber_spinner);
-	port_panel.setBackground(bg_color);
-
-        JPanel comb_panel = new JPanel();
-	comb_panel.setLayout(new FlowLayout(FlowLayout.LEFT));
-	comb_panel.add(servlet_label);
-	comb_panel.add(servlet_combobox);
-	comb_panel.setBackground(bg_color);
-
-        
-	JPanel  check_panel = new JPanel(); 
-       	check_panel.setLayout(new FlowLayout(FlowLayout.LEFT));
-        check_panel.add(autoEnter);
-        check_panel.setBackground(bg_color);
-
-	JPanel mid_panel = new JPanel();
-        mid_panel.setLayout(new GridLayout(3,1));
-	mid_panel.add(port_panel);
-	mid_panel.add(check_panel);
-	mid_panel.add(comb_panel);
-	mid_panel.setBackground(bg_color);
-	mid_panel.setBorder(BorderFactory.createEmptyBorder(5,10,5,10));
-
-
-	JPanel browser_panel = new JPanel();
-        browser_panel.setLayout(new GridLayout(4,1));
-        default_browser_button = new JRadioButton(Server.dictionary.get("ServerSettings.DefaultBrowser"));
-        other_browser_button = new JRadioButton(Server.dictionary.get("ServerSettings.OtherBrowser"));
-        other_browser_button.addActionListener(new BrowserSelectionListener());
-        default_browser_button.addActionListener(new BrowserSelectionListener());
-
-	ButtonGroup bg = new ButtonGroup();
-        bg.add(default_browser_button);
-        bg.add(other_browser_button);
-        default_browser_button.setBorder(BorderFactory.createEmptyBorder(5,10,5,0));
-        default_browser_button.setBackground(bg_color);     
-        other_browser_button.setBorder(BorderFactory.createEmptyBorder(5,10,5,0)); 
-        other_browser_button.setBackground(bg_color);
-        JPanel browse_program_panel = new JPanel();     
-        browse_program_panel.setLayout(new BorderLayout());
-        program_path_field = new JTextField(this.browserPath);
-        browse_button = new JButton(Server.dictionary.get("ServerSettings.Browse"));
-	browse_program_panel.add(program_path_field,BorderLayout.CENTER);
-        browse_program_panel.add(browse_button,BorderLayout.EAST);
-        browse_program_panel.setBorder(BorderFactory.createEmptyBorder(5,10,5,0));
-	browse_program_panel.setBackground(bg_color);
-        browser_panel.add(new JLabel(Server.dictionary.get("ServerSettings.ChooseBrowser")));
-        browser_panel.add(default_browser_button);
-	browser_panel.add(other_browser_button);
-        browser_panel.add(browse_program_panel);
-	browser_panel.setBorder(BorderFactory.createEmptyBorder(5,10,5,10));
-        browser_panel.setBackground(bg_color);
-	if (useDefaultBrowser){
-	    default_browser_button.setSelected(true);
-	    program_path_field.setEnabled(false);
-	    browse_button.setEnabled(false); 
-	}
-	else{
-	    other_browser_button.setSelected(true);
-	}
-        browse_button.addActionListener(new BrowseActionListener());       
-        
-        JPanel down_panel = new JPanel();
-	down_panel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
-	down_panel.add(save_button);
-	down_panel.add(exit_button);
-	down_panel.setBackground(bg_color);
-	down_panel.setBorder(BorderFactory.createEmptyBorder(5,10,5,10));
-
-        getContentPane().add(mid_panel, BorderLayout.NORTH);
-        getContentPane().add(browser_panel, BorderLayout.CENTER);
-	getContentPane().add(down_panel, BorderLayout.SOUTH);
-	getContentPane().setBackground(bg_color);
-	setVisible(true);
-    }
-
-    private class BrowseActionListener 
- 	implements ActionListener {
-	
-	public void actionPerformed(ActionEvent ev) {
-	    JFileChooser chooser = new JFileChooser();
-           int returnVal = chooser.showOpenDialog(self);        
-	   
-	    if(returnVal == JFileChooser.APPROVE_OPTION) {
-                File program_path = chooser.getSelectedFile();
-		program_path_field.setText(program_path.getPath());
-	    } 
-	}
-
-     }
-
-    private class BrowserSelectionListener 
- 	implements ActionListener {
-	
-	public void actionPerformed(ActionEvent ev) {
-	    if (default_browser_button.isSelected()){
-		program_path_field.setEnabled(false);
-                browse_button.setEnabled(false);
-	    }
-            else{
-		program_path_field.setEnabled(true);
-                browse_button.setEnabled(true);
-	    }
-	}
-
-     }
-    
-
-    private class SaveActionListener
-	implements ActionListener {
-	
-	public void actionPerformed(ActionEvent ev) {
-	    // save everything to build_properties if things have changed
-	     boolean has_changed = false;
-             boolean require_restart = false;
-	    if (portNum != ((Integer)portNumber_spinner.getValue()).intValue()) {
-		has_changed = true;
-                require_restart = true; 
-                server.reconfigRequired();
-                portNum = ((Integer)portNumber_spinner.getValue()).intValue();
-             	logger.info("port changed, new port is "+portNumber_spinner.getValue());
-	    }
-	    if (autoStart != autoEnter.isSelected()) {
-            	has_changed = true;
-	    }
-	    if (!servletDefault.equals(servlet_combobox.getSelectedItem())) {
-         	has_changed = true;
-                require_restart = true; 
-	    }
-            //changed to use other browser
-            if (useDefaultBrowser && other_browser_button.isSelected()){
-		browserPath = program_path_field.getText();
-		has_changed = true;
-	    } 
-	    //the browser path has been changed 
-	    if ( !useDefaultBrowser && !browserPath.equals(program_path_field.getText())){
-		browserPath = program_path_field.getText();
-		 has_changed = true;
-	    }
-	    
-            //changed to use the default browser
-	    if ( default_browser_button.isSelected() && !useDefaultBrowser){
-		browserPath = "";
-		has_changed = true;
-	    }
-             
-
-	    if (has_changed) {
-		ArrayList oldFileLines = null;
-		ArrayList newFileLines = null;
-		
-		ScriptReadWrite scriptReadWrite = new ScriptReadWrite();
-		oldFileLines = scriptReadWrite.readInFile(Server.build_properties_file);
-		
-		newFileLines = scriptReadWrite.queryReplace(oldFileLines, StaticStrings.TOMCAT_PORT_PROPERTY, portNum+"");
-		
-		String newAutoEnter = (new Boolean(autoEnter.isSelected())).toString();
-		newFileLines = scriptReadWrite.queryReplace(newFileLines, StaticStrings.AUTOSTART_PROPERTY, newAutoEnter);
-		
-		String newServletDef = (String) servlet_combobox.getSelectedItem();
-		newFileLines = scriptReadWrite.queryReplace(newFileLines,StaticStrings.DEFAULT_SERVLET_PROPERTY, (String) url_mappings.get(newServletDef));
-
-		String osName = System.getProperty("os.name");
-                if (osName.startsWith("Windows")){
-		    browserPath = browserPath.replaceAll("\\\\","/");
-		}
-                 newFileLines = scriptReadWrite.queryReplace(newFileLines,StaticStrings.BROWSER_PATH, browserPath);
-
-		scriptReadWrite.writeOutFile(Server.build_properties_file,
-					     newFileLines);
-		server.reloadBuildProperties();
-		if (require_restart){
-		    JOptionPane.showMessageDialog(null,server.dictionary.get("ServerSetting.SettingChanged"),"Info", JOptionPane.INFORMATION_MESSAGE);
-		}
-	    } 
-
-	    self.dispose();
-	}
-    }
-
-}
Index: eenstone3/trunk/src/java/org/greenstone/server/StaticStrings.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/server/StaticStrings.java	(revision 18557)
+++ 	(revision )
@@ -1,19 +1,0 @@
-package org.greenstone.server;
-
-public class StaticStrings {
-
-    static final public String GSDL3_HOME_PROPERTY = "gsdl3.home";
-    static final public String GSDL3_VERSION_PROPERTY = "gsdl3.version";
-    static final public String AUTOSTART_PROPERTY = "server.auto.start";
-    static final public String DEFAULT_SERVLET_PROPERTY = "server.default.servlet";
-    static final public String TOMCAT_SERVER_PROPERTY = "tomcat.server";
-    static final public String TOMCAT_PORT_PROPERTY = "tomcat.port";
-    static final public String TOMCAT_CONTEXT_PROPERTY = "tomcat.context";
-    static final public String TOMCAT_INSTALL_PATH = "tomcat.installed.path";
-
-    static final public String WIN_9X_OPEN_COMMAND = "command.com /c start %1";
-    static final public String WIN_OPEN_COMMAND = "cmd.exe /c start \"\" %1";
-    static final public String MAC_OPEN_COMMAND = "open %1";
-
-    static final public String BROWSER_PATH = "browser.path";
-}
