Beispiel #1
0
 def __init__(self, baseUrl=default_baseUrl):
     client = ServiceClient(baseUrl)
     params = {'verb': 'ListCollections'}
     request = client.setRequest(params)
     response = client.getResponse()
     if response.hasError():
         raise Exception, response.error
     self.results = self.parseResponse(response)
Beispiel #2
0
 def __init__(self, baseUrl, recId, item_record_class=XmlRecord):
     client = ServiceClient(baseUrl)
     params = {'verb': 'GetRecord', 'id': recId}
     request = client.setRequest(params)
     response = client.getResponse()
     if response.hasError():
         raise Exception, response.error
     self.result = self.parseResponse(response, item_record_class)
Beispiel #3
0
 def __init__(self, recId):
     client = ServiceClient(self.baseUrl)
     params = {
         'verb': 'GetRecord',
         'id': recId,
         'storedContent': ['dcsstatus', 'dcsstatusNote']
     }
     request = client.setRequest(params)
     response = client.getResponse()
     if response.hasError():
         raise Exception, response.error
     self.result = self.parseResponse(response)
Beispiel #4
0
	def __init__ (self, collectionKey, baseUrl=default_baseUrl):
		client = ServiceClient (baseUrl)
		params = {
			'n' : '1',
			's' : '0',
			'verb':'Search',
			'ky': collectionKey,
			"storedContent":['dcsndrHandle']
		}
		request = client.setRequest (params)
		self.result = None
		# print request.report()
		try:
			response = client.getResponse()
		except:
			raise Exception, "couldn't parse result for collectionKey='%s'\nRoot cause: %s" % (collectionKey, sys.exc_info()[1])
		if response.hasError():
			raise Exception, response.error
		self.result = self.parseResponse(response)