Index: gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/IIIFServerBridge.java
===================================================================
--- gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/IIIFServerBridge.java	(revision 32859)
+++ gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/IIIFServerBridge.java	(revision 32860)
@@ -91,7 +91,9 @@
     public void init(String site_name) throws UnavailableException, Exception
 	{
-	    //org.greenstone.util.GlobalProperties.loadGlobalProperties("");
+	    ////GlobalProperties.loadGlobalProperties(config.getServletContext().getRealPath(""));
+			
+	    org.greenstone.util.GlobalProperties.loadGlobalProperties("");
 	    //org.greenstone.util.GlobalProperties.loadGlobalProperties(config.getServletContext().getRealPath(""));
-	    org.greenstone.util.GlobalProperties.loadGlobalProperties("/home/osboxes/research/code/greenstone3-svn/web");
+	    //org.greenstone.util.GlobalProperties.loadGlobalProperties("/home/osboxes/research/code/greenstone3-svn/web");
 	    java.io.InputStream in = Class.forName("org.greenstone.util.GlobalProperties").getClassLoader().getResourceAsStream("global.properties");
 
Index: gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/collection/IIIFCollection.java
===================================================================
--- gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/collection/IIIFCollection.java	(revision 32859)
+++ gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/collection/IIIFCollection.java	(revision 32860)
@@ -55,14 +55,8 @@
 public class IIIFCollection extends Collection
 {
-
 	static Logger logger = Logger.getLogger(org.greenstone.gsdl3.collection.IIIFCollection.class.getName());
 
 	/** does this collection provide the IIIF service */
 	protected boolean has_iiif = false;
-
-	/** earliest datestamp of an OAI collection. Also used to work out the earliest datetimestamp of the entire OAI repository */
-    /*
-	protected long earliestOAIDatestamp = 0;
-    */
     
 	/** a reference to the IIIFPMH service rack */
@@ -116,14 +110,4 @@
 	}
 
-	// NOTE:
-	// Calling cleanUp() on IIIFPMH object iiif_service_rack will
-	// close any open dbs handles on module deactivation by
-	// MESSAGEROUTER (no deactivate yet called by
-	// IIIFMessageRouter)
-
-	// But the IIIFPMH object's cleanUp() is already called by
-	// superclass ServiceCluster, which goes around calling
-	// cleanUp() on all services/ServiceRacks.
-
 	/**
 	 * whether this collection has IIIFPMH services
@@ -134,14 +118,4 @@
 	}
 
-	/**
-	 * The earliesttimestamp entry in the oai-inf.db representing when the collection was created.
-	 * Used by the OAIReceptionist
-	*/
-    /*
-	public long getEarliestOAIDatestamp()
-	{
-		return earliestOAIDatestamp;
-	}
-    */
     
   /** add any extra info for collection from IIIFConfig.xml */
@@ -154,5 +128,6 @@
 	protected boolean configureServiceRackList(Element service_rack_list, Element extra_info)
 	{
-
+	    //logger.info("*** Away to call getNamedElement() for service_rack_list = " + XMLConverter.getPrettyString(service_rack_list));
+	    
 	  // find the IIIFPMH service
 	  Element iiif_service_xml = GSXML.getNamedElement(service_rack_list, GSXML.SERVICE_CLASS_ELEM, GSXML.NAME_ATT, "IIIFPMH");
@@ -181,17 +156,5 @@
 	  
 	  if (this.iiif_service_rack.configure(iiif_service_xml, extra_info)) {
-
-	      /*
-	      // once we've configured the IIIFPMH service, we can use the OAIPMH service to
-	      // retrieve the earliest timestamp of this OAI collection from the oai-inf db
-	      long earliestTimestamp = this.oai_service_rack.getEarliestTimestamp();
-	      if(earliestTimestamp == -1) {
-		  this.earliestOAIDatestamp = -1;
-		  logger.warn("No OAI timestamp for collection " + this.cluster_name);
-	      } else {
-		  this.earliestOAIDatestamp = earliestTimestamp; // milliseconds
-	      }
-	      */
-	    
+    
 	    // find out the supported service types for this service module
 	    Node types = this.iiif_service_rack.process(message);
@@ -224,7 +187,5 @@
 	  }
 	  
-
 	  return false;
 	}
-
 }
Index: gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/core/IIIFMessageRouter.java
===================================================================
--- gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/core/IIIFMessageRouter.java	(revision 32859)
+++ gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/core/IIIFMessageRouter.java	(revision 32860)
@@ -154,45 +154,8 @@
 		Element e = doc.createElement(GSXML.COLLECTION_ELEM);
 		e.setAttribute(GSXML.NAME_ATT, col_name);
-		/*
-		e.setAttribute(OAIXML.LASTMODIFIED, "" + c.getLastmodified());
-		e.setAttribute(OAIXML.EARLIEST_DATESTAMP, "" + c.getEarliestDatestamp());
-		e.setAttribute(OAIXML.EARLIEST_OAI_DATESTAMP, "" + c.getEarliestOAIDatestamp());
-		*/
+
 		this.collection_list.appendChild(e);
 		return true;
 		
 	}
-
-
-
-	//*****************************************************************
-	// auxiliary process methods
-	//*****************************************************************
-
-	/**
-	 * handles requests made to the MessageRouter itself
-	 * 
-	 * @param req
-	 *            - the request Element- <request>
-	 * @return the result Element - should be <response>
-	 */
-    /*
-  protected Element processMessage(Element req) {
-    Document doc = XMLConverter.newDOM();
-    String type = req.getAttribute(GSXML.TYPE_ATT);
-    Element response = doc.createElement(GSXML.RESPONSE_ELEM);
-    response.setAttribute(GSXML.FROM_ATT, "");
-    
-    if (type.equals(OAIXML.OAI_SET_LIST))
-      {
-	logger.info("oaiSetList request received");
-	//this is the oai receptionist asking for a list of oai-support collections
-	response.setAttribute(GSXML.TYPE_ATT, OAIXML.OAI_SET_LIST);
-	response.appendChild(doc.importNode(this.collection_list, true));
-	return response;
-      }
-    return super.processMessage(req);
-  }
-
-    */
 }
Index: gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/core/IIIFReceptionist.java
===================================================================
--- gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/core/IIIFReceptionist.java	(revision 32859)
+++ gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/core/IIIFReceptionist.java	(revision 32860)
@@ -45,8 +45,4 @@
   /** Instead of a config_params object, only a site_name is needed by iiif receptionist. */
   protected String site_name = null;
-  /** The unique  repository identifier */
-    /*
-  protected String repository_id = null;
-    */
     
   /** the configure file of this receptionist passed from the iiif restlet. */
@@ -56,30 +52,4 @@
   protected ModuleInterface mr = null;
   
-  // Some of the data/responses will not change while the servlet is running, so
-  // we can cache them
-  
-  /** A list of all the collections available to this IIIF image server */
-  protected Element collection_list = null;
-  /** a vector of the names, for convenience */
-  protected Vector<String> collection_name_list = null;
-  /** If this is true, then there are no OAI enabled collections, so can always return 
-      noRecordsMatch (after validating the request params) */
-  protected boolean noRecordsMatch = false;
-      
-  /** A set of all known 'sets' */
-  protected HashSet<String> set_set = null;
-
-  protected boolean has_super_colls = false;
-  /** a hash of super set-> collection list */
-  protected HashMap<String, Vector<String>> super_coll_map = null;
-  /** store the super coll elements for convenience */
-  HashMap<String, Element> super_coll_data = null;
-  /** store the metadata formats ??????*/
-  /** The identify response */
-  protected Element identify_response = null;
-  /** The list set response */
-  protected Element listsets_response = null;
-  /** the list metadata formats response */
-  protected Element listmetadataformats_response = null;
 
   public IIIFReceptionist() {
@@ -97,4 +67,5 @@
     this.site_name = site_name;
   }
+
   /** sets the message router  - it should already be created and
    * configured in the init() of a servlet/restlet (IIIFServerBridge, for example) before being passed to the receptionist*/
@@ -115,132 +86,8 @@
     }
     iiif_config = config;
-
-    /*
-    repository_id = getRepositoryIdentifier(); 
-    */
-    
-    /*
-    if (!configureSetInfo()) {
-      // there are no sets
-      logger.error("No sets (collections) available for IIIF");
-      return false;
-    }
-    */
     
     return true;
   }
 
