Ignore:
Timestamp:
2012-09-12T19:37:39+12:00 (12 years ago)
Author:
ak19
Message:
  1. Fixed the democlient to work with the new GS3 again: lots of small things had got broken (such as image display, since the metadata being stored was different). 2. Updating the jar files and democlient distribution zip files with the latest working version of this.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/gs3-webservices-java-client/trunk/src/GS3DemoClient/org/greenstone/gs3client/BrowseDisplay.java

    r22299 r26180  
    452452            if(docNode.hasNoText()) { //NoText field is 1, meaning it's an img
    453453                // now display the image
    454                 this.htmlPane.setText(
    455                         Displays.getImgUrlEnclosedInHtml(docNode.getImgURL()));
     454                this.htmlPane.setText(Displays.getImgUrlEnclosedInHtml(client.getBaseURL(), docNode.getImgURL()));
    456455            } else { // it has text
    457456                // Java's htmlpane does not recognise justified alignment.
     
    464463                String docContent = docNode.getContent().replaceAll(
    465464                        "ALIGN=\"JUSTIFY\"", "ALIGN=\"LEFT\"");
    466                 String baseURL = client.getBaseURL();
     465            String baseURL = client.getBaseURL();
     466                           
    467467                // TODO: make the docNode itself work out its URL by passing
    468468                // baseURL to the docNode?
     
    477477                        = (HTMLDocument)this.htmlPane.getDocument();
    478478                    try{
     479                   
     480                    switch(client.getActiveDL()) {
     481                   
     482                    case GS3JavaClient.GREENSTONE:
     483                    doc.setBase(new URL(baseURL));
     484                    break;
     485                    case GS3JavaClient.FEDORA:                 
    479486                        URL url = new URL(baseURL+docNode.getRoot().nodeID+"/");
    480487                        //System.err.println("url: " + url.toString());
     
    482489                        //docContent = docContent.replaceAll("_httpdocimg_/", "");
    483490                        LOG.debug(docContent);
     491                    break;
     492                    default:
     493                    break;
     494                    }
     495                   
    484496                    }catch(MalformedURLException mex) {
    485497                        ; //nothing to be done, leave the base as it is
    486498                    }
    487                 }
     499            }
    488500                this.htmlPane.setText(docContent);
    489501            }
     
    498510        c.setCursor(Cursor.getDefaultCursor()); // set the cursor back to normal
    499511    }
    500    
     512
    501513    /** Inner class (not static, as it needs access to outerclass' this object.
    502514     * This class represents a button that encapsulates a ClassifierData
Note: See TracChangeset for help on using the changeset viewer.