diff --git a/ckanext/cfpb_extrafields/exportutils.py b/ckanext/cfpb_extrafields/exportutils.py index 2922cb8..cdce59c 100644 --- a/ckanext/cfpb_extrafields/exportutils.py +++ b/ckanext/cfpb_extrafields/exportutils.py @@ -16,7 +16,6 @@ ("title", "Dataset title"), ("notes", "Description"), ("private", "Visibility"), - # ("i", "Subject Matter"), ("organization.name", "Organization"), ("also_known_as", "Also known as"), ("data_source_names", "Data sources"), @@ -36,7 +35,6 @@ ("access_notes", "How to get access"), ("usage_restrictions", "Usage restrictions"), ("dataset_notes", "Dataset notes"), - # ("i", "Dataset Last Modified Date"), ("obfuscated_title", "Obfuscated title"), ("transfer_details", "Transfer details"), ("transfer_initial_size", "Transfer initial size (MB)"), @@ -62,6 +60,16 @@ ("legal_notes","Legal: Notes"), ("pra_notes","PRA: Notes"), ("privacy_notes","Privacy: Notes"), + # New + ("website_name", "Reference Website Name"), + ("cleansing_rules_used", "cleansing rules used"), + ("dataset_last_modified_date", "Dataset Last Modified Date"), + ("foia_exemptions", "FOIA: Exemptions"), + ("foia_exemptions_notes", "FOIA Exemption Notes"), + ("opendata_indicator", "Open Data: open data indicator"), + ("opendata_priority_indicator", "Open Data: priority indicator"), + ("opendata_public_location", "Open Data: public location"), + ] try: diff --git a/ckanext/cfpb_extrafields/options.py b/ckanext/cfpb_extrafields/options.py index bc095a7..4cc00ef 100644 --- a/ckanext/cfpb_extrafields/options.py +++ b/ckanext/cfpb_extrafields/options.py @@ -92,6 +92,23 @@ def relevant_governing_documents(): def content_spatial(): return [""] +# WARNING - Updates will not update stored data +def foia_exemptions(): + return [ + "b3 - Specifically prohibited from disclosure by another federal statute", + "b4 - Trade secrets, commercial, financial, privileged or confidential", + "b5 - Privileged inter-agency or intra-agency communications", + "b6 - Personnel, medical files, or similar information. Includes all PII", + "b7A - Law enforcement data protected for law enforcement proceedings", + "b7B - Law enforcement data protected for fair trial or adjudication", + "b7C - Law enforcement data protected for personal privacy", + "b7D - Law enforcement data protected to safeguard a confidential source", + "b7E - Law enforcement data protected to avoid circumvention of the law", + "b7F - Law enforcement data protected to safeguard life or physical safety", + "b8 - Financial institutions supervision data", + "No Exemption", + ] + def frequency_standards(): #http://dublincore.org/groups/collections/frequency/ a=["Triennial", "Biennial","Annual", diff --git a/ckanext/cfpb_extrafields/plugin.py b/ckanext/cfpb_extrafields/plugin.py index 629deea..2bde97a 100644 --- a/ckanext/cfpb_extrafields/plugin.py +++ b/ckanext/cfpb_extrafields/plugin.py @@ -202,6 +202,7 @@ def get_helpers(self): 'options_approximate_total_size': opts.approximate_total_size, 'options_resource_type': opts.resource_type, 'options_source_categories': opts.source_categories, + 'options_foia_exemptions': opts.foia_exemptions, 'create_datastore': ds.create_datastore, 'get_unique_datastore_json': ds.get_unique_datastore_json, 'delete_datastore_json': ds.delete_datastore_json, @@ -322,6 +323,17 @@ def _modify_package_schema(self, schema): tk.get_converter('convert_to_extras'),], 'privacy_notes' : [tk.get_validator('ignore_missing'), tk.get_converter('convert_to_extras'),], + 'opendata_indicator' : [tk.get_validator('ignore_missing'), + tk.get_converter('convert_to_extras'),], + 'opendata_priority_indicator' : [tk.get_validator('ignore_missing'), + tk.get_converter('convert_to_extras'),], + 'opendata_public_location' : [tk.get_validator('ignore_missing'), + tk.get_converter('convert_to_extras'),], + 'foia_exemptions': [tk.get_validator('ignore_missing'), + v.input_value_validator, + tk.get_converter('convert_to_extras')], + 'foia_exemptions_notes' : [tk.get_validator('ignore_missing'), + tk.get_converter('convert_to_extras'),], }) # now modify tag fields and convert_to_tags schema.update({ @@ -458,6 +470,12 @@ def show_package_schema(self): tk.get_validator('ignore_missing'),], 'privacy_notes' : [tk.get_converter('convert_from_extras'), tk.get_validator('ignore_missing'),], + 'opendata_indicator' : [ tk.get_converter('convert_from_extras'),tk.get_validator('ignore_missing'),], + 'opendata_priority_indicator' : [ tk.get_converter('convert_from_extras'),tk.get_validator('ignore_missing'),], + 'opendata_public_location' : [ tk.get_converter('convert_from_extras'),tk.get_validator('ignore_missing'),], + 'foia_exemptions': [tk.get_converter('convert_from_extras'), + tk.get_validator('ignore_missing')], + 'foia_exemptions_notes' : [ tk.get_converter('convert_from_extras'),tk.get_validator('ignore_missing'),], }) schema['resources'].update({ 'approximate_total_size' : [ tk.get_validator('ignore_missing'),], diff --git a/ckanext/cfpb_extrafields/templates/macros/form_custom.html b/ckanext/cfpb_extrafields/templates/macros/form_custom.html index 8bade44..be28567 100644 --- a/ckanext/cfpb_extrafields/templates/macros/form_custom.html +++ b/ckanext/cfpb_extrafields/templates/macros/form_custom.html @@ -25,7 +25,7 @@ {% endmacro %} {# select multiple list with specified other option #} -{% macro select_multi_with_other(name, id='', label='', current_values=[], size="400", options_defaults=[], extra_html="", error='') %} +{% macro select_multi_with_other(name, id='', label='', current_values=[], size="400", options_defaults=[], extra_html="", error='',other=True) %}