-    /*
-  private boolean configureSetInfo() {
-    this.set_set = new HashSet<String>();
-
-    // First, we get a list of all the OAI enabled collections
-    // We get this by sending a listSets request to the MR
-    Document doc = XMLConverter.newDOM();
-    Element message = doc.createElement(GSXML.MESSAGE_ELEM);
-    
-    Element request = GSXML.createBasicRequest(doc, OAIXML.OAI_SET_LIST, "", null);
-    message.appendChild(request);
-    Node msg_node = mr.process(message);
-    
-    if (msg_node == null) {
-      logger.error("returned msg_node from mr is null");
-      return false;
-    }
-    Element resp = (Element)GSXML.getChildByTagName(msg_node, GSXML.RESPONSE_ELEM);
-    Element coll_list = (Element)GSXML.getChildByTagName(resp, GSXML.COLLECTION_ELEM + GSXML.LIST_MODIFIER);
-    if (coll_list == null) {
-      logger.error("coll_list is null");
-      return false;
-    }
-
-    this.collection_list = (Element)doc.importNode(coll_list, true);
-
-    // go through and store a list of collection names for convenience
-    // also create a 'to' attribute for the next request to the MR, which
-    // is a ListSets request to each collection
-    Node child = this.collection_list.getFirstChild();
-    if (child == null) {
-      logger.error("collection list has no children");
-      noRecordsMatch = true;
-      return false;
-    }
-    
-    this.collection_name_list = new Vector<String>();
-    StringBuffer to = new StringBuffer();
-    boolean first = true;
-    while (child != null) {
-      if (child.getNodeName().equals(GSXML.COLLECTION_ELEM)) {
-	String coll_id =((Element) child).getAttribute(GSXML.NAME_ATT);
-	this.collection_name_list.add(coll_id);
-	if (!first) {
-	  to.append(',');
-	}
-	first = false;
-	to.append(coll_id+"/"+OAIXML.LIST_SETS);
-      }
-      child = child.getNextSibling();
-    }
-    if (first) {
-      // we haven't found any collections
-      logger.error("found no collection elements in collectionList");
-      noRecordsMatch = true;
-      return false;
-    }
-    Document listsets_doc = XMLConverter.newDOM();
-    Element listsets_element = listsets_doc.createElement(OAIXML.LIST_SETS);
-    this.listsets_response = getMessage(listsets_doc, listsets_element);
-    
-    // Now, for each collection, get a list of all its sets
-    // might include subsets (classifiers) or super colls
-    // We'll reuse the first message, changing its type and to atts
-    request.setAttribute(GSXML.TYPE_ATT, "");
-    request.setAttribute(GSXML.TO_ATT, to.toString());
-    // send to MR
-    msg_node = mr.process(message);
-    //logger.info("*** " + XMLConverter.getPrettyString(msg_node));
-    NodeList response_list =  ((Element)msg_node).getElementsByTagName(GSXML.RESPONSE_ELEM);
-    for (int c=0; c<response_list.getLength(); c++) {
-      // for each collection's response
-      Element response = (Element)response_list.item(c);
-      String coll_name = GSPath.getFirstLink(response.getAttribute(GSXML.FROM_ATT));
-      logger.info("*** coll from response "+coll_name);
-      NodeList set_list = response.getElementsByTagName(OAIXML.SET);
-      for (int j=0; j<set_list.getLength(); j++) {
-	// now check if it a super collection
-	Element set = (Element)set_list.item(j);
-	String set_spec = GSXML.getNodeText((Element)GSXML.getChildByTagName(set, OAIXML.SET_SPEC));
-	logger.info("*** set spec = "+set_spec);
-	// this may change if we add site name back in
-	// setSpecs will be collname or collname:subset or supercollname
-	if (set_spec.indexOf(":")==-1 && ! set_spec.equals(coll_name)) {
-	  // it must be a super coll spec
-	  logger.info("*** found super coll, "+set_spec);
-	  // check that it is a valid one from config
-	  if (this.has_super_colls == true && this.super_coll_data.containsKey(set_spec)) {
-	    Vector <String> subcolls = this.super_coll_map.get(set_spec);
-	    if (subcolls == null) {
-	      logger.info("*** its new!!");
-	      // not in there yet
-	      subcolls = new Vector<String>();
-	      this.set_set.add(set_spec);
-	      this.super_coll_map.put(set_spec, subcolls);
-	      // the first time a supercoll is mentioned, add into the set list
-	      logger.info("*** finding the set info "+XMLConverter.getPrettyString(this.super_coll_data.get(set_spec)));
-	      listsets_element.appendChild(GSXML.duplicateWithNewName(listsets_doc, this.super_coll_data.get(set_spec), OAIXML.SET, true));
-	    }
-	    // add this collection to the list for the super coll
-	    subcolls.add(coll_name);
-	  }
-	} else { // its either the coll itself or a subcoll
-	  // add in the set
-	  listsets_element.appendChild(listsets_doc.importNode(set, true));
-	  this.set_set.add(set_spec);
-	}
-      } // for each set in the collection
-    } // for each OAI enabled collection
-    return true;
-  }
-    */
     
   protected void resetMessageRouter() {
@@ -311,8 +158,4 @@
     //The only thing that the oai receptionist can be sure is that these verbs are valid, nothing else.
     String verb = request.getAttribute(GSXML.TO_ATT);
-    /*
-    if (verb.equals(OAIXML.IDENTIFY)) {
-      return doIdentify();
-      }*/
     
     if (verb.equals(OAIXML.GET_RECORD)) {
@@ -324,84 +167,8 @@
     
   }
-
-    /*
-  private String getRepositoryIdentifier() {
-    Element ri = (Element)GSXML.getChildByTagName(iiif_config, OAIXML.REPOSITORY_IDENTIFIER);
-    if (ri != null) { 
-      return GSXML.getNodeText(ri);
-    }
-    return "";
-  }
-    */
-
-  private void copyNamedElementfromConfig(Element to_elem, String element_name) {
-    Element original_element = (Element)GSXML.getChildByTagName(iiif_config, element_name);
-    if(original_element != null) {
-      GSXML.copyNode(to_elem, original_element);
-    }
-  }
-
-    /*
-  private Element doIdentify() {
-    //The validation for this verb has been done in OAIServer.validate(). So no bother here.
-    logger.info("");
-    if (this.identify_response != null) {
-      // we have already created it
-      return getMessage(this.identify_response.getOwnerDocument(), this.identify_response);
-    }
-    Document doc = XMLConverter.newDOM();
-    Element identify = doc.createElement(OAIXML.IDENTIFY);
-    //do the repository name
-    copyNamedElementfromConfig(identify, OAIXML.REPOSITORY_NAME);
-    //do the baseurl
-    copyNamedElementfromConfig(identify, OAIXML.BASE_URL);
-    //do the protocol version
-    copyNamedElementfromConfig(identify, OAIXML.PROTOCOL_VERSION);
-        
-    //There can be more than one admin email according to the OAI specification
-    NodeList admin_emails = GSXML.getChildrenByTagName(iiif_config, OAIXML.ADMIN_EMAIL);
-    int num_admin = 0;
-    Element from_admin_email = null;  
-    if (admin_emails != null) {
-      num_admin = admin_emails.getLength();
-    }
-    for (int i=0; i<num_admin; i++) {
-      GSXML.copyNode(identify, admin_emails.item(i));
-    }
-
-    // IIIF does not have the equivalent of oai earliestDatestamp 
-     
-    // output the oai identifier
-    Element description = doc.createElement(OAIXML.DESCRIPTION);
-    identify.appendChild(description);
-    // TODO, make this a valid id
-    Element oaiIdentifier = OAIXML.createOAIIdentifierXML(doc, repository_id, "lucene-jdbm-demo", "ec159e");
-    description.appendChild(oaiIdentifier);
-
-    // if there are any oaiInfo metadata, add them in too.
-    Element info = (Element)GSXML.getChildByTagName(iiif_config, OAIXML.OAI_INFO);
-    if (info != null) {
-      NodeList meta = GSXML.getChildrenByTagName(info, OAIXML.METADATA);
-      if (meta != null && meta.getLength() > 0) {
-	Element gsdl = OAIXML.createGSDLElement(doc);
-	description.appendChild(gsdl);
-	for (int m = 0; m<meta.getLength(); m++) {
-	  GSXML.copyNode(gsdl, meta.item(m));
-	}
-	
-      }
-    }
-    this.identify_response = identify;
-    return getMessage(doc, identify);
-  }
-    */
     
   private Element doGetRecord(Element req){
-    logger.info("");
-    /** arguments:
-        identifier: required
-        metadataPrefix: required
-	*  Exceptions: badArgument; cannotDisseminateFormat; idDoesNotExist
-	*/ 
+    logger.info(""); 
+
     Document doc = XMLConverter.newDOM();
     Element get_record = doc.createElement(IIIFXML.GET_RECORD);
@@ -424,5 +191,4 @@
       return OAIXML.createErrorMessage(OAIXML.ID_DOES_NOT_EXIST, "");
     }    
-    //String name_of_site = strs[0];
     String coll_name = strs[0];
     String oid = strs[1];
@@ -445,6 +211,4 @@
     return GSXML.nodeToElement(result_node);
   }
-
-
 }
 
Index: gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/service/IIIFPMH.java
===================================================================
--- gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/service/IIIFPMH.java	(revision 32859)
+++ gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/service/IIIFPMH.java	(revision 32860)
@@ -61,5 +61,4 @@
   
   protected SimpleCollectionDatabase coll_db = null;
-    //protected SimpleCollectionDatabase oaiinf_db = null;
   
   protected String site_name = "";
@@ -79,5 +78,4 @@
   /** constructor */
   public IIIFPMH() {
-
   }
   
@@ -89,8 +87,4 @@
 	this.coll_db = null;
     }
-    /*
-    if (this.oaiinf_db != null){
-    	this.oaiinf_db.closeDatabase();
-	}*/
   }
   
