Package: collective.themesitesetup
collective.themesitesetupcollective.themesitesetupis aplone.app.theming-plugin for
embeddingGenericSetup-steps into zipped theme packages.collective.themesitesetupcan automatically import one embedded set of
generic setup steps during theme activation and another one (so calleduninstall profile) when theme is deactivated. Yet, also additionals ets
can be embedded and imported manually.See it activating theme site setup at:https://youtu.be/3vkrc7JFUU0InstallationSimply include this package into your Plone site buildout by followingthe official instructions. This add-on doesn’t require other activation,
but, of course, requiresplone.app.themingto be activated.ConfigurationThis plugin is enabled for any theme by simply adding the following line into
theme’smanifest.cfg:[theme:genericsetup]By default, this looks for the setup steps to be imported during activation
from theme’sinstall-subdirectory and the steps to be imported during
deactivation from theme’suninstall-subdirectory. If such directory does
not exist, this plugin simply does not import any steps.The default lookup directories can be customized by overriding the defaults
with custom values in theme’smanifest.cfg:[theme:genericsetup]install=my-installuninstall=my-uninstallThis plugin can also be disabled at any time simply by adding the linedisabled = trueinto plugin’s configuration in theme’smanifest.cfg:[theme:genericsetup]disabled=trueAbout securityThe use of this package encourages storing importable Generic Setup profiles
(and later Dexterity XML models, localization catalogs and other resource
directories data) in theme. Because all the resources in theme are public with
know URLs, also all the data in theme meant to be imported by this package are
made public.If you don’t want to publish your Generic Setup profiles and other theme data
included only to be imported by this plugin, use the following optionself-destruct= trueto remove all the imported resources after theme
activation:[theme:genericsetup]self-destruct=trueDexterity modelsA usual use for this plugin is to ship a theme with pre-configured Dexterity
content types. Unfortunately, describing a Dexterity XML schema in type
description inline in type description XML is inconvenient (because the schema
must be escaped) and Dexterity only supports reading separate XML model
files from filesystem and filesystem Python packages. Fortunately, this
plugin allows populating existing Dexterity content types (and also the
ones installed with this plugin) with a matching model XML from the theme.By default, the plugin loads model files frommodels-subdirectory of the
them. Models must have matching filename with the content type id (with.xmlextension). The default import directory can be changed with:[theme:genericsetup]models=my_modelsThe plugin does not overwrite existing models by default (unless they seem
empty), but this can be changed (e.g. for development purposes) with:[theme:genericsetup]models-overwrite=trueMessage catalogsThis plugin can also be used to register (and unregister) i18n message
catalogs directly from the theme. By default, the plugin looks for message
catalogs fromlocales-subdirectory of the theme, expecting the usual
message catalog directory structure:./locales/en/LC_MESSAGES/foo.po
./locales/en/LC_MESSAGES/bar.poIn the above example, two message catalogs, one for languageenfor domainfooand another for languageenfor domainbarare registered.The default locales directory name can be changed with:[theme:genericsetup]locales=my_localesThe registered message catalogs are unregistered when the theme is deactivated.NoteThe registered message catalogs use the persistent message catalog
classes fromzope.app.i18n. The existence of these catalogs can
be confirmed from ZMIComponents-tab from Plone site root by looking
fortranslationdomainutilities with themesitesetup in their names.Mosaic layouts (and other resources)This plugin can also be used to populate also other persistent resource
directories than theme directories. For example, with this plugin, your theme
could contain site and content layouts for Plone Mosaic. Layouts are copied
from theme into their own resource directory namespaces when theme is activated
(or updated). One layouts are copied, they are not removed, unless this plugin
is configured to purge those directories.For example, theme containing single site layout and content layout, could
contain the following file structure:./resources/sitelayout/manifest.cfg
./resources/sitelayout/layout.html
./resources/contentlayout/manifest.cfg
./resources/contentlayout/layout.htmlThe default resources directory name can be fromresourcesto e.g.designswith:[theme:genericsetup]resources=designBy default, this plugin never overwrites existing resources unless its
configuration optionresources-overwriteis enabled:[theme:genericsetup]resources-overwrite=trueIn addition, this plugin can be configured to purge existing directories
before copying with:[theme:genericsetup]resources-purge=trueAlthough, the plugin will still never remove top-level resources directories
(liketheme,sitelayoutorcontentlayout).NoteTechnically resources are simply copied intoportal_resourcesand they
can be manually removed via ZMI. Please, note that changes made in theme
editor are not copied unless theme has been re-activated (or updated).PermissionsThis plugin has also experimental support for TTW custom permissions, which
are useful for more complex content management scenarios involving Dexterity
content types and workflows. New permissions are registered before the
GenericSetup profile get imported, to make to new permission to be available
during import.Custom permissions are listed in theme’smanifest.cfginid Titleformat
as follow:[theme:genericsetup]permissions=mydomain.addMyProduct    MyDomain:Add My Productmydomain.removeMyProduct MyDomain:Remove My ProductCustom permissions are removed when theme is disabled. Yet, they disappear
from ZMI only when the site is restarted.NoteThe registered persistent permissions use and depend on LocalPermission
class fromzope.app.localpermission. If this package is removed without
uninstalling theme with permisions at first,zope.app.localpermissionmust exit to prevent possible errors caused by missing object class.In addition, permissions must be registered for Zope 2 in a non-persistent
way, which requires restart to remove permissions from ZMI screens.
Because of this, even installed permissions continue to work only as long
as this package is available.The existence of these permissions can be confirmed from ZMIComponents-tab from Plone site root by looking forPermissionutilities,
on ZMI security tab and e.g. in the options for Add permission in ZMI portal
type factory information pages.Exporting the site setupThis plugin provides helper forms for exporting the current site setup
into a through-the-web created (writable) theme and importing that site setup
manually from the theme folder.The export form is registered for the theme resource directory as@@export-site-setupand the import form as@@import-site-setup.The export form is useful for creating the initial site setup into the theme
directory. SimplyCreate a new theme from Theming control panelGo to the export form URL, e.g.http://localhost:8080/Plone/++theme++my-theme/@@export-site-setup:Choose the steps you wish to export and clickExport.Editing the site setupThe site setup steps can be edited like any theme file through the
theme editor:Tip:You can Usesix feet up’s greatGeneric Setup reference cardas
cheat cheet for editing the site setup files.Note:Because the theme editor hides alldotfiles, files starting with a
dot must be renamed to end with.dotfile(and to not start with a dot).Importing the setupBy default, this plugin is configured import setup steps from a directoryinstallwhenever the theme is activated, and steps from a directoryuninstall, when the theme is deactivated. Both, install and uninstall
step directory can be changed in the plugin configuration.In addition, it’s possible to import the embedded steps manually using
the import setup form. SimplyGo to the import form URL for your theme, e.g.http://localhost:8080/Plone/++theme++my-theme/@@import-site-setup:Choose the steps you wish to import and clickImport.Better site structure export and importThis package includes optional enhancements for the default Plone site
structure export and import.The enhancements include:support for News Item contentssupport for Zope Page Templatessupport for Python Scriptssupport for exporting tagged hidden folders (likeportal_skins/custom)The enhancements can be activated by including a special component
configuration file in your Plone buildout’s instance parts with:[instance]...zcml=collective.themesitesetup-extrasZMI-only content, which is hidden in Plone (folders likeportal_skins) can
be included in the export by tagging the folders in ZMI interface tab with a
special marker interface:``collective.themesitesetup.interfaces.IGenericSetupExportableContainer``PageTemplates and PythonScripts can only be exported when they are located in a
ZMI-only container with this marker interface. So, if you’d like to export
contents inportal_skins/custom, you should add one marker forportal_skinsand the other forcustom.This is only required when exporting ZMI-only content. Importing ZMI-only
content works according to normal structure import rules without these marker
interfaces.About plone.app.contenttypes supportBetter site structure export and importdescribed above must be enabled
to support exporting and importing site structures withplone.app.contenttypesbased content.In addition,plone.app.textfield>=1.2.5is recommended to fix issue,
where structure import does not decode field value properly, causing
UnicodeDecodeErrors later.About custom Dexterity content supportImporting site structures with custom Dexterity content types require custom
adapter to be implemented and registered for each content typefromProducts.GenericSetup.interfacesimportIContentFactoryfromcollective.themesitesetup.contentimportDexterityContentFactoryBasefromplone.dexterity.interfacesimportIDexterityContentfromzope.componentimportadapterfromzope.interfaceimportimplementer@adapter(IDexterityContent)@implementer(IContentFactory)classMyTypeFactory(DexterityContentFactoryBase):portal_type='MyType'<adapterfactory=".adapters.MyTypeFactory"name="MyType"/>This is not required when Dexterity content is only created into site root
or Archetypes based container.Changelog2.1.2 (2018-03-22)Fix to ensure that dynamically created message catalogs can have unicode message ids
[datakurre]2.1.1 (2017-10-18)Fix issue where theme defined permissions were not properly activated on
first theme activation due to theme settings cache
[datakurre]2.1.0 (2017-10-08)Add feature to remove imported directories after theme activation to not
expose those by theme traverser
[datakurre]2.0.1 (2017-09-24)Fix issue where uninstalling theme raised error because unregistering
localizations mutated list it was iterating
[datakurre]2.0.0 (2017-09-24)Change to always unregister all themesitesetup based utilities on theme
deactivation instead of the previous behavior to only unregister those
currently desfined in theme
[datakurre]1.5.1 (2017-06-15)Fix issue where it was not possible to install message catalogs with dot in domain
[datakurre]1.5.0 (2017-05-27)Pin zope.app.i18n < 4.0.0
[datakurre]1.4.1 (2017-04-11)Removed debug print
[datakurre]1.4.0 (2017-04-11)Patch TTW message catalogs to support plonejs18n view (translate-pattern),
but note that with plonejsi18n TTW catalog overrides don’t cascade with
the existing catalogs
[datakurre]Use theme cache for TTW permissions, because TTW permissions require that
their existence is checked on each request
[datakurre]1.3.2 (2017-01-03)Fix issue where message catalog support allowed (mostly accidentally)
overriding messages with empty strings. Messages with empty strings are
now ignored.
[datakurre]1.3.1 (2016-12-14)Add to purge plone.app.blocks’ site layout cache after resource directory
copy
[datakurre]1.3.0 (2016-11-22)Add support for populating persistent (plone.resource) resource directories
[datakurre]Refactor permission support to use zope.app.localpermission
[datakurre]1.2.0 (2016-08-17)Add support for TTW custom permissions
[datakurre]1.1.0 (2016-08-12)Add support for populating Dexterity content type models from theme
from./models/Xxxxxx.xml[datakurre]1.0.1 (2016-08-11)Fix issue where translationdomain internals prevented updating existing
catalog
[datakurre]1.0.0 (2016-08-11)Add support for registering i18n message catalogs directly from theme
from./locales/xx/LC_MESSAGES/yyyyy.po[datakurre]0.13.0 (2015-04-23)Add support for exporting and importing plone.app.contenttypes -content
[datakurre]0.12.0 (2015-04-04)Move custom GS import export adapters to external configuration
[datakurre]Fix to register setup forms for p.a.theming layer
[datakurre]0.11.1 (2015-04-04)Update README
[datakurre]0.11.0 (2015-04-04)Add site setup import view to allow testing or manual upgrading of site
setups
[datakurre]Add option to disable setup steps import via plugin configuration variable in
theme manifest (either withenabled = falseordisabled = true)
[datakurre]0.10.0 (2015-04-03)Add GS content export support to include non-CMF-containers
marked withcollective.themesitesetup.interfaces.IGenericSetupExportableContainer[datakurre]Add GS content export/import to support non-CMF-containers, PythonScripts
and PageTemplates.
[datakurre]0.9.0 (2015-04-01)First release.