Changeset 10953


Ignore:
Timestamp:
2005-11-25T14:07:14+13:00 (18 years ago)
Author:
kjdon
Message:

fixed up some paths. still needs more tidying...

Location:
trunk/gsdl3/src/java/org/greenstone/admin
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/admin/Configuration.java

    r10939 r10953  
    3939
    4040// eventually this class will hold configuration settings from a config file. For now, lets use static info
    41 // loosely based around Gatherer Configuration
     41// loosely copied from Gatherer Configuration
    4242public class Configuration {
    4343   
     
    6363    hash.put("coloring.workspace_selection_foreground", "0, 0, 0");
    6464    hash.put("coloring.workspace_selection_background", "176, 208, 176");
    65     hash.put("coloring.table_noneditable_background", "");
    66     hash.put("coloring.table_editable_background", "");
     65    hash.put("coloring.table_noneditable_background", "255, 255, 255");
     66    hash.put("coloring.table_editable_background", "255, 255, 255");
    6767    hash.put("coloring.collection_tree_background", "224, 240, 224");
    6868    hash.put("coloring.collection_tree_foreground", "0, 0, 0");
     
    114114    Color result = Color.white; // Default
    115115    String raw = (String)hash.get(property);
    116     if (raw == null) {
     116    if (raw == null || raw.equals("")) {
    117117        return result;
    118118    }
  • trunk/gsdl3/src/java/org/greenstone/admin/GAI.java

    r10943 r10953  
    22 *#########################################################################
    33 *
    4  * A component of the Gatherer application, part of the Greenstone digital
     4 * A component of the Greenstone Administrator Interface, part of the Greenstone digital
    55 * library suite from the New Zealand Digital Library Project at the
    66 * University of Waikato, New Zealand.
     
    5555    public static String gsdl3_src_home;
    5656    public static String gsdl3_web_home;
     57    public static String tomcat_home;
    5758   
    5859    public static File build_properties_file;
    5960
    60     public static String admin_path;
    61     public static String tomcat_file_path;
    6261    public static String images_path;
    63     public static File build_file;
    64     public static File site_conf;
    65     public static File interface_conf;
    6662    /** A public reference to the GAIManager. */
    6763    static public GAIManager ga_man;
     
    8177    this.dictionary = new Dictionary("gai", Configuration.getLocale("general.locale"));
    8278    this.build_properties_file = new File(this.gsdl3_src_home, "build.properties");
    83     this.images_path = this.gsdl3_src_home+File.separatorChar+"resources"+File.separatorChar+"images";
     79    // this may change if using preinstalled tomcat
     80    this.tomcat_home = this.gsdl3_src_home+File.separatorChar+"packages"+File.separatorChar+"tomcat";
     81   
     82    // should come from classpath ??
     83    this.images_path = this.gsdl3_src_home+File.separatorChar+"resources"+File.separatorChar+"images"+File.separatorChar;
    8484    // start the GAIManager
    8585    ga_man  = new GAIManager(screen_size);
    8686    ga_man.display();
    8787
    88     //this.admin_path = this.gsdl3_path + "/src/java/org/greenstone/admin/";
    89     //this.tomcat_file_path = this.gsdl3_path + "/comms/jakarta/tomcat/logs/";
    90     //this.images_path = this.admin_path + "images/";
    91         //this.build_file = new File(gsdl3_path, "build.properties");
    92     //this.site_conf = new File (gsdl3_path,"/web/sites/localsite/siteConfig.xml");
    93     //this.interface_conf = new File (gsdl3_path, "/web/interfaces/default/interfaceConfig.xml");
    94     //init();
    9588    }
    9689   
     
    116109    GAI gai = new GAI(args[0], args[1]);
    117110
    118     //  gsdl3_path = args[0];
    119     //admin_path = gsdl3_path + "/src/java/org/greenstone/admin/";
    120     //new Configuration (admin_path);
    121     //GAI gai = new GAI();
    122    
    123     //ga_man  = new GAIManager(screen_size);
    124     //ga_man.display();
    125111    }
    126112
  • trunk/gsdl3/src/java/org/greenstone/admin/GAIFirstSettingFrame.java

    r10943 r10953  
    101101   
    102102    // ImagesIcon for the buttons
    103     ImageIcon setYesButtonIcon = new ImageIcon(GAI.admin_path + "images/toolbarButtonGraphics/general/Refresh16.gif");
    104     ImageIcon setNoButtonIcon = new ImageIcon(GAI.admin_path + "images/toolbarButtonGraphics/general/exit16.gif");
     103    ImageIcon setYesButtonIcon = new ImageIcon(GAI.images_path + "refresh.gif");
     104    ImageIcon setNoButtonIcon = new ImageIcon(GAI.images_path + "exit.gif");
    105105   
    106106    fset_yes_button = new JButton("Yes", setYesButtonIcon);
  • trunk/gsdl3/src/java/org/greenstone/admin/GAIManager.java

    r10943 r10953  
    100100   public void display(){
    101101    CONF_ICON = new ImageIcon (GAI.images_path + "create.gif");
    102     EXT_ICON = new ImageIcon (GAI.images_path + "toolbarButtonGraphics/general/Information16.gif");
    103     MONITOR_ICON = new ImageIcon (GAI.images_path + "toolbarButtonGraphics/general/Zoom16.gif");
    104     LOG_ICON = new ImageIcon (GAI.images_path + "toolbarButtonGraphics/general/History16.gif");
     102    EXT_ICON = new ImageIcon (GAI.images_path + "information.gif");
     103    MONITOR_ICON = new ImageIcon (GAI.images_path + "zoom.gif");
     104    LOG_ICON = new ImageIcon (GAI.images_path + "history.gif");
    105105    content_pane = (JPanel) this.getContentPane();
    106106
     
    164164    public void actionPerformed (ActionEvent event){
    165165    Object esrc = event.getSource();
    166     boolean project_conf_changed = false;
    167     boolean site_conf_changed = false;
    168     boolean interface_conf_changed = false;
    169166    if (esrc == menu_bar.file_exit){
    170         project_conf_changed = conf_pane.ProjectConfChanged();
    171         site_conf_changed = conf_pane.site_conf.confChanged();
    172         interface_conf_changed = conf_pane.interface_conf.confChanged();
    173         /* Check if the Project and Site configuration files have been changed,
    174          * if changed, prompt to users if they want to save*/
    175         if (project_conf_changed || site_conf_changed || interface_conf_changed) {
     167        if (conf_pane.configurationChanged()) {
     168        // prompt users for save
    176169        int result = JOptionPane.showConfirmDialog((Component) null, "The Configuration files have been changed, do you want to save the change", "Save Confirmation", JOptionPane.YES_NO_OPTION);
    177170        if ( result == JOptionPane.YES_OPTION) {
    178             conf_pane.saveProjectConf(GAI.build_file);
    179             conf_pane.site_conf.saveFile(GAI.site_conf);
    180             conf_pane.interface_conf.saveFile(GAI.interface_conf);
     171            conf_pane.save();   
    181172        }
    182173        }
     
    185176    else if (esrc == menu_bar.file_save){
    186177        /* sliently and Globally save Project and Site configuration*/
    187         project_conf_changed = conf_pane.ProjectConfChanged();
    188         site_conf_changed = conf_pane.site_conf.confChanged();
    189         interface_conf_changed = conf_pane.interface_conf.confChanged();
    190         if (project_conf_changed) {
    191         conf_pane.saveProjectConf(GAI.build_file);
    192         }
    193         if (site_conf_changed){
    194         conf_pane.site_conf.saveFile(GAI.site_conf);
    195         }
    196         if (interface_conf_changed) {
    197         conf_pane.interface_conf.saveFile(GAI.interface_conf);
    198         }
     178        conf_pane.save();
    199179    }
    200180    else if (esrc == menu_bar.help_conf){
  • trunk/gsdl3/src/java/org/greenstone/admin/gui/ConfPane.java

    r10943 r10953  
    6161import org.greenstone.admin.gui.SiteConfSetting;
    6262import org.greenstone.core.ParsingProgress;
     63import org.greenstone.gsdl3.util.GSFile;
    6364
    6465/** The Configuration pane is to view the status of relevant configure files in GSIII
     
    155156   
    156157    //Site configuration
    157     public File site_conf_file = GAI.site_conf;
    158     public File interface_conf_file = GAI.interface_conf;
     158    // TODO!! there are more than one site and interface - need to extend this
     159    public File site_conf_file = new File(GSFile.siteConfigFile(GSFile.siteHome(GAI.gsdl3_web_home, "localsite")));
     160    public File interface_conf_file = new File(GSFile.interfaceConfigFile(GSFile.interfaceHome(GAI.gsdl3_web_home, "default")));
    159161    public boolean  project_conf_changed = false;
    160162
     
    220222    RestartMysqlButtonListener rmbl = new RestartMysqlButtonListener();
    221223       
    222     ImageIcon startupTomcatButtonIcon = new ImageIcon(GAI.images_path + "toolbarButtonGraphics/general/redo16.gif");
    223     ImageIcon shutdownTomcatButtonIcon = new ImageIcon(GAI.images_path + "toolbarButtonGraphics/general/stop16.gif");
    224     ImageIcon restartTomcatButtonIcon = new ImageIcon(GAI.images_path + "toolbarButtonGraphics/general/stop16.gif");
    225    
    226     ImageIcon startupMysqlButtonIcon = new ImageIcon(GAI.images_path + "toolbarButtonGraphics/general/redo16.gif");
    227     ImageIcon shutdownMysqlButtonIcon = new ImageIcon(GAI.images_path + "toolbarButtonGraphics/general/stop16.gif");
    228     ImageIcon restartMysqlButtonIcon = new ImageIcon(GAI.images_path + "toolbarButtonGraphics/general/stop16.gif");
    229     ImageIcon saveButtonIcon = new ImageIcon(GAI.images_path  + "toolbarButtonGraphics/general/Save16.gif");
     224    ImageIcon startupTomcatButtonIcon = new ImageIcon(GAI.images_path + "redo.gif");
     225    ImageIcon shutdownTomcatButtonIcon = new ImageIcon(GAI.images_path + "stop.gif");
     226    ImageIcon restartTomcatButtonIcon = new ImageIcon(GAI.images_path + "stop.gif");
     227   
     228    ImageIcon startupMysqlButtonIcon = new ImageIcon(GAI.images_path + "redo.gif");
     229    ImageIcon shutdownMysqlButtonIcon = new ImageIcon(GAI.images_path + "stop.gif");
     230    ImageIcon restartMysqlButtonIcon = new ImageIcon(GAI.images_path + "stop.gif");
     231    ImageIcon saveButtonIcon = new ImageIcon(GAI.images_path  + "save.gif");
    230232
    231233    startup_tomcat_button = new JButton(); 
     
    318320    confContent_label.setBackground(Configuration.getColor("coloring.workspace_selection_background"));
    319321    confContent_label.setForeground(Configuration.getColor("coloring.workspace_selection_foreground"));
    320     confContent_label.setText(GAI.dictionary.get("ConfPane.Conf_List"));
     322    confContent_label.setText(GAI.dictionary.get("ConfPane.Conf_Content"));
    321323       
    322324    conf_table_model = new ConfSettingTableModel();
     
    427429    this.add(main_conf_pane, BorderLayout.CENTER);
    428430    }
    429    
     431
     432    public void save() {
     433    if (project_conf_changed) {
     434        saveProjectConf(GAI.build_properties_file);
     435    }
     436    if (site_conf.confChanged()){
     437        site_conf.saveFile(site_conf_file);
     438    }
     439    if (interface_conf.confChanged()) {
     440        interface_conf.saveFile(interface_conf_file);
     441    }
     442   
     443
     444    }
     445   
     446    public boolean configurationChanged() {
     447    return (project_conf_changed || site_conf.confChanged() ||
     448        interface_conf.confChanged());
     449
     450    }
     451
    430452    private class StartupTomcatButtonListener
    431453    implements ActionListener {
     
    594616    }
    595617
    596     public boolean ProjectConfChanged() {
     618    public boolean projectConfChanged() {
    597619    return project_conf_changed;
    598620    }
  • trunk/gsdl3/src/java/org/greenstone/admin/gui/LogPane.java

    r10943 r10953  
    351351            //no selection
    352352        } else if (log_list.getSelectedIndex () == 0 ) {
    353             log_file = new File (GAI.tomcat_file_path+"catalina.out");
     353            log_file = new File (GAI.tomcat_home+File.separatorChar+"logs"+File.separatorChar+"catalina.out");
    354354            String filename = log_file.getPath();
    355355            updateLogsContent(filename);
  • trunk/gsdl3/src/java/org/greenstone/admin/gui/SetServerPane.java

    r10943 r10953  
    112112   
    113113    // ImagesIcon for the buttons
    114     ImageIcon SaveButtonIcon = new ImageIcon(GAI.admin_path + "images/toolbarButtonGraphics/general/Refresh16.gif");
    115     ImageIcon InstallButtonIcon = new ImageIcon(GAI.admin_path + "images/toolbarButtonGraphics/general/exit16.gif");
    116     ImageIcon ExitButtonIcon = new ImageIcon(GAI.admin_path + "images/toolbarButtonGraphics/general/exit16.gif");
     114    ImageIcon SaveButtonIcon = new ImageIcon(GAI.images_path + "refresh.gif");
     115    ImageIcon InstallButtonIcon = new ImageIcon(GAI.images_path + "exit.gif");
     116    ImageIcon ExitButtonIcon = new ImageIcon(GAI.images_path + "exit.gif");
    117117
    118118    save_button = new JButton("Save Setting", SaveButtonIcon);
Note: See TracChangeset for help on using the changeset viewer.