@@ -115,6 +109,7 @@
     Element metadata_list = (Element) GSXML.getChildByTagName(extra_info, GSXML.METADATA_ELEM+GSXML.LIST_MODIFIER);
 
+    // Is indexStem needed for IIIF // ****
     if (metadata_list != null) {
-      
+	
       Element index_stem_elem = (Element) GSXML.getNamedElement(metadata_list, GSXML.METADATA_ELEM, GSXML.NAME_ATT, "indexStem");
       
@@ -137,35 +132,4 @@
     }
 
-    /*
-    // Work out what sets this collection has.
-    //
-    // Will usually contain the collection itself, optional super
-    // collection, and maybe subcolls if appropriate classifiers are
-    // present.
-    
-    configureSetInfo();*/
-    
-    // the short_service_info is used by the message router to find the method names, 
-    /*
-    Element list_records = this.desc_doc.createElement(GSXML.SERVICE_ELEM);
-    list_records.setAttribute(GSXML.NAME_ATT, OAIXML.LIST_RECORDS);
-    list_records.setAttribute(GSXML.TYPE_ATT, "oai");
-    this.short_service_info.appendChild(list_records);
-
-    Element list_identifiers = this.desc_doc.createElement(GSXML.SERVICE_ELEM);
-    list_identifiers.setAttribute(GSXML.NAME_ATT, OAIXML.LIST_IDENTIFIERS);
-    list_identifiers.setAttribute(GSXML.TYPE_ATT, "oai");
-    this.short_service_info.appendChild(list_identifiers);
-    
-    Element list_sets = this.desc_doc.createElement(GSXML.SERVICE_ELEM);
-    list_sets.setAttribute(GSXML.NAME_ATT, OAIXML.LIST_SETS);
-    list_sets.setAttribute(GSXML.TYPE_ATT, "oai");
-    this.short_service_info.appendChild(list_sets);
-    
-    Element list_metadata_formats = this.desc_doc.createElement(GSXML.SERVICE_ELEM);
-    list_metadata_formats.setAttribute(GSXML.NAME_ATT, OAIXML.LIST_METADATA_FORMATS);
-    list_metadata_formats.setAttribute(GSXML.TYPE_ATT, "oai");
-    this.short_service_info.appendChild(list_metadata_formats);
-    */
     Element get_record = this.desc_doc.createElement(GSXML.SERVICE_ELEM);
     get_record.setAttribute(GSXML.NAME_ATT, IIIFXML.GET_RECORD);
@@ -177,53 +141,6 @@
 
   public boolean configureIIIF(Element iiif_config_elem) {
-      /*      
-    this.meta_formats_definition = this.desc_doc.createElement(OAIXML.LIST_METADATA_FORMATS);
-    this.format_response_map = new HashMap<String, Element>();
-    this.format_elements_map = new HashMap<String, HashSet<String>>();
-    this.format_meta_elem_map = new HashMap<String, Element>();
-
-    // for now, all we want is the metadata prefix description and the mapping list
-    Element main_lmf_elem = (Element) GSXML.getChildByTagName(oai_config_elem, OAIXML.LIST_METADATA_FORMATS);
-    if (main_lmf_elem == null) {
-      logger.error("No listMetadataFormats element found in OAIConfig.xml");
-      return false;
-    }
-    NodeList meta_formats_list = this.config_info.getElementsByTagName(OAIXML.METADATA_FORMAT);
-    if (meta_formats_list.getLength() == 0) {
-      logger.error("no metadataFormat elements found in OAIPMH serviceRack element");
-      return false;
-    }
       
-    boolean found_meta_format = false;
-    for(int i=0; i<meta_formats_list.getLength(); i++) {
-      Element mf = (Element) meta_formats_list.item(i);
-      String prefix = mf.getAttribute(OAIXML.METADATA_PREFIX);
-      if (prefix.equals("")) {
-	logger.error("metadataFormat element had no metadataPrefix attribute");
-	continue;
-      }
-      // get the right format from OAICOnfig
-      Element meta_format = findNamedMetadataFormat(main_lmf_elem, prefix);
-      if (meta_format == null) {
-	logger.error("Couldn't find metadataFormat named "+prefix+" in OAIConfig.xml");
-	continue;
-      }
-      
-      // copy the format definition into our stored Element
-      Element collection_version_format = (Element) this.desc_doc.importNode(meta_format, true);
-      collection_version_format.setAttribute(GSXML.NAME_ATT, prefix); // for convenience
-      this.meta_formats_definition.appendChild(collection_version_format);
-      // set up the response element for this format
-      format_response_map.put(prefix, OAIXML.getMetadataFormatShort(this.desc_doc, collection_version_format));
-      // add in collection specific mappings
-      addCollectionMappings(collection_version_format, mf);
-      // now set up a list of all collection elements for reverse lookup of the mapping
-      format_elements_map.put(prefix, getAllCollectionElements(collection_version_format));
-      format_meta_elem_map.put(prefix, OAIXML.getMetadataPrefixElement(this.desc_doc, prefix, collection_version_format));
-      
-    } // end for
-      */
-      
-	// Open the coll db db databases and store handles to them	
+      // Open the coll db db databases and store handles to them	
     coll_db = new SimpleCollectionDatabase(infodb_type);
     if (!coll_db.databaseOK()) {
@@ -231,11 +148,4 @@
       return false;
     }
-    /*
-    oaiinf_db = new SimpleCollectionDatabase(infodb_type);
-    if (!oaiinf_db.databaseOK()) {
-      logger.error("Couldn't create the oai-inf database of type "+infodb_type);
-      return false;
-    }
-    */
     
     // Open databases for querying
@@ -245,137 +155,10 @@
       return false;
     }
-    /*
-    // the oaiinf_db is called oai-inf.<infodb_type_extension>
-    String oaiinf_db_file = GSFile.OAIInfoDatabaseFile(this.site_home, this.cluster_name, "oai-inf", infodb_type);
-    File oaiinfFile = new File(oaiinf_db_file);
-    
-    if(!oaiinfFile.exists()) {
-	logger.warn("oai-inf database for collection + " + this.cluster_name + " does not exist.");
-	oaiinf_db = null;
-    } else if (!this.oaiinf_db.openDatabase(oaiinf_db_file, SimpleCollectionDatabase.READ)) {
-	logger.warn("Could not open oai-inf database for collection + " + this.cluster_name + "!");
-	oaiinf_db = null;
-    }
-    */
     
     return true;
   }
 
