Commit 16570703 authored by Jean-Paul Smets's avatar Jean-Paul Smets

2006-12-31 JPS - Major update with better naming, code review. This breaks...

2006-12-31 JPS - Major update with better naming, code review. This breaks everything. Time to repair.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11819 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1ae2b849
......@@ -81,7 +81,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/DMS_htmlRepresentation</string> </value>
<value> <string>string:${object_url}/Document_viewHTMLPreview</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/DMS_jumpToRelatedDocuments?what=all</string> </value>
<value> <string>string:${object_url}/Document_jumpToRelatedDocumentList?what=all</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/DMS_jumpToRelatedDocuments?what=related_predecessor</string> </value>
<value> <string>string:${object_url}/Document_jumpToRelatedDocumentList?what=related_predecessor</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/DMS_jumpToRelatedDocuments?what=related_similar</string> </value>
<value> <string>string:${object_url}/Document_jumpToRelatedDocumentList?what=related_similar</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/DMS_jumpToRelatedDocuments?what=cloud</string> </value>
<value> <string>string:${object_url}/Document_jumpToRelatedDocumentList?what=cloud</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/DMS_jumpToRelatedDocuments?what=related_successor</string> </value>
<value> <string>string:${object_url}/Document_jumpToRelatedDocumentList?what=related_successor</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/DMS_jumpToRelatedDocuments?what=wiki_predecessor</string> </value>
<value> <string>string:${object_url}/Document_jumpToRelatedDocumentList?what=wiki_predecessor</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/DMS_jumpToRelatedDocuments?what=wiki_successor</string> </value>
<value> <string>string:${object_url}/Document_jumpToRelatedDocumentList?what=wiki_successor</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -75,9 +75,7 @@
<item>
<key> <string>group_list</string> </key>
<value>
<tuple>
<string>dms_document</string>
</tuple>
<tuple/>
</value>
</item>
<item>
......
......@@ -68,7 +68,16 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>req=context.REQUEST\n
<value> <string># XXX-JPS \n
# This code is horrible: bad spacing, all lines glued together, short unexplicit variable names\n
# Please reformat and rewrite with readable variables and understandable comments\n
# Use standard python spacing, put some space between lines if meaningful,\n
# Add a description. Do not forget to translate messages. This is a multilingual\n
# system after all.\n
"""\n
XXX-JPS - Put description here\n
"""\n
req=context.REQUEST\n
# with any of\n
st=req.get(\'SearchableText\',\'\')\n
context.log(st)\n
......@@ -107,7 +116,7 @@ lng=req.get(\'language\')\n
if lng and lng!=\'0\':\n
st+=\' language:%s\' % lng\n
# category search\n
for c in (\'group\',\'function\',\'site\'):\n
for c in (\'group\',\'function\',\'site\'): # XXX-JPS What is this hardcoded stuff ?\n
cval=req.get(\'search_\'+c)\n
if cval:\n
st+=\' %s:%s\' % (c,cval)\n
......
......@@ -68,12 +68,16 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># get related object title in a security-aware way (without throwing exception\n
# if I don\'t have permissions to access the object)\n
cat_value=context.getProperty(category)\n
<value> <string>"""\n
get related object title in a security-aware way (without throwing exception\n
if I don\'t have permissions to access the object)\n
"""\n
# XXX-JPS reformat code as explained in Base_assembleSearchString\n
cat_value=context.getProperty(category) # XXX-JPS please rename cat_value - this is a path - value is normally used to name objects (ex. getResourceValue). Also, category parameter is strange. This is a base category afterall. Name it base_category\n
if cat_value is None:return \'\'\n
ob=context.restrictedTraverse(cat_value,None)\n
return ob is not None and ob.getTitle() or \'\'\n
# XXX-JPS What would be the problem in using getMyCategoryTitle() ?\n
</string> </value>
</item>
<item>
......
......@@ -68,10 +68,12 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># get related object title list in a security-aware way (without throwing exception\n
# if I don\'t have permissions to access the object)\n
\n
ob_list=context.Base_getRelatedObjectValueList(category)\n
<value> <string>"""\n
get related object title list in a security-aware way (without throwing exception\n
if I don\'t have permissions to access the object)\n
"""\n
# XXX-JPS reformat code as explained in Base_assembleSearchString\n
ob_list=context.Base_getRelatedObjectValueList(category) # XXX-JPS This is a base category afterall. Name it base_category\n
title_list=[o.getTitle() for o in ob_list]\n
\n
return filter(lambda t:t!=\'\',title_list)\n
......
......@@ -68,9 +68,12 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># get related object value list in a security-aware way (without throwing exception\n
# if I don\'t have permissions to access the object)\n
\n
<value> <string>"""\n
get related object value list in a security-aware way (without throwing exception\n
if I don\'t have permissions to access the object)\n
"""\n
# XXX-JPS reformat code as explained in Base_assembleSearchString\n
# New names: object_list, category_list, base_category\n
cat_value_list=context.getPropertyList(category)\n
if cat_value_list is None:return []\n
\n
......
......@@ -68,7 +68,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return context.getPortalDocumentTypeList()+(\'Conference\',\'Project\')\n
<value> <string>return context.getPortalDocumentTypeList() + (\'Conference\', \'Project\') # XXX-JPS What is this hardcoded stuff ?\n
</string> </value>
</item>
<item>
......
......@@ -70,6 +70,10 @@
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
# XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS put descrition here\n
"""\n
tags=(\'<div style="font-weight:bold;display:inline;">\',\'</div>\')\n
trail=5\n
maxlines=5\n
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_processAdvancedSearch</string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>SearchableText</string>
<string>my_search_portal_type</string>
<string>creation_from</string>
<string>creation_to</string>
<string>publication_from</string>
<string>publication_to</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list>
<string>reference</string>
<string>version</string>
<string>language</string>
<string>mine</string>
<string>newest</string>
<string>search_mode</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_viewAdvancedSearchDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Base_advancedSearchDialog</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_dialog</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Advanced Document Search</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list>
<string>listbox_Base_showFoundText</string>
</list>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_viewAdvancedSearchResultList</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Base_advancedSearchResults</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_list</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Search results</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>Base_processAdvancedSearch</string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>SearchableText</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_viewSearchDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Base_searchDialog</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_dialog</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Document Search</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>my_title</string>
<string>my_description</string>
<string>my_source_project_title</string>
<string>my_classification</string>
<string>my_dms_category_list</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Book_view</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>BookInformation_view</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Book</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -68,7 +68,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># overwrite this to add implementation-specific consistency check\n
<value> <string>"""\n
XXX-JPS Please add description. If this is a core custmisable script,\n
please explain in Document class in Products.ERP5.Document\n
"""\n
# overwrite this to add implementation-specific consistency check\n
return\n
</string> </value>
</item>
......
......@@ -68,7 +68,13 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># determine content type if not given\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
# I wonder how this relates to the ingestion machinary and to\n
# is this the same as Document_ingestFile ?\n
"""\n
XXX-JPS Description here please\n
"""\n
# determine content type if not given\n
# first try from content\n
context.log(fname,doctype)\n
if doctype is None or doctype==\'\':\n
......@@ -185,7 +191,7 @@ return ob\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DMS_createObjectFromFile</string> </value>
<value> <string>Document_createObjectFromFile</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -70,6 +70,7 @@
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
# XXX-JPS reformat code as explained in Base_assembleSearchString\n
htmlrepr=context.getHtmlRepresentation()[:2000]\n
htmlrepr=\'<div style="background-color:white;color:black;">%s</div>\' % htmlrepr\n
context.log(context.REQUEST[\'URL\'])\n
......@@ -140,7 +141,7 @@ return htmlrepr\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DMS_decorateHtmlRepresentation</string> </value>
<value> <string>Document_decorateHtmlRepresentation</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -68,9 +68,12 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># we search for docs that reference us in any way (reference only or more specific)\n
# we can return raw set, the class will get objects and make the records unique\n
# if you want only the most recent versions, filter the result and apply DMS_findDocument \n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
we search for docs that reference us in any way (reference only or more specific)\n
we can return raw set, the class will get objects and make the records unique\n
if you want only the most recent versions, filter the result and apply DMS_findDocument\n
"""\n
ss=[]\n
if context.getReference() is None: return []\n
ss.append(context.getReference())\n
......@@ -155,7 +158,7 @@ return lst\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DMS_findPredecessors</string> </value>
<value> <string>Document_findWikiPredecessorList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -68,8 +68,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># dummy simple implementation - if no version, then return the newest in the chosen language\n
# or in any language if not specified\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString \n
"""\n
dummy simple implementation - if no version, then return the newest in the chosen language\n
or in any language if not specified\n
"""\n
reference=kw.get(\'reference\')\n
if reference is None:\n
return []\n
......@@ -154,7 +157,7 @@ return res\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DMS_findDocument</string> </value>
<value> <string>Document_findWikiSuccessor</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -70,6 +70,10 @@
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
# XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Please put description here\n
"""\n
# if no args we return empty list\n
# we use only SearchableText - all params are passed through this\n
\n
......@@ -275,7 +279,7 @@ return res\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DMS_getAdvancedSearchResults</string> </value>
<value> <string>Document_getAdvancedSearchResultList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -68,10 +68,13 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># we return only those base categories to which all DMS-related portal_types belong\n
# you need to define the list of DMS types here\n
# and to add a base category add it in DMSFile property sheets\n
# or manually for all these portal_types\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
we return only those base categories to which all Document-related portal_types belong\n
you need to define the list of Document types here\n
and to add a base category add it in DMSFile property sheets\n
or manually for all these portal_types\n
"""\n
\n
types=context.getPortalDocumentTypeList()\n
nrtypes=len(types)\n
......@@ -158,7 +161,7 @@ return basecatlist\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DMS_getBaseCategoryList</string> </value>
<value> <string>Document_getBaseCategoryList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -68,7 +68,13 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>if context.getReference() is None:\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
# XXX-JPS how about moving this to the API of Document ?\n
# Please consider merging with WebSite_getDocumentValue API\n
"""\n
XXX-JPS Description here\n
"""\n
if context.getReference() is None:\n
return context\n
res=context.DMS_findDocument(reference=context.getReference(),language=context.getLanguage())\n
return res[0].getObject()\n
......@@ -135,7 +141,7 @@ return res[0].getObject()\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DMSDocument_getLatestVersion</string> </value>
<value> <string>Document_getLatestVersion</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -68,7 +68,12 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return {}\n
<value> <string>"""\n
XXX-JPS Put description here\n
"""\n
# XXX-JPS What is this for. If this part of the Document API, it should be documented in\n
# the Document class as a customisable script.\n
return {}\n
\n
# write your own method (probably External Method, since it is most likely\n
# to use re) that would analyze text content of the doc\n
......
......@@ -34,7 +34,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Document_getPropertiesFromFilename</string> </value>
<value> <string>Document_getPropertyListFromFilename</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -34,7 +34,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Document_getPropertiesFromMail</string> </value>
<value> <string>Document_getPropertyListFromMail</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
......@@ -70,12 +70,21 @@
<key> <string>_body</string> </key>
<value> <string># XXX results should be cached as volatile attributes\n
\n
"""\n
XXX-JPS put description here\n
"""\n
# XXX-JPS reformat code as explained in Base_assembleSearchString\n
# XXX-JPS should probably be moved to core API of document\n
# with dynamic method selection\n
# getWikiSuccessorValueList = get + upperCase(wiki_successor) + ValueList\n
# Document_getSimilarityCloud = Document_get + upperCase(cloud) + ValueList\n
\n
def getRelatedLatest(category):\n
funcname=\'get%sValueList\' % category.title()\n
func=getattr(context,funcname)\n
return [o.DMSDocument_getLatestVersion() for o in func()]\n
\n
what=kw.get(\'what\')\n
what=kw.get(\'what\') # XXX-JPS Change \'what\' to more explicit name and include in API of script\n
if what==\'wiki_predecessor\':\n
return context.getWikiPredecessorValueList()\n
if what==\'wiki_successor\':\n
......@@ -161,7 +170,7 @@ return []\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DMS_getRelatedDocumentList</string> </value>
<value> <string>Document_getRelatedDocumentList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -68,7 +68,13 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.Message import Message\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description needed\n
"""\n
# XXX-JPS This should also be moved to Document API - using preferences\n
# and a title value taken from the script or preferences \n
from Products.ERP5Type.Message import Message\n
\n
what=context.REQUEST.get(\'what\')\n
\n
......@@ -152,7 +158,7 @@ return str(Message(domain=\'ui\',message=s))\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DMS_getRelatedDocumentsListboxTitle</string> </value>
<value> <string>Document_getRelatedDocumentsListboxTitle</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -68,16 +68,18 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># returns all documents related by similarity (either way), recursively\n
# so all documents related indirectly are also returned\n
# recursion depth can be limited, to avoid returning all documents\n
# if there is many similarities\n
# every doc is returned in its latest version available\n
\n
<value> <string>"""\n
returns all documents related by similarity (either way), recursively\n
so all documents related indirectly are also returned\n
recursion depth can be limited, to avoid returning all documents\n
if there is many similarities\n
every doc is returned in its latest version available\n
"""\n
# XXX-JPS reformat code as explained in Base_assembleSearchString\n
lista={}\n
depth=int(depth)\n
\n
def getSimilarities(self,level=0):\n
def getSimilarities(self,level=0): # XXX-JPS Naming: please do not use plural\n
level+=1\n
context.log(self.getRelativeUrl())\n
context.log(level)\n
......@@ -161,7 +163,7 @@ return [o.DMSDocument_getLatestVersion() for o in lista.keys()]\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DMS_getSimilarityCloud</string> </value>
<value> <string>Document_getSimilarityCloud</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -68,7 +68,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.ERP5Type.Cache import CachingMethod\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here\n
"""\n
from Products.ERP5Type.Cache import CachingMethod\n
context.log(value_list)\n
def cached_DMSGetItemList(base_category):\n
basecatobject=context.portal_categories.resolveCategory(base_category)\n
......@@ -187,7 +191,7 @@ return sub_field_dict.values()\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DMSBaseCategoryHash</string> </value>
<value> <string>Document_hashBaseCategoryList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -141,7 +141,7 @@ return \'%03d\' % (int(ver)+1)\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DMSDocument_incrementVersion</string> </value>
<value> <string>Document_incrementVersion</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -72,6 +72,10 @@
#from Products.ERP5Type.Message import Message\n
\n
# XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here\n
"""\n
noSenderInHeaderMsg="no sender in headers"\n
noSenderMsg="you are not in user database"\n
manySendersMsg="very serious error: your address has multiple entries"\n
......@@ -210,7 +214,7 @@ return\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DMS_handleMail</string> </value>
<value> <string>Document_ingestEmail</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -68,9 +68,15 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># this script does not save file data in a document\n
# it can be run any time\n
# is meant to extract metadata from file name and contents\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
this script does not save file data in a document\n
it can be run any time\n
is meant to extract metadata from file name and contents\n
"""\n
# XXX-JPS This script is probably what Document_discoverMetadata\n
# should do. There are too many similar scripts in the current design\n
# Please simplify and clarify. Use APIs at class level if necessary.\n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
if data is None:\n
if hasattr(context,\'oo_data\'):\n
......@@ -177,7 +183,7 @@ if fname is not None:\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DMS_ingestFile</string> </value>
<value> <string>Document_ingestFile</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Document_jumpToRelatedDocumentList</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>DMS_jumpToRelatedDocuments</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_list</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>Default</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>Default</string> </key>
<value>
<list>
<string>my_dms_category_list</string>
<string>my_source_project_title</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Document_library</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>DMS_library</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -68,7 +68,8 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return context.getWikiPredecessorValueList()\n
<value> <string>#XXX-JPS What is the use of this script ?\n
return context.getWikiPredecessorValueList()\n
</string> </value>
</item>
<item>
......@@ -131,7 +132,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DMS_listWikiPredecessor</string> </value>
<value> <string>Document_listWikiPredecessor</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -68,7 +68,8 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return context.getWikiSuccessorValueList()\n
<value> <string>#XXX-JPS What is the use of this script ?\n
return context.getWikiSuccessorValueList()\n
</string> </value>
</item>
<item>
......@@ -131,7 +132,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DMS_listWikiSuccessor</string> </value>
<value> <string>Document_listWikiSuccessor</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -70,6 +70,11 @@
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
"""\n
XXX-JPS Description here please\n
"""\n
# XXX-JPS reformat code as explained in Base_assembleSearchString\n
# XXX-JPS is this part of the Document API ? of the ingestion API ?\n
pref=context.portal_preferences.getPreferredDmsIngestEmailNotification()\n
if pref is not None and len(pref)==0:\n
pref=pref[0]\n
......@@ -194,7 +199,7 @@ context.MailHost.send(msg,mto,mfro,subject)\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DMS_notifyByEmail</string> </value>
<value> <string>Document_notifyByEmail</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -68,7 +68,12 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>klass=context.getClassification()\n
<value> <string>"""\n
XXX-JPS Description here please\n
"""\n
# XXX-JPS reformat code as explained in Base_assembleSearchString\n
\n
klass=context.getClassification()\n
if klass is None:return False\n
kl=klass.split(\'/\')\n
\n
......
......@@ -70,6 +70,11 @@
<key> <string>_body</string> </key>
<value> <string># implementation layer - additional properties to be set from various sources \n
# (e.g. current user info)\n
"""\n
XXX-JPS Description needed\n
This is a very unclear script. Probably needs some API level explanation\n
if it is really useful.\n
"""\n
</string> </value>
</item>
<item>
......@@ -137,7 +142,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Document_setOtherProperties</string> </value>
<value> <string>Document_setOtherPropertyList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -68,7 +68,14 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>translateString = context.Base_translateString\n
<value> <string>"""\n
XXX-JPS Description here please\n
"""\n
# XXX-JPS the number of upload / ingestion method is too high and their organisation\n
# is very confusing. The only way to progress is to explain the general concept\n
# within the Document or File class (do not forget that TextDocument can also\n
# be uploaded) \n
translateString = context.Base_translateString\n
request = context.REQUEST\n
ptype = context.getPortalType()\n
fname = file.filename\n
......@@ -203,7 +210,7 @@ return ob.Base_redirect(form_id, keep_items = {\'portal_status_message\' : msg},
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DMSDocument_uploadFile</string> </value>
<value> <string>Document_uploadFile</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>a</string>
<string>left</string>
<string>center</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>a</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list>
<string>html_representation</string>
</list>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>my_title</string>
<string>my_reference</string>
</list>
</value>
</item>
<item>
<key> <string>not_assigned</string> </key>
<value>
<list>
<string>comment</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Document_viewHTMLPreview</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>DMS_htmlRepresentation</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>HTML representation</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -68,7 +68,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># category_order : list of base_categories we want to use to generate the group id\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here please\n
"""\n
# category_order : list of base_categories we want to use to generate the group id\n
# kw : keys should be base categories,\n
# values should be value of corresponding relative urls (obtained by getBaseCategory())\n
#\n
......
......@@ -70,6 +70,10 @@
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
# XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here please\n
"""\n
# XXX For now, this script requires proxy manager to retrieve the Person object in all cases\n
\n
# base_category_list : list of category values we need to retrieve\n
......
......@@ -70,6 +70,10 @@
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
# XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here please\n
"""\n
# the same, but does group only with strict membership\n
# XXX needs refactoring\n
\n
......
......@@ -68,7 +68,12 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># here we calculate permissions for a memo - we must find the recipient\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here please\n
"""\n
\n
# here we calculate permissions for a memo - we must find the recipient\n
\n
context.log(base_category_list)\n
category_list = []\n
......
......@@ -68,7 +68,12 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>context.log(base_category_list)\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here please\n
"""\n
\n
context.log(base_category_list)\n
category_list = []\n
\n
# We look for valid assignments of destination users\n
......
......@@ -68,7 +68,12 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># here we calculate permissions for a Person, so we need categories from his assignment\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here please\n
"""\n
\n
# here we calculate permissions for a Person, so we need categories from his assignment\n
\n
# must always return a list of dicts\n
\n
......
......@@ -70,6 +70,11 @@
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
# XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here please\n
"""\n
\n
# XXX For now, this script requires proxy manager to retrieve the Person object in all cases\n
\n
# base_category_list : list of category values we need to retrieve\n
......
......@@ -68,7 +68,13 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>#context.log(\'---\')\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here please\n
"""\n
# XXX-JPS This code is quite frightening. I wonder really what it is for.\n
\n
#context.log(\'---\')\n
return (\n
(\'ERP5Type_getSecurityCategoryFromAssignment\', [\'function\'] ),\n
(\'ERP5Type_getSecurityCategoryFromAssignment\', [\'source_project\'] ),\n
......
......@@ -70,6 +70,10 @@
<key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[
# XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here please\n
"""\n
# XXX it is the same as ERP5Type_getSecurityCategoryFromAssignment\n
# only it returns only the first part of category\n
\n
......
......@@ -68,7 +68,12 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>context.resetTopObject()\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here please\n
"""\n
\n
context.resetTopObject()\n
context.ExternalDocument_spiderAndSetState()\n
return context.REQUEST.RESPONSE.redirect(context.absolute_url()+\'/view?portal_status_message=Done\')\n
</string> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ExternalLibraryFile_viewBookList</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>ExternalWebSite_viewSubpages</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Subpages</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>listbox</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ExternalWebPage_viewWebPageList</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>ExternalWebSite_viewSubpages</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Subpages</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value> <string>DMSDocument_uploadFile</string> </value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string>multipart/form-data</string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list>
<string>my_file</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>File_viewUploadDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>DMS_FileUploadDialog</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_dialog</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Upload file</string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -68,7 +68,12 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>request=context.REQUEST\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here please\n
"""\n
\n
request=context.REQUEST\n
fname=request.get(\'filename\')\n
format=request.get(\'format\')\n
context.log(\'format\',format)\n
......
......@@ -68,11 +68,17 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>msg=context.convert()\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here please\n
"""\n
\n
msg=context.convert()\n
context.log(script.getId(),msg)\n
if msg[0]==0: # if everything was ok\n
context.OOoDocument_postConversion()\n
return context.REQUEST.RESPONSE.redirect(context.absolute_url()+\'/view?portal_status_message=\'+str(msg[1]))\n
# XXX-JPS Message translation needed\n
</string> </value>
</item>
<item>
......
......@@ -68,7 +68,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here please\n
"""\n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
\n
ob=context\n
context.log(kw)\n
......
......@@ -68,7 +68,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>request=context.REQUEST\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here please\n
"""\n
request=context.REQUEST\n
request.RESPONSE.setHeader(\'Content-type\', context.getContentType())\n
context.log(\'mimetype\',context.getContentType())\n
request.RESPONSE.setHeader(\'Content-disposition\', \'attachment;; filename="%s"\' % context.title_or_id())\n
......
......@@ -68,7 +68,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>request=context.REQUEST\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here please\n
"""\n
request=context.REQUEST\n
request.RESPONSE.setHeader(\'Content-type\', \'application/pdf\')\n
context.log(\'format\',\'application/pdf\')\n
request.RESPONSE.setHeader(\'Content-disposition\', \'attachment;; filename="%s.pdf"\' % context.title_or_id())\n
......
......@@ -68,7 +68,12 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># ZMI level interface for getting file converted to a desired format\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here please\n
"""\n
\n
# ZMI level interface for getting file converted to a desired format\n
type,data=context.getTargetFile(format)\n
request=context.REQUEST\n
request.RESPONSE.setHeader(\'Content-type\', type)\n
......
......@@ -68,7 +68,15 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># implementation layer - operations to be perfomed after converting data to ODF\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here please\n
"""\n
# XXX-JPS This looks like API level.\n
# A good API for the conversion process with a documentation on OOoDocument class\n
# would help a lot to make things clearer and better designed.\n
\n
# implementation layer - operations to be perfomed after converting data to ODF\n
return\n
</string> </value>
</item>
......
......@@ -68,7 +68,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>request=context.REQUEST\n
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here please\n
"""\n
request=context.REQUEST\n
request.RESPONSE.setHeader(\'Content-type\', \'application/x-pdf\')\n
request.RESPONSE.setHeader(\'Content-disposition\', \'attachment;; filename="%s"\' % context.title_or_id())\n
return context.getTargetFile(\'pdf\')\n
......
......@@ -68,7 +68,13 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return not(value is None or not value)\n
<value> <string>"""\n
This script is called at file upload time as an external validator.\n
It is meant to check that a file was provided in the upload field\n
of the upload dialog.\n
"""\n
# XXX-JPS should be moved to File_validateRequiredFile and used everywhere\n
return not(value is None or not value)\n
</string> </value>
</item>
<item>
......
......@@ -86,7 +86,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>OOoDocument_getOOoFileDialog</string> </value>
<value> <string>OOoDocument_viewOOoFileDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
......
......@@ -86,7 +86,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>OOoDocument_getSnapshotDialog</string> </value>
<value> <string>OOoDocument_viewSnapshotDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment