Ignore:
Timestamp:
2009-03-18T19:00:09+13:00 (15 years ago)
Author:
ak19
Message:
  1. Bugfix on saving and working out the servlet; 2. Variables related to the servlet and the saving of servlet data have been moved into Server3Settings from BaseServerSettings since servlets are unique to GS3.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/src/java/org/greenstone/server/Server3Settings.java

    r18696 r18708  
    1717
    1818public class Server3Settings extends BaseServerSettings
     19{
     20    protected String servletDefault = null;
     21    protected JComboBox servlet_combobox;
     22    protected HashMap url_mappings = null;
    1923
    20 {
    2124    public Server3Settings(BaseServer server)
    2225    {
    2326    super(server);
    24     this.servletDefault = server.build_properties.getProperty(BaseServer.Property.DEFAULT_SERVLET).replaceAll("/","");
    2527    }
    2628
    2729    protected JPanel createServletPanel()
    2830    {
    29 
    3031    JLabel servlet_label = new JLabel(server.dictionary.get(BaseServer.Property.SERVER_SETTINGS+".URL"));
    3132
     33    this.servletDefault = server.build_properties.getProperty(BaseServer.Property.DEFAULT_SERVLET).replaceAll("/","");
     34   
    3235    servlet_combobox = new JComboBox();
    3336    servlet_combobox.setMaximumRowCount(5);
     
    5760        }
    5861
    59         if (name.equals(servletDefault)) {
     62        if (pattern.replaceAll("/","").equals(servletDefault)) {
    6063        servlet_combobox.setSelectedItem(name);
    6164        }
     
    7174    }
    7275
     76    public String onSave()
     77    {
     78    String result = "";
     79    if (!servletDefault.equals((String)url_mappings.get(servlet_combobox.getSelectedItem()))) {
     80        result += "changed";
     81        result += "restart";
     82    }
     83    return result;
     84    }
     85
     86    public void save(ScriptReadWrite scriptReadWrite, ArrayList newFileLines)
     87    {
     88    String newServletDef = (String) servlet_combobox.getSelectedItem();
     89    newFileLines = scriptReadWrite.queryReplace(newFileLines,BaseServer.Property.DEFAULT_SERVLET, (String) url_mappings.get(newServletDef));   
     90    }
     91
    7392}
Note: See TracChangeset for help on using the changeset viewer.