Example #1
0
def db_setup():
    """Create tables in the database"""
    # These tables will already be defined in memory if the csw plugin is enabled.
    #  IConfigurer will make a call to define_tables()
    contentmodel_record = meta.metadata.tables.get("contentmodel_record", None)

    if contentmodel_record == None:
        # The tables have not been defined. Its likely that the plugin is not enabled in the CKAN .ini file
        log.debug(
            "Could not create contentmodel_record tables. Please make sure that you've added the csw plugin to your CKAN config .ini file."
        )
    else:
        log.debug('contentmodel_record tables defined in memory')

    contentmodel_version_record = meta.metadata.tables.get(
        "contentmodel_version_record", None)

    if contentmodel_version_record == None:
        # The tables have not been defined. Its likely that the plugin is not enabled in the CKAN .ini file
        log.debug(
            "Could not create contentmodel_version_record tables. Please make sure that you've added the csw plugin to your CKAN config .ini file."
        )
    else:
        log.debug('contentmodel_version_record tables defined in memory')

        # All right. Create the tables.
        from ckanext.ngds.base.commands.ngds_tables import create_tables
        create_tables([contentmodel_record], log)
        create_tables([contentmodel_version_record], log)
Example #2
0
def db_setup():
    """Create database tables"""
    node_table = meta.metadata.tables.get("harvest_node", None)
    harvest_record_table = meta.metadata.tables.get("harvested_record", None)
    
    if node_table == None or harvest_record_table == None:
        log.debug("Could not create additional tables. Please make sure that you've added the ngdsharvest plugin to your CKAN config .ini file.")
    else:
        log.debug("NGDS Harvesting tables defined in memory")
        from ckanext.ngds.base.commands.ngds_tables import create_tables
        create_tables([node_table, harvest_record_table], log)
Example #3
0
def db_setup():
    """Create database tables"""
    node_table = meta.metadata.tables.get("harvest_node", None)
    harvest_record_table = meta.metadata.tables.get("harvested_record", None)

    if node_table == None or harvest_record_table == None:
        log.debug(
            "Could not create additional tables. Please make sure that you've added the ngdsharvest plugin to your CKAN config .ini file."
        )
    else:
        log.debug("NGDS Harvesting tables defined in memory")
        from ckanext.ngds.base.commands.ngds_tables import create_tables
        create_tables([node_table, harvest_record_table], log)
Example #4
0
def db_setup():
    """Create tables in the database"""
    # These tables will already be defined in memory if the csw plugin is enabled.
    #  IConfigurer will make a call to define_tables()
    csw_record = meta.metadata.tables.get("csw_record", None)
    
    if csw_record == None:
        # The tables have not been defined. Its likely that the plugin is not enabled in the CKAN .ini file
        log.debug("Could not create CSW tables. Please make sure that you've added the csw plugin to your CKAN config .ini file.")
    else:    
        log.debug('CSW tables defined in memory')
        
        # Alright. Create the tables.
        from ckanext.ngds.base.commands.ngds_tables import create_tables
        create_tables([csw_record], log)
Example #5
0
def db_setup():
    """Create tables in the database"""
    # These tables will already be defined in memory IConfigurer will make a call to define_tables()
    
    bulkupload = meta.metadata.tables.get("bulk_upload", None)
    bulkupload_package = meta.metadata.tables.get("bulk_upload_package", None)
    standingdata = meta.metadata.tables.get("standing_data", None)
    user_saved_search = meta.metadata.tables.get("user_saved_search", None)
    document_index = meta.metadata.tables.get("resource_document_index", None)

    if bulkupload == None:
        # The tables have not been defined. Its likely that the plugin is not enabled in the CKAN .ini file
        log.debug("Could not create additional tables. Please make sure that you've added the metadata plugin to your CKAN config .ini file.")
    else:    
        log.debug('Additional Metadata tables defined in memory')
        
        # Alright. Create the tables.
        from ckanext.ngds.base.commands.ngds_tables import create_tables
        create_tables([bulkupload,bulkupload_package,standingdata,user_saved_search,document_index], log)
Example #6
0
def db_setup():
    """Create tables in the database"""
    # These tables will already be defined in memory if the metadata plugin is enabled.
    #  IConfigurer will make a call to define_tables()
    
    
    party = meta.metadata.tables.get("responsible_party", None)
    languages = meta.metadata.tables.get("languages", None)
    
    if party == None:
        # The tables have not been defined. Its likely that the plugin is not enabled in the CKAN .ini file
        log.debug("Could not create additional tables. Please make sure that you've added the metadata plugin to your CKAN config .ini file.")
    else:    
        log.debug('Additional Metadata tables defined in memory')
        
        # Alright. Create the tables.
        from ckanext.ngds.base.commands.ngds_tables import create_tables
        create_tables([party, languages], log)
        populate_languages()