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/data/DocumentNodeData.java

    r15222 r26180  
    501501            return ""; // deal with any odd cases
    502502       
    503         if(!this.nodeMetadata.containsKey("srclink"))
     503        String imgMetaFound = "";
     504        String srclinkFile = nodeMetadata.containsKey("srclinkFile") ? (String)((Vector)nodeMetadata.get("srclinkFile")).get(0) : "";
     505        String w = nodeMetadata.containsKey("ImageWidth") ? (String)((Vector)nodeMetadata.get("ImageWidth")).get(0) : "";
     506        String h = nodeMetadata.containsKey("ImageHeight") ? (String)((Vector)nodeMetadata.get("ImageHeight")).get(0) : "";
     507
     508        if(this.nodeMetadata.containsKey("srcicon")) {
     509            imgMetaFound = "srcicon";
     510        }
     511        else if(this.nodeMetadata.containsKey("srclink")) { // old Greenstone 3
     512            imgMetaFound = "srclink";
     513        }
     514        else {
    504515            return "";
    505         Vector values = (Vector)this.nodeMetadata.get("srclink");
     516        }
     517        Vector values = (Vector)this.nodeMetadata.get(imgMetaFound);
    506518        String imgTag = (String)values.get(0);
     519
     520        if(imgMetaFound.equals("srcicon")) {
     521            imgTag = imgTag.replace("[srclinkFile]", srclinkFile);
     522            imgTag = imgTag.replace("[ImageWidth]", w);
     523            imgTag = imgTag.replace("[ImageHeight]", h);
     524            return imgTag;
     525        }
     526
     527        // else deal with srclink in the old Greenstone 3 way:
     528
    507529        // now we got <a href="somelink">; extract just the "somelink" portion
    508530        int startindex = imgTag.indexOf('\"');
Note: See TracChangeset for help on using the changeset viewer.