-    /**
-     * @return the associated OAICollection's OAI_EARLIEST_TIMESTAMP_OID record's 
-     * OAI_INF_TIMESTAMP field from the collection's oai-inf.db IN MILLISECONDS
-     */
-    /*
-    public long getEarliestTimestamp() {
-	long timestamp = -1;
-	
-	DBInfo oai_info = null;
-	if(oaiinf_db != null) {
-	    // get internal record containing the earliest timestamp of the collection
-	    oai_info = this.oaiinf_db.getInfo(OAIXML.OAI_EARLIEST_TIMESTAMP_OID);
-	    if (oai_info == null) {
-		logger.warn("Can't get collection " + this.cluster_name + "'s earliest timestamp from oai-inf db. No entry for 'OID' " + OAIXML.OAI_EARLIEST_TIMESTAMP_OID + " in the db.");		
-	    } else {
-		timestamp = Long.parseLong(oai_info.getInfo(OAIXML.OAI_INF_TIMESTAMP)) * 1000; // stored in seconds, so x1000 to  convert to milliseconds
-		//logger.info("@@@ found earliest OAI timestamp for collection " + this.coll_name + ": " + timestamp + " (ms)");
-	    }
-	}
-	return timestamp;
-    }
-    */
-
-    /*
-  protected Element findNamedMetadataFormat(Element list_meta_formats, String prefix) {
-    NodeList formats = list_meta_formats.getElementsByTagName(OAIXML.METADATA_FORMAT);
-    for (int i=0; i<formats.getLength(); i++) {
-      Element format = (Element)formats.item(i);
-      String meta_name = GSXML.getNodeText((Element)GSXML.getChildByTagName(format, OAIXML.METADATA_PREFIX));
-      if (prefix.equals(meta_name)) {
-	return format;
-      }
-    }
-    return null;
-  }
-    */
-    
-    /** goes through the mappings from the collection one, and replaces existing ones in the main one */
-    /*
-    protected void addCollectionMappings(Element main_meta_format, Element coll_meta_format) {
-
-      Element element_list = (Element)GSXML.getChildByTagName(main_meta_format, OAIXML.ELEMENT+GSXML.LIST_MODIFIER);
-      Document doc = element_list.getOwnerDocument();
-      NodeList coll_elements = coll_meta_format.getElementsByTagName(OAIXML.ELEMENT);
-      if (coll_elements.getLength()==0) {
-	// no mappings to include
-	return;
-      }
-      for (int i=0; i<coll_elements.getLength(); i++) {
-	Element e = (Element)coll_elements.item(i);
-	String elem_name = e.getAttribute(GSXML.NAME_ATT);
-	Element main_elem = GSXML.getNamedElement(element_list, OAIXML.ELEMENT, GSXML.NAME_ATT, elem_name);
-	if (main_elem == null) {
-	  logger.error(elem_name+" not found in meta format, not using it");
-	} else {
-	  element_list.replaceChild(doc.importNode(e, true),main_elem );
-      }
-      }
-    }
-    */
-    
-    /** goes through all the mappings and makes a set of all collection
-	metadata names that could become an oai meta element - acts as
-	a reverse lookup for the mappings */
-    /*
-    protected HashSet<String> getAllCollectionElements(Element meta_format) {
-      HashSet<String> meta_name_set = new HashSet<String>();
-      NodeList elements = meta_format.getElementsByTagName(OAIXML.ELEMENT);
-      for (int i=0; i<elements.getLength(); i++) {
-	Element e = (Element)elements.item(i);
-	Element map = (Element)GSXML.getChildByTagName(e, OAIXML.MAPPING);
-	if (map == null) {
-	  // there is no mapping, just use the element name
-	  meta_name_set.add(e.getAttribute(GSXML.NAME_ATT));
-	} else {
-	  String list_of_names = map.getAttribute(OAIXML.ELEMENTS);
-	  String[] name_array = list_of_names.split(",");
-	  for (int j=0; j<name_array.length; j++) {
-	    meta_name_set.add(name_array[j]);
-	  }
-	}
-      }
-      return meta_name_set;
-    }
-    */
-    
   /** returns a specific service description */
   public Element getServiceDescription(Document doc, String service_id, String lang, String subset) {
-
-      /*
-    if (service_id.equals(OAIXML.LIST_RECORDS)) {
-      Element list_records = doc.createElement(GSXML.SERVICE_ELEM);
-      list_records.setAttribute(GSXML.NAME_ATT, OAIXML.LIST_RECORDS);
-      list_records.setAttribute(GSXML.TYPE_ATT, "oai");
-      return list_records;
-    }
-    
-    if (service_id.equals(OAIXML.LIST_IDENTIFIERS)) {
-      Element list_identifiers = doc.createElement(GSXML.SERVICE_ELEM);
-      list_identifiers.setAttribute(GSXML.NAME_ATT, OAIXML.LIST_IDENTIFIERS);
-      list_identifiers.setAttribute(GSXML.TYPE_ATT, "oai");
-      return list_identifiers;
-    }
-    if (service_id.equals(OAIXML.LIST_SETS)) {
-      Element list_sets = doc.createElement(GSXML.SERVICE_ELEM);
-      list_sets.setAttribute(GSXML.NAME_ATT, OAIXML.LIST_SETS);
-      list_sets.setAttribute(GSXML.TYPE_ATT, "oai");
-      return list_sets;
-    }
-    if (service_id.equals(OAIXML.LIST_METADATA_FORMATS)) {
-      Element list_metadata_formats = doc.createElement(GSXML.SERVICE_ELEM);
-      list_metadata_formats.setAttribute(GSXML.NAME_ATT, OAIXML.LIST_METADATA_FORMATS);
-      list_metadata_formats.setAttribute(GSXML.TYPE_ATT, "oai");
-      return list_metadata_formats;
-    }
-      */
       
     if (service_id.equals(IIIFXML.GET_RECORD)) {
@@ -388,11 +171,4 @@
     return null;
   }
-
-  /** The list sets service returns all the sets that this collection is/is part of/contains. This is gathered by Receptionist from all collections to answer the OAI ListSets request.  */
-    /*
-  protected Element processListSets(Element req) {
-    return list_sets_response;
-  }
-    */
     
   /** returns the actual record element used in the OAI GetRecord response */
@@ -422,30 +198,4 @@
     
     String oid = param_map.get(IIIFXML.OID); // TODO should this be identifier???
-
-    /*
-    boolean OID_is_deleted = false;
-    long millis = -1;
-
-    DBInfo oai_info = null;
-    if(oaiinf_db != null) {
-	oai_info = this.oaiinf_db.getInfo(oid);
-	if (oai_info == null) {
-	    logger.warn("OID: " + oid + " is not present in the collection's oai-inf database.");
-	} else  {
-
-	    // indexdb doesn't have info on deleted docs, only oaiinf db does.
-	    // So only oaiinfdb has timestamps for deleted docs
-	    // For non-deleted doc ids: also obtain timestamp from oaiinf db, 
-	    // but if the oaiinf db doesn't exist, resort to oailastmodified fields of indexdb.
-	    String timestamp = oai_info.getInfo(OAIXML.OAI_INF_TIMESTAMP); // stored in seconds, like oailastmodified in the collection index db
-	    millis = Long.parseLong(timestamp)*1000; // in milliseconds	    
-	    
-	    String oaiinf_status = oai_info.getInfo(OAIXML.OAI_INF_STATUS);
-	    if(oaiinf_status != null && oaiinf_status.equals(OAIXML.OAI_INF_DELETED)) {
-		OID_is_deleted = true;
-	    }
-	}
-    }
-    */
     
     //get a DBInfo object of the identifier; if this identifier is not present in the database,
@@ -459,11 +209,6 @@
     }
 
-    /*
-    else if (millis == -1) { // so couldn't get doc lastmod from oaiinf db, get oailastmodified from collection's index db
-	millis = getDateStampMillis(info);	
-    }
-    String oailastmodified = (millis == -1) ? "" : OAIXML.getTime(millis);
-    */
-
+
+    // ****
     Element get_record_response = doc.createElement(GSXML.RESPONSE_ELEM);
     Element get_record = doc.createElement(IIIFXML.GET_RECORD);
@@ -472,229 +217,10 @@
     //compose the header element
     record.appendChild(createHeaderElement(doc, oid));      
-    //if(!OID_is_deleted) { // ****
-	//compose the metadata element
-	record.appendChild(createMetadataElement(doc, prefix, info));
-	// } // ****
+    //compose the metadata element
+    record.appendChild(createMetadataElement(doc, prefix, info));
     get_record.appendChild(record);
     return get_record_response;
   }
 
