Ignore:
Timestamp:
2024-02-26T17:44:36+13:00 (3 months ago)
Author:
anupama
Message:
  1. Replacing class Phind with JPhind in service/PhindPhraseBrowser allows the JPhind JApplet (new swing phind applet) to work in the Java appletviewer after making the same correction to JApplet class JPhind.java as just committed for Applet class Phind.java: the change was to replace ampersand HTML entities with actual ampersands. 2. Launching the JPhind applet as an application largely works, if the xercesImpl and xml-apis jar files are added to the classpath. There are still differences: there's more information in the GUI when run as applet than as application, which I think has to do with the additional key-value params passed into the applet. I will test that next.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/applet/phind/JPhind.java

    r38782 r38795  
    3131/*********************************************************************
    3232
    33 To run this applet as an application, for which this class has a main(), run as:
    34 
    35 java -cp ./web/WEB-INF/lib/gsdl3.jar:./web/WEB-INF/lib/gutil.jar:./web/applet/phind.jar:./web/WEB-INF/lib/log4j-1.2.8.jar:./web/WEB-INF/classes org.greenstone.applet.phind.JPhind "http://localhost:8383/greenstone3/library" --collection tudor --classifier 1 --phindcgi "?a=a&rt=r&s=PhindApplet&o=xml&ro=1" --library "gs2-library" --backdrop "interfaces/default/images/phindbg1.jpg"
     33To run this applet as an application, for which purpose this class has a main() method, run as:
     34
     35java -cp ./web/WEB-INF/lib/gsdl3.jar:./web/WEB-INF/lib/gutil.jar:./web/applet/phind.jar:./web/applet/xercesImpl.jar:./web/applet/xml-apis.jar:./web/WEB-INF/lib/log4j-1.2.8.jar:./web/WEB-INF/classes org.greenstone.applet.phind.JPhind "http://localhost:8383/greenstone3/library" --collection tudor --classifier 1 --phindcgi "?a=a&rt=r&s=PhindApplet&o=xml&ro=1" --library "gs2-library" --backdrop "interfaces/default/images/phindbg1.jpg"
    3636
    3737To print very basic usage, run this as an application so:
     
    128128    // set only if JPhind object is run as an application
    129129    URL docBaseURL = null;
    130     JTextField statusField = null;   
     130    JLabel statusBar = null;   
    131131    Map<String,String> appParams;
    132132   
     
    311311    // status bar that applet has, but we want one also if we run JPhind as application
    312312    if(!isRunAsApplet) {
    313         JPanel statusBar = new JPanel();
    314         this.statusField = new JTextField();
    315         statusBar.add(statusField);
     313        statusBar = new JLabel();
    316314        this.add(statusBar, BorderLayout.SOUTH);
    317315    }
     
    596594    public void showStatus(String msg) {
    597595    if(!isRunAsApplet) {
    598         this.statusField.setText(msg);
     596        this.statusBar.setText(msg);
    599597    } else {
    600598        super.showStatus(msg);
     
    712710    // we assume this is relative to the greenstone library
    713711    phindcgi_address = parameterValue("library")+parameterValue("phindcgi");
     712    phindcgi_address = phindcgi_address.replace("&amp;", "&");
    714713    phindcgi_address = tidy_URL(phindcgi_address, true);
    715714    System.out.println("Phind phindcgi: " + phindcgi_address);
Note: See TracChangeset for help on using the changeset viewer.