Changeset 38887


Ignore:
Timestamp:
2024-03-28T00:47:50+13:00 (4 weeks ago)
Author:
anupama
Message:

Some of the variable and GS3-specific parameters have been moved out of webswing.config into the webswing-collage.xsl for customisation and for dynamically working out what they are. TODO: I think width and height of the app must also be passed in as parameters as it shouldn't be hardcoded in the applet when run as application. Probably the same fix is needed for the Phind applet too when run as application.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/webswing/trunk/web/etc/webswing.config.in

    r38886 r38887  
    159159      "launcherConfig" : {
    160160        "mainClass" : "org.greenstone.applet.GsdlCollageApplet.GsdlCollageApplet",
    161     "args" : "--webswing 1 --baseurl \"http://localhost:8383/greenstone3/\" --library library --collection smallbea --gsdlversion 3 --sitename localsite --documentroot greenstone3 --verbosity 3 --imageType \".jpg%.png\" --imageMustNotHave \"interfaces/\" --classifier \"CL2.3\" --maxDepth 500 --maxDisplay 25 --refreshDelay 1500 --isJava2 auto --bgcolor \"#96c29a\""
    162       },     
     161    "args" : "${customArgs} --webswing 1 --gsdlversion 3 --verbosity 3 --imageType \".jpg%.png\" --imageMustNotHave \"interfaces/\" --classifier \"CL2.3\" --maxDepth 500 --maxDisplay 25 --refreshDelay 1500 --isJava2 auto --bgcolor \"#96c29a\""
     162      },
    163163      "homeDir" : "@gsdl3webwritablehomeunix@"
    164164    },
  • main/trunk/greenstone3/src/java/org/greenstone/applet/GsdlCollageApplet/GsdlCollageApplet.java

    r38885 r38887  
    606606    public static void printUsage() {
    607607    System.err.println("Params needed include: --gsdlversion <3/2> [--baseurl <GS3 DL baseURL>/--gwcgi <library.cgi URL>] --library l --sitename s --collection c --classifier cl --imageType \".jpg%.png\" --imageMustNotHave \"interfaces/\" --documentroot greenstone3 [--webswing <1/0>] [--verbosity <v>] --maxDepth 500 --maxDisplay 25 --refreshDelay 1500 --isJava2 auto --bgcolor \"#96c29a\" [--xtraParams <key1=value1&key2=value2&...]");
     608    System.err.println("To run as webswing application, additionally pass in --webswing 1");
    608609    }
    609610   
  • main/trunk/greenstone3/web/interfaces/default/transform/pages/webswing-collage.xsl

    r38880 r38887  
    139139       
    140140       // The applet jar files can just remain in web/applet where they are compiled up
    141 /*       
     141       
    142142       if(!webswingInstance0.options.args) {
    143143       webswingInstance0.options.args="";       
     
    146146       //https://stackoverflow.com/questions/25203124/how-to-get-base-url-with-jquery-or-javascript
    147147       var baseURL = window.location.origin+window.location.pathname;       
    148        // webswingInstance0.options.args += "\"" + baseURL+ "?a=a&amp;rt=d&amp;s=PhindApplet&amp;c="+gs.cgiParams.c + "\"";       
    149        webswingInstance0.options.args += "\"" + baseURL + "\"";
    150        
    151        webswingInstance0.options.args += " --collection=" + gs.cgiParams.c;
    152        webswingInstance0.options.args += " --library=" + gs.xsltParams.library_name;
    153        
    154        //console.log("args: " +  webswingInstance0.options.args);
    155 */       
    156        
    157        /*
    158        // Not yet working. Stick ${customArgs} at end of final param Value (BEFORE the value's closing double quote) in webswing.config.in
    159        // The applet jar files can just remain in web/applet where they are compiled up
    160        if(!webswingInstance0.options.args) {
    161        webswingInstance0.options.args="";
     148       // webswingInstance0.options.args += "\"" + baseURL+ "?a=a&amp;rt=d&amp;s=GsdlCollageApplet&amp;c=smallbea\"";
     149       var servlet_index = baseURL.indexOf("/"+gs.xsltParams.library_name);
     150       if(servlet_index > 0) {
     151       baseURL = baseURL.substring(0, servlet_index+1);
    162152       }
    163        if (gs.cgiParams.c) {       
    164        webswingInstance0.options.args += ", -Dwebswing.appletParam_collection=" + gs.cgiParams.c;
    165        }
    166        webswingInstance0.options.args += ", -Dwebswing.appletParam_library=";
    167        webswingInstance0.options.args+=(gs.xsltParams.library_name)?gs.xsltParams.library_name:"library";
     153       webswingInstance0.options.args += "--baseurl \"" + baseURL + "\"";       
     154       webswingInstance0.options.args += " --collection " + gs.cgiParams.c;
     155       webswingInstance0.options.args += " --library " + gs.xsltParams.library_name;
     156       webswingInstance0.options.args += " --sitename " + gs.xsltParams.site_name;
     157       webswingInstance0.options.args += " --documentroot greenstone3";
     158//       webswingInstance0.options.args += " --gsdlversion 3";
     159//       webswingInstance0.options.args += " --verbosity " + 3;
     160//       webswingInstance0.options.args += " --imageType " + "\".jpg%.png\"";
     161//       webswingInstance0.options.args += "--imageMustNotHave \"interfaces/\"";
     162//       webswingInstance0.options.args += "--classifier \"CL2.3\"";
     163       //webswingInstance0.options.args += "--maxDepth 500 --maxDisplay 25 --refreshDelay 1500 --isJava2 auto --bgcolor "#96c29a";
    168164       
    169165       console.log("args: " +  webswingInstance0.options.args);
    170        */
    171 
    172        /*       
    173        if(!webswingInstance0.options.appletParams) {
    174        webswingInstance0.options.appletParams={};
    175        }       
    176        if (gs.cgiParams.c) {       
    177        webswingInstance0.options.appletParams["collection"] = gs.cgiParams.c;
    178        }       
    179        webswingInstance0.options.appletParams["library"] = (gs.xsltParams.library_name) ? gs.xsltParams.library_name : "library";
    180        */
    181        /*
    182        if(!webswingInstance0.options.appletParams) {
    183        webswingInstance0.options.appletParams="";
    184        }
    185        webswingInstance0.options.appletParams += "&amp;collection=tudor&amp;library=library";     
    186        console.log("Custom Args: " + JSON.stringify(webswingInstance0.options.appletParams));
    187        */
    188        
     166   
    189167    function getParam(name) {
    190168        name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
Note: See TracChangeset for help on using the changeset viewer.