-  /** return a list of records in specified set, containing metadata from specified prefix*/
-    /*
-  protected Element processListRecords(Element req) {
-    return processListIdentifiersOrRecords(req, OAIXML.LIST_RECORDS, true);
-  }
-    */
-  /** return a list of identifiers in specified set that contain metadata belonging to specified prefix. */
-    /*
-  protected Element processListIdentifiers(Element req) {
-    return processListIdentifiersOrRecords(req, OAIXML.LIST_IDENTIFIERS, false);
-  }
-    */
-    
-  // Get a list of records/identifiers that match the parameters.
-    
-  //protected Element processListIdentifiersOrRecords(Element req, String response_name, boolean include_metadata) {
-    /** arguments:
-        metadataPrefix: required
-     *  from: optional
-     *  until: optional
-     *  set: optional
-     *  resumptionToken: exclusive and optional (ignored as it has been handled by OAIReceptionist)
-     *  Exceptions: badArgument; cannotDisseminateFormat; idDoesNotExist
-     */
-    /*
-    NodeList params = GSXML.getChildrenByTagName(req, GSXML.PARAM_ELEM);
-    
-    if(params.getLength() == 0) {
-      logger.error("must at least have the metadataPrefix parameter, can't be none");
-      return OAIXML.createErrorResponse(OAIXML.BAD_ARGUMENT, "");
-    }
-    
-    HashMap<String, String> param_map = GSXML.getParamMap(params);  
-    
-    String prefix = "";
-    Date from_date = null;
-    Date until_date = null;
-    
-    if(param_map.containsKey(OAIXML.METADATA_PREFIX) == false) {    
-      //Just a double-check
-      logger.error("A param element containing the metadataPrefix is not present.");
-      return OAIXML.createErrorResponse(OAIXML.CANNOT_DISSEMINATE_FORMAT, "");
-    }
-    prefix = param_map.get(OAIXML.METADATA_PREFIX);
-    if (prefix == null || prefix.equals("")) {
-      //Just a double-check
-      logger.error("the value of metadataPrefix att is not present in the request.");
-      return OAIXML.createErrorResponse(OAIXML.CANNOT_DISSEMINATE_FORMAT, "");
-    }
-    
-    if(param_map.containsKey(OAIXML.FROM)) {
-      String from = param_map.get(OAIXML.FROM);
-      from_date = OAIXML.getDate(from);
-    }    
-    if(param_map.containsKey(OAIXML.UNTIL)) {
-      String until = param_map.get(OAIXML.UNTIL);
-      until_date = OAIXML.getDate(until);
-    }    
-
-    if (!format_response_map.containsKey(prefix)) {
-      logger.error(prefix + " metadata prefix is not supported for collection "+this.coll_name);
-      return OAIXML.createErrorResponse(OAIXML.CANNOT_DISSEMINATE_FORMAT, "");
-    }
-
-    // get list of oids
-    ArrayList<String> oid_list = null;
-    if(oaiinf_db != null) { // try getting the OIDs from the oaiinf_db
-	oid_list = new ArrayList<String>(oaiinf_db.getAllKeys());
-    
-	if(oid_list == null) { // try getting the OIDs from the oai entries in the index db
-	    logger.warn("@@@@@@@@@@@@@ NO OIDs in oai-inf db for " + this.cluster_name);
-	    oid_list = getChildrenIds(OAIXML.BROWSELIST);
-	}
-    }
-
-    if (oid_list == null) {
-      logger.error("No matched records found in collection: oai-inf and index db's browselist are empty");
-      return OAIXML.createErrorResponse(OAIXML.NO_RECORDS_MATCH, "");
-    }
-    // all validation is done
-
-    // get the list of elements that are in this metadata prefix
-    HashSet<String> set_of_elems = format_elements_map.get(prefix);
-
-    Document doc = XMLConverter.newDOM();
-    Element list_items_response = doc.createElement(GSXML.RESPONSE_ELEM);
-    Element list_items = doc.createElement(response_name);
-    list_items_response.appendChild(list_items);
-
-    for(int i=0; i<oid_list.size(); i++) {
-      String oid = oid_list.get(i);
-
-      if(oid.equals(OAIXML.OAI_EARLIEST_TIMESTAMP_OID)) { // internal id not doc id, so skip
-	  continue;
-      }
-      
-      boolean OID_is_deleted = false;
-      long millis = -1;
-
-      DBInfo oai_info = null;
-      if(oaiinf_db != null) {
-	  oai_info = this.oaiinf_db.getInfo(oid);
-	  if (oai_info == null) {
-	      logger.warn("OID: " + oid + " is not present in the collection's oai-inf database.");
-	  } else  {
-	      
-	      // indexdb doesn't have info on deleted docs, only oaiinf db does.
-	      // So only oaiinfdb has timestamps for deleted docs
-	      // For non-deleted doc ids: also obtain timestamp from oaiinf db, 
-	      // but if the oaiinf db doesn't exist, resort to oailastmodified fields of indexdb.
-	      String timestamp = oai_info.getInfo(OAIXML.OAI_INF_TIMESTAMP); // stored in seconds like oailastmodified in the collection index db	      
-	      millis = Long.parseLong(timestamp)*1000; // in milliseconds
-		  
-	      String oaiinf_status = oai_info.getInfo(OAIXML.OAI_INF_STATUS);
-	      if(oaiinf_status != null && oaiinf_status.equals(OAIXML.OAI_INF_DELETED)) {
-		  OID_is_deleted = true;
-	      }
-	  }
-      }
-      DBInfo info = this.coll_db.getInfo(oid);
-      if (info == null) { // can happen if oid was deleted, in which case only oai_info keeps a record of the oid
-	  if(!OID_is_deleted) { // we don't expect to find entries for deleted docs in index db.
-	      logger.error("Collection database does not contain information about oid: " +oid);
-	  }
-      }
-      else if (millis == -1) { // so couldn't get doc lastmod from oaiinf db, get oailastmodified from collection's index db
-	  
-	  millis = getDateStampMillis(info);
-      }
-
-      Date this_date = null;
-      String oailastmodified = (millis == -1) ? "" : OAIXML.getTime(millis);
-      
-      if (millis == -1) {
-	  if (from_date != null || until_date !=null) {
-	      continue; // if this doc doesn't have a date for some reason, and
-	      // we are doing a date range, then don't include it.
-	  }
-      } else {
-	  this_date = new Date(millis);
-	  if (from_date != null) {
-	      if(this_date.before(from_date)) {
-		  continue;
-	      }
-	  }
-	  if (until_date != null) {
-	      if (this_date.after(until_date)) {
-		  continue;
-	      }
-	  }    
-      }
-      
-      //compose the header element, which we'll be appending no matter what
-      Element header = createHeaderElement(doc, oid, oailastmodified, OID_is_deleted);
-
-      if (include_metadata) { // doing ListRecords
-	  // compose a record for adding header and metadata
-	  Element record = doc.createElement(OAIXML.RECORD);
-	  list_items.appendChild(record);
-	  //insert the header element
-	  record.appendChild(header);
-	  //Now check that this id has metadata for the required prefix.
-	  if (info != null && documentContainsMetadata(info, set_of_elems)) {
-	      // YES, it does have some metadata for this prefix	    
-	      //compose the metadata element
-	      record.appendChild(createMetadataElement(doc, prefix, info));
-	  } // otherwise the oid was 'deleted' and only in the oai-inf db and not in the info (collection index) db
-      } else { // doing ListIdentifiers
-	  //append the header element
-	  list_items.appendChild(header);      
-      }      
-      
-    }//end of for(int i=0; i<oid_list.size(); i++) of doing thru each record
-    
-    return list_items_response;        
-    
-  }
-*/
-  
-  // have implemented setDescription as an element, instead of a container containing metadata
-/*
-  private boolean configureSetInfo() {
-
-    Document doc = XMLConverter.newDOM();
-    this.list_sets_response = doc.createElement(GSXML.RESPONSE_ELEM);
-    Element list_sets_elem = doc.createElement(OAIXML.LIST_SETS);
-    this.list_sets_response.appendChild(list_sets_elem);
-    String set_name = this.coll_name;
-    String set_description = null;
-    Element name_elem = (Element)GSXML.getChildByTagName(this.config_info, OAIXML.SET_NAME);
-    if (name_elem!=null) {
-      set_name = GSXML.getNodeText(name_elem);
-      if (set_name.equals("")) {
-	set_name = this.coll_name; // default to coll name if can't find one
-      }
-    }
-    Element description_elem = (Element)GSXML.getChildByTagName(this.config_info, OAIXML.SET_DESCRIPTION);
-    if (description_elem!=null) {
-      set_description = GSXML.getNodeText(description_elem);
-      if (set_description.equals("")) {
-	set_description = null;
-      }
-    }
-    Element coll_set = OAIXML.createSet(doc, this.coll_name, set_name, set_description);
-    list_sets_elem.appendChild(coll_set);
-    
-    // are we part of any super sets?
-    NodeList super_set_list = GSXML.getChildrenByTagName(this.config_info, OAIXML.OAI_SUPER_SET);
-    for (int i=0; i<super_set_list.getLength(); i++) {
-      String super_name = ((Element)super_set_list.item(i)).getAttribute(GSXML.NAME_ATT);
-      if (super_name != null && !super_name.equals("")) {
-	list_sets_elem.appendChild(OAIXML.createSet(doc, super_name, super_name, null));
-      }
-    }
-    return true;
-  }
-*/
     
  /** create the metadata element used when processing ListRecords/GetRecord requests
@@ -804,173 +330,11 @@
         Element header = doc.createElement(OAIXML.HEADER);
 	
-	// if deleted, get the date and change oailastmodified to timestamp in oaiinfo
-	/*
-	if(deleted) {
-	    header.setAttribute(OAIXML.OAI_INF_STATUS, OAIXML.HEADER_STATUS_ATTR_DELETED); // set the header status to deleted
-		// then the timestamp for deletion will be from oai-inf database 
-	}
-	*/
         Element identifier = doc.createElement(IIIFXML.IDENTIFIER);
 	GSXML.setNodeText(identifier, coll_name + ":" + oid);
         header.appendChild(identifier);
-	/*
-        Element set_spec = doc.createElement(OAIXML.SET_SPEC);
-	GSXML.setNodeText(set_spec, coll_name);
-        header.appendChild(set_spec);
-        Element datestamp = doc.createElement(OAIXML.DATESTAMP);
-        GSXML.setNodeText(datestamp, oailastmodified);
-        header.appendChild(datestamp);
-	*/
+
         return header;
   }
 
