Example #1
0
            #print 'blobStart#%s#END' % blob
            blob_mssql = ESSMSSQL.escape_string(DOC)
            #print 'blob_MSSQL2 Start#%s#END' % blob_mssql

        if FTPflag and DBflag:
            self.timestamp_utc = datetime.datetime.utcnow().replace(
                microsecond=0, tzinfo=pytz.utc)
            self.timestamp_dst = self.timestamp_utc.astimezone(self.tz)
            ArchiveObject_obj = ArchiveObject.objects.get(
                ObjectUUID=ObjectUUID)
            ArchiveObjectMetadata_obj = ArchiveObjectMetadata()
            ArchiveObjectMetadata_obj.ObjectUUID = ArchiveObject_obj
            ArchiveObjectMetadata_obj.ObjectIdentifierValue = ObjectIdentifierValue
            ArchiveObjectMetadata_obj.ObjectMetadataType = ObjectMetadataType
            ArchiveObjectMetadata_obj.ObjectMetadataServer = self.ftp_res[0]
            ArchiveObjectMetadata_obj.ObjectMetadataURL = self.ftp_res[1]
            ArchiveObjectMetadata_obj.ObjectMetadataBLOB = blob
            ArchiveObjectMetadata_obj.linkingAgentIdentifierValue = AgentIdentifierValue
            ArchiveObjectMetadata_obj.LocalDBdatetime = self.timestamp_utc
            ArchiveObjectMetadata_obj.save()
            #            res,errno,why =  ESSDB.DB().action('IngestObjectMetadata','INS',('ObjectUUID',ObjectUUID,
            #                                                                 'ObjectIdentifierValue',ObjectIdentifierValue,
            #                                                                 'ObjectMetadataType',ObjectMetadataType,
            #                                                                 'ObjectMetadataServer',self.ftp_res[0],
            #                                                                 'ObjectMetadataURL',self.ftp_res[1],
            #                                                                 'ObjectMetadataBLOB',blob,
            #                                                                 'linkingAgentIdentifierValue',AgentIdentifierValue,
            #                                                                 'LocalDBdatetime',self.timestamp_utc.replace(tzinfo=None)))
            #            if errno: return '',40,'errno: %s, why: %s' % (str(errno),str(why))
            #            if errno == 0 and ExtDBupdate:
            if ExtDBupdate:
Example #2
0
            #print 'DOC',DOC 
            blob = MySQLdb.escape_string(DOC)
            #print 'blobStart#%s#END' % blob
            blob_mssql = ESSMSSQL.escape_string(DOC)
            #print 'blob_MSSQL2 Start#%s#END' % blob_mssql
        
        if FTPflag and DBflag:
            self.timestamp_utc = datetime.datetime.utcnow().replace(microsecond=0,tzinfo=pytz.utc)
            self.timestamp_dst = self.timestamp_utc.astimezone(self.tz)
            ArchiveObject_obj = ArchiveObject.objects.get(ObjectUUID = ObjectUUID)
            ArchiveObjectMetadata_obj = ArchiveObjectMetadata()
            ArchiveObjectMetadata_obj.ObjectUUID = ArchiveObject_obj
            ArchiveObjectMetadata_obj.ObjectIdentifierValue = ObjectIdentifierValue
            ArchiveObjectMetadata_obj.ObjectMetadataType = ObjectMetadataType
            ArchiveObjectMetadata_obj.ObjectMetadataServer = self.ftp_res[0]
            ArchiveObjectMetadata_obj.ObjectMetadataURL = self.ftp_res[1]
            ArchiveObjectMetadata_obj.ObjectMetadataBLOB = blob
            ArchiveObjectMetadata_obj.linkingAgentIdentifierValue = AgentIdentifierValue
            ArchiveObjectMetadata_obj.LocalDBdatetime = self.timestamp_utc.replace(tzinfo=None)
            ArchiveObjectMetadata_obj.save()       
#            res,errno,why =  ESSDB.DB().action('IngestObjectMetadata','INS',('ObjectUUID',ObjectUUID,
#                                                                 'ObjectIdentifierValue',ObjectIdentifierValue,
#                                                                 'ObjectMetadataType',ObjectMetadataType,
#                                                                 'ObjectMetadataServer',self.ftp_res[0],
#                                                                 'ObjectMetadataURL',self.ftp_res[1],
#                                                                 'ObjectMetadataBLOB',blob,
#                                                                 'linkingAgentIdentifierValue',AgentIdentifierValue,
#                                                                 'LocalDBdatetime',self.timestamp_utc.replace(tzinfo=None)))
#            if errno: return '',40,'errno: %s, why: %s' % (str(errno),str(why))
#            if errno == 0 and ExtDBupdate:
            if ExtDBupdate: