Changeset 14974


Ignore:
Timestamp:
2008-02-12T16:13:13+13:00 (14 years ago)
Author:
davidb
Message:

Changes to GLI to support export into Fedora. New utility called flisvn diff gems/MetadataSetManager.java

Location:
gli/trunk/src/org/greenstone/gatherer
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • gli/trunk/src/org/greenstone/gatherer/Configuration.java

    r14302 r14974  
    6969    /** The name of the general Gatherer configuration file for running with GS3. */
    7070    static public String GS3_CONFIG_XML = "config3.xml";
     71    static public String FEDORA_CONFIG_PREFIX = "fedora-";
    7172
    7273    /** The name of the root element of the subtree containing gatherer configuration options. This is required as the document itself may contain several other subtrees of settings (such as in the case of a '.col' file). */
     
    101102    /** If we are using GLI in Greenstone 3, the path to gsdl3 src directory (== gsdl3 dir)*/
    102103    static public String gsdl3_src_path = "";
     104
     105    static public FedoraInfo fedora_info = null;
     106   
    103107    /** The path to the PERL executable, up to and including Perl.exe. */
    104108    static public String perl_path = "";
     
    134138     * @param site_name The name of the Greenstone 3 site currently in use.
    135139     */
    136     public Configuration(String gli_user_directory_path, String gsdl_path, String gsdl3_path, String gsdl3_src_path, String site_name)
     140    public Configuration(String gli_user_directory_path, String gsdl_path, String gsdl3_path, String gsdl3_src_path, String site_name,
     141             FedoraInfo fedora_info)
    137142    {
    138143    super();
     
    145150    this.site_name = site_name;
    146151
     152    this.fedora_info = fedora_info;
     153
    147154    // Try to load the configuration file from the user specific location
    148155    String config_xml_file_name = CONFIG_XML;
     
    151158    }
    152159
     160    if (fedora_info.isActive()) {
     161        config_xml_file_name = FEDORA_CONFIG_PREFIX + config_xml_file_name;
     162    }
     163
    153164    // If the existing user config.xml file isn't recent enough, backup the old version and update it
    154165    File config_xml_file = new File(gli_user_directory_path + config_xml_file_name);
     166
    155167    if (config_xml_file != null && config_xml_file.exists()) {
    156168        just_updated_config_xml_file = updateUserConfigXMLFileIfNecessary(config_xml_file);
     
    597609    }
    598610
     611    static public String getApplicationTitle() {
     612    String gli_title = getString("GLI.Title", GENERAL_SETTING);
     613    String title = (gli_title=="") ? Gatherer.PROGRAM_NAME : gli_title;
     614
     615    return title;
     616    }
     617
     618
    599619    static public String getServletPath() {
    600620    return servlet_path;
     
    688708    File user_config_xml = null;
    689709    String config_xml_name = CONFIG_XML;
     710
    690711    if (gsdl3_path!=null) {
    691712        config_xml_name = GS3_CONFIG_XML;
    692713    }
    693 
     714       
    694715    if (Gatherer.isGsdlRemote) {
    695716        if (Gatherer.GS3){
     
    699720        }
    700721    }
     722
     723    if (fedora_info.isActive()) {
     724        config_xml_name = FEDORA_CONFIG_PREFIX + config_xml_name;
     725    }
     726
    701727    try {
    702728        user_config_xml = new File(gli_user_directory_path + config_xml_name);
  • gli/trunk/src/org/greenstone/gatherer/GAuthenticator.java

    r14567 r14974  
    4242import java.util.*;
    4343import javax.swing.*;
     44
     45
    4446import org.greenstone.gatherer.gui.GLIButton;
     47
    4548
    4649/** Provides a graphic authenticator for network password requests.
     
    7578     * @see org.greenstone.gatherer.GAuthenticator.RequestFocusListener
    7679     */
    77     protected PasswordAuthentication getPasswordAuthentication() {
     80    protected PasswordAuthentication getPasswordAuthentication(String username_str, String password_str) {
    7881    // Component definition.
    7982    dialog = new JDialog (Gatherer.g_man, Dictionary.get("GAuthenticator.Title"), true);
     
    8285    JPanel content_pane = (JPanel) dialog.getContentPane();
    8386    JLabel title_label = new JLabel(getMessageString());
     87
    8488    JPanel user_panel = new JPanel();
    8589    JLabel username_label = new JLabel(Dictionary.get("GAuthenticator.Username"));
    8690    JTextField username = new JTextField();
    8791    username.setToolTipText(Dictionary.get("GAuthenticator.Username_Tooltip"));
     92    if (username_str != null) {
     93        username.setText(username_str);
     94    }
     95
    8896    JPanel password_panel = new JPanel();
    8997    JLabel password_label = new JLabel(Dictionary.get("GAuthenticator.Password"));
     
    9199    password.setEchoChar('*');
    92100    password.setToolTipText(Dictionary.get("GAuthenticator.Password_Tooltip"));
     101    if (password_str != null) {
     102        password.setText(password_str);
     103    }
     104
    93105    JPanel button_panel = new JPanel();
    94106    ok_button = new GLIButton(Dictionary.get("General.OK"), Dictionary.get("General.OK_Tooltip"));
     
    134146    }
    135147
     148    protected PasswordAuthentication getPasswordAuthentication() {
     149    return getPasswordAuthentication(null,null);
     150    }
    136151
    137152    /** This is defined so it can be overridden by subclasses (getRequestingPrompt is final). */
  • gli/trunk/src/org/greenstone/gatherer/Gatherer.java

    r14605 r14974  
    3636import javax.swing.plaf.*;
    3737import javax.swing.text.*;
     38
     39
    3840import org.greenstone.gatherer.Configuration;
    3941import org.greenstone.gatherer.GAuthenticator;
     42import org.greenstone.gatherer.FedoraInfo;
    4043import org.greenstone.gatherer.collection.CollectionManager;
    4144import org.greenstone.gatherer.feedback.ActionRecorderDialog;
     
    5154import org.greenstone.gatherer.gui.URLField;
    5255import org.greenstone.gatherer.gui.WarningDialog;
     56import org.greenstone.gatherer.gui.FedoraLogin;
    5357import org.greenstone.gatherer.remote.RemoteGreenstoneServer;
    5458import org.greenstone.gatherer.util.JarTools;
     
    7781        * change the regex in the gs3-release-maker code and in this message
    7882        */
    79     static final public String PROGRAM_VERSION = "trunk";
     83    static final public String PROGRAM_VERSION = "1.0";
    8084
    8185    static private Dimension size = new Dimension(800, 540);
     
    186190    // More special code for running with a remote Greenstone
    187191    if (isGsdlRemote) {
    188         Configuration.TEMPLATE_CONFIG_XML = "xml/configRemote.xml";
     192        if (go.fedora_info.isActive()) {
     193        Configuration.TEMPLATE_CONFIG_XML = "xml/" + Configuration.FEDORA_CONFIG_PREFIX + "configRemote.xml";
     194        }
     195        else {
     196        Configuration.TEMPLATE_CONFIG_XML = "xml/configRemote.xml";
     197        }
     198
    189199        if (!go.run_gsdl3){ 
    190200        Configuration.CONFIG_XML = "configRemote.xml";
     
    198208        }
    199209    }
    200 
    201     init(go.gsdl_path, go.gsdl3_path, go.gsdl3_src_path, go.local_library_path, go.library_url_string,
     210    else {     
     211        if (go.fedora_info.isActive()) {
     212        Configuration.TEMPLATE_CONFIG_XML = "xml/" + Configuration.FEDORA_CONFIG_PREFIX + Configuration.CONFIG_XML;
     213
     214        }
     215    }
     216
     217    init(go.gsdl_path, go.gsdl3_path, go.gsdl3_src_path,
     218         go.fedora_info,
     219         go.local_library_path, go.library_url_string,
    202220         go.gliserver_url_string, go.debug, go.perl_path, go.no_load, go.filename, go.site_name,
    203221         go.servlet_path);
     
    205223
    206224
    207     public void init(String gsdl_path, String gsdl3_path, String gsdl3_src_path, String local_library_path,
     225    public void init(String gsdl_path, String gsdl3_path, String gsdl3_src_path,
     226             FedoraInfo fedora_info,
     227             String local_library_path,
    208228             String library_url_string, String gliserver_url_string, boolean debug_enabled,
    209229             String perl_path, boolean no_load, String open_collection,
     
    245265    try {
    246266        // Load GLI config file
    247         new Configuration(getGLIUserDirectoryPath(), gsdl_path, gsdl3_path, gsdl3_src_path, site_name);
     267        new Configuration(getGLIUserDirectoryPath(), gsdl_path, gsdl3_path, gsdl3_src_path, site_name,
     268                  fedora_info);
    248269
    249270        // Check we know where Perl is
     
    278299        }
    279300
     301        if (fedora_info.isActive()) {
     302        popupFedoraInfo();
     303        }
     304
     305
    280306        // Start up the local library server, if that's what we want
    281307        if (Utility.isWindows() && local_library_path != null && !isGsdlRemote && !GS3) {
     
    298324        if (Configuration.library_url == null) {
    299325        missingEXEC();
     326
    300327        if ((Configuration.library_url!=null) && isGsdlRemote && (gliserver_url_string==null)){
    301328            if (GS3){
    302329            default_gliserver_url = new URL(Configuration.library_url.toString() + "/cgi-bin/gliserver4gs3.pl");
    303330            }else{
    304             default_gliserver_url = new URL(Configuration.library_url.toString().substring(0,Configuration.library_url.toString().lastIndexOf("/library")) + "/gliserver.pl");
     331            String default_gliserver_str = "";
     332            String library_url_str = Configuration.library_url.toString();         
     333            int cut_pos = library_url_str.lastIndexOf("/library");
     334
     335            if (cut_pos>0) {
     336                default_gliserver_str = library_url_str.substring(0,cut_pos) + "/gliserver.pl";
     337            }
     338            else {
     339                cut_pos = library_url_str.lastIndexOf("/");
     340                if (cut_pos>0) {
     341                default_gliserver_str = library_url_str.substring(0,cut_pos) + "/gliserver.pl";
     342                }
     343                else {
     344                default_gliserver_str = library_url_str + "/gliserver.pl";
     345                }
     346            }
     347
     348            default_gliserver_url = new URL(default_gliserver_str);
    305349            }
    306350            missingGLIServer();
     
    327371                default_gliserver_url = new URL(Configuration.library_url.toString() + "/cgi-bin/gliserver4gs3.pl");
    328372            }else{
    329                 default_gliserver_url = new URL(Configuration.library_url.toString().substring(0,Configuration.library_url.toString().lastIndexOf("/library")) + "/gliserver.pl");
     373                String library_url = Configuration.library_url.toString();
     374                default_gliserver_url = new URL(library_url.substring(0,library_url.lastIndexOf("/library")) + "/gliserver.pl");
    330375            }
    331376            }
     
    787832    }
    788833    }
     834
     835
     836
     837    /** Prints a warning message about a missing library path, which means the final collection cannot be previewed in the Gatherer.
     838     */
     839    static private void popupFedoraInfo() {
     840
     841    FedoraLogin dialog = new FedoraLogin("Fedora Login", false);
     842
     843    if (Configuration.library_url == null) {
     844       
     845        String library_url_string = dialog.getLibraryURL();
     846        if (!library_url_string.equals("")) {
     847        try {
     848            Configuration.library_url = new URL(library_url_string);
     849        }
     850        catch (MalformedURLException exception) {
     851            DebugStream.printStackTrace(exception);
     852        }
     853        }
     854    }
     855       
     856    if (dialog.loginRequested()) {
     857
     858        String hostname = dialog.getHostname();
     859        String port     = dialog.getPort();
     860        String username = dialog.getUsername();
     861        String password = dialog.getPassword();
     862        String protocol = dialog.getProtocol();
     863
     864        Configuration.fedora_info.setHostname(hostname);
     865        Configuration.fedora_info.setPort(port);
     866        Configuration.fedora_info.setUsername(username);
     867        Configuration.fedora_info.setPassword(password);
     868        Configuration.fedora_info.setProtocol(protocol);
     869
     870        String ping_url_str = protocol + "://" + hostname + ":" + port + "/fedora";
     871        String login_str = username + ":" + password;
     872       
     873        String login_encoding = new sun.misc.BASE64Encoder().encode(login_str.getBytes());
     874
     875
     876        try {
     877        URL ping_url = new URL(ping_url_str);
     878        URLConnection uc = ping_url.openConnection();
     879        uc.setRequestProperty  ("Authorization", "Basic " + login_encoding);
     880        // Attempt to access some content ...
     881        InputStream content = (InputStream)uc.getInputStream();
     882
     883        }
     884        catch (Exception exception) {
     885        System.err.println("****");
     886        System.err.println("* Failed to connect to Fedora server.");
     887        System.err.println("* Server might not be running, or incorrect username and/or password.");
     888        System.err.println("***");
     889        DebugStream.printStackTrace(exception);
     890        System.exit(1);
     891        }
     892    }
     893    else {
     894        System.exit(0);
     895    }
     896
     897
     898    dialog.dispose();
     899    dialog = null;
     900
     901
     902    }
     903
    789904
    790905
  • gli/trunk/src/org/greenstone/gatherer/GathererProg.java

    r13599 r14974  
    5555    // Ensure platform specific LAF
    5656    try {
    57         UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
     57        // UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
     58        UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
    5859    }
    5960    catch (Exception exception) {
  • gli/trunk/src/org/greenstone/gatherer/GetOpt.java

    r14303 r14974  
    5555    public String metadata_path = null;
    5656
     57    protected FedoraInfo fedora_info = null;
     58
    5759    public GetOpt(String[] args)
    5860    {
    5961    // Default dictionary. Only used for starting error messages.
    6062    Dictionary dictionary = new Dictionary(null, null);
     63
     64    fedora_info = new FedoraInfo();
    6165
    6266    // Parse arguments
     
    142146            use_remote_greenstone = true;
    143147            //Use a remote Greenstone
    144        
    145             }else if (argument_name.equals(StaticStrings.GSDL3_ARGUMENT)){
     148            }
     149            else if (argument_name.equals(StaticStrings.GSDL3_ARGUMENT)){
    146150            //Use a remote Greenstone3
    147151            run_gsdl3=true;
     
    243247            }
    244248            }
     249
     250            // Fedora home
     251            if(argument_name.equals(StaticStrings.FEDORA_HOME)) {
     252            if(argument_value.endsWith(File.separator)) {
     253                fedora_info.setHome(argument_value);
     254            }
     255            else {
     256                fedora_info.setHome(argument_value + File.separator);
     257            }
     258            }
     259
     260            // Fedora hostname
     261            if(argument_name.equals(StaticStrings.FEDORA_HOSTNAME)) {
     262            if(argument_value.endsWith(File.separator)) {
     263                fedora_info.setHostname(argument_value);
     264            }
     265            else {
     266                fedora_info.setHostname(argument_value + File.separator);
     267            }
     268            }
     269            // Fedora port
     270            if(argument_name.equals(StaticStrings.FEDORA_PORT)) {
     271            if(argument_value.endsWith(File.separator)) {
     272                fedora_info.setPort(argument_value);
     273            }
     274            else {
     275                fedora_info.setPort(argument_value + File.separator);
     276            }
     277            }
     278            // Fedora username
     279            if(argument_name.equals(StaticStrings.FEDORA_USERNAME)) {
     280            if(argument_value.endsWith(File.separator)) {
     281                fedora_info.setUsername(argument_value);
     282            }
     283            else {
     284                fedora_info.setUsername(argument_value + File.separator);
     285            }
     286            }
     287            // Fedora password
     288            if(argument_name.equals(StaticStrings.FEDORA_PASSWORD)) {
     289            if(argument_value.endsWith(File.separator)) {
     290                fedora_info.setPassword(argument_value);
     291            }
     292            else {
     293                fedora_info.setPassword(argument_value + File.separator);
     294            }
     295            }
     296            // Fedora protocol, e.g. http or https
     297            if(argument_name.equals(StaticStrings.FEDORA_PROTOCOL)) {
     298            if(argument_value.endsWith(File.separator)) {
     299                fedora_info.setProtocol(argument_value);
     300            }
     301            else {
     302                fedora_info.setProtocol(argument_value + File.separator);
     303            }
     304            }
     305
     306
     307
     308
    245309                 
    246310        }
  • gli/trunk/src/org/greenstone/gatherer/collection/Collection.java

    r13819 r14974  
    8686    /** The name of the import element. */
    8787    static final private String IMPORT = "Import";
     88    /** The name of the import element. */
     89    static final private String EXPORT = "Export";
    8890    /** The name of the imported attribute. */
    8991    static final private String IMPORTED = "imported";
     
    111113    }
    112114    // Finally create all of the child managers that are directly dependant on a collection
    113     build_options = new ScriptOptions(getBuildValues(), "buildcol.pl");
    114     import_options = new ScriptOptions(getImportValues(), "import.pl");
     115
     116    if (Configuration.fedora_info.isActive()) {
     117        build_options = new ScriptOptions(getValues(BUILD), "g2f-buildcol.pl");
     118        import_options = new ScriptOptions(getValues(IMPORT), "g2f-import.pl");
     119    }
     120    else {
     121        build_options = new ScriptOptions(getBuildValues(), "buildcol.pl");
     122        import_options = new ScriptOptions(getImportValues(), "import.pl");
     123    }
    115124    }
    116125   
     
    334343   
    335344
     345    /** Method to retrieve the current import/build/export/whatever options associated with this Collection. */
     346    private Element getValues(String val_type) {
     347    Element values_element = null;
     348    try {
     349        Element document_element = document.getDocumentElement();
     350        Element config_element = (Element) XMLTools.getNodeFromNamed(document_element, BUILD_CONFIG);
     351        values_element = (Element) XMLTools.getNodeFromNamed(config_element, val_type);
     352        config_element = null;
     353        document_element = null;
     354    }
     355    catch (Exception error) {
     356        DebugStream.printStackTrace(error);
     357    }
     358    return values_element;
     359    }
     360
    336361   
    337362    /** Method to retrieve the current build options associated with this Collection. */
     
    350375    return build_values_element;
    351376    }
     377
    352378   
    353379    /** Count either documents or folders, depending on the state of the given boolean. */
  • gli/trunk/src/org/greenstone/gatherer/collection/CollectionManager.java

    r14817 r14974  
    159159        command_parts_list.add("-S");
    160160    }
    161     command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "buildcol.pl");
     161
     162    if (Configuration.fedora_info.isActive()) {
     163        command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "g2f-buildcol.pl");
     164
     165        command_parts_list.add("-hostname");
     166        command_parts_list.add(Configuration.fedora_info.getHostname());
     167
     168        command_parts_list.add("-port");
     169        command_parts_list.add(Configuration.fedora_info.getPort());
     170
     171        command_parts_list.add("-username");
     172        command_parts_list.add(Configuration.fedora_info.getUsername());
     173
     174        command_parts_list.add("-password");
     175        command_parts_list.add(Configuration.fedora_info.getPassword());
     176
     177        command_parts_list.add("-protocol");
     178        command_parts_list.add(Configuration.fedora_info.getProtocol());
     179
     180    }
     181    else {
     182        command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "buildcol.pl");
     183    }
    162184    command_parts_list.add("-gli");
    163185    command_parts_list.add("-language");
     
    193215    public boolean built() {
    194216    if(collection != null) {
    195         // Determine if the collection has been built by looking for the build.cfg or buildConfig.xml file
    196         String file_name = (Gatherer.GS3)? Utility.BUILD_CONFIG_XML : Utility.BUILD_CFG;
    197         File build_cfg_file = new File(getLoadedCollectionIndexDirectoryPath() + file_name);
    198         return build_cfg_file.exists();
     217        // Determine if the collection has been built by looking for the build.cfg (gs20 buildConfig.xml (gs3) or export.inf (fedora) file
     218        String file_name = "";
     219
     220        if (Gatherer.GS3) {
     221        file_name = getLoadedCollectionIndexDirectoryPath() + Utility.BUILD_CONFIG_XML;
     222        }
     223        else {
     224        if (Configuration.fedora_info.isActive()) {
     225            // Fedora build
     226            //file_name = getLoadedCollectionArchivesDirectoryPath() + "import.inf";
     227            file_name = getLoadedCollectionExportDirectoryPath() + "export.inf";
     228        }
     229        else {
     230            file_name = getLoadedCollectionIndexDirectoryPath() + Utility.BUILD_CFG;
     231        }
     232        }
     233
     234        File test_file = new File(file_name);
     235        return test_file.exists();
    199236    }
    200237    return false;
     
    592629    }
    593630
     631    /** Returns the absolute filename of the loaded collection's export directory.
     632     */
     633    static public String getLoadedCollectionExportDirectoryPath()
     634    {
     635    return getLoadedCollectionDirectoryPath() + "export" + File.separator;
     636    }
     637
     638
    594639
    595640    /** Returns the absolute filename of the loaded collection's building directory.
     
    764809        command_parts_list.add("-S");
    765810    }
    766     command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "import.pl");
     811
     812    if (Configuration.fedora_info.isActive()) {
     813        command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "g2f-import.pl");
     814
     815        command_parts_list.add("-hostname");
     816        command_parts_list.add(Configuration.fedora_info.getHostname());
     817
     818        command_parts_list.add("-port");
     819        command_parts_list.add(Configuration.fedora_info.getPort());
     820
     821        command_parts_list.add("-username");
     822        command_parts_list.add(Configuration.fedora_info.getUsername());
     823
     824        command_parts_list.add("-password");
     825        command_parts_list.add(Configuration.fedora_info.getPassword());
     826
     827        command_parts_list.add("-protocol");
     828        command_parts_list.add(Configuration.fedora_info.getProtocol());
     829    }
     830    else {
     831        command_parts_list.add(LocalGreenstone.getBinScriptDirectoryPath() + "import.pl");
     832    }
     833
    767834    command_parts_list.add("-gli");
    768835    command_parts_list.add("-language");
     
    13391406    private boolean installCollection()
    13401407    {
     1408    if (Configuration.fedora_info.isActive()) {
     1409        DebugStream.println("Fedora build complete. No need to move files.");
     1410        return true;
     1411    }
     1412
     1413       
    13411414    DebugStream.println("Build complete. Moving files.");
    13421415
  • gli/trunk/src/org/greenstone/gatherer/collection/ScriptOptions.java

    r13753 r14974  
    247247        }
    248248
     249
    249250        // Create the process.
    250251        Runtime runtime = Runtime.getRuntime();
    251252        Process process = runtime.exec(args);
     253
     254        /*
     255        for (int i=0; i<args.length; i++) {
     256            System.err.print(args[i] + " ");
     257        }
     258        System.err.println("");
     259        */
     260
     261
    252262        document = XMLTools.parseXML(process.getErrorStream());
     263       
     264        if (document == null) {
     265            // command has not generated XML, script has probably failed in some way
     266            for (int i=0; i<args.length; i++) {
     267            DebugStream.print(args[i] + " ");
     268            }
     269            DebugStream.println("");
     270        }
    253271        }
    254272
  • gli/trunk/src/org/greenstone/gatherer/gems/MetadataSetManager.java

    r13680 r14974  
    8282        }
    8383
    84     new Configuration(gli_user_directory_path, gsdl_path, gsdl3_path, null, null);         
     84    new Configuration(gli_user_directory_path, gsdl_path, gsdl3_path, null, null, null);         
    8585    current_language = Configuration.getLanguage();
    8686
  • gli/trunk/src/org/greenstone/gatherer/gui/DesignPane.java

    r12144 r14974  
    3939import org.greenstone.gatherer.cdm.CollectionDesignManager;
    4040import org.greenstone.gatherer.cdm.Control;
     41
     42import org.greenstone.gatherer.Configuration;
     43
    4144public class DesignPane
    4245    extends BaseConfigPane {
     
    4548    public DesignPane() {
    4649    super();
    47     contents = new String [] { "CDM.GUI.Plugins", "CDM.GUI.Indexes", "CDM.GUI.Subcollections",  "CDM.GUI.Classifiers" };
     50    if (Configuration.fedora_info.isActive()) {
     51        contents = new String [] { "CDM.GUI.Plugins" };
     52    }
     53    else {
     54        contents = new String [] { "CDM.GUI.Plugins", "CDM.GUI.Indexes", "CDM.GUI.Subcollections",  "CDM.GUI.Classifiers" };
     55    }
    4856   
    4957    }
  • gli/trunk/src/org/greenstone/gatherer/gui/GUIManager.java

    r13944 r14974  
    387387        if (Configuration.get("workflow.design", true)) {
    388388        // "GUI.Design_Tooltip" is used automatically
    389         tab_pane.addTab(Dictionary.get("GUI.Design"), JarTools.getImage("design.gif"), design_pane, Dictionary.get("GUI.Design_Tooltip"));
     389        if (Configuration.fedora_info.isActive()) {
     390            tab_pane.addTab("Plugins", JarTools.getImage("design.gif"), design_pane, Dictionary.get("GUI.Design_Tooltip"));
     391        }
     392        else {
     393            tab_pane.addTab(Dictionary.get("GUI.Design"), JarTools.getImage("design.gif"), design_pane, Dictionary.get("GUI.Design_Tooltip"));
     394        }
     395
    390396        tab_pane.setEnabledAt(tab_pane.indexOfComponent(design_pane), false);
    391397        }
     
    641647    public void setTitle(String title, String name) {
    642648    // Finally display the collection name in the title bar.
    643     StringBuffer title_buffer = new StringBuffer(Gatherer.PROGRAM_NAME);
     649    StringBuffer title_buffer = new StringBuffer(Configuration.getApplicationTitle());
    644650    title_buffer.append(StaticStrings.SPACE_CHARACTER);
    645651    title_buffer.append(Gatherer.PROGRAM_VERSION);
  • gli/trunk/src/org/greenstone/gatherer/remote/RemoteGreenstoneServer.java

    r14601 r14974  
    3737import org.greenstone.gatherer.DebugStream;
    3838import org.greenstone.gatherer.Dictionary;
     39import org.greenstone.gatherer.FedoraInfo;
    3940import org.greenstone.gatherer.GAuthenticator;
    4041import org.greenstone.gatherer.Gatherer;
     
    854855    public void run()
    855856    {
    856         remote_greenstone_server_authentication = new RemoteGreenstoneServerAuthenticator().getAuthentication();
     857
     858        if (Configuration.fedora_info.isActive()) {
     859
     860        FedoraInfo fedora_info = Configuration.fedora_info;
     861       
     862        String username = fedora_info.getUsername();
     863        String password = fedora_info.getPassword();
     864
     865        //remote_greenstone_server_authentication.setUsername(fedora_info.getUsername());
     866        //remote_greenstone_server_authentication.setPassword(fedora_info.getPassword());
     867
     868        remote_greenstone_server_authentication = new RemoteGreenstoneServerAuthenticator().getAuthentication(username,password);
     869       
     870
     871        }
     872        else {
     873        remote_greenstone_server_authentication = new RemoteGreenstoneServerAuthenticator().getAuthentication();
     874
     875        }
    857876    }
    858877
     
    861880        extends GAuthenticator
    862881    {
     882        public PasswordAuthentication getAuthentication(String username, String password)
     883        {
     884        return getPasswordAuthentication(username,password);
     885        }
     886
    863887        public PasswordAuthentication getAuthentication()
    864888        {
  • gli/trunk/src/org/greenstone/gatherer/shell/GShell.java

    r14818 r14974  
    192192        System.err.println("Collection name: " + collection_name);
    193193
     194
    194195        String script_args = "";
    195196        for (int i = 1; i < (args.length - 1); i++) {
     
    404405        else if(type == BUILD) {
    405406        // download the building directory (if gsdl server is remote)
    406         if (Gatherer.isGsdlRemote) {
     407        if ((Gatherer.isGsdlRemote) && (!Configuration.fedora_info.isActive())) {
    407408            if (progress!=null) {
    408409            progress.messageOnProgressBar("Downloading index data from server");
    409410            }
    410            
     411                       
    411412            if (!Gatherer.GS3){
    412413            // Only need to download build.cfg file
  • gli/trunk/src/org/greenstone/gatherer/util/StaticStrings.java

    r14241 r14974  
    114114    static final public String FORMAT_END_TAG = "</format>";
    115115    static final public String FURTHER_DIALOG_INDICATOR = "...";
     116    static final public String FEDORA_HOME = "-fedora_home";
     117    static final public String FEDORA_HOSTNAME = "-fedora_hostname";
     118    static final public String FEDORA_PORT     = "-fedora_port";
     119    static final public String FEDORA_USERNAME = "-fedora_username";
     120    static final public String FEDORA_PASSWORD = "-fedora_password";
     121    static final public String FEDORA_PROTOCOL = "-fedora_protocol";
    116122    static final public String GLI_ATTRIBUTE = "gli";
    117123    static final public String GLISERVER_URL_ARGUMENT = "-gliserver_url";
Note: See TracChangeset for help on using the changeset viewer.