-    
-  /** return the metadata information  */
-/*
-  protected Element processListMetadataFormats(Element req) {
-    // the request sent here must contain an OID. see doListMetadataFormats() in OAIReceptionist
-    Element param = GSXML.getNamedElement(req, GSXML.PARAM_ELEM, GSXML.NAME_ATT, OAIXML.OID);
-    if (param == null) {
-      logger.error("An element containing the OID attribute not is present.");
-      return OAIXML.createErrorResponse(OAIXML.ID_DOES_NOT_EXIST, "");
-    }
-    String oid = param.getAttribute(GSXML.VALUE_ATT);
-    if (oid == null || oid.equals("")) {
-      logger.error("No OID is present in the request.");
-      return OAIXML.createErrorResponse(OAIXML.ID_DOES_NOT_EXIST, "");
-    }
-*/
-    /*
-    ArrayList<String> oid_list = null;
-    if(oaiinf_db != null) { // try getting the OIDs from the oaiinf_db
-	oid_list = new ArrayList<String>(oaiinf_db.getAllKeys());
-	
-	if(oid_list == null) { // try getting the OIDs from the oai entries in the index db
-	    oid_list = getChildrenIds(OAIXML.BROWSELIST);
-	}
-    }
-    */
-/*
-    // assume meta formats are only for OIDs that have not been deleted
-    // so don't need to check oai-inf db, and can just check collection's index db for list of OIDs
-    ArrayList<String> oid_list = getChildrenIds(OAIXML.BROWSELIST);
-    if (oid_list == null || oid_list.contains(oid) == false) {
-      logger.error("OID: " + oid + " is not present in the database.");
-      Element e= OAIXML.createErrorResponse(OAIXML.ID_DOES_NOT_EXIST, "");
-//      logger.error((new XMLConverter()).getPrettyString (e));
-      return e;
-    }
-    
-    DBInfo info = null;    
-    info = this.coll_db.getInfo(oid);
-    if (info == null) { //just double check
-      return OAIXML.createErrorResponse(OAIXML.OAI_SERVICE_UNAVAILABLE, "");
-    }
-    
-    Document doc = XMLConverter.newDOM();
-    Element list_metadata_formats_response = doc.createElement(GSXML.RESPONSE_ELEM);
-    
-    Element list_metadata_formats = doc.createElement(OAIXML.LIST_METADATA_FORMATS);
-    list_metadata_formats_response.appendChild(list_metadata_formats);
-    boolean has_meta_format = false;
-    
-    // for each format in format_elements_map
-    Iterator<String> it = format_elements_map.keySet().iterator();
-    while (it.hasNext()) {
-      String format = it.next();
-      HashSet<String> set_of_elems = format_elements_map.get(format);
-      if (documentContainsMetadata(info, set_of_elems)) {
-	// add this format into the response
-	has_meta_format = true;
-	list_metadata_formats.appendChild(doc.importNode(format_response_map.get(format), true));
-      }
-    }
-
-    if (has_meta_format == false) {
-      logger.error("Specified metadata names are not contained in the database.");
-      return OAIXML.createErrorResponse(OAIXML.NO_METADATA_FORMATS, "");
-    } else {
-      return list_metadata_formats_response;
-    }
-  }
-*/
-/*
-  protected boolean documentContainsMetadata(DBInfo info, HashSet<String> set_of_elems) {
-    if (set_of_elems.size() == 0) {
-      return false;
-    }
-    Iterator<String> i = set_of_elems.iterator();
-    while (i.hasNext()) {
-      if (!info.getInfo(i.next()).equals("")) {
-	return true;
-      }
-    }
-    return false;
-  }
-*/
-
-  /** returns a list of the child ids in order, null if no children */
-/*
-  protected ArrayList<String> getChildrenIds(String node_id) {
-    DBInfo info = this.coll_db.getInfo(node_id);
-    if (info == null) {
-      return null;
-    }
-    
-    String contains = info.getInfo("contains");
-    if (contains.equals("")) {
-      return null;
-    }
-    ArrayList<String> children = new ArrayList<String>();
-    StringTokenizer st = new StringTokenizer(contains, ";");
-    while (st.hasMoreTokens()) {
-      String child_id = st.nextToken().replaceAll("\"", node_id);
-      children.add(child_id);
-    }
-    return children;    
-  }
-*/
-    
-  /**method to check whether any of the 'metadata_names' is contained in the 'info'.
-   * The name may be in the form: <name>,<mapped name>, in which the mapped name is
-   * optional. The mapped name is looked up in the DBInfo; if not present, use the first
-   * name which is mandatory.
-   */
-/*
-  protected boolean containsMetadata(DBInfo info, String[] metadata_names) {
-    if (metadata_names == null) return false;
-    logger.info("checking metadata names in db.");
-    for(int i=0; i<metadata_names.length; i++) {
-      int index = metadata_names[i].indexOf(",");
-      String meta_name = (index == -1) ? metadata_names[i] :
-                              metadata_names[i].substring(index + 1);
-      
-      if(info.getInfo(meta_name).equals("") == false) {
-        return true;
-      }
-    }
-    return false;
-  }
-*/
-/*
-  protected long getDateStampMillis(DBInfo info) {
-    // gs.OAIDateStamp is in YYYY-MM-DD
-    String time_stamp = info.getInfo(OAIXML.GS_OAI_DATE_STAMP);
-    long millis = -1;
-    if (!time_stamp.equals("")) {
-      millis = OAIXML.getTime(time_stamp);
-    }
-    if (millis == -1) {
-      // oailastmodified is in seconds
-      time_stamp = info.getInfo(OAIXML.OAI_LASTMODIFIED);
-      if (!time_stamp.equals("")) {
-	millis = Long.parseLong(time_stamp)*1000;
-      }
-    }
-    return millis;
-    
-
-  }
-*/
 }
 
Index: gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/util/IIIFXML.java
===================================================================
--- gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/util/IIIFXML.java	(revision 32859)
+++ gs3-extensions/iiif-servlet/trunk/src/gsdl-src/java/org/greenstone/gsdl3/util/IIIFXML.java	(revision 32860)
@@ -44,25 +44,9 @@
   public static final int ACTIVATION = 1;
   
-  // six valid oai verbs
+  // one valid iiif verb // ****
   public static final String GET_RECORD = "GetRecord";
-    /*    
-  public static final String LIST_RECORDS = "ListRecords";
-  public static final String LIST_IDENTIFIERS = "ListIdentifiers";
-  public static final String LIST_SETS = "ListSets";
-  public static final String LIST_METADATA_FORMATS = "ListMetadataFormats";
-  public static final String IDENTIFY = "Identify";
-    */
-
-    
-  // oai request parameters
+    
+  // iiif request parameters
   public static final String IDENTIFIER = "identifier";
-  /*
-  public static final String METADATA_PREFIX = "metadataPrefix";
-  public static final String FROM = "from";
-  public static final String UNTIL = "until";
-  public static final String SET = "set";
-  public static final String RESUMPTION_TOKEN = "resumptionToken";
-  public static final String IDENTIFIER = "identifier";
-    */
     
   // Error element and code att
@@ -70,136 +54,31 @@
   public static final String CODE = "code";
   
-  // OAI error codes
-      public static final String ID_DOES_NOT_EXIST = "idDoesNotExist";
-    /*
-  public static final String BAD_ARGUMENT = "badArgument";
-  public static final String BAD_RESUMPTION_TOKEN = "badResumptionToken";
-  public static final String BAD_VERB = "badVerb";
-  public static final String CANNOT_DISSEMINATE_FORMAT = "cannotDisseminateFormat";
-  public static final String NO_METADATA_FORMATS = "noMetadataFormats";
-  public static final String NO_RECORDS_MATCH = "noRecordsMatch";
-  public static final String NO_SET_HIERARCHY = "noSetHierarchy";
-    */
-
-  // words used to compose oai responses
-  // many of these used in OAIConfig too
+  // IIIF error codes
+  public static final String ID_DOES_NOT_EXIST = "idDoesNotExist";
 
   // General
-    public static final String IIIF_PMH = "IIIF-PMH"; // ****
-  public static final String RESPONSE_DATE = "responseDate";
+  public static final String IIIF_PMH = "IIIF-PMH"; // ****
+    public static final String RESPONSE_DATE = "responseDate"; // ****
   public static final String REQUEST = "request";
-
-  // internal "OID" identifiers in the oai-inf db
-  /** represents the timestamp of the OAI collection (when its oai-inf db was first created) */
-    /*
-  public static final String OAI_EARLIEST_TIMESTAMP_OID = "_earliesttimestamp";  
-    */
     
   // Identify data
-    // OAI replacing => IIIF, maybe want baseURL and oai-identifier
-      public static final String BASE_URL = "baseURL";
-    /*
-  public static final String ADMIN_EMAIL = "adminEmail";
+  // OAI replacing => IIIF, maybe want baseURL and oai-identifier
   public static final String BASE_URL = "baseURL";
-  public static final String COMPRESSION = "compression";
-  public static final String DELETED_RECORD = "deletedRecord";
-  public static final String DESCRIPTION = "description";
-  public static final String EARLIEST_DATESTAMP = "earliestDatestamp"; // taken from buildconfig used as publishing date by RSS service
-  public static final String EARLIEST_OAI_DATESTAMP = "earliestOAIDatestamp"; // earliest timestamp of an OAI collection stored in oai-inf db
-  public static final String GRANULARITY = "granularity";
-  public static final String LAST_MODIFIED = "lastmodified";
-  public static final String PROTOCOL_VERSION = "protocolVersion";
-  public static final String REPOSITORY_NAME = "repositoryName";
-  public static final String OAI_IDENTIFIER = "oai-identifier";
-  public static final String SCHEME = "scheme";
-  public static final String REPOSITORY_IDENTIFIER = "repositoryIdentifier";
-  public static final String DELIMITER = "delimiter";
-  public static final String SAMPLE_IDENTIFIER = "sampleIdentifier";
-    */
-
-    /*
-  // metadata formats
-  public static final String METADATA_FORMAT = "metadataFormat";
-  public static final String SCHEMA = "schema";
-  public static final String METADATA_NAMESPACE = "metadataNamespace";
-  public static final String META_FORMAT_DC = "oai_dc";
-    */
-
     
   // record response data
   // SET_SPEC
   public static final String RECORD = "record";
