Changeset 34158


Ignore:
Timestamp:
2020-06-12T23:47:19+12:00 (4 years ago)
Author:
ak19
Message:

Fixing discovery of client-gli issues with previewing a different library (e.g. /default-library instead of /library). This commit adds to Kathy's recent work on supporting other libraries when previewing especially in the remote case, where Diego had detected problems. 1. First fixed a foolish copy paste error I made last time in full-rebuild.pl, commit 34128, when I was fixing up the script to accept the library_name parameter so it could pass this to buildcol.pl calling activate and/or to activate.pl directly. Only detected the problem when I was going to copy paste it into incremental-rebuild.pl. 2. Similar solution added to incremental-rebuild.pl and tested from commandline that this script too now accepts and passes on the library_name parameter to buildcol.pl to reach activate when needed. 3. GLI now passes library_name to building process, so activate can call the correct library to activate a collection. The library_name is obtained from client-gli, where the library (servlet_path) is set when configuring the site in use.

Location:
main/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java

    r33015 r34158  
    234234        command_parts_list.add("-collectdir");
    235235        command_parts_list.add(getCollectDirectory()); // <../collect/>
     236    } else { // actually this should work in local Greenstone case too:
     237        command_parts_list.add("-library_name");
     238        String library_servlet_name = Configuration.servlet_path;
     239        if(library_servlet_name.startsWith("/")) {
     240        library_servlet_name = library_servlet_name.substring(1);
     241        }
     242        command_parts_list.add(library_servlet_name);
    236243    }
    237244
     
    291298        import_list.add(getCollectDirectory());
    292299    }
     300    // import.pl does not at present need to know the library/servlet_path
     301    // whether in a remote or local GS server situation
    293302
    294303    String[] import_options = collection.import_options.getValues();
     
    338347        build_list.add("-collectdir");
    339348        build_list.add(getCollectDirectory());
     349    } else { // actually this should work in local Greenstone case too:
     350        build_list.add("-library_name");
     351        String library_servlet_name = Configuration.servlet_path;
     352        if(library_servlet_name.startsWith("/")) {
     353        library_servlet_name = library_servlet_name.substring(1);
     354        }
     355        build_list.add(library_servlet_name);
    340356    }
    341357
  • main/trunk/greenstone2/bin/script/full-rebuild.pl

    r34128 r34158  
    131131        # we want buildcol.pl to send it to activate if running buildcol.pl with -activate
    132132        # And we want activate.pl to get it if running activate.pl
    133         $build_dir = shift @argv;
    134         push(@buildcol_argv,$arg,$build_dir);
    135         push(@activate_argv,$arg,$build_dir);
     133        my $library_info = shift @argv;
     134        push(@buildcol_argv,$arg,$library_info);
     135        push(@activate_argv,$arg,$library_info);
    136136    }
    137137    elsif ($arg =~ "-OIDtype") {
  • main/trunk/greenstone2/bin/script/incremental-rebuild.pl

    r31397 r34158  
    105105        push(@buildcol_argv,$buildcol_arg,$buildcol_val);
    106106    }
     107    elsif ($arg eq "-library_url" || $arg eq "-library_name") {
     108        # only makes sense in buildcol.pl as -activate could
     109        # have been passed in then. And if so, then activate.pl will be
     110        # called by buildcol.pl which will pass on library_url/library_name
     111        # to activate.pl
     112        my $library_info = shift @argv;
     113        push(@buildcol_argv,$arg,$library_info);
     114    }
    107115    elsif ($arg =~ "-OIDtype") {
    108116        shift @argv; # skip OIDtype (don't pass OIDtype to buildcol.pl. It's not currently accepted.)
Note: See TracChangeset for help on using the changeset viewer.