Ignore:
Timestamp:
2019-03-11T09:37:51+13:00 (5 years ago)
Author:
davidb
Message:

Additional error checking

Location:
gs3-extensions/iiif-servlet/trunk/src/src/main/java/edu/illinois/library/cantaloupe/resource/iiif/v2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/iiif-servlet/trunk/src/src/main/java/edu/illinois/library/cantaloupe/resource/iiif/v2/GSInformationResource.java

    r32886 r32891  
    9191    final Identifier identifier_image = IdentifierToGSAssocfile.createIdentifierImage(identifier);
    9292    final Source source = new SourceFactory().newSource(identifier_image, getDelegateProxy());
    93     /*
    94     String identifier_str = identifier.toString();
    95     String[] strs = identifier_str.split(":", 3);
    96     if(strs == null || strs.length < 3) {
    97         System.err.println("identifier is not in the form site:coll:id" + identifier_str);
    98         return null;
    99     }   
    100     String site_name = strs[0];
    101     String coll_name = strs[1];
    102     String doc_id = strs[2];
    103 
    104     // Move into Constructor, ,and keep hashmap ???
    105     IIIFServerBridge gs_iiif_bridge = new IIIFServerBridge();
    106     gs_iiif_bridge.init(site_name);
    107     String collect_image_filename = gs_iiif_bridge.doGetDocumentMessage(coll_name + ":" + doc_id);
    108     String site_image_filename = site_name + "/collect/" + coll_name + "/index/assoc/" + collect_image_filename;
    109    
    110     //System.err.println("**** gs_message = " + XMLConverter.getPrettyString(gs_message_elem));
    111     System.err.println("**** Greenstone site image filename = " + site_image_filename);
    112 
    113     final Identifier identifier_image = new Identifier(site_image_filename);
    114 
    115         //final Source source = new SourceFactory().newSource(identifier, getDelegateProxy());
    116     final Source source = new SourceFactory().newSource(identifier_image, getDelegateProxy());
    117        
    118     System.err.println("***** identifier_image = " + identifier_image);
    119     System.err.println("***** source path = " + ((edu.illinois.library.cantaloupe.source.FileSource)source).getPath());
    120     */
    12193   
    12294        // If we are resolving first, or if the source image is not present in
  • gs3-extensions/iiif-servlet/trunk/src/src/main/java/edu/illinois/library/cantaloupe/resource/iiif/v2/IdentifierToGSAssocfile.java

    r32886 r32891  
    4343    public static Identifier createIdentifierImage(Identifier identifier) throws Exception
    4444    {
     45    Identifier identifier_image = null;
     46
    4547    String identifier_str = identifier.toString();
    4648    String[] strs = identifier_str.split(":", 3);
     
    5961   
    6062    String collect_image_filename = gs_iiif_bridge.doGetDocumentMessage(coll_name + ":" + doc_id);
    61     String site_image_filename = site_name + "/collect/" + coll_name + "/index/assoc/" + collect_image_filename;
    62    
    63     //System.err.println("**** Greenstone site image filename = " + site_image_filename);
    6463
    65     final Identifier identifier_image = new Identifier(site_image_filename);
    66     //System.err.println("***** identifier_image = " + identifier_image);
     64    if (collect_image_filename != null) {
     65        String site_image_filename = site_name + "/collect/" + coll_name + "/index/assoc/" + collect_image_filename;
     66
     67        identifier_image = new Identifier(site_image_filename);
     68    }
    6769
    6870
Note: See TracChangeset for help on using the changeset viewer.