diff --git a/Products/zms/ZMSWorkflowProvider.py b/Products/zms/ZMSWorkflowProvider.py index 5598c4273..c155dcc5a 100644 --- a/Products/zms/ZMSWorkflowProvider.py +++ b/Products/zms/ZMSWorkflowProvider.py @@ -316,13 +316,13 @@ def doAutocommit(self, lang, REQUEST): Change workflow. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - def manage_changeWorkflow(self, lang, btn='', key='properties', REQUEST=None, RESPONSE=None): + def manage_changeWorkflow(self, lang, btn='', key='workflow_properties', REQUEST=None, RESPONSE=None): """ ZMSWorkflowProvider.manage_changeWorkflow """ message = '' # Version Control. # ----------- - if key == 'history': + if key == 'workflow_versioning': old_active = self.getConfProperty('ZMS.Version.active',0) new_active = REQUEST.get('active',0) old_nodes = self.getConfProperty('ZMS.Version.nodes',['{$}']) @@ -342,10 +342,19 @@ def manage_changeWorkflow(self, lang, btn='', key='properties', REQUEST=None, RE except: message += '[%s: %s]'%(node,'No history to pack') message = self.getZMILangStr('MSG_CHANGED')+message - + + # Content Assignment. + # ----------- + elif key == 'workflow_assignment': + # Save. + # ------ + if btn == 'BTN_SAVE': + self.nodes = standard.string_list(REQUEST.get('nodes', '')) + message = self.getZMILangStr('MSG_CHANGED') + # Properties. # ----------- - elif key == 'properties': + elif key == 'workflow_properties': # Save. # ------ if btn == 'BTN_SAVE': @@ -354,7 +363,6 @@ def manage_changeWorkflow(self, lang, btn='', key='properties', REQUEST=None, RE new_autocommit = REQUEST.get('workflow', 0) == 0 self.revision = REQUEST.get('revision', '0.0.0') self.autocommit = new_autocommit - self.nodes = standard.string_list(REQUEST.get('nodes', '')) if old_autocommit == 0 and new_autocommit == 1: self.doAutocommit(lang, REQUEST) message = self.getZMILangStr('MSG_CHANGED') @@ -383,10 +391,10 @@ def manage_changeWorkflow(self, lang, btn='', key='properties', REQUEST=None, RE else: filename = REQUEST['init'] self.importConf(filename) - message = self.getZMILangStr('MSG_IMPORTED')%('%s'%f.filename) + message = self.getZMILangStr('MSG_IMPORTED')%('%s'%filename) # Return with message. message = standard.url_quote(message) - return RESPONSE.redirect('manage_main?lang=%s&key=%s&manage_tabs_message=%s#_properties'%(lang, key, message)) + return RESPONSE.redirect('manage_main?lang=%s&key=%s&manage_tabs_message=%s#%s'%(lang, key, message, key)) ################################################################################ diff --git a/Products/zms/_importable.py b/Products/zms/_importable.py index 248fd9b8e..f1fee72ef 100644 --- a/Products/zms/_importable.py +++ b/Products/zms/_importable.py @@ -74,8 +74,11 @@ def recurse_importContent(self, folder): self.setObjProperty(key, blob, lang) # Commit object. - self.onChangeObj( self.REQUEST, forced=1) - + try: + self.onChangeObj( self.REQUEST, forced=1) + except: + standard.writeBlock( self, '[recurse_importContent]: %s commitObject failed'%(self.getId())) + # Process children. for ob in self.getChildNodes(): recurse_importContent(ob, folder) diff --git a/Products/zms/conf/metacmd_manager/manage_export_pydocx/manage_export_pydocx.py b/Products/zms/conf/metacmd_manager/manage_export_pydocx/manage_export_pydocx.py index 3b02d273b..781bb7b70 100644 --- a/Products/zms/conf/metacmd_manager/manage_export_pydocx/manage_export_pydocx.py +++ b/Products/zms/conf/metacmd_manager/manage_export_pydocx/manage_export_pydocx.py @@ -186,6 +186,7 @@ def add_hyperlink(docx_block, link_text, url): url_base = 'http://neon/' # Omit javascript links if not url.startswith('javascript:'): + url = url.replace('mailto:', '') # Fix missing domain name url = ('http' in url) and url.replace('http:///', url_base) or (url_base + (url.startswith('/') and url[1:] or url)) r_id = docx_block.part.relate_to(url, docx.opc.constants.RELATIONSHIP_TYPE.HYPERLINK, is_external=True) @@ -222,7 +223,7 @@ def add_hyperlink(docx_block, link_text, url): # ############################################# # Clean HTML -def clean_html(html): +def clean_html(html, wrap_trailling_text=False): """ Clean comments, styles, empty tags and handle special characters: left-to-right, triangle @@ -244,6 +245,9 @@ def clean_html(html): html = html.replace(left_to_right_char,'') html = html.replace('[[', triangle_char) html = html.replace(']]', '') + if wrap_trailling_text: + # Wrap untagged text following a block element into a paragraph + html = re.sub(r'(?i)(?m)(
\g<2>
', html)
return html
# ADD RUNS TO DOCX-BLOCK
@@ -276,6 +280,8 @@ def add_runs(docx_block, bs_element):
docx_block.add_run(u'\U0000F021', style='Icon')
elif elrun.has_attr('class') and 'fa-phone' in elrun['class']:
docx_block.add_run(u'\U0000F028', style='Icon')
+ elif elrun.has_attr('class') and 'fa-exclamation-triangle' in elrun['class']:
+ docx_block.add_run(u'\U0000F045', style='Icon')
elif elrun.text != '':
docx_block.add_run(elrun.text).italic = True
elif elrun.text != '':
@@ -294,6 +300,8 @@ def add_runs(docx_block, bs_element):
docx_block.add_run(elrun.text).font.subscript = True
elif elrun.name == 'sup':
docx_block.add_run(elrun.text).font.superscript = True
+ elif elrun.name == 'u':
+ docx_block.add_run(elrun.text).underline = True
elif elrun.name == 'a':
if elrun.has_attr('href'):
add_hyperlink(docx_block = docx_block, link_text = elrun.text, url = elrun.get('href'))
@@ -355,6 +363,7 @@ def add_tagged_content_as_paragraph(docx_doc, bs_element, style_name="Standard",
def add_htmlblock_to_docx(zmscontext, docx_doc, htmlblock, zmsid=None, zmsmetaid=None):
# Clean HTML
htmlblock = clean_html(htmlblock)
+ htmlblock = htmlblock.strip()
heading_text = ''
# Apply BeautifulSoup and iterate over elements
soup = BeautifulSoup(htmlblock, 'html.parser')
@@ -376,20 +385,18 @@ def add_htmlblock_to_docx(zmscontext, docx_doc, htmlblock, zmsid=None, zmsmetaid
prepend_bookmark(p, zmsid)
else:
# #############################################
- # HTML-Elements, element.name != None
- # #############################################
-
- # #############################################
+ # BLOCK-Elements, element.name != None
+ # ---------------------------------------------
# HEADINGS
# #############################################
- if element.name in ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']:
+ if element.name in ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'h7', 'h8']:
heading_level = int(element.name[1])
heading_text = standard.pystr(element.text).strip()
p = add_heading(docx_doc, heading_text, level=heading_level)
if c==1 and zmsid:
prepend_bookmark(p, zmsid)
if element.text == 'Inhaltsverzeichnis':
- p.style = docx_doc.styles['TOC-Header']
+ p.style = doc.styles['TOC-Header']
# #############################################
# PARAGRAPH
# #############################################
@@ -401,11 +408,14 @@ def add_htmlblock_to_docx(zmscontext, docx_doc, htmlblock, zmsid=None, zmsmetaid
# htmlblock.__contains__('ZMSTable') or htmlblock.__contains__('img')
if element.has_attr('class'):
if 'caption' in element['class'] and zmsmetaid in ['ZMSGraphic', 'ZMSTable']:
- p.style = docx_doc.styles['caption']
+ p.style = doc.styles['caption']
else:
class_name = element['class'][0]
- style_name = (class_name in docx_doc.styles) and class_name or 'Normal'
- p.style = docx_doc.styles[style_name]
+ try:
+ style_name = (class_name in doc.styles) and class_name or 'Normal'
+ except:
+ style_name = 'Normal'
+ p.style = doc.styles[style_name]
add_runs(docx_block = p, bs_element = element)
## Remove empty paragraphs
@@ -495,7 +505,7 @@ def add_list(docx_obj, element, level=0, c=0):
# ------------------------------------------------
def convert_cell_html_to_docx(zmscontext, docx_cell, text_style='Normal'):
'''Convert cell html to docx'''
- cl_html = clean_html(docx_cell.text)
+ cl_html = clean_html(docx_cell.text, wrap_trailling_text=True)
cl_type = cl_html.startswith('[th:') and 'th' or 'td'
cl_html = re.sub(r'\[(th|td):\d:\d\] ','',cl_html)
cl = BeautifulSoup(cl_html, 'html.parser')
@@ -509,7 +519,14 @@ def convert_cell_html_to_docx(zmscontext, docx_cell, text_style='Normal'):
try:
if {'div','ol','ul','table','p'} & set([e.name for e in cl.children]):
# [A] Block elements
- add_htmlblock_to_docx(zmscontext, docx_cell, cl_html, zmsid=None)
+ try:
+ add_htmlblock_to_docx(zmscontext, docx_cell, cl_html, zmsid=None)
+ except:
+ p.add_run('Rendering Error Table-Cell: %s'%cl.text)
+ # Cleaning: remove first cell paragraph if empty
+ if docx_cell.paragraphs[0].text == '':
+ first_p = docx_cell.paragraphs[0]._element
+ docx_cell._tc.remove(first_p)
elif set([e.name for e in cl.children])==set([None]):
# [B] Just text
p.text = cl.text
@@ -547,7 +564,7 @@ def convert_cell_html_to_docx(zmscontext, docx_cell, text_style='Normal'):
img_src = zmscontext.operator_getattr(zmscontext,zmsid).attr('imghires').getHref(zmscontext.REQUEST)
except:
pass
- img_name = img_src.split('/')[-1]
+ img_name = img_src.split('?')[0].split('/')[-1]
if not img_src.startswith('http'):
src_url0 = zmscontext.absolute_url().split('/content/')[0]
src_url1 = img_src.split('/content/')[-1]
@@ -583,12 +600,34 @@ def convert_cell_html_to_docx(zmscontext, docx_cell, text_style='Normal'):
elif element.name == 'div':
if element.has_attr('class') and (('ZMSGraphic' in element['class']) or ('graphic' in element['class'])):
ZMSGraphic_html = standard.pystr(''.join([str(e) for e in element.children]))
+ zmsid = element.has_attr('id') and element['id'] or zmsid
+ zmscontext = zmscontext.operator_getattr(zmscontext,zmsid)
add_htmlblock_to_docx(zmscontext, docx_doc, ZMSGraphic_html, zmsid, zmsmetaid='ZMSGraphic')
elif element.has_attr('class') and ('ZMSTextarea' in element['class']):
ZMSTextarea_html = standard.pystr(''.join([str(e) for e in element.children]))
+ zmsid = element.has_attr('id') and element['id'] or zmsid
+ zmscontext = zmscontext.operator_getattr(zmscontext,zmsid)
add_htmlblock_to_docx(zmscontext, docx_doc, ZMSTextarea_html, zmsid, zmsmetaid='ZMSTextarea')
elif element.has_attr('class') and 'handlungsaufforderung' in element['class']:
- add_tagged_content_as_paragraph(docx_doc, element, 'Handlungsaufforderung', c, zmsid)
+ if len([e.name for e in element.children if e.name in ['ul','ol']])>0:
+ add_tagged_content_as_paragraph(docx_doc, element, 'Handlungsaufforderung', c, zmsid)
+ child_tag = [e.name for e in element.children if e.name][0]
+ # COPY add_list
+ def add_list(docx_obj, element, level=0, c=0):
+ for i, li in enumerate(element.find_all('li', recursive=False)):
+ if docx_obj.paragraphs and docx_obj.paragraphs[-1].text == '':
+ p = docx_obj.paragraphs[-1]
+ else:
+ p = docx_obj.add_paragraph()
+ p = set_block_as_listitem(p, list_type=element.name, level=level, i=i)
+ add_runs(docx_block = p, bs_element = li)
+ if c==1 and zmsid:
+ prepend_bookmark(p, zmsid)
+ for ul in li.find_all(['ul','ol'], recursive=False):
+ add_list(docx_doc, ul, level+1)
+ add_list(docx_doc, element.find(child_tag), level=1, c=c)
+ else:
+ add_tagged_content_as_paragraph(docx_doc, element, 'Handlungsaufforderung', c, zmsid)
elif element.has_attr('class') and 'grundsatz' in element['class']:
add_tagged_content_as_paragraph(docx_doc, element, 'Grundsatz', c, zmsid)
elif element.has_attr('style') and 'background: rgb(238, 238, 238)' in element['style'] \
@@ -601,14 +640,14 @@ def convert_cell_html_to_docx(zmscontext, docx_cell, text_style='Normal'):
add_runs(docx_block = p, bs_element = element)
else:
child_tags = [e.name for e in element.children if e.name]
- if {'em','strong','i', 'span'} & set(child_tags):
+ if {'em','strong','i','span','u'} & set(child_tags):
p = docx_doc.add_paragraph()
if c==1 and zmsid:
prepend_bookmark(p, zmsid)
if len(element.contents) == 1:
if element.has_attr('class'):
- style_name = (class_name in docx_doc.styles) and class_name or 'Normal'
- p.style = docx_doc.styles[style_name]
+ style_name = (class_name in doc.styles) and class_name or 'Normal'
+ p.style = doc.styles[style_name]
p.add_run(element.text)
elif len(element.contents) > 1:
for e in element.contents:
@@ -621,8 +660,15 @@ def convert_cell_html_to_docx(zmscontext, docx_cell, text_style='Normal'):
# p.add_run('Routing: ')
p.add_run(u'\U0000F028', style='Icon')
p.add_run(' ')
+ elif 'fa-exclamation-triangle' in class_name:
+ # p.add_run('Kommentar: ')
+ p.add_run(u'\U0000F045', style='Icon')
+ p.add_run(' ')
if list(e.children)!=[]:
- add_runs(docx_block = p, bs_element = e)
+ if [ch.name for ch in e.children if ch.name in ['p', 'ol', 'ul', 'div']]:
+ add_htmlblock_to_docx(zmscontext, docx_doc, standard.pystr(e), zmsid)
+ else:
+ add_runs(docx_block = p, bs_element = e)
else:
p.add_run(standard.pystr(e.text))
elif e.name:
@@ -678,8 +724,9 @@ def convert_cell_html_to_docx(zmscontext, docx_cell, text_style='Normal'):
for input_field in element.find_all('input', recursive=True):
input_field_count += 1
p.add_run('%s. : %s\n'%(input_field_count, input_field.get('name','')))
+
# #############################################
- # OTHERS
+ # OTHER ELEMENTS
# #############################################
elif element.name == 'hr':
# Omit horizontal rule
@@ -687,6 +734,9 @@ def convert_cell_html_to_docx(zmscontext, docx_cell, text_style='Normal'):
elif element.name == 'script':
# Omit javascript
pass
+ elif element.name == 'style':
+ # Omit style
+ pass
else:
try:
if element.has_text:
@@ -705,7 +755,7 @@ def add_breadcrumbs_as_runs(zmscontext, p):
c = 0
for obj in breadcrumbs:
c += 1
- link_text = obj.meta_id == 'ZMS' and standard.pystr(obj.attr('title')) or standard.pystr(obj.attr('titlealt'))
+ link_text = obj.meta_id == 'ZMS' and standard.pystr(obj.attr('title')) or standard.pystr(obj.getTitlealt(zmscontext.REQUEST))
add_hyperlink(docx_block = p, link_text = link_text, url = obj.getHref2IndexHtml(zmscontext.REQUEST))
if c < len(breadcrumbs):
p.add_run(' > ')
@@ -755,7 +805,9 @@ def apply_standard_json_docx(self):
zmscontext = self
request = zmscontext.REQUEST
+ # For debugging use preview content
# request.set('preview', 'preview')
+ # #################################
is_page = zmscontext.isPage()
id = zmscontext.id
@@ -794,7 +846,7 @@ def apply_standard_json_docx(self):
pageelements = [ \
e for e in zmscontext.getChildNodes(request) \
if ( ( e.getType() in [ 'ZMSObject', 'ZMSRecordSet'] ) \
- and not e.meta_id in [ 'LgChangeHistory','ZMSTeaserContainer','LgELearningBanner'] \
+ and not e.meta_id in [ 'LgChangeHistory','ZMSTeaserContainer'] \
and not e.isPage() ) \
or e.meta_id in [ 'ZMSLinkElement' ]
]
@@ -832,7 +884,7 @@ def apply_standard_json_docx(self):
'parent_id':parent_id,
'parent_meta_id':parent_meta_id,
'docx_format':'image',
- 'imgwidth': imgwidth,
+ 'imgwidth': imgwidth,
'imgheight':imgheight,
'content':img_url
},
@@ -938,7 +990,7 @@ def apply_standard_json_docx(self):
}]
# Give some customizing hints for standard_html
- if pageelement.meta_id in ['LgRegel','LgBedingung','LgELearningBanner','ZMSNote']:
+ if pageelement.meta_id in ['LgRegel','LgBedingung','LgELearningBanner','ZMSNote','ZMSTestarea']:
standard.writeStdout(None, 'IMPORTANT NOTE: %s.standard_html needs to be customized!'%(pageelement.meta_id))
# %<---- CUSTOMIZE LIKE THIS ---------------------
# zmi python:request['URL'].find('/manage')>0 and not request['URL'].find('pydocx')>0;
@@ -1057,6 +1109,7 @@ def add_heading(self, text, level=1):
# binary data of the DOCX file.
def manage_export_pydocx(self, save_file=True, file_name=None):
request = self.REQUEST
+ request.set('lang', self.getPrimaryLanguage())
docx_creator = request.AUTHENTICATED_USER.getUserName()
# PAGE_COUNTER: Counter for recursive export
@@ -1207,22 +1260,21 @@ def manage_export_pydocx(self, save_file=True, file_name=None):
# #############################################
# [4] CAPTION TEXT-BLOCK
elif v and block['docx_format']=='Caption':
- if re.match(r'^\[Abb. e\d+\] .*', v):
- capt_list = re.split(r'^\[Abb. e\d+\] ', v)
- if len(capt_list) > 1 and len(capt_list[1]) > 0:
- p = doc.add_paragraph(style='Caption')
- prepend_bookmark(p, block['id'])
- p.add_run('Abb. %s: '%block['id']).font.italic = False
- p.add_run(capt_list[1])
- elif re.match(r'^\[Abb. e\d+\] ', v):
- # Omit caption with empty text
- pass
+ p = doc.add_paragraph(style='Caption')
+ if re.match(r'^\[Abb\. e\d+\] .*', v):
+ re_list = re.split(r'^(\[Abb. e\d+\]) (.*)',v)
+ v1 = re_list[1]
+ v2 = BeautifulSoup(re_list[2], 'html.parser').get_text()
+ p.add_run(v1).font.italic = False
+ p.add_run(' ')
+ p.add_run(v2)
else:
- p = doc.add_paragraph(style='Caption')
- prepend_bookmark(p, block['id'])
+ p.add_run(v)
+ prepend_bookmark(p, block['id'])
+
# #############################################
# [5] TEXT-BLOCK with given block format (style)
- elif v and block['docx_format'] in [e.name for e in doc.styles]:
+ elif v and ( block['docx_format'] in [e.name for e in doc.styles] or block['docx_format'] in [e.name.replace(' ','') for e in doc.styles] ):
p = doc.add_paragraph(v, style=block['docx_format'])
prepend_bookmark(p, block['id'])
elif v:
diff --git a/Products/zms/conf/metacmd_manager/manage_export_pydocx/neon.docx b/Products/zms/conf/metacmd_manager/manage_export_pydocx/neon.docx
index 57e177f41..0d3d8a091 100644
Binary files a/Products/zms/conf/metacmd_manager/manage_export_pydocx/neon.docx and b/Products/zms/conf/metacmd_manager/manage_export_pydocx/neon.docx differ
diff --git a/Products/zms/conf/metacmd_manager/manage_export_pydocx/readme.md b/Products/zms/conf/metacmd_manager/manage_export_pydocx/readme.md
index 255a4bdcd..85ca1862b 100644
--- a/Products/zms/conf/metacmd_manager/manage_export_pydocx/readme.md
+++ b/Products/zms/conf/metacmd_manager/manage_export_pydocx/readme.md
@@ -17,6 +17,19 @@ pip install python-docx
## Configuration and Customization
-Ensure that the script is configured correctly with the necessary parameters for your specific use case (especially the global variable `docx_tmpl` as filesystem path to the DOCX file that is used as a template). You may need to modify the script to fit your data source and desired output format.
-Some (complex) ZMS content objects may need another template `standard_json_docx` (Python script) to generate a normalized JSON representation of the object's content. The standard content model contains some examples of the script. For further details, please refer to the docstring of
+Ensure that the script is configured correctly with the necessary parameters for your specific use case, especially the global variable `docx_tmpl` as filesystem path to the DOCX file that is used as a template:
+
+```py
+# Set local path for docx-template
+docx_tmpl = open("/home/zope/src/zms-publishing/ZMS5/Products/zms/conf/metacmd_manager/manage_export_pydocx/neon.docx", "rb")
+```
+
+You may prefer to export not the committed but the working content, so set the REQUEST-variable:
+
+```py
+# For debugging use preview content
+request.set('preview', 'preview')
+```
+
+Furthermore You may need to modify the script to fit your data source and desired output format. Some (complex) ZMS content objects may need another template `standard_json_docx` (Python script) to generate a normalized JSON representation of the object's content. The standard content model contains some examples of the script. For further details, please refer to the docstring of
`manage_export_pydocx.apply_standard_json_docx()`.
diff --git a/Products/zms/conf/metacmd_manager/manage_export_pydocx/styles.xml b/Products/zms/conf/metacmd_manager/manage_export_pydocx/styles.xml
index b83c53633..981f0c4e9 100644
--- a/Products/zms/conf/metacmd_manager/manage_export_pydocx/styles.xml
+++ b/Products/zms/conf/metacmd_manager/manage_export_pydocx/styles.xml
@@ -108,6 +108,8 @@
%s%s
original
')
+ changed = request.get('changed','changed
')
+ data = standard.htmldiff(original, changed)
+ ct = decoration['content_type']
+ request.RESPONSE.setHeader('Content-Type',ct)
+ return data
\ No newline at end of file
diff --git a/Products/zms/standard.py b/Products/zms/standard.py
index bd0c3c880..22e6fd37b 100644
--- a/Products/zms/standard.py
+++ b/Products/zms/standard.py
@@ -2244,6 +2244,30 @@ def processData(context, processId, data, trans=None):
return _filtermanager.processData(context, processId, data, trans)
+security.declarePublic('htmldiff')
+def htmldiff(original, changed):
+ """
+ Wrapper for htmldiff2.render_html_diff.
+ @param original: html-file-0
+ @type context: C{str}
+ @param changed: html-file-1
+ @type changed: C{str}
+ """
+ try:
+ from htmldiff2 import render_html_diff
+ def remove_curly_braces(s):
+ return re.sub(r'/[\{\}]', '', s, flags=re.IGNORECASE)
+ def remove_html_comments(s):
+ return re.sub(r'', '', s, flags=re.DOTALL)
+ # Remove html comments for processing with htmldiff2/genshi.
+ original = remove_html_comments(remove_curly_braces(original))
+ changed = remove_html_comments(remove_curly_braces(changed))
+ diff = render_html_diff(original,changed)
+ except:
+ diff = 'ERROR: Cannot load or work with htmldiff2
'
+ return diff
+
+
############################################################################
#
#{ Executable
diff --git a/Products/zms/zmscontainerobject.py b/Products/zms/zmscontainerobject.py
index 94df6e6a5..2e0ca9b9e 100644
--- a/Products/zms/zmscontainerobject.py
+++ b/Products/zms/zmscontainerobject.py
@@ -247,30 +247,28 @@ def moveObjsToTrashcan(self, ids, REQUEST):
if self.meta_id == 'ZMSTrashcan':
return
trashcan = self.getTrashcan()
- # Set deletion-date.
- ids_copy = []
+ nodes = []
for id in ids:
try:
context = getattr(self, id)
context.del_uid = str(REQUEST.get('AUTHENTICATED_USER', None))
context.del_dt = standard.getDateTime( time.time())
- ids_copy.append(id)
+ # Move (Cut & Paste).
+ children = [context]
+ [standard.triggerEvent(child,'beforeDeleteObjsEvt') for child in children]
+ cb_copy_data = _cb_decode(self.manage_cutObjects([id]))
+ trashcan.manage_pasteObjects(cb_copy_data=_cb_encode(cb_copy_data))
+ [standard.triggerEvent(child,'afterDeleteObjsEvt') for child in children]
+ nodes.extend(children)
except:
standard.writeBlock( self, "[moveObjsToTrashcan]: Attribute Error %s"%(id))
- # Use only successfully tried ids
- ids = ids_copy
- # Move (Cut & Paste).
- children = [getattr(self,x) for x in ids]
- [standard.triggerEvent(child,'beforeDeleteObjsEvt') for child in children]
- cb_copy_data = _cb_decode(self.manage_cutObjects(ids))
- trashcan.manage_pasteObjects(cb_copy_data=_cb_encode(cb_copy_data))
+ # Synchronize search.
+ self.getCatalogAdapter().unindex_nodes(nodes=nodes)
+ # Trashcan: Sort-IDs and Garbage-Collection,
trashcan.normalizeSortIds()
trashcan.run_garbage_collection(forced=1)
- # Synchronize search.
- self.getCatalogAdapter().unindex_nodes(nodes=children)
# Sort-IDs.
self.normalizeSortIds()
- [standard.triggerEvent(child,'afterDeleteObjsEvt') for child in children]
############################################################################
diff --git a/Products/zms/zpt/ZMSMetacmdProvider/manage_main.zpt b/Products/zms/zpt/ZMSMetacmdProvider/manage_main.zpt
index c310992c9..9b91b8ddb 100644
--- a/Products/zms/zpt/ZMSMetacmdProvider/manage_main.zpt
+++ b/Products/zms/zpt/ZMSMetacmdProvider/manage_main.zpt
@@ -23,7 +23,7 @@
-
+