collective.documentgenerator 4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- collective/documentgenerator/DX_renderer.py +51 -0
- collective/documentgenerator/__init__.py +11 -0
- collective/documentgenerator/adapters.py +30 -0
- collective/documentgenerator/browser/__init__.py +0 -0
- collective/documentgenerator/browser/actionspanel.py +19 -0
- collective/documentgenerator/browser/check_pod_templates.pt +86 -0
- collective/documentgenerator/browser/children_pod_template.pt +27 -0
- collective/documentgenerator/browser/configure.zcml +217 -0
- collective/documentgenerator/browser/controlpanel.py +165 -0
- collective/documentgenerator/browser/generation_view.py +613 -0
- collective/documentgenerator/browser/overrides.py +9 -0
- collective/documentgenerator/browser/resources/css/documentgenerator.css +133 -0
- collective/documentgenerator/browser/static/.gitkeep +0 -0
- collective/documentgenerator/browser/static/configurable.svg +1232 -0
- collective/documentgenerator/browser/static/csv.svg +521 -0
- collective/documentgenerator/browser/static/doc.svg +23 -0
- collective/documentgenerator/browser/static/docx.svg +20 -0
- collective/documentgenerator/browser/static/download_icon.svg +54 -0
- collective/documentgenerator/browser/static/libreoffice-blanck.svg +481 -0
- collective/documentgenerator/browser/static/mailinglooptemplate.svg +1207 -0
- collective/documentgenerator/browser/static/missing_use.svg +42 -0
- collective/documentgenerator/browser/static/nok.svg +38 -0
- collective/documentgenerator/browser/static/nok_use.svg +38 -0
- collective/documentgenerator/browser/static/nok_used.svg +38 -0
- collective/documentgenerator/browser/static/odp.svg +1264 -0
- collective/documentgenerator/browser/static/ods.svg +1354 -0
- collective/documentgenerator/browser/static/odt.svg +1347 -0
- collective/documentgenerator/browser/static/ok.svg +38 -0
- collective/documentgenerator/browser/static/ok_use.svg +38 -0
- collective/documentgenerator/browser/static/ok_used.svg +38 -0
- collective/documentgenerator/browser/static/pdf.svg +557 -0
- collective/documentgenerator/browser/static/podtemplate.svg +1197 -0
- collective/documentgenerator/browser/static/rtf.svg +521 -0
- collective/documentgenerator/browser/static/style.svg +1207 -0
- collective/documentgenerator/browser/static/subtemplate.svg +1232 -0
- collective/documentgenerator/browser/static/xls.svg +159 -0
- collective/documentgenerator/browser/static/xlsx.svg +48 -0
- collective/documentgenerator/browser/table.py +326 -0
- collective/documentgenerator/browser/templates_listing.pt +29 -0
- collective/documentgenerator/browser/views.py +366 -0
- collective/documentgenerator/config.py +174 -0
- collective/documentgenerator/configure.zcml +51 -0
- collective/documentgenerator/content/__init__.py +0 -0
- collective/documentgenerator/content/condition.py +66 -0
- collective/documentgenerator/content/conditions.zcml +30 -0
- collective/documentgenerator/content/configure.zcml +18 -0
- collective/documentgenerator/content/document_factory.py +73 -0
- collective/documentgenerator/content/file_representation.py +70 -0
- collective/documentgenerator/content/file_representation.zcml +29 -0
- collective/documentgenerator/content/merge_templates.py +15 -0
- collective/documentgenerator/content/merge_templates.zcml +11 -0
- collective/documentgenerator/content/pod_template.py +601 -0
- collective/documentgenerator/content/style_template.py +54 -0
- collective/documentgenerator/content/vocabulary.py +344 -0
- collective/documentgenerator/content/vocabulary.zcml +105 -0
- collective/documentgenerator/demo/__init__.py +0 -0
- collective/documentgenerator/demo/configure.zcml +18 -0
- collective/documentgenerator/demo/helper.py +170 -0
- collective/documentgenerator/events/__init__.py +0 -0
- collective/documentgenerator/events/configure.zcml +44 -0
- collective/documentgenerator/events/pod_templates_events.py +66 -0
- collective/documentgenerator/events/styles_events.py +151 -0
- collective/documentgenerator/helper/__init__.py +7 -0
- collective/documentgenerator/helper/base.py +334 -0
- collective/documentgenerator/helper/configure.zcml +34 -0
- collective/documentgenerator/helper/dexterity.py +178 -0
- collective/documentgenerator/interfaces.py +166 -0
- collective/documentgenerator/locales/collective.documentgenerator.pot +564 -0
- collective/documentgenerator/locales/es/LC_MESSAGES/collective.documentgenerator.po +572 -0
- collective/documentgenerator/locales/es/LC_MESSAGES/plone.po +32 -0
- collective/documentgenerator/locales/fr/LC_MESSAGES/collective.documentgenerator.po +566 -0
- collective/documentgenerator/locales/fr/LC_MESSAGES/plone.po +27 -0
- collective/documentgenerator/locales/manual.pot +30 -0
- collective/documentgenerator/locales/plone-manual.pot +22 -0
- collective/documentgenerator/locales/plone.pot +30 -0
- collective/documentgenerator/locales/update.sh +22 -0
- collective/documentgenerator/migrations/__init__.py +0 -0
- collective/documentgenerator/migrations/migrate_to_11.py +52 -0
- collective/documentgenerator/migrations/migrate_to_12.py +32 -0
- collective/documentgenerator/migrations/migrate_to_13.py +35 -0
- collective/documentgenerator/migrations/migrate_to_3.py +36 -0
- collective/documentgenerator/migrations/migrate_to_5.py +30 -0
- collective/documentgenerator/migrations/migrate_to_6.py +27 -0
- collective/documentgenerator/migrations/migrate_to_7.py +34 -0
- collective/documentgenerator/migrations/migrate_to_8.py +36 -0
- collective/documentgenerator/migrations/migrate_to_9.py +50 -0
- collective/documentgenerator/profiles/base/browserlayer.xml +6 -0
- collective/documentgenerator/profiles/base/controlpanel.xml +21 -0
- collective/documentgenerator/profiles/base/metadata.xml +8 -0
- collective/documentgenerator/profiles/base/registry.xml +48 -0
- collective/documentgenerator/profiles/base/types/ConfigurablePODTemplate.xml +69 -0
- collective/documentgenerator/profiles/base/types/MailingLoopTemplate.xml +68 -0
- collective/documentgenerator/profiles/base/types/PODTemplate.xml +68 -0
- collective/documentgenerator/profiles/base/types/StyleTemplate.xml +68 -0
- collective/documentgenerator/profiles/base/types/SubTemplate.xml +68 -0
- collective/documentgenerator/profiles/base/types.xml +22 -0
- collective/documentgenerator/profiles/base/viewlets.xml +10 -0
- collective/documentgenerator/profiles/demo/browserlayer.xml +6 -0
- collective/documentgenerator/profiles/demo/collectivedocumentgenerator_demo_marker.txt +0 -0
- collective/documentgenerator/profiles/demo/import_steps.xml +11 -0
- collective/documentgenerator/profiles/demo/metadata.xml +7 -0
- collective/documentgenerator/profiles/demo/registry.xml +14 -0
- collective/documentgenerator/profiles/demo/templates/mailing.odt +0 -0
- collective/documentgenerator/profiles/demo/templates/modele_general.ods +0 -0
- collective/documentgenerator/profiles/demo/templates/modele_general.odt +0 -0
- collective/documentgenerator/profiles/demo/templates/mod/303/250le_collection.odt +0 -0
- collective/documentgenerator/profiles/demo/templates/possibly_mailed_model.odt +0 -0
- collective/documentgenerator/profiles/demo/templates/styles.odt +0 -0
- collective/documentgenerator/profiles/demo/templates/styles_2.odt +0 -0
- collective/documentgenerator/profiles/demo/templates/sub_template.odt +0 -0
- collective/documentgenerator/profiles/demo/viewlets.xml +3 -0
- collective/documentgenerator/profiles/testing/metadata.xml +7 -0
- collective/documentgenerator/profiles/testing/types/member.xml +114 -0
- collective/documentgenerator/profiles/testing/types.xml +9 -0
- collective/documentgenerator/profiles/uninstall/browserlayer.xml +7 -0
- collective/documentgenerator/profiles/uninstall/controlpanel.xml +21 -0
- collective/documentgenerator/profiles/uninstall/metadata.xml +4 -0
- collective/documentgenerator/profiles/uninstall/registry.xml +14 -0
- collective/documentgenerator/profiles/uninstall/types.xml +27 -0
- collective/documentgenerator/profiles/uninstall/viewlets.xml +8 -0
- collective/documentgenerator/profiles.zcml +209 -0
- collective/documentgenerator/renderer.zcml +36 -0
- collective/documentgenerator/search_replace/__init__.py +0 -0
- collective/documentgenerator/search_replace/configure.zcml +21 -0
- collective/documentgenerator/search_replace/pod_template.py +161 -0
- collective/documentgenerator/search_replace/search_result_form.pt +76 -0
- collective/documentgenerator/search_replace/searchreplace_panel.pt +31 -0
- collective/documentgenerator/search_replace/searchreplace_panel.py +274 -0
- collective/documentgenerator/setuphandlers.py +297 -0
- collective/documentgenerator/testing.py +278 -0
- collective/documentgenerator/testing.zcml +17 -0
- collective/documentgenerator/tests/__init__.py +0 -0
- collective/documentgenerator/tests/failing_template.odt +0 -0
- collective/documentgenerator/tests/robot/.gitkeep +0 -0
- collective/documentgenerator/tests/template_to_clean.odt +0 -0
- collective/documentgenerator/tests/template_without_style_page.odt +0 -0
- collective/documentgenerator/tests/test_DX_helper_view.py +398 -0
- collective/documentgenerator/tests/test_base_helper_view.py +216 -0
- collective/documentgenerator/tests/test_check_podtemplates_view.py +138 -0
- collective/documentgenerator/tests/test_config.py +119 -0
- collective/documentgenerator/tests/test_configurable_pod_template.py +467 -0
- collective/documentgenerator/tests/test_demo_profile.py +121 -0
- collective/documentgenerator/tests/test_events.py +187 -0
- collective/documentgenerator/tests/test_generation_view.py +680 -0
- collective/documentgenerator/tests/test_mailing_loop_template.py +48 -0
- collective/documentgenerator/tests/test_pod_template.py +190 -0
- collective/documentgenerator/tests/test_robot.py +26 -0
- collective/documentgenerator/tests/test_search_replace.py +485 -0
- collective/documentgenerator/tests/test_setup.py +77 -0
- collective/documentgenerator/tests/test_style_template.py +19 -0
- collective/documentgenerator/tests/test_sub_template.py +49 -0
- collective/documentgenerator/tests/test_templates_listing_view.py +120 -0
- collective/documentgenerator/tests/test_utils.py +205 -0
- collective/documentgenerator/tests/test_vocabulary.py +169 -0
- collective/documentgenerator/utils.py +245 -0
- collective/documentgenerator/viewlets/__init__.py +0 -0
- collective/documentgenerator/viewlets/batchactions.py +14 -0
- collective/documentgenerator/viewlets/configure.zcml +17 -0
- collective/documentgenerator/viewlets/generationlinks.pt +46 -0
- collective/documentgenerator/viewlets/generationlinks.py +67 -0
- collective.documentgenerator-4.0-py3.12-nspkg.pth +1 -0
- collective_documentgenerator-4.0.dist-info/METADATA +1136 -0
- collective_documentgenerator-4.0.dist-info/RECORD +167 -0
- collective_documentgenerator-4.0.dist-info/WHEEL +5 -0
- collective_documentgenerator-4.0.dist-info/entry_points.txt +2 -0
- collective_documentgenerator-4.0.dist-info/namespace_packages.txt +1 -0
- collective_documentgenerator-4.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
domain=collective.documentgenerator
|
|
2
|
+
i18ndude rebuild-pot --pot $domain.pot --merge manual.pot --create $domain ../
|
|
3
|
+
i18ndude rebuild-pot --pot plone.pot --merge plone-manual.pot --create plone ../profiles
|
|
4
|
+
i18ndude sync --pot $domain.pot */LC_MESSAGES/$domain.po
|
|
5
|
+
i18ndude sync --pot plone.pot */LC_MESSAGES/plone.po
|
|
6
|
+
|
|
7
|
+
WARNINGS=`find . -name "*pt" | xargs i18ndude find-untranslated | grep -e '^-WARN' | wc -l`
|
|
8
|
+
ERRORS=`find . -name "*pt" | xargs i18ndude find-untranslated | grep -e '^-ERROR' | wc -l`
|
|
9
|
+
FATAL=`find . -name "*pt" | xargs i18ndude find-untranslated | grep -e '^-FATAL' | wc -l`
|
|
10
|
+
|
|
11
|
+
echo
|
|
12
|
+
echo "There are $WARNINGS warnings \(possibly missing i18n markup\)"
|
|
13
|
+
echo "There are $ERRORS errors \(almost definitely missing i18n markup\)"
|
|
14
|
+
echo "There are $FATAL fatal errors \(template could not be parsed, eg. if it\'s not html\)"
|
|
15
|
+
echo "For more details, run \'find . -name \"\*pt\" \| xargs i18ndude find-untranslated\' or"
|
|
16
|
+
echo "Look the rebuild i18n log generate for this script called \'rebuild_i18n.log\' on locales dir"
|
|
17
|
+
|
|
18
|
+
rm -f ./rebuild_i18n.log
|
|
19
|
+
touch ./rebuild_i18n.log
|
|
20
|
+
|
|
21
|
+
find ../ -name "*pt" | xargs i18ndude find-untranslated > ./rebuild_i18n.log
|
|
22
|
+
# Ok, now poedit is your friend!
|
|
File without changes
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
from imio.migrator.migrator import Migrator
|
|
4
|
+
from plone import api
|
|
5
|
+
from plone.registry import field
|
|
6
|
+
from plone.registry import Record
|
|
7
|
+
from plone.registry.interfaces import IRegistry
|
|
8
|
+
from zope.component import getUtility
|
|
9
|
+
|
|
10
|
+
import logging
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
logger = logging.getLogger("collective.documentgenerator")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class Migrate_To_11(Migrator): # pragma: no cover
|
|
17
|
+
def __init__(self, context):
|
|
18
|
+
Migrator.__init__(self, context)
|
|
19
|
+
self.catalog = api.portal.get_tool("portal_catalog")
|
|
20
|
+
|
|
21
|
+
def run(self):
|
|
22
|
+
logger.info("Migrating to collective.documentgenerator 11 ...")
|
|
23
|
+
|
|
24
|
+
registry = getUtility(IRegistry)
|
|
25
|
+
records = registry.records
|
|
26
|
+
key = "collective.documentgenerator.browser.controlpanel.IDocumentGeneratorControlPanelSchema.use_stream"
|
|
27
|
+
|
|
28
|
+
current_record = api.portal.get_registry_record(key)
|
|
29
|
+
value = True
|
|
30
|
+
if current_record is False:
|
|
31
|
+
value = u"auto"
|
|
32
|
+
|
|
33
|
+
record = Record(
|
|
34
|
+
field.Choice(
|
|
35
|
+
title=u"Force communication via in/out stream with LibreOffice.",
|
|
36
|
+
description=(
|
|
37
|
+
u"If enabled, this will force using stream to communicate witth LibreOffice server. "
|
|
38
|
+
u"This must be true if the LO server is not on localhost or is in a docker container."
|
|
39
|
+
),
|
|
40
|
+
vocabulary="collective.documentgenerator.ConfigStream",
|
|
41
|
+
),
|
|
42
|
+
value=value,
|
|
43
|
+
)
|
|
44
|
+
records[key] = record
|
|
45
|
+
api.portal.set_registry_record(key, value)
|
|
46
|
+
|
|
47
|
+
self.finish()
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def migrate(context):
|
|
51
|
+
""" """
|
|
52
|
+
Migrate_To_11(context).run()
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
from collective.documentgenerator.content.pod_template import POD_TEMPLATE_TYPES
|
|
4
|
+
from imio.migrator.migrator import Migrator
|
|
5
|
+
from plone import api
|
|
6
|
+
|
|
7
|
+
import logging
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
logger = logging.getLogger("collective.documentgenerator")
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Migrate_To_12(Migrator): # pragma: no cover
|
|
14
|
+
def __init__(self, context):
|
|
15
|
+
Migrator.__init__(self, context)
|
|
16
|
+
self.catalog = api.portal.get_tool("portal_catalog")
|
|
17
|
+
|
|
18
|
+
def run(self):
|
|
19
|
+
logger.info("Migrating to collective.documentgenerator 12 ...")
|
|
20
|
+
self.runProfileSteps(
|
|
21
|
+
"collective.documentgenerator",
|
|
22
|
+
steps=["typeinfo", "controlpanel"],
|
|
23
|
+
profile="install-base",
|
|
24
|
+
)
|
|
25
|
+
for brain in self.catalog(portal_type=POD_TEMPLATE_TYPES.values()):
|
|
26
|
+
brain.getObject().reindexObject(idxs=["getIcon"])
|
|
27
|
+
self.finish()
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def migrate(context):
|
|
31
|
+
""" """
|
|
32
|
+
Migrate_To_12(context).run()
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
from collective.documentgenerator.content.pod_template import IPODTemplate
|
|
4
|
+
from collective.documentgenerator.utils import clean_notes
|
|
5
|
+
from imio.migrator.migrator import Migrator
|
|
6
|
+
from plone import api
|
|
7
|
+
|
|
8
|
+
import logging
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
logger = logging.getLogger("collective.documentgenerator")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Migrate_To_13(Migrator):
|
|
15
|
+
def __init__(self, context):
|
|
16
|
+
Migrator.__init__(self, context)
|
|
17
|
+
self.catalog = api.portal.get_tool("portal_catalog")
|
|
18
|
+
|
|
19
|
+
def _clean_notes(self):
|
|
20
|
+
"""Clean notes of existing POD templates."""
|
|
21
|
+
logger.info("Cleaning notes for existing POD templates...")
|
|
22
|
+
for brain in self.catalog(object_provides=IPODTemplate.__identifier__):
|
|
23
|
+
pod_template = brain.getObject()
|
|
24
|
+
clean_notes(pod_template)
|
|
25
|
+
logger.info("Done.")
|
|
26
|
+
|
|
27
|
+
def run(self):
|
|
28
|
+
logger.info("Migrating to collective.documentgenerator 13 ...")
|
|
29
|
+
self._clean_notes()
|
|
30
|
+
self.finish()
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def migrate(context):
|
|
34
|
+
""" """
|
|
35
|
+
Migrate_To_13(context).run()
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
from collective.documentgenerator.content.pod_template import IConfigurablePODTemplate
|
|
4
|
+
from imio.migrator.migrator import Migrator
|
|
5
|
+
from plone import api
|
|
6
|
+
|
|
7
|
+
import logging
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
logger = logging.getLogger("collective.documentgenerator")
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Migrate_To_3(Migrator): # pragma: no cover
|
|
14
|
+
def __init__(self, context):
|
|
15
|
+
Migrator.__init__(self, context)
|
|
16
|
+
self.catalog = api.portal.get_tool("portal_catalog")
|
|
17
|
+
|
|
18
|
+
def run(self):
|
|
19
|
+
logger.info("Migrating to collective.documentgenerator 3 ...")
|
|
20
|
+
for brain in self.catalog(
|
|
21
|
+
object_provides=IConfigurablePODTemplate.__identifier__
|
|
22
|
+
):
|
|
23
|
+
obj = brain.getObject()
|
|
24
|
+
if obj.merge_templates:
|
|
25
|
+
newvalue = []
|
|
26
|
+
for line in obj.merge_templates:
|
|
27
|
+
if "do_rendering" not in line:
|
|
28
|
+
line["do_rendering"] = True
|
|
29
|
+
newvalue.append(line)
|
|
30
|
+
obj.merge_templates = newvalue
|
|
31
|
+
self.finish()
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def migrate(context):
|
|
35
|
+
""" """
|
|
36
|
+
Migrate_To_3(context).run()
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
from collective.documentgenerator.content.pod_template import POD_TEMPLATE_TYPES
|
|
4
|
+
from imio.migrator.migrator import Migrator
|
|
5
|
+
from plone import api
|
|
6
|
+
|
|
7
|
+
import logging
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
logger = logging.getLogger("collective.documentgenerator")
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Migrate_To_5(Migrator): # pragma: no cover
|
|
14
|
+
def __init__(self, context):
|
|
15
|
+
Migrator.__init__(self, context)
|
|
16
|
+
self.catalog = api.portal.get_tool("portal_catalog")
|
|
17
|
+
|
|
18
|
+
def run(self):
|
|
19
|
+
logger.info("Migrating to collective.documentgenerator 5 ...")
|
|
20
|
+
self.runProfileSteps(
|
|
21
|
+
"collective.documentgenerator", steps=["typeinfo"], profile="install-base"
|
|
22
|
+
)
|
|
23
|
+
for brain in self.catalog(portal_type=POD_TEMPLATE_TYPES.values()):
|
|
24
|
+
brain.getObject().reindexObject(idxs=["getIcon"])
|
|
25
|
+
self.finish()
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def migrate(context):
|
|
29
|
+
""" """
|
|
30
|
+
Migrate_To_5(context).run()
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
from imio.migrator.migrator import Migrator
|
|
4
|
+
from plone import api
|
|
5
|
+
|
|
6
|
+
import logging
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
logger = logging.getLogger("collective.documentgenerator")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Migrate_To_6(Migrator): # pragma: no cover
|
|
13
|
+
def __init__(self, context):
|
|
14
|
+
Migrator.__init__(self, context)
|
|
15
|
+
self.catalog = api.portal.get_tool("portal_catalog")
|
|
16
|
+
|
|
17
|
+
def run(self):
|
|
18
|
+
logger.info("Migrating to collective.documentgenerator 6 ...")
|
|
19
|
+
self.runProfileSteps(
|
|
20
|
+
"collective.documentgenerator", steps=["typeinfo"], profile="install-base"
|
|
21
|
+
)
|
|
22
|
+
self.finish()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def migrate(context):
|
|
26
|
+
""" """
|
|
27
|
+
Migrate_To_6(context).run()
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
from collective.documentgenerator.content.pod_template import IRenamePageStylesSchema
|
|
4
|
+
from imio.migrator.migrator import Migrator
|
|
5
|
+
from plone import api
|
|
6
|
+
|
|
7
|
+
import logging
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
logger = logging.getLogger("collective.documentgenerator")
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Migrate_To_7(Migrator): # pragma: no cover
|
|
14
|
+
def __init__(self, context):
|
|
15
|
+
Migrator.__init__(self, context)
|
|
16
|
+
self.catalog = api.portal.get_tool("portal_catalog")
|
|
17
|
+
|
|
18
|
+
def run(self):
|
|
19
|
+
logger.info("Migrating to collective.documentgenerator 7 ...")
|
|
20
|
+
for brain in self.catalog(
|
|
21
|
+
object_provides=IRenamePageStylesSchema.__identifier__
|
|
22
|
+
):
|
|
23
|
+
obj = brain.getObject()
|
|
24
|
+
if obj.rename_page_styles is None:
|
|
25
|
+
logger.info(
|
|
26
|
+
"Setting rename_page_styles to false on %s" % brain.getPath()
|
|
27
|
+
)
|
|
28
|
+
obj.rename_page_styles = False
|
|
29
|
+
self.finish()
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def migrate(context):
|
|
33
|
+
""" """
|
|
34
|
+
Migrate_To_7(context).run()
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
from collective.documentgenerator.content.pod_template import IRenamePageStylesSchema
|
|
4
|
+
from imio.migrator.migrator import Migrator
|
|
5
|
+
from plone import api
|
|
6
|
+
from Products.CMFPlone.utils import base_hasattr
|
|
7
|
+
|
|
8
|
+
import logging
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
logger = logging.getLogger("collective.documentgenerator")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Migrate_To_8(Migrator): # pragma: no cover
|
|
15
|
+
def __init__(self, context):
|
|
16
|
+
Migrator.__init__(self, context)
|
|
17
|
+
self.catalog = api.portal.get_tool("portal_catalog")
|
|
18
|
+
|
|
19
|
+
def run(self):
|
|
20
|
+
logger.info("Migrating to collective.documentgenerator 8 ...")
|
|
21
|
+
for brain in self.catalog(
|
|
22
|
+
object_provides=IRenamePageStylesSchema.__identifier__
|
|
23
|
+
):
|
|
24
|
+
obj = brain.getObject()
|
|
25
|
+
if base_hasattr(obj, "rename_page_styles"):
|
|
26
|
+
logger.info(
|
|
27
|
+
"Removing rename_page_styles attribute on %s" % brain.getPath()
|
|
28
|
+
)
|
|
29
|
+
delattr(obj, "rename_page_styles")
|
|
30
|
+
obj.reindexObject(idxs=["object_provides"])
|
|
31
|
+
self.finish()
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def migrate(context):
|
|
35
|
+
""" """
|
|
36
|
+
Migrate_To_8(context).run()
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
from collective.documentgenerator.content.pod_template import IConfigurablePODTemplate
|
|
4
|
+
from imio.migrator.migrator import Migrator
|
|
5
|
+
from plone import api
|
|
6
|
+
from plone.registry.interfaces import IRegistry
|
|
7
|
+
from zope.component import getUtility
|
|
8
|
+
|
|
9
|
+
import logging
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
logger = logging.getLogger("collective.documentgenerator")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Migrate_To_9(Migrator): # pragma: no cover
|
|
16
|
+
def __init__(self, context):
|
|
17
|
+
Migrator.__init__(self, context)
|
|
18
|
+
self.catalog = api.portal.get_tool("portal_catalog")
|
|
19
|
+
|
|
20
|
+
def run(self):
|
|
21
|
+
logger.info("Migrating to collective.documentgenerator 9 ...")
|
|
22
|
+
for brain in self.catalog(
|
|
23
|
+
object_provides=IConfigurablePODTemplate.__identifier__
|
|
24
|
+
):
|
|
25
|
+
obj = brain.getObject()
|
|
26
|
+
if hasattr(obj, "optimize_tables"):
|
|
27
|
+
if obj.optimize_tables:
|
|
28
|
+
obj.column_modifier = "optimize"
|
|
29
|
+
delattr(obj, "optimize_tables")
|
|
30
|
+
|
|
31
|
+
optimize_tables_registry_key = "collective.documentgenerator.browser.controlpanel.IDocumentGeneratorControlPanelSchema.optimize_tables"
|
|
32
|
+
column_modifier_registry_key = "collective.documentgenerator.browser.controlpanel.IDocumentGeneratorControlPanelSchema.column_modifier"
|
|
33
|
+
|
|
34
|
+
registry = getUtility(IRegistry)
|
|
35
|
+
optimize_tables = api.portal.get_registry_record(
|
|
36
|
+
optimize_tables_registry_key, default=None
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
if optimize_tables:
|
|
40
|
+
api.portal.set_registry_record(column_modifier_registry_key, "optimize")
|
|
41
|
+
|
|
42
|
+
if optimize_tables_registry_key in registry.records:
|
|
43
|
+
del registry.records[optimize_tables_registry_key]
|
|
44
|
+
|
|
45
|
+
self.finish()
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def migrate(context):
|
|
49
|
+
""" """
|
|
50
|
+
Migrate_To_9(context).run()
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<object xmlns:i18n="http://xml.zope.org/namespaces/i18n"
|
|
3
|
+
name="portal_controlpanel"
|
|
4
|
+
purge="False"
|
|
5
|
+
i18n:domain="collective.documentgenerator"
|
|
6
|
+
>
|
|
7
|
+
|
|
8
|
+
<configlet action_id="collective.documentgenerator.settings"
|
|
9
|
+
appId="collective.documentgenerator"
|
|
10
|
+
category="Products"
|
|
11
|
+
condition_expr=""
|
|
12
|
+
icon_expr="string:mimetype-application/vnd.oasis.opendocument.text"
|
|
13
|
+
title="Document Generator settings"
|
|
14
|
+
url_expr="string:${portal_url}/@@collective.documentgenerator-controlpanel"
|
|
15
|
+
visible="True"
|
|
16
|
+
i18n:attributes="title"
|
|
17
|
+
>
|
|
18
|
+
<permission>Manage portal</permission>
|
|
19
|
+
</configlet>
|
|
20
|
+
|
|
21
|
+
</object>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<registry>
|
|
3
|
+
|
|
4
|
+
<!-- Content types icons -->
|
|
5
|
+
<record name="plone.icon.contenttype/configurablepodtemplate">
|
|
6
|
+
<field type="plone.registry.field.TextLine">
|
|
7
|
+
<title>ConfigurablePODTemplate</title>
|
|
8
|
+
</field>
|
|
9
|
+
<value key="resource">++plone++bootstrap-icons/file-earmark-font.svg</value>
|
|
10
|
+
</record>
|
|
11
|
+
<record name="plone.icon.contenttype/mailinglooptemplate">
|
|
12
|
+
<field type="plone.registry.field.TextLine">
|
|
13
|
+
<title>MailingLoopTemplate</title>
|
|
14
|
+
</field>
|
|
15
|
+
<value key="resource">++plone++bootstrap-icons/file-post.svg</value>
|
|
16
|
+
</record>
|
|
17
|
+
<record name="plone.icon.contenttype/podtemplate">
|
|
18
|
+
<field type="plone.registry.field.TextLine">
|
|
19
|
+
<title>PODTemplate</title>
|
|
20
|
+
</field>
|
|
21
|
+
<value key="resource">++plone++bootstrap-icons/file-earmark-font.svg</value>
|
|
22
|
+
</record>
|
|
23
|
+
<record name="plone.icon.contenttype/styletemplate">
|
|
24
|
+
<field type="plone.registry.field.TextLine">
|
|
25
|
+
<title>StyleTemplate</title>
|
|
26
|
+
</field>
|
|
27
|
+
<value key="resource">++plone++bootstrap-icons/file-richtext.svg</value>
|
|
28
|
+
</record>
|
|
29
|
+
<record name="plone.icon.contenttype/subtemplate">
|
|
30
|
+
<field type="plone.registry.field.TextLine">
|
|
31
|
+
<title>SubTemplate</title>
|
|
32
|
+
</field>
|
|
33
|
+
<value key="resource">++plone++bootstrap-icons/file-earmark-medical.svg</value>
|
|
34
|
+
</record>
|
|
35
|
+
|
|
36
|
+
<records interface="Products.CMFPlone.interfaces.IBundleRegistry"
|
|
37
|
+
prefix="plone.bundles/collective.documentgenerator"
|
|
38
|
+
>
|
|
39
|
+
<value key="enabled">True</value>
|
|
40
|
+
<value key="csscompilation">++resource++collective.documentgenerator.css/documentgenerator.css</value>
|
|
41
|
+
<value key="last_compilation">2016-01-01 00:00:00</value>
|
|
42
|
+
<value key="compile">False</value>
|
|
43
|
+
<value key="depends">plone</value>
|
|
44
|
+
</records>
|
|
45
|
+
|
|
46
|
+
<records interface="collective.documentgenerator.browser.controlpanel.IDocumentGeneratorControlPanelSchema" />
|
|
47
|
+
|
|
48
|
+
</registry>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<object xmlns:i18n="http://xml.zope.org/namespaces/i18n"
|
|
3
|
+
meta_type="Dexterity FTI"
|
|
4
|
+
name="ConfigurablePODTemplate"
|
|
5
|
+
i18n:domain="collective.documentgenerator"
|
|
6
|
+
>
|
|
7
|
+
<property name="title"
|
|
8
|
+
i18n:translate=""
|
|
9
|
+
>ConfigurablePODTemplate</property>
|
|
10
|
+
<property name="description"
|
|
11
|
+
i18n:translate=""
|
|
12
|
+
>A document to generate on a content.</property>
|
|
13
|
+
<property name="icon_expr">string:contenttype/configurablepodtemplate</property>
|
|
14
|
+
<property name="factory">ConfigurablePODTemplate</property>
|
|
15
|
+
<property name="add_view_expr">string:${folder_url}/++add++ConfigurablePODTemplate</property>
|
|
16
|
+
<property name="link_target" />
|
|
17
|
+
<property name="immediate_view">view</property>
|
|
18
|
+
<property name="global_allow">True</property>
|
|
19
|
+
<property name="allow_discussion">False</property>
|
|
20
|
+
<property name="default_view">view</property>
|
|
21
|
+
<property name="view_methods">
|
|
22
|
+
<element value="view" />
|
|
23
|
+
</property>
|
|
24
|
+
<property name="default_view_fallback">False</property>
|
|
25
|
+
<property name="add_permission">cmf.AddPortalContent</property>
|
|
26
|
+
<property name="klass">collective.documentgenerator.content.pod_template.ConfigurablePODTemplate</property>
|
|
27
|
+
<property name="behaviors">
|
|
28
|
+
<element value="plone.app.dexterity.behaviors.metadata.IBasic" />
|
|
29
|
+
<element value="plone.app.content.interfaces.INameFromTitle" />
|
|
30
|
+
<element value="plone.app.lockingbehavior.behaviors.ILocking" />
|
|
31
|
+
<element value="collective.behavior.talcondition.behavior.ITALCondition" />
|
|
32
|
+
</property>
|
|
33
|
+
<property name="schema">collective.documentgenerator.content.pod_template.IConfigurablePODTemplate</property>
|
|
34
|
+
<property name="schema_policy">dexterity</property>
|
|
35
|
+
<alias from="(Default)"
|
|
36
|
+
to="(dynamic view)"
|
|
37
|
+
/>
|
|
38
|
+
<alias from="edit"
|
|
39
|
+
to="@@edit"
|
|
40
|
+
/>
|
|
41
|
+
<alias from="sharing"
|
|
42
|
+
to="@@sharing"
|
|
43
|
+
/>
|
|
44
|
+
<alias from="view"
|
|
45
|
+
to="(selected layout)"
|
|
46
|
+
/>
|
|
47
|
+
<action action_id="view"
|
|
48
|
+
category="object"
|
|
49
|
+
condition_expr=""
|
|
50
|
+
icon_expr="string:toolbar-action/view"
|
|
51
|
+
title="View"
|
|
52
|
+
url_expr="string:${object_url}"
|
|
53
|
+
visible="True"
|
|
54
|
+
i18n:attributes="title"
|
|
55
|
+
>
|
|
56
|
+
<permission value="View" />
|
|
57
|
+
</action>
|
|
58
|
+
<action action_id="edit"
|
|
59
|
+
category="object"
|
|
60
|
+
condition_expr="not:object/@@plone_lock_info/is_locked_for_current_user|python:True"
|
|
61
|
+
icon_expr="string:toolbar-action/edit"
|
|
62
|
+
title="Edit"
|
|
63
|
+
url_expr="string:${object_url}/edit"
|
|
64
|
+
visible="True"
|
|
65
|
+
i18n:attributes="title"
|
|
66
|
+
>
|
|
67
|
+
<permission value="Modify portal content" />
|
|
68
|
+
</action>
|
|
69
|
+
</object>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<object xmlns:i18n="http://xml.zope.org/namespaces/i18n"
|
|
3
|
+
meta_type="Dexterity FTI"
|
|
4
|
+
name="MailingLoopTemplate"
|
|
5
|
+
i18n:domain="collective.documentgenerator"
|
|
6
|
+
>
|
|
7
|
+
<property name="title"
|
|
8
|
+
i18n:translate=""
|
|
9
|
+
>MailingLoopTemplate</property>
|
|
10
|
+
<property name="description"
|
|
11
|
+
i18n:translate=""
|
|
12
|
+
/>
|
|
13
|
+
<property name="icon_expr">string:contenttype/mailinglooptemplate</property>
|
|
14
|
+
<property name="factory">MailingLoopTemplate</property>
|
|
15
|
+
<property name="add_view_expr">string:${folder_url}/++add++MailingLoopTemplate</property>
|
|
16
|
+
<property name="link_target" />
|
|
17
|
+
<property name="immediate_view">view</property>
|
|
18
|
+
<property name="global_allow">True</property>
|
|
19
|
+
<property name="allow_discussion">False</property>
|
|
20
|
+
<property name="default_view">view</property>
|
|
21
|
+
<property name="view_methods">
|
|
22
|
+
<element value="view" />
|
|
23
|
+
</property>
|
|
24
|
+
<property name="default_view_fallback">False</property>
|
|
25
|
+
<property name="add_permission">cmf.AddPortalContent</property>
|
|
26
|
+
<property name="klass">collective.documentgenerator.content.pod_template.MailingLoopTemplate</property>
|
|
27
|
+
<property name="behaviors">
|
|
28
|
+
<element value="plone.app.dexterity.behaviors.metadata.IBasic" />
|
|
29
|
+
<element value="plone.app.content.interfaces.INameFromTitle" />
|
|
30
|
+
<element value="plone.app.lockingbehavior.behaviors.ILocking" />
|
|
31
|
+
</property>
|
|
32
|
+
<property name="schema">collective.documentgenerator.content.pod_template.IMailingLoopTemplate</property>
|
|
33
|
+
<property name="schema_policy">dexterity</property>
|
|
34
|
+
<alias from="(Default)"
|
|
35
|
+
to="(dynamic view)"
|
|
36
|
+
/>
|
|
37
|
+
<alias from="edit"
|
|
38
|
+
to="@@edit"
|
|
39
|
+
/>
|
|
40
|
+
<alias from="sharing"
|
|
41
|
+
to="@@sharing"
|
|
42
|
+
/>
|
|
43
|
+
<alias from="view"
|
|
44
|
+
to="(selected layout)"
|
|
45
|
+
/>
|
|
46
|
+
<action action_id="view"
|
|
47
|
+
category="object"
|
|
48
|
+
condition_expr=""
|
|
49
|
+
icon_expr="string:toolbar-action/view"
|
|
50
|
+
title="View"
|
|
51
|
+
url_expr="string:${object_url}"
|
|
52
|
+
visible="True"
|
|
53
|
+
i18n:attributes="title"
|
|
54
|
+
>
|
|
55
|
+
<permission value="View" />
|
|
56
|
+
</action>
|
|
57
|
+
<action action_id="edit"
|
|
58
|
+
category="object"
|
|
59
|
+
condition_expr="not:object/@@plone_lock_info/is_locked_for_current_user|python:True"
|
|
60
|
+
icon_expr="string:toolbar-action/edit"
|
|
61
|
+
title="Edit"
|
|
62
|
+
url_expr="string:${object_url}/edit"
|
|
63
|
+
visible="True"
|
|
64
|
+
i18n:attributes="title"
|
|
65
|
+
>
|
|
66
|
+
<permission value="Modify portal content" />
|
|
67
|
+
</action>
|
|
68
|
+
</object>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<object xmlns:i18n="http://xml.zope.org/namespaces/i18n"
|
|
3
|
+
meta_type="Dexterity FTI"
|
|
4
|
+
name="PODTemplate"
|
|
5
|
+
i18n:domain="collective.documentgenerator"
|
|
6
|
+
>
|
|
7
|
+
<property name="title"
|
|
8
|
+
i18n:translate=""
|
|
9
|
+
>PODTemplate</property>
|
|
10
|
+
<property name="description"
|
|
11
|
+
i18n:translate=""
|
|
12
|
+
/>
|
|
13
|
+
<property name="icon_expr">string:contenttype/podtemplate</property>
|
|
14
|
+
<property name="factory">PODTemplate</property>
|
|
15
|
+
<property name="add_view_expr">string:${folder_url}/++add++PODTemplate</property>
|
|
16
|
+
<property name="link_target" />
|
|
17
|
+
<property name="immediate_view">view</property>
|
|
18
|
+
<property name="global_allow">True</property>
|
|
19
|
+
<property name="allow_discussion">False</property>
|
|
20
|
+
<property name="default_view">view</property>
|
|
21
|
+
<property name="view_methods">
|
|
22
|
+
<element value="view" />
|
|
23
|
+
</property>
|
|
24
|
+
<property name="default_view_fallback">False</property>
|
|
25
|
+
<property name="add_permission">cmf.AddPortalContent</property>
|
|
26
|
+
<property name="klass">collective.documentgenerator.content.pod_template.PODTemplate</property>
|
|
27
|
+
<property name="behaviors">
|
|
28
|
+
<element value="plone.app.dexterity.behaviors.metadata.IBasic" />
|
|
29
|
+
<element value="plone.app.content.interfaces.INameFromTitle" />
|
|
30
|
+
<element value="plone.app.lockingbehavior.behaviors.ILocking" />
|
|
31
|
+
</property>
|
|
32
|
+
<property name="schema">collective.documentgenerator.content.pod_template.IPODTemplate</property>
|
|
33
|
+
<property name="schema_policy">dexterity</property>
|
|
34
|
+
<alias from="(Default)"
|
|
35
|
+
to="(dynamic view)"
|
|
36
|
+
/>
|
|
37
|
+
<alias from="edit"
|
|
38
|
+
to="@@edit"
|
|
39
|
+
/>
|
|
40
|
+
<alias from="sharing"
|
|
41
|
+
to="@@sharing"
|
|
42
|
+
/>
|
|
43
|
+
<alias from="view"
|
|
44
|
+
to="(selected layout)"
|
|
45
|
+
/>
|
|
46
|
+
<action action_id="view"
|
|
47
|
+
category="object"
|
|
48
|
+
condition_expr=""
|
|
49
|
+
icon_expr="string:toolbar-action/view"
|
|
50
|
+
title="View"
|
|
51
|
+
url_expr="string:${object_url}"
|
|
52
|
+
visible="True"
|
|
53
|
+
i18n:attributes="title"
|
|
54
|
+
>
|
|
55
|
+
<permission value="View" />
|
|
56
|
+
</action>
|
|
57
|
+
<action action_id="edit"
|
|
58
|
+
category="object"
|
|
59
|
+
condition_expr="not:object/@@plone_lock_info/is_locked_for_current_user|python:True"
|
|
60
|
+
icon_expr="string:toolbar-action/edit"
|
|
61
|
+
title="Edit"
|
|
62
|
+
url_expr="string:${object_url}/edit"
|
|
63
|
+
visible="True"
|
|
64
|
+
i18n:attributes="title"
|
|
65
|
+
>
|
|
66
|
+
<permission value="Modify portal content" />
|
|
67
|
+
</action>
|
|
68
|
+
</object>
|