Ignore:
Timestamp:
2019-03-03T22:50:56+13:00 (5 years ago)
Author:
davidb
Message:

Shift from OAI as a template, to separate IIIF based classes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/core/IIIFMessageRouter.java

    r32707 r32842  
    2828import org.apache.commons.lang3.StringUtils;
    2929import org.apache.log4j.Logger;
    30 import org.greenstone.gsdl3.collection.OAICollection;
     30import org.greenstone.gsdl3.collection.IIIFCollection;
    3131import org.greenstone.gsdl3.collection.ServiceCluster;
    3232import org.greenstone.gsdl3.comms.Communicator;
     
    3636import org.greenstone.gsdl3.util.GSPath;
    3737import org.greenstone.gsdl3.util.GSXML;
    38 import org.greenstone.gsdl3.util.OAIXML;
     38import org.greenstone.gsdl3.util.IIIFXML;
    3939import org.greenstone.gsdl3.util.UserContext;
    4040import org.greenstone.gsdl3.util.XMLConverter;
     
    4848 * The hub of a Greenstone IIIF image server/bridge.
    4949 *
    50  * A simplified version of MessageRouter for OAIServer. Only loads up collections that have OAI services.
     50 * A simplified version of MessageRouter for IIIFServerBridge. Only loads up collections that have IIIF services.
    5151 */
    5252public class IIIFMessageRouter extends MessageRouter
     
    5555  static Logger logger = Logger.getLogger(org.greenstone.gsdl3.core.IIIFMessageRouter.class.getName());
    5656
    57   public Element oai_config = null;
     57  public Element iiif_config = null;
    5858    //***************************************************************
    5959    // public methods
     
    7474        cleanUpModuleMapEntire();
    7575
    76         // for oai, we don't do anything with the site config file. But we'll read it in and keep it in case need it later, eg for replace elements when retrieving metadata - which I don't think has been implemented
     76        // ****
     77        // for oai, we don't do anything with the site config
     78        // file. But we'll read it in and keep it in case need
     79        // it later, e.g. for replace elements when retrieving
     80        // metadata - which I don't think has been implemented
    7781        File configFile = new File(GSFile.siteConfigFile(this.site_home));
    7882
     
    9296        this.config_info = config_doc.getDocumentElement();
    9397
    94         // this is the receptionists OAIConfig.xml. Need to rethink how the MR gets this this if we ever talk to remote site, and whether it should be using it anyway
    95         this.oai_config = OAIXML.getOAIConfigXML();
    96         if (this.oai_config == null)
     98        // this is the receptionist's IFFFConfig.xml.
     99        // Need to rethink how the MR gets this this if we
     100        // ever talk to remote site, and whether it should be
     101        // using it anyway
     102        this.iiif_config = IIIFXML.getIIIFConfigXML();
     103        if (this.iiif_config == null)
    97104        {
    98           logger.error("Couldn't load in OAIConfig.xml");
     105          logger.error("Couldn't load in IIIFConfig.xml");
    99106          return false;
    100107        }
     
    122129        logger.info("Activating collection: " + col_name + ".");
    123130        Document doc = this.collection_list.getOwnerDocument();
    124         // use our special OAICollection - this will only load in oai services
    125         OAICollection c = new OAICollection();
     131        // use our special IIIFCollection - this will only load in IIIF services
     132        IIIFCollection c = new IIIFCollection();
    126133
    127134        c.setCollectionName(col_name);
     
    135142
    136143        logger.info("have just configured collection " + col_name);
    137         if (!c.hasOAI()) {
    138           logger.info ("collection "+col_name+" has no OAI services. Not keeping it loaded");
     144        if (!c.hasIIIF()) {
     145          logger.info ("collection "+col_name+" has no IIIF services. Not keeping it loaded");
    139146          return false;
    140147        }
    141         if (!c.configureOAI(this.oai_config)) {
    142           logger.info("couldn't configure the collection : "+col_name +" with the oai config info");
     148        if (!c.configureIIIF(this.iiif_config)) {
     149          logger.info("couldn't configure the collection : "+col_name +" with the iiif config info");
    143150          return false;
    144151        }
     
    147154        Element e = doc.createElement(GSXML.COLLECTION_ELEM);
    148155        e.setAttribute(GSXML.NAME_ATT, col_name);
     156        /*
    149157        e.setAttribute(OAIXML.LASTMODIFIED, "" + c.getLastmodified());
    150158        e.setAttribute(OAIXML.EARLIEST_DATESTAMP, "" + c.getEarliestDatestamp());
    151159        e.setAttribute(OAIXML.EARLIEST_OAI_DATESTAMP, "" + c.getEarliestOAIDatestamp());
     160        */
    152161        this.collection_list.appendChild(e);
    153162        return true;
     
    168177     * @return the result Element - should be <response>
    169178     */
     179    /*
    170180  protected Element processMessage(Element req) {
    171181    Document doc = XMLConverter.newDOM();
     
    185195  }
    186196
    187 
     197    */
    188198}
Note: See TracChangeset for help on using the changeset viewer.