-    /*
-  public static final String HEADER = "header";
-  public static final String DATESTAMP = "datestamp";
-  public static final String METADATA = "metadata";
-    */
-
-    /*
-  // list sets
-  // SET, 
-  public static final String SET_NAME = "setName";
-  public static final String SET_SPEC = "setSpec";
-  public static final String SET_DESCRIPTION = "setDescription";
-    */
-
-    /*
-  // resumption token element
-  public static final String RESUMPTION_TOKEN_ELEM = "resumptionToken";
-  public static final String EXPIRATION_DATE = "expirationDate";
-  public static final String COMPLETE_LIST_SIZE = "completeListSize";
-  public static final String CURSOR = "cursor";
-    */
-    
-  // extra elements/attributes from OAIConfig
-    /*
-  public static final String OAI_INFO = "oaiInfo";
-  public static final String USE_STYLESHEET = "useOAIStylesheet";
-  public static final String STYLESHEET = "OAIStylesheet";
-  public static final String RESUME_AFTER = "resumeAfter";
-  public static final String RESUMPTION_TOKEN_EXPIRATION = "resumptionTokenExpiration";
-  public static final String OAI_SUPER_SET = "oaiSuperSet";
-  public static final String ELEMENT = "element";
-  public static final String ELEMENTS = "elements";
-  public static final String MAPPING = "mapping";
-  public static final String SELECT = "select";
-  public static final String SELECT_SINGLE_VALUE = "firstvalue";
-  public static final String SELECT_FIRST_VALID_META = "firstvalidmetadata";
-  public static final String SELECT_ALL_VALUES = "allvalues";
-  // code constants
-  public static final String GS_OAI_DATE_STAMP = "gs.OAIDateStamp";
-   public static final String GS_OAI_RESOURCE_URL = "gs.OAIResourceURL";
-  public static final String GSF_LINK_PREFIX = "gsflink.";
-  public static final String LINK_TYPE_DOCUMENT = "document";
-  public static final String LINK_TYPE_SOURCE = "source";
-   public static final String ILLEGAL_OAI_VERB = "Illegal OAI verb";
-   public static final String LASTMODIFIED = "lastmodified";
-  // // The node id in the collection database, which contains all the OIDs in the database
-   public static final String BROWSELIST = "browselist";
-   public static final String OAI_LASTMODIFIED = "oailastmodified";
-    */
-   public static final String OAIPMH = "OAIPMH";
+
+    public static final String OAIPMH = "OAIPMH"; // ****
     
     //public static final String OAI_SET_LIST = "oaiSetList"; // ****
-   public static final String OAI_SERVICE_UNAVAILABLE = "OAI service unavailable";
-   public static final String OID = "OID";
-    /*
-    // The node id in the oai-inf database of the collection, which should contain all the OIDs in the db
-    public static final String OAI_INF_STATUS = "status"; // D = Deleted; E = Existing (PD = Provisionally Deleted but PD should not be present at this stage in the oai-inf database)
-    public static final String OAI_INF_TIMESTAMP = "timestamp"; // the time of deletion/last (re)indexing of doc
-    public static final String OAI_INF_DATESTAMP = "datestamp"; // date version of timestamp    
-    // oai-inf db values for OAI_INF_STATUS
-    public static final String OAI_INF_DELETED = "D";
-    public static final String OAI_INF_EXISTS = "E";
-    public static final String OAI_INF_PROVISIONALLY_DELETED = "PD";
-    // header values for ListRecords/GetRecord and listIdentifiers
-    public static final String HEADER_STATUS_ATTR_DELETED = "deleted";
-    */
+    //public static final String OAI_SERVICE_UNAVAILABLE = "OAI service unavailable";
+    public static final String OID = "OID"; // ****
     
   public static final String IIIF_SERVICE_RACK = "IIIFPMH";
   //system-dependent file separator, maybe '/' or '\'
-  public static final String FILE_SEPARATOR = File.separator;
+  //public static final String FILE_SEPARATOR = File.separator;
     //public static final String OAI_VERSION1 = "1.0";
-  public static final String IIIF_VERSION2 = "2.1";
+    public static final String IIIF_VERSION2 = "2.1"; // ****
   /*************************above are final values****************************/
     
@@ -208,23 +87,5 @@
   public static Element iiif_config_elem = null;
     
-  //stores the date format "yyyy-MM-ddTHH:mm:ssZ"
-  // this is the granularity for datestamps
-    /*
-  public static String granularity = "";
-    */
-    
-  // http://www.openarchives.org/OAI/openarchivesprotocol.html#DatestampsRequests 
-  // specifies that all repositories must support YYYY-MM-DD (yyyy-MM-dd in Java)
-  // this would be in addition to the other (optional) granularity of above that 
-  // a repository may additionally choose to support.
-    /*
-  public static final String default_granularity = "yyyy-MM-dd";
-    */
-    
-    //public static long token_expiration = 7200;
-  /** which version of oai that this oaiserver supports; default is 2.0 
-   *  initialized in getOAIConfigXML()
-   */
-  public static final String iiif_version = "2.1";
+    public static final String iiif_version = "2.1"; // ****
   public static String baseURL = "";
     
@@ -273,94 +134,17 @@
       return null;
     }
-      
-    //initialize oai_version
-    /*
-    Element protocol_version = (Element)GSXML.getChildByTagName(iiif_config_elem, PROTOCOL_VERSION);
-    iiif_version = GSXML.getNodeText(protocol_version).trim();
-    */
-    
+          
     // initialize baseURL
     Element base_url_elem = (Element)GSXML.getChildByTagName(iiif_config_elem, BASE_URL);
     baseURL = GSXML.getNodeText(base_url_elem);
 
-    /*
-    //initialize token_expiration
-    Element expiration = (Element)GSXML.getChildByTagName(iiif_config_elem, RESUMPTION_TOKEN_EXPIRATION);
-    String expire_str = GSXML.getNodeText(expiration).trim();
-    if (expiration != null && !expire_str.equals("")) {
-      token_expiration = Long.parseLong(expire_str);
-    }
-    */
-    /*
-    // read granularity from the config file
-    Element granu_elem = (Element)GSXML.getChildByTagName(iiif_config_elem, GRANULARITY);
-    //initialize the granu_str which might be used by other methods (eg, getDate())
-    granularity = GSXML.getNodeText(granu_elem).trim();
-
-    //change "yyyy-MM-ddTHH:mm:ssZ" to "yyyy-MM-dd'T'HH:mm:ss'Z'"
-    granularity = granularity.replaceAll("T", "'T'");
-    granularity = granularity.replaceAll("Z", "'Z'");
-    granularity = granularity.replaceAll("YYYY", "yyyy").replaceAll("DD", "dd").replaceAll("hh", "HH");
-    */
-    
     return iiif_config_elem;
   }
 
-    /*
-  public static String[] getMetadataMapping(Element metadata_format) {
-
-    if (metadata_format == null) {
-      return null;
-    }
-    NodeList mappings = metadata_format.getElementsByTagName(MAPPING);
-    int size = mappings.getLength();
-    if (size == 0) {
-      logger.info("No metadata mappings are provided in IIIFConfig.xml."); 
-      return null;
-    }
-    String[] names = new String[size];
-    for (int i=0; i<size; i++) {
-      names[i] = GSXML.getNodeText((Element)mappings.item(i)).trim();
-    }
-    return names;      
-    
-  }
-    
-  public static String[] getGlobalMetadataMapping(String prefix) {
-    Element list_meta_formats = (Element)GSXML.getChildByTagName(iiif_config_elem, LIST_METADATA_FORMATS);
-    if(list_meta_formats == null) {
-      return null;
-    }
-    Element metadata_format = GSXML.getNamedElement(list_meta_formats, METADATA_FORMAT, METADATA_PREFIX, prefix);
-    if(metadata_format == null) {
-      return null;
-    }
-    return getMetadataMapping(metadata_format);
-  }
-    */
-    
-  /** Copies out the main info from a metadataFormat element, leaving behind the mapping stuff. This gets the bit needed for OAI response */
-    /*
-  public static Element getMetadataFormatShort(Document doc, Element meta_format_long) {
-    Element meta_fmt = doc.createElement(OAIXML.METADATA_FORMAT);
-    // Copy in the elements that we want, and ignore the rest
-    meta_fmt.appendChild(doc.importNode(GSXML.getChildByTagName(meta_format_long, OAIXML.METADATA_PREFIX), true));
-	meta_fmt.appendChild(doc.importNode(GSXML.getChildByTagName(meta_format_long, OAIXML.SCHEMA), true));
-	meta_fmt.appendChild(doc.importNode(GSXML.getChildByTagName(meta_format_long, OAIXML.METADATA_NAMESPACE), true));
-
-	return meta_fmt;
-  }
-    */
-
-    /*
-  public static long getTokenExpiration() {
-    return token_expiration*1000; // in milliseconds
-  }
-    */
     
   /** TODO: returns a basic response for appropriate oai version
    *  
    */
