Changeset 32842 for gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/core/IIIFMessageRouter.java
- Timestamp:
- 2019-03-03T22:50:56+13:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/core/IIIFMessageRouter.java
r32707 r32842 28 28 import org.apache.commons.lang3.StringUtils; 29 29 import org.apache.log4j.Logger; 30 import org.greenstone.gsdl3.collection. OAICollection;30 import org.greenstone.gsdl3.collection.IIIFCollection; 31 31 import org.greenstone.gsdl3.collection.ServiceCluster; 32 32 import org.greenstone.gsdl3.comms.Communicator; … … 36 36 import org.greenstone.gsdl3.util.GSPath; 37 37 import org.greenstone.gsdl3.util.GSXML; 38 import org.greenstone.gsdl3.util. OAIXML;38 import org.greenstone.gsdl3.util.IIIFXML; 39 39 import org.greenstone.gsdl3.util.UserContext; 40 40 import org.greenstone.gsdl3.util.XMLConverter; … … 48 48 * The hub of a Greenstone IIIF image server/bridge. 49 49 * 50 * A simplified version of MessageRouter for OAIServer. Only loads up collections that have OAIservices.50 * A simplified version of MessageRouter for IIIFServerBridge. Only loads up collections that have IIIF services. 51 51 */ 52 52 public class IIIFMessageRouter extends MessageRouter … … 55 55 static Logger logger = Logger.getLogger(org.greenstone.gsdl3.core.IIIFMessageRouter.class.getName()); 56 56 57 public Element oai_config = null;57 public Element iiif_config = null; 58 58 //*************************************************************** 59 59 // public methods … … 74 74 cleanUpModuleMapEntire(); 75 75 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 77 81 File configFile = new File(GSFile.siteConfigFile(this.site_home)); 78 82 … … 92 96 this.config_info = config_doc.getDocumentElement(); 93 97 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) 97 104 { 98 logger.error("Couldn't load in OAIConfig.xml");105 logger.error("Couldn't load in IIIFConfig.xml"); 99 106 return false; 100 107 } … … 122 129 logger.info("Activating collection: " + col_name + "."); 123 130 Document doc = this.collection_list.getOwnerDocument(); 124 // use our special OAICollection - this will only load in oaiservices125 OAICollection c = new OAICollection();131 // use our special IIIFCollection - this will only load in IIIF services 132 IIIFCollection c = new IIIFCollection(); 126 133 127 134 c.setCollectionName(col_name); … … 135 142 136 143 logger.info("have just configured collection " + col_name); 137 if (!c.has OAI()) {138 logger.info ("collection "+col_name+" has no OAIservices. Not keeping it loaded");144 if (!c.hasIIIF()) { 145 logger.info ("collection "+col_name+" has no IIIF services. Not keeping it loaded"); 139 146 return false; 140 147 } 141 if (!c.configure OAI(this.oai_config)) {142 logger.info("couldn't configure the collection : "+col_name +" with the oaiconfig info");148 if (!c.configureIIIF(this.iiif_config)) { 149 logger.info("couldn't configure the collection : "+col_name +" with the iiif config info"); 143 150 return false; 144 151 } … … 147 154 Element e = doc.createElement(GSXML.COLLECTION_ELEM); 148 155 e.setAttribute(GSXML.NAME_ATT, col_name); 156 /* 149 157 e.setAttribute(OAIXML.LASTMODIFIED, "" + c.getLastmodified()); 150 158 e.setAttribute(OAIXML.EARLIEST_DATESTAMP, "" + c.getEarliestDatestamp()); 151 159 e.setAttribute(OAIXML.EARLIEST_OAI_DATESTAMP, "" + c.getEarliestOAIDatestamp()); 160 */ 152 161 this.collection_list.appendChild(e); 153 162 return true; … … 168 177 * @return the result Element - should be <response> 169 178 */ 179 /* 170 180 protected Element processMessage(Element req) { 171 181 Document doc = XMLConverter.newDOM(); … … 185 195 } 186 196 187 197 */ 188 198 }
Note:
See TracChangeset
for help on using the changeset viewer.