Changeset 38888


Ignore:
Timestamp:
2024-03-28T21:04:33+13:00 (4 weeks ago)
Author:
anupama
Message:

GsdlCollageApplet updates. 1. Removed the sitename parameter I had introduced, to just pass the official hrefMustHave parameter which builds up the necessary parameter using the sitename, instead of building up hrefMustHave in Java which would have hardcoded a customisable parameter. 2. Can now hide/show the status bar, which is now hidden by default since the GsdlCollageApplet never used the statusbar any way. 3. Moved a lot of the parameters out of webswing.config.in into the webswing-collage.xsl so that they are more easily customisable for the end user.

Files:
4 edited

Legend:

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

    r38887 r38888  
    159159      "launcherConfig" : {
    160160        "mainClass" : "org.greenstone.applet.GsdlCollageApplet.GsdlCollageApplet",
    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\""
     161    "args" : "${customArgs} --webswing 1 --gsdlversion 3 --isJava2 auto"
    162162      },
    163163      "homeDir" : "@gsdl3webwritablehomeunix@"
  • main/trunk/greenstone3/src/java/org/greenstone/applet/GsdlCollageApplet/GsdlCollageApplet.java

    r38887 r38888  
    251251
    252252    // gets the parameters specified
     253    String showStatusBar        = getParameter("statusbar");
     254    if(showStatusBar == null || showStatusBar.equals("0")) {
     255        System.err.println("### Hiding status bar (default)");
     256        statusBar.setVisible(false);
     257    }   
    253258    String verbosity_param      = getParameter("verbosity");
    254259    String is_java2_param       = getParameter("isJava2");
     
    379384        // Try GS3 way
    380385        String library = getParameter("library");
    381         String site = getParameter("sitename");
     386        //String site = getParameter("sitename");
    382387       
    383388        // starting URL (image_url) might not be base_url. We need to store base_url separately
     
    406411        }
    407412
     413        /*
    408414        if(library != null && site != null && collection_param != null) {
    409415            String gs3CollImgPath = library + "/sites/" + site + "/collect/" + collection_param;
     
    417423            }
    418424        }
     425        */
    419426        }
    420427    }
     
    605612
    606613    public static void printUsage() {
    607     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&...]");
     614    System.err.println("Params needed include: --gsdlversion <3/2> [--statusbar 0/1] [--baseurl <GS3 DL baseURL>/--gwcgi <library.cgi URL>] --library l --collection c --classifier cl --imageType \".jpg%.png\" --imageMustNotHave \"interfaces/\" [--hrefMustHave \"LIBRARYNAME/sites/SITENAME/collect/COLNAME\"] -documentroot greenstone3 [--webswing <1/0>] [--verbosity <v>] --maxDepth 500 --maxDisplay 25 --refreshDelay 1500 --isJava2 auto --bgcolor \"#96c29a\" [--xtraParams <key1=value1&key2=value2&...]");
    608615    System.err.println("To run as webswing application, additionally pass in --webswing 1");
    609616    }
     
    612619    /**
    613620     * After building the GS3 Multimedia collection, try running this Application as:
    614 java -cp ./web/applet/GsdlCollageApplet.jar:./web/WEB-INF/lib/log4j-1.2.8.jar:./web/WEB-INF/classes org.greenstone.applet.GsdlCollageApplet.GsdlCollageApplet --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"
     621java -cp ./web/applet/GsdlCollageApplet.jar:./web/WEB-INF/lib/log4j-1.2.8.jar:./web/WEB-INF/classes org.greenstone.applet.GsdlCollageApplet.GsdlCollageApplet --statusbar 1 --baseurl "http://localhost:8383/greenstone3/" --library library --collection smallbea --gsdlversion 3 --hrefMustHave "library/sites/localsite/collect/smallbea" --documentroot greenstone3 --verbosity 3 --imageType ".jpg%.png" --imageMustNotHave "interfaces/" --classifier "CL2.3" --maxDepth 500 --maxDisplay 25 --refreshDelay 1500 --isJava2 auto --bgcolor "#96c29a"
    615622     */
    616623    public static void main(String[] args) {
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GsdlCollageBrowse.java

    r38885 r38888  
    9090
    9191    String app_info = "<"+GSXML.APPLET_ELEM+" CODEBASE='applet' CODE='org.greenstone.applet.GsdlCollageApplet.GsdlCollageApplet.class' ARCHIVE='GsdlCollageApplet.jar' WIDTH='600' HEIGHT='300'>"; // w=645,h=780
    92     app_info +="<param name='library' value='library'/>"; // TODO
    93     app_info +="<param name='collection'   value='";
    94     app_info += this.cluster_name + "'/>";
     92    app_info +="<param name='library' value='" + this.library_name + "'/>";
     93    app_info +="<param name='collection'   value='" + this.cluster_name + "'/>";
    9594    app_info += "<param name='gsdlversion' value='3' />";
    9695    app_info += "<param name='baseurl' value='http://localhost:8383/greenstone3/' />";
    97     app_info += "<param name='sitename' value='localsite' />\n";
    98    
     96    //app_info += "<param name='sitename' value='"+ this.site_home +"' />\n";
     97    //app_info += "<param name='hrefMustHave' value='smallbea' />\n";
     98    app_info += "<param name='hrefMustHave' value='" + this.library_name + "/sites/" + this.site_home + "/collect/" + this.cluster_name + "'/>\n";
    9999    //app_info += "<param name='gwcgi' value='http://localhost:8383/greenstone3/library' /><param name='classifier' value='CL3.1' /><param name='hrefMustHave' value='CL3' /><param name='imageMustNotHave' value='hl=%x=%gt=%gc=%.pr' /><param name='imageType' value='.jpg%%.png' /><param name='maxDepth' value='500' /><param name='maxDisplay' value='25' /><param name='refreshDelay' value='1500' /><param name='isJava2' value='auto' /><param name='bgcolor' value='#96c29a' />The Collage Applet.</"+GSXML.APPLET_ELEM+">"; // TODO
    100100
    101101    //app_info += "<param name='documentroot' value='library/collection/" + this.cluster_name + "/'/>";
    102     app_info += "<param name='documentroot' value='greenstone3'/>\n";
     102    app_info += "<param name='documentroot' value='greenstone3'/>\n"; // TODO
    103103    app_info += "<param name='verbosity' value='3' />\n";
    104104    app_info += "<param name='imageType' value='.jpg%.png' />\n";
    105     //app_info += "<param name='hrefMustHave' value='smallbea' />\n";
    106105    app_info += "<param name='imageMustNotHave' value='interfaces/' />\n";
    107106    app_info += "<param name='classifier' value='CL2.3' /><param name='maxDepth' value='500' /><param name='maxDisplay' value='25' /><param name='refreshDelay' value='1500' /><param name='isJava2' value='auto' /><param name='bgcolor' value='#96c29a' />The Collage Applet.</"+GSXML.APPLET_ELEM+">"; // TODO
  • main/trunk/greenstone3/web/interfaces/default/transform/pages/webswing-collage.xsl

    r38887 r38888  
    151151       baseURL = baseURL.substring(0, servlet_index+1);
    152152       }
    153        webswingInstance0.options.args += "--baseurl \"" + baseURL + "\"";       
     153       var gs3CollImgPath = gs.xsltParams.library_name + "/sites/" + gs.xsltParams.site_name + "/collect/" + gs.cgiParams.c;
     154
     155       webswingInstance0.options.args += "--baseurl \"" + baseURL + "\"";
     156       //webswingInstance0.options.args += " --gsdlversion 3";       
    154157       webswingInstance0.options.args += " --collection " + gs.cgiParams.c;
    155158       webswingInstance0.options.args += " --library " + gs.xsltParams.library_name;
    156        webswingInstance0.options.args += " --sitename " + gs.xsltParams.site_name;
    157159       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";
    164        
    165        console.log("args: " +  webswingInstance0.options.args);
     160       webswingInstance0.options.args += " --hrefMustHave " + gs3CollImgPath;
     161       webswingInstance0.options.args += " --imageMustNotHave \"interfaces/\"";
     162       webswingInstance0.options.args += " --verbosity " + 3;
     163       webswingInstance0.options.args += " --imageType " + "\".jpg%.png\"";
     164       webswingInstance0.options.args += " --classifier \"CL2.3\"";
     165       webswingInstance0.options.args += " --maxDepth 500 --maxDisplay 25 --refreshDelay 1500 --bgcolor \"#96c29a\"";
     166       
     167       //console.log("args: " +  webswingInstance0.options.args);
    166168   
    167169    function getParam(name) {
Note: See TracChangeset for help on using the changeset viewer.