コード例 #1
0
ファイル: UpdateDataSource.py プロジェクト: JSchwzr/vkviewer
def resetMapObject(mapObjectId, dbsession, logger, testing = False):
    logger.debug('Reset map object into unreferenced state.')
    messtischblatt = Messtischblatt.by_id(mapObjectId, dbsession)
    messtischblatt.isttransformiert = False
    messtischblatt.hasgeorefparams = 0
    messtischblatt.verzeichnispfad = messtischblatt.original_path
    refmtblayer = RefMtbLayer.by_id(MTB_LAYER_ID, messtischblatt.id, dbsession)
    if refmtblayer:
        dbsession.delete(refmtblayer)
        
    if testing:
        dbsession.rollback()
    
    logger.debug('Remove metadata record from catalog instance')
    if not testing:
        gn_transaction_delete('vk20-md-%s'%messtischblatt.id, GN_SETTINGS['gn_username'], GN_SETTINGS['gn_password'], logger)
    return True
コード例 #2
0
def resetMapObject(mapObjectId, dbsession, logger, testing=False):
    logger.debug('Reset map object into unreferenced state.')
    messtischblatt = Messtischblatt.by_id(mapObjectId, dbsession)
    messtischblatt.isttransformiert = False
    messtischblatt.hasgeorefparams = 0
    messtischblatt.verzeichnispfad = messtischblatt.original_path
    refmtblayer = RefMtbLayer.by_id(MTB_LAYER_ID, messtischblatt.id, dbsession)
    if refmtblayer:
        dbsession.delete(refmtblayer)

    if testing:
        dbsession.rollback()

    logger.debug('Remove metadata record from catalog instance')
    if not testing:
        gn_transaction_delete('vk20-md-%s' % messtischblatt.id,
                              GN_SETTINGS['gn_username'],
                              GN_SETTINGS['gn_password'], logger)
    return True
コード例 #3
0
 def testInsertMetadata_forUmlaute(self):
     gn_transaction_delete('df_dk_0010001_1116', GN_SETTINGS['gn_username'], GN_SETTINGS['gn_password'], self.logger)
     response = insertMetadata(id=71055037,db=self.dbSession,logger=self.logger)
     self.assertIsNotNone(response, "testInsertMetadata_forUmlaute should pass, but fails.")
     gn_transaction_delete('df_dk_0010001_1116', GN_SETTINGS['gn_username'], GN_SETTINGS['gn_password'], self.logger)