示例#1
0
	def ingestProduct(self, params):
		productHash, metadata, clientXfer = params
		p = Structs.getProductFromXmlRpc(productHash)
		p.setTransferStatus(Product.STATUS_TRANSFER)
		self.catalog.addProduct(p)
		
		m = Metadata()
		m.addMetadata(metadata)
		self.catalog.addMetadata(m, p)
		
		if not clientXfer:
	                versioner = GenericFileManagerObjectFactory.getVersionerFromClassName(p.getProductType().getVersioner())
			versioner.createDataStoreReferences(p, m)
			self.catalog.addProductReferences(p)
			self.xfer.transferProduct(p)
			p.setTransferStatus(Product.STATUS_RECEIVED)
			self.catalog.setProductTranfserStatus(p)
		return Result(None, p.getProductId())
示例#2
0
	def addMetadata(self, params):
		p = Structs.getProductFromXmlRpc(params[0])
		m = Metadata()
		m.addMetadata(params[1])
		self.catalog.addMetadata(m, p)
		return Result(Boolean, 'true')