Changeset 38936 for gs3-extensions


Ignore:
Timestamp:
2024-04-21T17:43:45+12:00 (7 weeks ago)
Author:
anupama
Message:

(When the PC ran out of memory and tomcat wouldn't shutdown, it got into a state thereafter where it could neither restart nor stop nor start. A machine reboot fixed the problem, but the problem distracted me for a while and prevented the initial commit and further cleanup of code.) This commit: getting the GsdlCollageApplet to successfully work as a *webswing* *applet*. Dr Bainbridge worked out: 1. How to get the GsdlCollageApplet to work with correct, hardcoded applet parameters in webswing.config.in. The applet wasn't showing yet on init() when run with webswing, and only shows when the GsdlCollageApplet Java Component receives the resize event (not even on its first Shown event). 2. How to pass in applet parameters use customArgs as a value to a applet param key in webswing.config, then set the value of customArgs in JavaScript to be string of key-value pairs with custom separators that will successfully make it into Java and can be parsed out. 3. How to get the webswing kill() JavaScript function to stop the GsdlCollageApplet when run *as an applet* when the user navigates away from the page (the kill() function had successfully stopped GsdlCollageApplet when it had been run as an application. The problem was that unless we implement a webswing shutdown handler, by default, webswing's kill() just generates a windowClosing event and it's done. This works out for the collage application as it has been written to respond to the windowClosing event, but it didn't work for applets as they don't respond to windowClosing events. Instead, the webswing API docs online mentioned the signature of the shutdown handler that we could add to do our own thing on shutdown, which the GsdlCollageApplet now does when run as an applet (it calls stop and destroy, which ensure the threads GsdlCollageApplet launched stop running, just as it does when it exits as an application). The hint of the issue of why kill() wasn't responding was in the tomcat/bin/logs/webswing.log file where webswing added a message that no custom shutdown listeners were registered so it was just going to follow the default shutdown procedure (which from the webswing source code turned to be generating a windowClosing Event). 4. Finally JPhind needed an adjustment around the isWebswing parameter since it stopped being called isWebswingApplication (when it used to behave accordingly if it was run as webswing and as an application not applet).

Location:
gs3-extensions/webswing/trunk/web/etc
Files:
1 added
1 edited

Legend:

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

    r38888 r38936  
    156156      "allowJsLink" : true,
    157157      "allowLocalClipboard" : true,
    158       "launcherType" : "Desktop",
     158      "launcherType" : "Applet",
    159159      "launcherConfig" : {
    160         "mainClass" : "org.greenstone.applet.GsdlCollageApplet.GsdlCollageApplet",
    161     "args" : "${customArgs} --webswing 1 --gsdlversion 3 --isJava2 auto"
     160        "appletClass" : "org.greenstone.applet.GsdlCollageApplet.GsdlCollageApplet",
     161    "parameters" : {           
     162           "gsdlversion" : "3",
     163       "webswing" : "1",
     164       "xtraParams" : "${customArgs}"
     165    }
    162166      },
    163167      "homeDir" : "@gsdl3webwritablehomeunix@"
Note: See TracChangeset for help on using the changeset viewer.