Changeset 32886 for gs3-extensions


Ignore:
Timestamp:
2019-03-08T13:59:41+13:00 (5 years ago)
Author:
davidb
Message:

Copy refactoring

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

Legend:

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

    r32877 r32886  
    3636import java.util.Set;
    3737
    38 import org.greenstone.gsdl3.IIIFServerBridge;
    39 
    4038/**
    4139 * Handles IIIF Image API 2.x image requests.
     
    4644public class GSImageResource extends IIIF2Resource {
    4745
    48     protected Source createSource(Identifier identifier) throws Exception
    49     {
    50     String identifier_str = identifier.toString();
    51     String[] strs = identifier_str.split(":", 3);
    52     if(strs == null || strs.length < 3) {
    53         System.err.println("identifier is not in the form site:coll:id" + identifier_str);
    54         return null;
    55     }   
    56     String site_name = strs[0];
    57     String coll_name = strs[1];
    58     String doc_id = strs[2];
    59 
    60     // Move into Constructor ???
    61     IIIFServerBridge gs_iiif_bridge = new IIIFServerBridge();
    62     // and keep cache of of bridges in hashmap, keyed on sitename??     
    63     gs_iiif_bridge.init(site_name);
    64    
    65     String collect_image_filename = gs_iiif_bridge.doGetDocumentMessage(coll_name + ":" + doc_id);
    66     String site_image_filename = site_name + "/collect/" + coll_name + "/index/assoc/" + collect_image_filename;
    67    
    68     System.err.println("**** Greenstone site image filename = " + site_image_filename);
    69 
    70     final Identifier identifier_image = new Identifier(site_image_filename);
    71     System.err.println("***** identifier_image = " + identifier_image);
    72 
    73     final Source source = new SourceFactory().newSource(identifier_image, getDelegateProxy());
    74        
    75     System.err.println("***** source path = " + ((edu.illinois.library.cantaloupe.source.FileSource)source).getPath());
    76 
    77     return source;
    78     }
    7946   
    8047    /**
     
    143110        }
    144111
    145     final Source source = createSource(identifier);
    146         //final Source source = new SourceFactory().newSource(
    147         //        identifier, getDelegateProxy());
     112    final Identifier identifier_image = IdentifierToGSAssocfile.createIdentifierImage(identifier);
     113    final Source source = new SourceFactory().newSource(identifier_image, getDelegateProxy());
     114       
     115    //System.err.println("***** source path = " + ((edu.illinois.library.cantaloupe.source.FileSource)source).getPath());
    148116
    149117        // 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/GSInformationResource.java

    r32875 r32886  
    2727import org.restlet.resource.Get;
    2828
    29 import org.greenstone.gsdl3.IIIFServerBridge;
     29//import org.greenstone.gsdl3.IIIFServerBridge; // ****
    3030
    3131/**
     
    8888            }
    8989        }
    90 
     90   
     91    final Identifier identifier_image = IdentifierToGSAssocfile.createIdentifierImage(identifier);
     92    final Source source = new SourceFactory().newSource(identifier_image, getDelegateProxy());
     93    /*
    9194    String identifier_str = identifier.toString();
    9295    String[] strs = identifier_str.split(":", 3);
     
    115118    System.err.println("***** identifier_image = " + identifier_image);
    116119    System.err.println("***** source path = " + ((edu.illinois.library.cantaloupe.source.FileSource)source).getPath());
     120    */
    117121   
    118122        // If we are resolving first, or if the source image is not present in
Note: See TracChangeset for help on using the changeset viewer.