Ejemplo n.º 1
0
    def init_service(self, service_url, user, password, doGetFile):
        self.service = CheckInLocator().getCheckInSoap(URL(service_url))
        self.service.setUsername(user)
        self.service.setPassword(password)

        if doGetFile:
            self.file = GetFileLocator().getGetFileSoap(URL(service_url))
            self.file.setUsername(user)
            self.file.setPassword(password)
Ejemplo n.º 2
0
	def init_service( self, service_url, user, password, doGetFile ):
		self.service = CheckInLocator().getCheckInSoap(URL(service_url))
		self.service.setUsername(user)
		self.service.setPassword(password)
		
		if doGetFile:
			self.file = GetFileLocator().getGetFileSoap(URL(service_url))
			self.file.setUsername(user)
			self.file.setPassword(password)
Ejemplo n.º 3
0
class VamosaService:
	
	def init_service( self, service_url, user, password, doGetFile ):
		self.service = CheckInLocator().getCheckInSoap(URL(service_url))
		self.service.setUsername(user)
		self.service.setPassword(password)
		
		if doGetFile:
			self.file = GetFileLocator().getGetFileSoap(URL(service_url))
			self.file.setUsername(user)
			self.file.setPassword(password)
		
	def vCheckIn( self, dDocName, dDocTitle, dDocType, dDocAuthor, dSecurityGroup, dDocAccount, customDocMetadata, primaryFile, alternateFile, extraProps ):
		return self.service.checkInUniversal(dDocName,dDocTitle,dDocType,dDocAuthor,dSecurityGroup,dDocAccount,customDocMetadata,primaryFile,alternateFile,extraProps)
		
	def vCheckOut( self, dID, extraProps ):
		return self.service.checkOut(dID,extraProps)
		
	def vGetFileByID( self, dID, rendition="Primary", extraProps=[] ):
		return self.file.getFileByID(dID,rendition,extraProps)
		
	def vGetFileByName( self, dDocName, revisionSelectionMethod="Latest", rendition="Primary", extraProps=[] ):
		return self.file.getFileByName(dDocName,revisionSelectionMethod,rendition,extraProps)
		
	####################################################
	# ---------------  Helper Methods  --------------- #
	####################################################
	def map2IdcPropList( self, map ):
		idcProps = []
		for key in map:
			name = key
			value = map[key]
			idcProps.append(IdcProperty(name,value))
		return idcProps
			
	def content2IdcFile( self, name, content ):
		byteArray = Base64.decode(content)
		return IdcFile(name,byteArray)
		
	def getGetFile( self, result ):
		fileBytes = result.getDownloadFile()
		return Base64.encodeBytes(fileBytes)
		
	def getGetFileString( self, result ):		
		fileInfos = result.getFileInfo()
		fileString = '\n'
		for fileInfo in fileInfos:
			fileString += "-------------------------------\n"
			fileString +="dDocName:\t%s\n" % fileInfo.getDDocName()
			fileString +="dDocTitle:\t%s\n" % fileInfo.getDDocTitle()
			fileString +="dDocType:\t%s\n" % fileInfo.getDDocType()
			fileString +="dDocAuthor:\t%s\n" % fileInfo.getDDocAuthor()
			fileString +="dSecurityGroup:\t%s\n" % fileInfo.getDSecurityGroup()
			fileString +="dDocAccount:\t%s\n" % fileInfo.getDDocAccount()
			fileString +="dID:\t\t%s\n" % fileInfo.getDID()
			#fileString +="dRevClassID:\t%s\n" % fileInfo.getDRevClassID()
			#fileString +="dRevisionID:\t%s\n" % fileInfo.getDRevisionID()
			#fileString +="dRevLabel:\t%s\n" % fileInfo.getDRevLabel()
			#fileString +="dIsCheckedOut:\t%s\n" % fileInfo.getDIsCheckedOut()
			#fileString +="dCheckoutUser:\t%s\n" % fileInfo.getDCheckoutUser()
			#fileString +="dCreateDate:\t%s\n" % fileInfo.getDCreateDate()
			#fileString +="dInDate:\t\t%s\n" % fileInfo.getDInDate()
			#fileString +="dOutDate:\t\t%s\n" % fileInfo.getDOutDate()
			#fileString +="dStatus:\t\t%s\n" % fileInfo.getDStatus()
			#fileString +="dReleaseState:\t%s\n" % fileInfo.getDReleaseState()
			#fileString +="dFlag1:\t\t%s\n" % fileInfo.getDFlag1()
			#fileString +="dWebExtension:\t%s\n" % fileInfo.getDWebExtension()
			#fileString +="dProcessingState:\t%s\n" % fileInfo.getDProcessingState()
			#fileString +="dMessage:\t\t%s\n" % fileInfo.getDMessage()
			#fileString +="dReleaseDate:\t%s\n" % fileInfo.getDReleaseDate()
			#fileString +="dRendition1:\t%s\n" % fileInfo.getDRendition1()
			#fileString +="dRendition2:\t%s\n" % fileInfo.getDRendition2()
			#fileString +="dIndexerState:\t%s\n" % fileInfo.getDIndexerState()
			#fileString +="dPublishType:\t%s\n" % fileInfo.getDPublishType()
			#fileString +="dPublishState:\t%s\n" % fileInfo.getDPublishState()
			#fileString +="dDocID:\t\t%s\n" % fileInfo.getDDocID()
			#fileString +="dIsPrimary:\t%s\n" % fileInfo.getDIsPrimary()
			#fileString +="dIsWebFormat:\t%s\n" % fileInfo.getDIsWebFormat()
			#fileString +="dLocation:\t%s\n" % fileInfo.getDLocation()
			#fileString +="dOriginalName:\t%s\n" % fileInfo.getDOriginalName()
			fileString +="dFormat:\t%s\n" % fileInfo.getDFormat()
			fileString +="dExtension:\t%s\n" % fileInfo.getDExtension()
			#fileString +="dFileSize:\t%s\n" % fileInfo.getDFileSize()
			mds = fileInfo.getCustomDocMetaData()
			for md in mds:
				fileString += "  customDocMetaData:\t%s, %s\n" % (md.getName(),md.getValue())
		return fileString
Ejemplo n.º 4
0
class VamosaService:
    def init_service(self, service_url, user, password, doGetFile):
        self.service = CheckInLocator().getCheckInSoap(URL(service_url))
        self.service.setUsername(user)
        self.service.setPassword(password)

        if doGetFile:
            self.file = GetFileLocator().getGetFileSoap(URL(service_url))
            self.file.setUsername(user)
            self.file.setPassword(password)

    def vCheckIn(self, dDocName, dDocTitle, dDocType, dDocAuthor,
                 dSecurityGroup, dDocAccount, customDocMetadata, primaryFile,
                 alternateFile, extraProps):
        return self.service.checkInUniversal(dDocName, dDocTitle, dDocType,
                                             dDocAuthor, dSecurityGroup,
                                             dDocAccount, customDocMetadata,
                                             primaryFile, alternateFile,
                                             extraProps)

    def vCheckOut(self, dID, extraProps):
        return self.service.checkOut(dID, extraProps)

    def vGetFileByID(self, dID, rendition="Primary", extraProps=[]):
        return self.file.getFileByID(dID, rendition, extraProps)

    def vGetFileByName(self,
                       dDocName,
                       revisionSelectionMethod="Latest",
                       rendition="Primary",
                       extraProps=[]):
        return self.file.getFileByName(dDocName, revisionSelectionMethod,
                                       rendition, extraProps)

    ####################################################
    # ---------------  Helper Methods  --------------- #
    ####################################################
    def map2IdcPropList(self, map):
        idcProps = []
        for key in map:
            name = key
            value = map[key]
            idcProps.append(IdcProperty(name, value))
        return idcProps

    def content2IdcFile(self, name, content):
        byteArray = Base64.decode(content)
        return IdcFile(name, byteArray)

    def getGetFile(self, result):
        fileBytes = result.getDownloadFile()
        return Base64.encodeBytes(fileBytes)

    def getGetFileString(self, result):
        fileInfos = result.getFileInfo()
        fileString = '\n'
        for fileInfo in fileInfos:
            fileString += "-------------------------------\n"
            fileString += "dDocName:\t%s\n" % fileInfo.getDDocName()
            fileString += "dDocTitle:\t%s\n" % fileInfo.getDDocTitle()
            fileString += "dDocType:\t%s\n" % fileInfo.getDDocType()
            fileString += "dDocAuthor:\t%s\n" % fileInfo.getDDocAuthor()
            fileString += "dSecurityGroup:\t%s\n" % fileInfo.getDSecurityGroup(
            )
            fileString += "dDocAccount:\t%s\n" % fileInfo.getDDocAccount()
            fileString += "dID:\t\t%s\n" % fileInfo.getDID()
            #fileString +="dRevClassID:\t%s\n" % fileInfo.getDRevClassID()
            #fileString +="dRevisionID:\t%s\n" % fileInfo.getDRevisionID()
            #fileString +="dRevLabel:\t%s\n" % fileInfo.getDRevLabel()
            #fileString +="dIsCheckedOut:\t%s\n" % fileInfo.getDIsCheckedOut()
            #fileString +="dCheckoutUser:\t%s\n" % fileInfo.getDCheckoutUser()
            #fileString +="dCreateDate:\t%s\n" % fileInfo.getDCreateDate()
            #fileString +="dInDate:\t\t%s\n" % fileInfo.getDInDate()
            #fileString +="dOutDate:\t\t%s\n" % fileInfo.getDOutDate()
            #fileString +="dStatus:\t\t%s\n" % fileInfo.getDStatus()
            #fileString +="dReleaseState:\t%s\n" % fileInfo.getDReleaseState()
            #fileString +="dFlag1:\t\t%s\n" % fileInfo.getDFlag1()
            #fileString +="dWebExtension:\t%s\n" % fileInfo.getDWebExtension()
            #fileString +="dProcessingState:\t%s\n" % fileInfo.getDProcessingState()
            #fileString +="dMessage:\t\t%s\n" % fileInfo.getDMessage()
            #fileString +="dReleaseDate:\t%s\n" % fileInfo.getDReleaseDate()
            #fileString +="dRendition1:\t%s\n" % fileInfo.getDRendition1()
            #fileString +="dRendition2:\t%s\n" % fileInfo.getDRendition2()
            #fileString +="dIndexerState:\t%s\n" % fileInfo.getDIndexerState()
            #fileString +="dPublishType:\t%s\n" % fileInfo.getDPublishType()
            #fileString +="dPublishState:\t%s\n" % fileInfo.getDPublishState()
            #fileString +="dDocID:\t\t%s\n" % fileInfo.getDDocID()
            #fileString +="dIsPrimary:\t%s\n" % fileInfo.getDIsPrimary()
            #fileString +="dIsWebFormat:\t%s\n" % fileInfo.getDIsWebFormat()
            #fileString +="dLocation:\t%s\n" % fileInfo.getDLocation()
            #fileString +="dOriginalName:\t%s\n" % fileInfo.getDOriginalName()
            fileString += "dFormat:\t%s\n" % fileInfo.getDFormat()
            fileString += "dExtension:\t%s\n" % fileInfo.getDExtension()
            #fileString +="dFileSize:\t%s\n" % fileInfo.getDFileSize()
            mds = fileInfo.getCustomDocMetaData()
            for md in mds:
                fileString += "  customDocMetaData:\t%s, %s\n" % (
                    md.getName(), md.getValue())
        return fileString