diff --git a/.gitignore b/.gitignore index a61569d..50f3452 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ *.py? *.swp # dirs +__pycache__/ bin/ buildout-cache/ develop-eggs/ diff --git a/CHANGES.rst b/CHANGES.rst index cc3137c..3b339ca 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,7 +5,8 @@ Changelog 1.2.2 (unreleased) ------------------ -- Nothing changed yet. +- Add footer_top field in settings, to manage a new footer row before columns. + [cekk] 1.2.1 (2024-01-17) diff --git a/README.rst b/README.rst index bc232f9..f3cf092 100644 --- a/README.rst +++ b/README.rst @@ -26,16 +26,19 @@ To avoid enabling registry access to everyone, this package exposes a dedicated The response is something similar to this:: - [ - { - 'text': {'data': 'foo'}, - 'title': 'First column' - }, - { - 'text': {'content-type': 'text/html', 'data': ''}, - 'title': 'Second column' - } - ] + { + "footer_top": {...}, + "footer_columns": [ + { + 'text': {'data': 'foo'}, + 'title': 'First column' + }, + { + 'text': {'content-type': 'text/html', 'data': ''}, + 'title': 'Second column' + } + ] + } Control panel diff --git a/src/redturtle/voltoplugin/editablefooter/configure.zcml b/src/redturtle/voltoplugin/editablefooter/configure.zcml index 758fbc4..326fe7d 100644 --- a/src/redturtle/voltoplugin/editablefooter/configure.zcml +++ b/src/redturtle/voltoplugin/editablefooter/configure.zcml @@ -16,6 +16,8 @@ + + diff --git a/src/redturtle/voltoplugin/editablefooter/interfaces.py b/src/redturtle/voltoplugin/editablefooter/interfaces.py index 98eaa91..4999113 100644 --- a/src/redturtle/voltoplugin/editablefooter/interfaces.py +++ b/src/redturtle/voltoplugin/editablefooter/interfaces.py @@ -10,6 +10,15 @@ class IRedturtleVoltoEditablefooterLayer(IDefaultBrowserLayer): class IEditableFooterSettings(IControlpanel): + footer_top = SourceText( + title=_("footer_top_label", default="Footer top"), + description=_( + "footer_top_help", + default="Insert some text that will be shown as first element in the footer, before the columns.", + ), + required=False, + default="", + ) footer_columns = SourceText( title=_("footer_columns_label", default="Footer columns"), description=_( diff --git a/src/redturtle/voltoplugin/editablefooter/locales/en/LC_MESSAGES/redturtle.volto_editablefooter.po b/src/redturtle/voltoplugin/editablefooter/locales/en/LC_MESSAGES/redturtle.volto_editablefooter.po deleted file mode 100644 index 25bbfc9..0000000 --- a/src/redturtle/voltoplugin/editablefooter/locales/en/LC_MESSAGES/redturtle.volto_editablefooter.po +++ /dev/null @@ -1,55 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-10-08 14:24+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0\n" -"Language-Code: en\n" -"Language-Name: English\n" -"Preferred-Encodings: utf-8 latin1\n" -"Domain: DOMAIN\n" - -#: redturtle/voltoplugin/editablefooter/profiles/default/controlpanel.xml -msgid "Editable footer settings" -msgstr "" - -#: redturtle/voltoplugin/editablefooter/configure.zcml:28 -msgid "Installs the redturtle.voltoplugin.editablefooter add-on." -msgstr "" - -#: redturtle/voltoplugin/editablefooter/configure.zcml:37 -msgid "Uninstalls the redturtle.voltoplugin.editablefooter add-on." -msgstr "" - -#. Default: "Set infos for columns in footer." -#: redturtle/voltoplugin/editablefooter/browser/controlpanel.py:13 -msgid "editable_footer_settings_help" -msgstr "" - -#. Default: "Editable Footer Settings" -#: redturtle/voltoplugin/editablefooter/browser/controlpanel.py:10 -msgid "editable_footer_settings_label" -msgstr "" - -#. Default: "Set a list of custom columns for the footer. You can have different sets for each portal's languages." -#: redturtle/voltoplugin/editablefooter/interfaces.py:15 -msgid "footer_columns_help" -msgstr "" - -#. Default: "Footer columns" -#: redturtle/voltoplugin/editablefooter/interfaces.py:14 -msgid "footer_columns_label" -msgstr "" - -#: redturtle/voltoplugin/editablefooter/configure.zcml:28 -msgid "redturtle.voltoplugin.editablefooter" -msgstr "" - -#: redturtle/voltoplugin/editablefooter/configure.zcml:37 -msgid "redturtle.voltoplugin.editablefooter (uninstall)" -msgstr "" diff --git a/src/redturtle/voltoplugin/editablefooter/locales/it/LC_MESSAGES/redturtle.volto_editablefooter.po b/src/redturtle/voltoplugin/editablefooter/locales/it/LC_MESSAGES/redturtle.voltoplugin.editablefooter.po similarity index 66% rename from src/redturtle/voltoplugin/editablefooter/locales/it/LC_MESSAGES/redturtle.volto_editablefooter.po rename to src/redturtle/voltoplugin/editablefooter/locales/it/LC_MESSAGES/redturtle.voltoplugin.editablefooter.po index 20460e0..4c95fe2 100644 --- a/src/redturtle/voltoplugin/editablefooter/locales/it/LC_MESSAGES/redturtle.volto_editablefooter.po +++ b/src/redturtle/voltoplugin/editablefooter/locales/it/LC_MESSAGES/redturtle.voltoplugin.editablefooter.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-10-08 14:24+0000\n" +"POT-Creation-Date: 2024-01-31 11:22+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,38 +18,48 @@ msgstr "" msgid "Editable footer settings" msgstr "Impostazioni footer" -#: redturtle/voltoplugin/editablefooter/configure.zcml:28 +#: redturtle/voltoplugin/editablefooter/configure.zcml:31 msgid "Installs the redturtle.voltoplugin.editablefooter add-on." msgstr "Installa redturtle.voltoplugin.editablefooter" -#: redturtle/voltoplugin/editablefooter/configure.zcml:37 +#: redturtle/voltoplugin/editablefooter/configure.zcml:40 msgid "Uninstalls the redturtle.voltoplugin.editablefooter add-on." msgstr "Disinstalla redturtle.voltoplugin.editablefooter" +#: redturtle/voltoplugin/editablefooter/configure.zcml:31 +msgid "Volto Editable Footer" +msgstr "Volto Editable Footer" + +#: redturtle/voltoplugin/editablefooter/configure.zcml:40 +msgid "Volto Editable Footer (uninstall)" +msgstr "Volto Editable Footer (uninstall" + #. Default: "Set infos for columns in footer." -#: redturtle/voltoplugin/editablefooter/browser/controlpanel.py:13 +#: redturtle/voltoplugin/editablefooter/browser/controlpanel.py:12 msgid "editable_footer_settings_help" msgstr "Imposta i dati per le colonne del footer." #. Default: "Editable Footer Settings" -#: redturtle/voltoplugin/editablefooter/browser/controlpanel.py:10 +#: redturtle/voltoplugin/editablefooter/browser/controlpanel.py:11 msgid "editable_footer_settings_label" msgstr "Impostazioni footer" #. Default: "Set a list of custom columns for the footer. You can have different sets for each portal's languages." -#: redturtle/voltoplugin/editablefooter/interfaces.py:15 +#: redturtle/voltoplugin/editablefooter/interfaces.py:24 msgid "footer_columns_help" msgstr "Configura una serie di colonne per il footer. Puoi creare differenti impostazioni per le varie lingue del sito." #. Default: "Footer columns" -#: redturtle/voltoplugin/editablefooter/interfaces.py:14 +#: redturtle/voltoplugin/editablefooter/interfaces.py:23 msgid "footer_columns_label" msgstr "Colonne footer" -#: redturtle/voltoplugin/editablefooter/configure.zcml:28 -msgid "redturtle.voltoplugin.editablefooter" -msgstr "" +#. Default: "Insert some text that will be shown as first element in the footer, before the columns." +#: redturtle/voltoplugin/editablefooter/interfaces.py:15 +msgid "footer_top_help" +msgstr "Inserisci del testo che apparirà come primo elemento nel footer, sopra alle colonne." -#: redturtle/voltoplugin/editablefooter/configure.zcml:37 -msgid "redturtle.voltoplugin.editablefooter (uninstall)" -msgstr "" +#. Default: "Footer top" +#: redturtle/voltoplugin/editablefooter/interfaces.py:14 +msgid "footer_top_label" +msgstr "Testata del footer" diff --git a/src/redturtle/voltoplugin/editablefooter/locales/redturtle.volto_editablefooter.pot b/src/redturtle/voltoplugin/editablefooter/locales/redturtle.voltoplugin.editablefooter.pot similarity index 64% rename from src/redturtle/voltoplugin/editablefooter/locales/redturtle.volto_editablefooter.pot rename to src/redturtle/voltoplugin/editablefooter/locales/redturtle.voltoplugin.editablefooter.pot index 61ab3a1..b1fbdc8 100644 --- a/src/redturtle/voltoplugin/editablefooter/locales/redturtle.volto_editablefooter.pot +++ b/src/redturtle/voltoplugin/editablefooter/locales/redturtle.voltoplugin.editablefooter.pot @@ -1,10 +1,10 @@ -# --- PLEASE EDIT THE LINES BELOW CORRECTLY --- -# SOME DESCRIPTIVE TITLE. -# FIRST AUTHOR , YEAR. +#--- PLEASE EDIT THE LINES BELOW CORRECTLY --- +#SOME DESCRIPTIVE TITLE. +#FIRST AUTHOR , YEAR. msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-10-08 14:24+0000\n" +"POT-Creation-Date: 2024-01-31 11:22+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,38 +21,48 @@ msgstr "" msgid "Editable footer settings" msgstr "" -#: redturtle/voltoplugin/editablefooter/configure.zcml:28 +#: redturtle/voltoplugin/editablefooter/configure.zcml:31 msgid "Installs the redturtle.voltoplugin.editablefooter add-on." msgstr "" -#: redturtle/voltoplugin/editablefooter/configure.zcml:37 +#: redturtle/voltoplugin/editablefooter/configure.zcml:40 msgid "Uninstalls the redturtle.voltoplugin.editablefooter add-on." msgstr "" +#: redturtle/voltoplugin/editablefooter/configure.zcml:31 +msgid "Volto Editable Footer" +msgstr "" + +#: redturtle/voltoplugin/editablefooter/configure.zcml:40 +msgid "Volto Editable Footer (uninstall)" +msgstr "" + #. Default: "Set infos for columns in footer." -#: redturtle/voltoplugin/editablefooter/browser/controlpanel.py:13 +#: redturtle/voltoplugin/editablefooter/browser/controlpanel.py:12 msgid "editable_footer_settings_help" msgstr "" #. Default: "Editable Footer Settings" -#: redturtle/voltoplugin/editablefooter/browser/controlpanel.py:10 +#: redturtle/voltoplugin/editablefooter/browser/controlpanel.py:11 msgid "editable_footer_settings_label" msgstr "" #. Default: "Set a list of custom columns for the footer. You can have different sets for each portal's languages." -#: redturtle/voltoplugin/editablefooter/interfaces.py:15 +#: redturtle/voltoplugin/editablefooter/interfaces.py:24 msgid "footer_columns_help" msgstr "" #. Default: "Footer columns" -#: redturtle/voltoplugin/editablefooter/interfaces.py:14 +#: redturtle/voltoplugin/editablefooter/interfaces.py:23 msgid "footer_columns_label" msgstr "" -#: redturtle/voltoplugin/editablefooter/configure.zcml:28 -msgid "redturtle.voltoplugin.editablefooter" +#. Default: "Insert some text that will be shown as first element in the footer, before the columns." +#: redturtle/voltoplugin/editablefooter/interfaces.py:15 +msgid "footer_top_help" msgstr "" -#: redturtle/voltoplugin/editablefooter/configure.zcml:37 -msgid "redturtle.voltoplugin.editablefooter (uninstall)" +#. Default: "Footer top" +#: redturtle/voltoplugin/editablefooter/interfaces.py:14 +msgid "footer_top_label" msgstr "" diff --git a/src/redturtle/voltoplugin/editablefooter/locales/update.py b/src/redturtle/voltoplugin/editablefooter/locales/update.py index 2c6cd42..1c6ad48 100644 --- a/src/redturtle/voltoplugin/editablefooter/locales/update.py +++ b/src/redturtle/voltoplugin/editablefooter/locales/update.py @@ -7,7 +7,7 @@ domain = "redturtle.voltoplugin.editablefooter" os.chdir(pkg_resources.resource_filename(domain, "")) -os.chdir("../../../") +os.chdir("../../../../") target_path = "src/redturtle/voltoplugin/editablefooter/" locale_path = target_path + "locales/" i18ndude = "./bin/i18ndude" @@ -31,7 +31,7 @@ def locale_folder_setup(): ) subprocess.call(cmd, shell=True) - os.chdir("../../../../") + os.chdir("../../../../../") def _rebuild(): diff --git a/src/redturtle/voltoplugin/editablefooter/profiles/default/metadata.xml b/src/redturtle/voltoplugin/editablefooter/profiles/default/metadata.xml index 6ec05d9..2d36211 100644 --- a/src/redturtle/voltoplugin/editablefooter/profiles/default/metadata.xml +++ b/src/redturtle/voltoplugin/editablefooter/profiles/default/metadata.xml @@ -1,6 +1,6 @@ - 1000 + 1001 profile-plone.restapi:default diff --git a/src/redturtle/voltoplugin/editablefooter/restapi/configure.zcml b/src/redturtle/voltoplugin/editablefooter/restapi/configure.zcml index 07b360c..5d216b6 100644 --- a/src/redturtle/voltoplugin/editablefooter/restapi/configure.zcml +++ b/src/redturtle/voltoplugin/editablefooter/restapi/configure.zcml @@ -23,14 +23,14 @@ diff --git a/src/redturtle/voltoplugin/editablefooter/restapi/deserializer.py b/src/redturtle/voltoplugin/editablefooter/restapi/deserializer.py index 48ee160..77b7814 100644 --- a/src/redturtle/voltoplugin/editablefooter/restapi/deserializer.py +++ b/src/redturtle/voltoplugin/editablefooter/restapi/deserializer.py @@ -21,15 +21,21 @@ def __call__(self): req = json_body(self.controlpanel.request) proxy = self.registry.forInterface(self.schema, prefix=self.schema_prefix) errors = [] - data = req.get("footer_columns", {}) - if not data: + footer_top = req.get("footer_top", {}) + footer_columns = req.get("footer_columns", {}) + + if not footer_columns: errors.append({"message": "Missing data", "field": "footer_columns"}) raise BadRequest(errors) try: # later we need to do some validations - setattr(proxy, "footer_columns", json.dumps(data)) + setattr(proxy, "footer_columns", json.dumps(footer_columns)) except ValueError as e: errors.append({"message": str(e), "field": "footer_columns", "error": e}) - + try: + # later we need to do some validations + setattr(proxy, "footer_top", json.dumps(footer_top)) + except ValueError as e: + errors.append({"message": str(e), "field": "footer_top", "error": e}) if errors: raise BadRequest(errors) diff --git a/src/redturtle/voltoplugin/editablefooter/restapi/get.py b/src/redturtle/voltoplugin/editablefooter/restapi/get.py index 097a635..c34ec08 100644 --- a/src/redturtle/voltoplugin/editablefooter/restapi/get.py +++ b/src/redturtle/voltoplugin/editablefooter/restapi/get.py @@ -20,17 +20,20 @@ @implementer(IPublishTraverse) -class FooterColumns(Service): - def __init__(self, context, request): - super(FooterColumns, self).__init__(context, request) - +class EditableFooterGet(Service): def reply(self): - record = api.portal.get_registry_record( + res = {"footer_top": None, "footer_columns": None} + footer_top = api.portal.get_registry_record( + "footer_top", interface=IEditableFooterSettings, default="" + ) + footer_columns = api.portal.get_registry_record( "footer_columns", interface=IEditableFooterSettings, default="" ) - if not record: - return [] - data = json.loads(record) + if footer_top: + res["footer_top"] = json.loads(footer_top) + if not footer_columns: + return res + data = json.loads(footer_columns) portal_url = self.get_portal_url() for el in data or []: if isinstance(el, dict): @@ -44,7 +47,8 @@ def reply(self): item["text"]["data"] = item["text"]["data"].replace( 'href="/', f'href="{portal_url}/' ) - return data + res["footer_columns"] = data + return res def get_portal_url(self): portal_url = api.portal.get().absolute_url() diff --git a/src/redturtle/voltoplugin/editablefooter/restapi/serializer.py b/src/redturtle/voltoplugin/editablefooter/restapi/serializer.py index 0428c16..c11a62e 100644 --- a/src/redturtle/voltoplugin/editablefooter/restapi/serializer.py +++ b/src/redturtle/voltoplugin/editablefooter/restapi/serializer.py @@ -15,7 +15,8 @@ class EditableFooterControlpanelSerializeToJson(ControlpanelSerializeToJson): def __call__(self): json_data = super(EditableFooterControlpanelSerializeToJson, self).__call__() - conf = json_data["data"].get("footer_columns", "") - if conf: - json_data["data"]["footer_columns"] = json.loads(conf) + for field in ["footer_columns", "footer_top"]: + value = json_data["data"].get(field, "") + if value: + json_data["data"][field] = json.loads(value) return json_data diff --git a/src/redturtle/voltoplugin/editablefooter/tests/test_footer_columns_route.py b/src/redturtle/voltoplugin/editablefooter/tests/test_editable_footer_data_service.py similarity index 65% rename from src/redturtle/voltoplugin/editablefooter/tests/test_footer_columns_route.py rename to src/redturtle/voltoplugin/editablefooter/tests/test_editable_footer_data_service.py index d2e236d..bba906c 100644 --- a/src/redturtle/voltoplugin/editablefooter/tests/test_footer_columns_route.py +++ b/src/redturtle/voltoplugin/editablefooter/tests/test_editable_footer_data_service.py @@ -19,22 +19,19 @@ import unittest -class FooterColumnsEndpointTest(unittest.TestCase): - layer = VOLTO_EDITABLEFOOTER_API_FUNCTIONAL_TESTING - +class BaseTest(unittest.TestCase): def setUp(self): self.app = self.layer["app"] self.portal = self.layer["portal"] self.request = self.layer["request"] self.portal_url = self.portal.absolute_url() - self.controlpanel_url = "/@controlpanels/editable-footer-settings" setRoles(self.portal, TEST_USER_ID, ["Manager"]) self.api_session = RelativeSession(self.portal_url) self.api_session.headers.update({"Accept": "application/json"}) self.api_session.auth = (SITE_OWNER_NAME, SITE_OWNER_PASSWORD) - self.value = [ + self.footer_columns_value = [ { "items": [ {"text": {"data": 'Link 1'}}, @@ -42,7 +39,9 @@ def setUp(self): ] } ] - self.set_record_value(field="footer_columns", value=json.dumps(self.value)) + self.set_record_value( + field="footer_columns", value=json.dumps(self.footer_columns_value) + ) def tearDown(self): self.api_session.close() @@ -51,24 +50,37 @@ def set_record_value(self, field, value): api.portal.set_registry_record(field, value, interface=IEditableFooterSettings) commit() + +class EditableFooterDataServiceTest(BaseTest): + layer = VOLTO_EDITABLEFOOTER_API_FUNCTIONAL_TESTING + def test_route_exists(self): response = self.api_session.get("/@footer-columns") self.assertEqual(response.status_code, 200) self.assertEqual(response.headers.get("Content-Type"), "application/json") - def test_return_json_data(self): + def test_return_data_structure(self): + response = self.api_session.get("/@footer-columns") + result = response.json() + + self.assertIn("footer_top", result) + self.assertIn("footer_columns", result) + + def test_return_json_data_absolute_links_converted_for_footer_columns(self): response = self.api_session.get("/@footer-columns") self.assertEqual(response.status_code, 200) result = response.json() - # self.value has relative links, but the result should have absolute links - self.assertNotEqual(result, self.value) + # self.footer_columns_value has relative links, but the result should have absolute links + self.assertNotEqual(result["footer_columns"], self.footer_columns_value) self.assertEqual( - json.dumps(result), - json.dumps(self.value).replace('href=\\"/', f'href=\\"{self.portal_url}/'), + json.dumps(result["footer_columns"]), + json.dumps(self.footer_columns_value).replace( + 'href=\\"/', f'href=\\"{self.portal_url}/' + ), ) -class FooterColumnsEndpointTestWithPloneVolto(FooterColumnsEndpointTest): +class EditableFooterDataServiceTestWithPloneVolto(BaseTest): layer = VOLTO_EDITABLEFOOTER_API_FUNCTIONAL_TESTING def setUp(self): @@ -81,11 +93,13 @@ def test_return_json_data_with_portal_url_if_plone_volto_installed_and_not_confi response = self.api_session.get("/@footer-columns") self.assertEqual(response.status_code, 200) result = response.json() - # self.value has relative links, but the result should have absolute links - self.assertNotEqual(result, self.value) + # self.footer_columns_value has relative links, but the result should have absolute links + self.assertNotEqual(result["footer_columns"], self.footer_columns_value) self.assertEqual( - json.dumps(result), - json.dumps(self.value).replace('href=\\"/', f'href=\\"{self.portal_url}/'), + json.dumps(result["footer_columns"]), + json.dumps(self.footer_columns_value).replace( + 'href=\\"/', f'href=\\"{self.portal_url}/' + ), ) def test_return_json_data_with_frontend_domain_if_set(self): @@ -99,11 +113,11 @@ def test_return_json_data_with_frontend_domain_if_set(self): response = self.api_session.get("/@footer-columns") self.assertEqual(response.status_code, 200) result = response.json() - # self.value has relative links, but the result should have absolute links - self.assertNotEqual(result, self.value) + # self.footer_columns_value has relative links, but the result should have absolute links + self.assertNotEqual(result["footer_columns"], self.footer_columns_value) self.assertEqual( - json.dumps(result), - json.dumps(self.value).replace( + json.dumps(result["footer_columns"]), + json.dumps(self.footer_columns_value).replace( 'href=\\"/', f'href=\\"{settings.frontend_domain}/' ), ) diff --git a/src/redturtle/voltoplugin/editablefooter/upgrades/__init__.py b/src/redturtle/voltoplugin/editablefooter/upgrades/__init__.py new file mode 100644 index 0000000..40a96af --- /dev/null +++ b/src/redturtle/voltoplugin/editablefooter/upgrades/__init__.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- diff --git a/src/redturtle/voltoplugin/editablefooter/upgrades/configure.zcml b/src/redturtle/voltoplugin/editablefooter/upgrades/configure.zcml new file mode 100644 index 0000000..035dca3 --- /dev/null +++ b/src/redturtle/voltoplugin/editablefooter/upgrades/configure.zcml @@ -0,0 +1,16 @@ + + + + + + diff --git a/src/redturtle/voltoplugin/editablefooter/upgrades/upgrades.py b/src/redturtle/voltoplugin/editablefooter/upgrades/upgrades.py new file mode 100644 index 0000000..2d65a3e --- /dev/null +++ b/src/redturtle/voltoplugin/editablefooter/upgrades/upgrades.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +import logging + +logger = logging.getLogger(__name__) + +DEFAULT_PROFILE = "profile-redturtle.voltoplugin.editablefooter:default" + + +def update_profile(context, profile, run_dependencies=True): + context.runImportStepFromProfile(DEFAULT_PROFILE, profile, run_dependencies) + + +def update_types(context): + update_profile(context, "typeinfo") + + +def update_rolemap(context): + update_profile(context, "rolemap") + + +def update_registry(context): + update_profile(context, "plone.app.registry", run_dependencies=False) + + +def update_controlpanel(context): + update_profile(context, "controlpanel") + + +def update_catalog(context): + update_profile(context, "catalog")