-
Notifications
You must be signed in to change notification settings - Fork 1
imio.annex integration #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
from collective.iconifiedcategory.utils import calculate_category_id | ||
from collective.iconifiedcategory.utils import update_categorized_elements | ||
from collective.messagesviewlet.utils import add_message | ||
from collective.wfadaptations.api import apply_from_registry | ||
from collective.wfadaptations.api import get_applied_adaptations | ||
|
@@ -77,6 +79,9 @@ def run(self): | |
self.runProfileSteps("imio.dms.mail", steps=["catalog", "plone.app.registry"]) | ||
load_type_from_package("dmsoutgoingmail", "profile-imio.dms.mail:default") # behavior | ||
load_type_from_package("held_position", "profile-imio.dms.mail:default") # behavior | ||
load_type_from_package("dmsappendixfile", "profile-imio.dms.mail:default") # iconified | ||
load_type_from_package("dmsommainfile", "profile-imio.dms.mail:default") # iconified | ||
self.runProfileSteps('imio.dms.mail', steps=['imiodmsmail-add-test-annexes-types'], profile='examples') | ||
|
||
# Update wf changes | ||
reset = load_workflow_from_package("outgoingmail_workflow", "imio.dms.mail:default") | ||
|
@@ -175,6 +180,44 @@ def run(self): | |
obj = brain._unrestrictedGetObject() | ||
obj.reindexObject(idxs=["markers"]) | ||
|
||
# imio.annex integration to dms files with iconified category | ||
self.context.runImportStepFromProfile('collective.dms.basecontent:default', 'catalog') | ||
self.context.runImportStepFromProfile('imio.dms.mail:default', 'catalog') | ||
load_type_from_package("dmsmainfile", "imio.dms.mail:default") | ||
load_type_from_package("dmsommainfile", "imio.dms.mail:default") | ||
load_type_from_package("dmsappendixfile", "imio.dms.mail:default") | ||
self.context.runImportStepFromProfile(u'imio.dms.mail:examples', u'imiodmsmail-add-test-annexes-types') | ||
files = self.portal.portal_catalog.unrestrictedSearchResults(portal_type=["dmsmainfile", "dmsommainfile", "dmsappendixfile"]) | ||
category = self.portal["annexes_types"]["signable_files"]["signable-ged-file"] | ||
for f in files: | ||
obj = f.getObject() | ||
if not hasattr(obj, "approved"): | ||
obj.approved = False | ||
if not hasattr(obj, "to_print"): | ||
obj.to_print = False | ||
if not hasattr(obj, "content_category"): | ||
obj.content_category = calculate_category_id(category) | ||
update_categorized_elements(obj.aq_parent, obj, category) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Est-ce qu'il me faudrait pas aussi mettre à jour imio.zamqp.dms pour ajouter une catégorie sur les emails entrants ? Et est-ce que ces catégories sont pertinentes sur les courriers entrants ? Si non, est-ce qu'on doit avoir des iconified catégories pour les annexes des courriers sortants mais pas les courriers entrants ? |
||
catalog = self.portal.portal_catalog | ||
indexes = catalog.indexes() | ||
wanted = [ | ||
('to_print', 'BooleanIndex'), | ||
('to_be_signed', 'BooleanIndex'), | ||
('signed', 'BooleanIndex'), | ||
('approved', 'BooleanIndex'), | ||
] | ||
added = set() | ||
for name, meta_type in wanted: | ||
if name not in indexes: | ||
catalog.addIndex(name, meta_type) | ||
added.add(name) | ||
if added: | ||
self.reindexIndexes(idxs=list(added), | ||
portal_types=["dmsmainfile", "dmsommainfile", "dmsappendixfile"], | ||
update_metadata=True) | ||
|
||
# END | ||
|
||
# END | ||
|
||
# finished = True # can be eventually returned and set by batched method | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je pense que c'est dupliqué avec mes changements