-  public static  Element createBasicResponse(Document doc, String verb, String[] pairs) {
+    public static  Element createBasicResponse(Document doc, String verb, String[] pairs) { // ****
 
     Element response = createResponseHeader(doc, verb);
@@ -385,12 +169,8 @@
       
     Node resp_date = GSXML.getChildByTagName(response, RESPONSE_DATE); // ****
-    /*
-    if (resp_date != null) {
-      GSXML.setNodeText((Element)resp_date, getCurrentUTCTime());
-    }
-    */
     
     return response;
   }
+    
   /** @param error_code the value of the code attribute
    *  @param error_text the node text of the error element
@@ -497,5 +277,5 @@
    *  escaped sequences (eg, '%3A'). 
    */
-  public static String oaiEncode(String original_str) {
+    public static String oaiEncode(String original_str) { // ****
     logger.info("oaiEncode() " + original_str);      
     for (int i=0; i<special_char.length; i++) {
@@ -506,108 +286,9 @@
     return original_str;  
   }
-  /** convert YYYY-MM_DDThh:mm:ssZ to yyyy-MM-ddTHH:mm:ssZ
-   */
-    /*
-  public static String convertToJava(String oai_format) {
-    oai_format = oai_format.replaceAll("YYYY", "yyyy").replaceAll("DD", "dd").replaceAll("hh", "HH");
-    return oai_format;
-  }
-    */
-  /** convert yyyy-MM-ddTHH:mm:ssZ to YYYY-MM_DDThh:mm:ssZ
-   */
-    /*
-  public static String convertToOAI(String java_format) {
-    java_format = java_format.replaceAll("yyyy", "YYYY").replaceAll("dd", "DD").replaceAll("HH", "hh");
-    return java_format;      
-  }    
-  public static String getCurrentUTCTime() {
-    Date current_utc = new Date(System.currentTimeMillis());
-    //granularity is in the form: yyyy-MM-dd'T'HH:mm:ss'Z '
-    DateFormat formatter = new SimpleDateFormat(granularity);
-    return formatter.format(current_utc);
-  }
-    */
-  /** get a Date object from a Date format pattern string
-   *
-   * @param pattern - in the form: 2007-06-14T16:48:25Z, for example.
-   * @return a Date object - null if the pattern is not in the specified form
-   */
-    /*
-  public static Date getDate(String pattern) {
-    if (pattern == null || pattern.equals("")) {
-      return null;
-    }
-    Date date = null;
-    //      String str = pattern.replaceAll("T", " ");
-    //      str = str.replaceAll("Z", "");
-    SimpleDateFormat sdf = null;
-    try {
-      sdf = new SimpleDateFormat(granularity);
-      date = sdf.parse(pattern);
-    } catch(Exception e) {
-      if(!default_granularity.equals(granularity)) { // try validating against default granularity
-	try {
-	  date = null;
-	  sdf = null;
-	  sdf = new SimpleDateFormat(default_granularity);
-	  date = sdf.parse(pattern);
-	} catch(Exception ex) {
-	  logger.error("invalid date format: " + pattern);
-	  return null;
-	}
-      } else {
-	logger.error("invalid date format: " + pattern);
-	return null;
-      }
-    }
-    return date;
-  }
-    */
-  /** get the million second value from a string representing time in a pattern
-   * (eg, 2007-06-14T16:48:25Z)
-   */
-    /*
-  public static long getTime(String pattern) {
-    if (pattern == null || pattern.equals("")) {
-      return -1;
-    }
-    Date date = null;
-    SimpleDateFormat sdf = null;
-    try {
-      //granularity is a global variable in the form: yyyy-MM-ddTHH:mm:ssZ 
-      sdf = new SimpleDateFormat(granularity);
-      date = sdf.parse(pattern);
-    } catch(Exception e) {
-      if(!default_granularity.equals(granularity)) { // try validating against default granularity
-	try {
-	  date = null;
-	  sdf = null;
-	  sdf = new SimpleDateFormat(default_granularity);
-	  date = sdf.parse(pattern);
-	} catch(Exception ex) {
-	  logger.error("invalid date format: " + pattern);
-	  return -1;
-	}
-      } else {
-	logger.error("invalid date format: " + pattern);
-	return -1;
-      }        
-    }
-    return date.getTime();
-  }   
-    */ 
-  /** get the string representation of a time from a long value(long type)
-   */
-    /*
-  public static String getTime(long milliseconds) {
-    Date date = new Date(milliseconds);
-    SimpleDateFormat sdf = new SimpleDateFormat(granularity);
-    return sdf.format(date);
-  }   
-    */ 
+
   public static Element createResponseHeader(Document response_doc, String verb) {
       String tag_name = (iiif_version.equals(IIIF_VERSION2))? IIIF_PMH : verb; // ****
     Element oai = response_doc.createElement(tag_name);
-    Element resp_date = response_doc.createElement(RESPONSE_DATE);
+    Element resp_date = response_doc.createElement(RESPONSE_DATE); // ****
     Element req = response_doc.createElement(REQUEST);
     oai.appendChild(resp_date);
@@ -626,77 +307,4 @@
   }
 
-    /*
-  public static Element getMetadataPrefixElement(Document doc, String prefix, Element meta_format) {
-
-    Element ns_elem = (Element)GSXML.getChildByTagName(meta_format, METADATA_NAMESPACE);
-    String namespace = null;
-    if (ns_elem != null) {
-      namespace = GSXML.getNodeText(ns_elem);
-    }
-    if (namespace == null || namespace.equals("")) {
-      logger.error("No namespace URI found in metadataFormat elemnt for "+prefix);
-      logger.error(XMLConverter.getPrettyString(meta_format));
-      return null;
-    }
-
-    Element sc_elem = (Element)GSXML.getChildByTagName(meta_format, SCHEMA);
-    String schema = null;
-    if (sc_elem != null) {
-      schema = GSXML.getNodeText(sc_elem);
-    }
-    if (schema == null || schema.equals("")) {
-      logger.error("No schema found in metadataFormat element for "+prefix);
-      logger.error(XMLConverter.getPrettyString(meta_format));
-      return null;
-    }
-      
-    String tag_name = getMetadataTagName(prefix, oai_version);
-    Element oai = doc.createElement(tag_name);
-    oai.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
-    
-    if (oai_version.equals(OAI_VERSION2)) {
-      oai.setAttribute("xmlns:"+prefix, namespace);
-      if (prefix.equals(META_FORMAT_DC)) {
-	// there seems to be an extra one for dc
-	oai.setAttribute("xmlns:dc", "http://purl.org/dc/elements/1.1/");
-      }
-      oai.setAttribute("xsi:schemaLocation", namespace+" \n "+schema);
-    } else {
-      oai.setAttribute("xmlns", "http://www.openarchives.com/OAI/1.1/");
-      if (prefix.equals(META_FORMAT_DC)) {
-	oai.setAttribute("xsi:schemaLocation", "http://www.openarchives.org/OAI/1.1/" + tag_name + ".xsd");
-      } else {
-	oai.setAttribute("xsi:schemaLocation", schema);
-      }
-    }
-
-    return oai;
-    
-  }
-    
-  public static String getMetadataTagName(String prefix, String oai_version) {
-    if (prefix.equals(META_FORMAT_DC)) {
-      if (oai_version.equals(OAI_VERSION2)) {
-	return "oai_dc:dc";
-      }
-      return "dc";
-    }
-    return prefix;
-  }
-
-  public static HashMap<String, Node> getChildrenMapByTagName(Node n, String tag_name) {
-	
-    HashMap<String, Node> map= new HashMap<String, Node>();
-    Node child = n.getFirstChild();
-    while (child!=null) {
-      String name = child.getNodeName();
-      if(name.equals(tag_name)) {
-	map.put(name, child);
-      }
-      child = child.getNextSibling();
-    }
-    return map;
-  }
-    */
     
   public static Element createOAIIdentifierXML(Document doc, String repository_id, String sample_collection, String sample_doc_id) {
@@ -712,48 +320,6 @@
     String xml = "<gsdl xmlns=\"http://www.greenstone.org/namespace/gsdl_oaiinfo/1.0/gsdl_oaiinfo\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://www.greenstone.org/namespace/gsdl_oaiinfo/1.0/gsdl_oaiinfo\n   http://www.greenstone.org/namespace/gsdl_oaiinfo/1.0/gsdl_oaiinfo.xsd\"></gsdl>";
     Document xml_doc = converter.getDOM(xml);
-    return (Element)doc.importNode(xml_doc.getDocumentElement(), true);
-    
-
-  }
-    /*
-  public static Element createSet(Document doc, String spec, String name, String description) {
-
-    Element set_elem = doc.createElement(SET);
-    Element set_spec = doc.createElement(SET_SPEC);
-    GSXML.setNodeText(set_spec, spec);
-    set_elem.appendChild(set_spec);
-    Element set_name = doc.createElement(SET_NAME);
-    GSXML.setNodeText(set_name, name);
-    set_elem.appendChild(set_name);
-    if (description != null) {
-      Element set_description = doc.createElement(SET_DESCRIPTION);
-      GSXML.setNodeText(set_description, description);
-      set_elem.appendChild(set_description);
-    }
-    return set_elem;
-    
-  }
-    */
-    
-  /** returns the resumptionToken element to go into an OAI response */
-    /*
-  public static Element createResumptionTokenElement(Document doc, String token_name, int total_size, int cursor, long expiration_time) {
-    Element token = doc.createElement(OAIXML.RESUMPTION_TOKEN);
-    if (total_size != -1) {
-      token.setAttribute(OAIXML.COMPLETE_LIST_SIZE, "" + total_size);
-    }
-    if (cursor != -1) {
-      token.setAttribute(OAIXML.CURSOR, "" + cursor);
-    }
-    if(expiration_time !=-1) {
-      token.setAttribute(OAIXML.EXPIRATION_DATE, getTime(expiration_time));
-    }
-   
-    if (token != null) {
-      GSXML.setNodeText(token, token_name);
-    }
-    return token;
-  }
-    */
+    return (Element)doc.importNode(xml_doc.getDocumentElement(), true);    
+  }
 }
 
