def notifyExternalRelationship(self, relationship,pid,system,identifier): try: url = self.systemConfig.getString(None, "curation","external-system-urls","notify-curation",system) self.writer.println(url+ "&relationship=isCollectedBy&curatedPid="+pid+"&identifier="+relationship.get("identifier")+"&system="+self.systemConfig.getString(None,"system")+"&sourceIdentifier="+identifier) client = BasicHttpClient(url+ "&relationship=isCollectedBy&curatedPid="+pid+"&identifier="+relationship.get("identifier")+"&system="+self.systemConfig.getString(None,"system")+"&sourceIdentifier="+identifier) get = GetMethod(url+ "&relationship=isCollectedBy&curatedPid="+pid+"&identifier="+relationship.get("identifier")+"&system="+self.systemConfig.getString(None,"system")+"&sourceIdentifier="+identifier) client.executeMethod(get) status = get.getStatusCode() if status != 200: text = get.getStatusText() self.log.error(String.format("Error accessing ReDBox: %s %s",status, text)); return None; except Exception, ex: return None;
def notifyExternalRelationship(self,relationship,pid,system,identifier): try: url = self.systemConfig.getString(None, "curation","external-system-urls","notify-curation",system) url = "http://localhost:9001/default/api/notifyCuration.script?apiKey=1412412412241" completeUrl = url+ "&relationship=isCollectorOf&curatedPid="+pid+"&identifier="+relationship.get("identifier")+"&system="+self.systemConfig.getString("redbox","system")+"&sourceIdentifier="+identifier self.writer.println("the completeUrl: "+ completeUrl) client = BasicHttpClient(completeUrl) get = GetMethod(completeUrl) client.executeMethod(get) status = get.getStatusCode() if status != 200: text = get.getStatusText() self.log.error(String.format("Error accessing Mint",status, text)); return None; except Exception, ex: return None;
def queryJobStatus(self, curationJob): relations = ArrayList() get = None try: url = self.systemConfig.getString(None, "curation","curation-manager-url") client = BasicHttpClient(url + "/job/"+ curationJob.getCurationJobId()) get = GetMethod(url+ "/job/"+ curationJob.getCurationJobId()) client.executeMethod(get) status = get.getStatusCode() if status != 200: text = get.getStatusText() self.log.error(String.format("Error accessing Curation Manager, status code '%d' returned with message: %s",status, text)); return None; except Exception, ex: return None;
def queryJobStatus(self, curationJob): relations = ArrayList() get = None try: url = self.systemConfig.getString(None, "curation", "curation-manager-url") client = BasicHttpClient(url + "/job/" + curationJob.getCurationJobId()) get = GetMethod(url + "/job/" + curationJob.getCurationJobId()) client.executeMethod(get) status = get.getStatusCode() if status != 200: text = get.getStatusText() self.log.error( String.format( "Error accessing Curation Manager, status code '%d' returned with message: %s", status, text)) return None except Exception, ex: return None
def notifyExternalRelationship(self, relationship, pid, system, identifier): try: url = self.systemConfig.getString(None, "curation", "external-system-urls", "notify-curation", system) url = "http://localhost:9001/default/api/notifyCuration.script?apiKey=1412412412241" completeUrl = url + "&relationship=isCollectorOf&curatedPid=" + pid + "&identifier=" + relationship.get( "identifier") + "&system=" + self.systemConfig.getString( "redbox", "system") + "&sourceIdentifier=" + identifier self.writer.println("the completeUrl: " + completeUrl) client = BasicHttpClient(completeUrl) get = GetMethod(completeUrl) client.executeMethod(get) status = get.getStatusCode() if status != 200: text = get.getStatusText() self.log.error( String.format("Error accessing Mint", status, text)) return None except Exception, ex: return None