Commit 96940308 authored by Bartek Górny's avatar Bartek Górny

a HUGE commit after a major refactoring; use with caution.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12353 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 48c50120
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.CMFCore.ActionInformation</string>
<string>ActionInformation</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_action</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>contribute_content</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>Modify portal content</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Contribute Content</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.CMFCore.Expression</string>
<string>Expression</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/ContributionTool_viewContributeFileDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.CMFCore.ActionInformation</string>
<string>ActionInformation</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>latest</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>2.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Latest</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.CMFCore.Expression</string>
<string>Expression</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/ContributionTool_viewLatestContentList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.CMFCore.ActionInformation</string>
<string>ActionInformation</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_view</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>view</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>1.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>View</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.CMFCore.Expression</string>
<string>Expression</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/ContributionTool_viewMyContentList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -54,11 +54,11 @@
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>2.0</float> </value>
<value> <float>4.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Document Search</string> </value>
<value> <string>Advanced Search</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
......@@ -81,7 +81,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Base_searchDialog</string> </value>
<value> <string>string:${object_url}/Base_viewAdvancedSearchDialog</string> </value>
</item>
</dictionary>
</pickle>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.CMFCore.ActionInformation</string>
<string>ActionInformation</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>action</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>category</string> </key>
<value> <string>object_search</string> </value>
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>search</string> </value>
</item>
<item>
<key> <string>permissions</string> </key>
<value>
<tuple>
<string>View</string>
</tuple>
</value>
</item>
<item>
<key> <string>priority</string> </key>
<value> <float>2.0</float> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Document Search</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.CMFCore.Expression</string>
<string>Expression</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Base_viewSearchDialog</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -30,7 +30,9 @@
</item>
<item>
<key> <string>condition</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -86,4 +88,23 @@
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<tuple>
<string>Products.CMFCore.Expression</string>
<string>Expression</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>python:object.hasFile()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -81,7 +81,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/File_UploadDialog</string> </value>
<value> <string>string:${object_url}/File_viewUploadDialog</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -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,11 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/DMS_jumpToRelatedDocuments?what=all</string> </value>
<value> <string encoding="cdata"><![CDATA[
string:${object_url}/Document_jumpToRelatedDocumentList?relation_id=all&listbox_title=All related documents
]]></string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,11 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/DMS_jumpToRelatedDocuments?what=related_predecessor</string> </value>
<value> <string encoding="cdata"><![CDATA[
string:${object_url}/Document_jumpToRelatedDocumentList?relation_id=related_predecessor&listbox_title=Reference documents
]]></string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,11 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/DMS_jumpToRelatedDocuments?what=related_similar</string> </value>
<value> <string encoding="cdata"><![CDATA[
string:${object_url}/Document_jumpToRelatedDocumentList?relation_id=related_similar&listbox_title=Similar documents
]]></string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,11 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/DMS_jumpToRelatedDocuments?what=cloud</string> </value>
<value> <string encoding="cdata"><![CDATA[
string:${object_url}/Document_jumpToRelatedDocumentList?relation_id=cloud&listbox_title=Similarity Cloud
]]></string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,11 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/DMS_jumpToRelatedDocuments?what=related_successor</string> </value>
<value> <string encoding="cdata"><![CDATA[
string:${object_url}/Document_jumpToRelatedDocumentList?relation_id=related_successor&listbox_title=Related documents
]]></string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,11 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/DMS_jumpToRelatedDocuments?what=wiki_predecessor</string> </value>
<value> <string encoding="cdata"><![CDATA[
string:${object_url}/Document_jumpToRelatedDocumentList?relation_id=wiki_predecessor&listbox_title=Wiki predecessors
]]></string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,11 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/DMS_jumpToRelatedDocuments?what=wiki_successor</string> </value>
<value> <string encoding="cdata"><![CDATA[
string:${object_url}/Document_jumpToRelatedDocumentList?relation_id=wiki_successor&listbox_title=Wiki successors
]]></string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Base_viewLocalPermission</string> </value>
<value> <string>string:${object_url}/Base_viewLocalPermissionList</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Preference_viewDMS</string> </value>
<value> <string>string:${object_url}/Preference_viewDocument</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -83,7 +83,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/OOoDocument_convert</string> </value>
<value> <string>string:${object_url}/OOoDocument_convertToBase</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -83,7 +83,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/OOoDocument_downloadDialog</string> </value>
<value> <string>string:${object_url}/OOoDocument_viewDownloadDialog</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -83,7 +83,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/OOoDocument_getOOoFileDialog</string> </value>
<value> <string>string:${object_url}/OOoDocument_viewOOoFileDialog</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -83,7 +83,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/OOoDocument_getSnapshotDialog</string> </value>
<value> <string>string:${object_url}/OOoDocument_viewSnapshotDialog</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -83,7 +83,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/OOoDocument_viewTargetFileDialog</string> </value>
<value> <string>string:${object_url}/OOoDocument_viewConvertDialog</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/File_UploadDialog</string> </value>
<value> <string>string:${object_url}/File_viewUploadDialog</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,11 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Document_jumpToRelatedDocumentList?what=all</string> </value>
<value> <string encoding="cdata"><![CDATA[
string:${object_url}/Document_jumpToRelatedDocumentList?relation_id=all&listbox_title=All related documents
]]></string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,11 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Document_jumpToRelatedDocumentList?what=related_predecessor</string> </value>
<value> <string encoding="cdata"><![CDATA[
string:${object_url}/Document_jumpToRelatedDocumentList?relation_id=related_predecessor&listbox_title=Reference documents
]]></string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,11 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Document_jumpToRelatedDocumentList?what=related_similar</string> </value>
<value> <string encoding="cdata"><![CDATA[
string:${object_url}/Document_jumpToRelatedDocumentList?relation_id=related_similar&listbox_title=Similar documents
]]></string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,11 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Document_jumpToRelatedDocumentList?what=cloud</string> </value>
<value> <string encoding="cdata"><![CDATA[
string:${object_url}/Document_jumpToRelatedDocumentList?relation_id=cloud&listbox_title=Similarity Cloud
]]></string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,11 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Document_jumpToRelatedDocumentList?what=related_successor</string> </value>
<value> <string encoding="cdata"><![CDATA[
string:${object_url}/Document_jumpToRelatedDocumentList?relation_id=related_successor&listbox_title=Related documents
]]></string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,11 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Document_jumpToRelatedDocumentList?what=wiki_predecessor</string> </value>
<value> <string encoding="cdata"><![CDATA[
string:${object_url}/Document_jumpToRelatedDocumentList?relation_id=wiki_predecessor&listbox_title=Wiki predecessors
]]></string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,11 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Document_jumpToRelatedDocumentList?what=wiki_successor</string> </value>
<value> <string encoding="cdata"><![CDATA[
string:${object_url}/Document_jumpToRelatedDocumentList?relation_id=wiki_successor&listbox_title=Wiki successors
]]></string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -81,7 +81,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
<value> <string>string:${object_url}/Base_viewLocalPermission</string> </value>
<value> <string>string:${object_url}/Base_viewLocalPermissionList</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -140,6 +140,12 @@
<dictionary/>
</value>
</item>
<item>
<key> <string>revision</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
......@@ -171,28 +177,29 @@
<key> <string>_keys</string> </key>
<value>
<list>
<string>uid</string>
<string>Creator</string>
<string>Date</string>
<string>PrincipiaSearchSource</string>
<string>SearchableText</string>
<string>CreationDate</string>
<string>EffectiveDate</string>
<string>ExpiresDate</string>
<string>ModificationDate</string>
<string>Type</string>
<string>bobobase_modification_time</string>
<string>created</string>
<string>effective</string>
<string>expires</string>
<string>getIcon</string>
<string>in_reply_to</string>
<string>modified</string>
<string>review_state</string>
<string>summary</string>
<string>language</string>
<string>version</string>
<string>short_title</string>
<string>uid</string>
<string>Creator</string>
<string>Date</string>
<string>PrincipiaSearchSource</string>
<string>SearchableText</string>
<string>CreationDate</string>
<string>EffectiveDate</string>
<string>ExpiresDate</string>
<string>ModificationDate</string>
<string>Type</string>
<string>bobobase_modification_time</string>
<string>created</string>
<string>effective</string>
<string>expires</string>
<string>getIcon</string>
<string>in_reply_to</string>
<string>modified</string>
<string>review_state</string>
<string>summary</string>
<string>language</string>
<string>version</string>
<string>revision</string>
<string>short_title</string>
</list>
</value>
</item>
......@@ -230,6 +237,7 @@ review_state\r\n
summary\r\n
language\r\n
version\r\n
revision\r\n
short_title</string> </value>
</item>
<item>
......@@ -296,7 +304,8 @@ VALUES\n
<dtml-sqlvar expr="summary[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="language[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="version[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="short_title[loop_item]" type="string" optional>\n
<dtml-sqlvar expr="short_title[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="revision[loop_item]" type="string" optional>\n
)\n
<dtml-if sequence-end>\n
<dtml-else>\n
......@@ -367,7 +376,8 @@ VALUES\n
<dtml-sqlvar expr="summary[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="language[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="version[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="short_title[loop_item]" type="string" optional>\n
<dtml-sqlvar expr="short_title[loop_item]" type="string" optional>,\n
<dtml-sqlvar expr="revision[loop_item]" type="string" optional>\n
)\n
<dtml-if sequence-end>\n
<dtml-else>\n
......
......@@ -123,6 +123,7 @@ CREATE TABLE `compatibility` (\n
`summary` text,\n
`language` varchar(5) default \'\',\n
`version` varchar(10) default \'\',\n
`revision` varchar(10) default \'\',\n
`short_title` varchar(100) default \'\',\n
PRIMARY KEY (`uid`),\n
KEY `Type` (`Type`),\n
......@@ -188,6 +189,7 @@ CREATE TABLE `compatibility` (\n
`summary` text,\n
`language` varchar(5) default \'\',\n
`version` varchar(10) default \'\',\n
`revision` varchar(10) default \'\',\n
`short_title` varchar(100) default \'\',\n
PRIMARY KEY (`uid`),\n
KEY `Type` (`Type`),\n
......
......@@ -31,39 +31,143 @@
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<key> <string>_tree</string> </key>
<value>
<none/>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<key> <string>acquisition_append_value</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>acquisition_base_category</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
<tuple/>
</value>
</item>
<item>
<key> <string>acquisition_copy_value</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>acquisition_mask_value</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>acquisition_object_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>acquisition_portal_type</string> </key>
<value> <string>python: []</string> </value>
</item>
<item>
<key> <string>acquisition_sync_value</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>category_type</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>criterion_property</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>fallback_base_category</string> </key>
<value>
<none/>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>classification</string> </value>
</item>
<item>
<key> <string>id_generator</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id_group</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>last_id</string> </key>
<value> <string>1</string> </value>
</item>
<item>
<key> <string>membership_criterion_base_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>multimembership_criterion_base_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Base Category</string> </value>
</item>
<item>
<key> <string>read_permission</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>rid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Security Classification</string> </value>
......@@ -74,6 +178,12 @@
<none/>
</value>
</item>
<item>
<key> <string>write_permission</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -82,5 +82,5 @@ def asSecurityGroupIdList(self, category_order=None, **kw):
#LOG('asSecurityGroupIdList, result',0,['_'.join(x) for x in getCombinationList(code_list) if len(x)])
#return ['_'.join(x) for x in getCombinationList(code_list) if len(x)]
#LOG('asSecurityGroupIdList', 0, 'return full_code_list = %s' %(full_code_list,))
#self.log('full_code_list',full_code_list)
self.log('full_code_list',full_code_list)
return full_code_list
......@@ -3,46 +3,64 @@ import xmlrpclib, base64
from Products.CMFCore.utils import getToolByName
def extractContent(data):
cs=cStringIO.StringIO()
"""
extract text content from ODF data
directly by unzipping (no need for oood here)
"""
# XXX probably not used - to really get text content it should
# strip xml too
cs = cStringIO.StringIO()
cs.write(data)
try:
z=zipfile.ZipFile(cs)
z = zipfile.ZipFile(cs)
except zipfile.BadZipfile:
cs.close()
return ''
s=z.read('content.xml')
s = z.read('content.xml')
cs.close()
z.close()
return s
def convertToOdf(self,name,data):
sp=mkProxy(self)
kw=sp.run_convert(name,base64.encodestring(data))
odf=base64.decodestring(kw['data'])
###### XXX these methods repeat what is in OOoDocument class
# maybe redundant, but we need to access them from Script (Python)
def convertToOdf(self, name, data):
"""
convert data into ODF format
to be used in ingestion when we don't yet have an ERP5 object
to work with (and we for example have to figure out portal_type)
"""
sp = mkProxy(self)
kw = sp.run_convert(name,base64.encodestring(data))
odf = base64.decodestring(kw['data'])
return odf
def mkProxy(self):
pref=getToolByName(self,'portal_preferences')
adr=pref.getPreferredDmsOoodocServerAddress()
nr=pref.getPreferredDmsOoodocServerPortNumber()
pref = getToolByName(self,'portal_preferences')
adr = pref.getPreferredDmsOoodocServerAddress()
nr = pref.getPreferredDmsOoodocServerPortNumber()
if adr is None or nr is None:
raise Exception('you should set conversion server coordinates in preferences')
sp=xmlrpclib.ServerProxy('http://%s:%d' % (adr,nr),allow_none=True)
sp = xmlrpclib.ServerProxy('http://%s:%d' % (adr,nr), allow_none=True)
return sp
def generateFile(self,name,data,format):
sp=mkProxy(self)
kw=sp.run_generate(name,data,None,format)
res=base64.decodestring(kw['data'])
def generateFile(self, name, data, format):
sp = mkProxy(self)
kw = sp.run_generate(name, data, None, format)
res = base64.decodestring(kw['data'])
return res
def getAttrFromFilename(self,fname):
rx_parse=re.compile(self.portal_preferences.getPreferredDmsFilenameRegexp())
m=rx_parse.match(fname)
def getAttrFromFilename(self, fname):
"""
parse file name using regexp specified in preferences
"""
rx_parse = re.compile(self.portal_preferences.getPreferredDmsFilenameRegexp())
m = rx_parse.match(fname)
if m is None:
return {}
return m.groupdict()
def ofof(one, another):
return one.__of__(another)
# vim: syntax=python shiftwidth=2
import re
def findAddress(txt):
"""
find email address in a string
"""
validchars='0-9A-Za-z.\-_'
r=re.compile('[%s]+@[%s]+' % (validchars,validchars))
m=r.search(txt)
return m and m.group()
def extractParams(txt):
"""
extract parameters given in mail body
We assume that parameters are given as lines of the format:
name:value
"""
r=re.compile('^([\w_]+):([\w_/]+)$')
res=[]
for line in txt.split():
......
'''
"""
RULES
Single arguments:
......@@ -15,8 +15,15 @@ Multiple arguments:
- state (simulation_state), type (portal_type)
Everything else is treated as SearchableText
'''
"""
# XXX score:
# pythonicity: high
# obfuscation level: brain-twisting
# how to customize:
# (1) think for two hours
# (2) type for 20 seconds
import re
import sys
......@@ -24,10 +31,14 @@ sys.path.append('/usr/lib/zope/lib/python/')
from DateTime import DateTime
def dateRangeProc(s):
m=re.match('(\d)([my]).*',s)
"""
process date range (can be given in months or years)
"""
m=re.match('(\d)([wmy]).*',s)
try:
dif=0
gr=m.groups()
if gr[1]=='w':dif=int(gr[0])*7
if gr[1]=='m':dif=int(gr[0])*30
if gr[1]=='y':dif=int(gr[0])*365
return ('creation_from',DateTime()-dif)
......
<type_roles>
<role id='Associate'>
<property id='title'>Project Associates</property>
<property id='description'>Policy: */project
<property id='description'>Policy: */project
Rule: all project members have a right to access document once it has been shared or released</property>
<property id='condition'>python:object.Document_policyApplies('*/project')</property>
<property id='priority'>10</property>
<property id='priority'>10.0</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromArrow</property>
<multi_property id='category'></multi_property>
<multi_property id='base_category'>source_project</multi_property>
</role>
<role id='Assignor'>
<property id='title'>Project Director</property>
<property id='description'>Policy: */project
<property id='description'>Policy: */project
Rule: project director is an Assignor (has management rights to the doc - can review it, release, publish, add local roles)</property>
<property id='condition'>python:object.Document_policyApplies('*/project')</property>
<property id='priority'>10</property>
<property id='priority'>10.0</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromArrow</property>
<multi_property id='category'>function/knowledge/manager</multi_property>
<multi_property id='base_category'>function</multi_property>
......@@ -22,40 +21,37 @@ Rule: project director is an Assignor (has management rights to the doc - can re
</role>
<role id='Assignee'>
<property id='title'>Owner</property>
<property id='description'>Policy: */*
<property id='description'>Policy: */*
Rule: the creator is Assignee - can edit the doc and submit it</property>
<property id='priority'>10</property>
<property id='priority'>10.0</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromUser</property>
<multi_property id='category'></multi_property>
<multi_property id='base_category'>reference</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Organisation members</property>
<property id='description'>Policy: */*
Rule: all people working for the same organisation are Auditors (we identify the organisation by the first part of the "group" path)
<property id='description'>Policy: */*
Rule: all people working for the same organisation are Auditors (we identify the organisation by the first part of the "group" path)
This does not apply if it is a project document and does not have a project</property>
<property id='condition'>python: not object.Document_policyApplies('*/restricted') and (object.Document_policyApplies('*/project') or not object.Document_policyApplies('*/project',True) )</property>
<property id='priority'>10</property>
<property id='priority'>10.0</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryRoot</property>
<multi_property id='category'></multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
<role id='Assignee'>
<property id='title'>Project Collaborators</property>
<property id='description'>Policy: collaborative/project
<property id='description'>Policy: collaborative/project
Rule: all members of project team can edit the document before it is submitted, and can submit it</property>
<property id='condition'>python:object.Document_policyApplies('collaborative/project')</property>
<property id='priority'>10</property>
<property id='priority'>10.0</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromArrow</property>
<multi_property id='category'></multi_property>
<multi_property id='base_category'>source_project</multi_property>
</role>
<role id='Assignor'>
<property id='title'>Team Director</property>
<property id='description'>Policy: */team
<property id='description'>Policy: */team
Rule: team manager is an Assignor (has management rights to the doc - can review it, release, publish, add local roles)</property>
<property id='condition'>python:object.Document_policyApplies('*/team')</property>
<property id='priority'>10</property>
<property id='priority'>10.0</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromAssignment</property>
<multi_property id='category'>function/auc/department/director_of_department</multi_property>
<multi_property id='base_category'>group</multi_property>
......@@ -63,10 +59,10 @@ Rule: team manager is an Assignor (has management rights to the doc - can review
</role>
<role id='Assignor'>
<property id='title'>Team Deputy</property>
<property id='description'>Policy: */team
<property id='description'>Policy: */team
Rule: team manager is an Assignor (has management rights to the doc - can review it, release, publish, add local roles)</property>
<property id='condition'>python:object.Document_policyApplies('*/team')</property>
<property id='priority'>10</property>
<property id='priority'>10.0</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromAssignment</property>
<multi_property id='category'>function/auc/department/deputy_director_of_department</multi_property>
<multi_property id='base_category'>group</multi_property>
......@@ -74,40 +70,37 @@ Rule: team manager is an Assignor (has management rights to the doc - can review
</role>
<role id='Associate'>
<property id='title'>Team Associates</property>
<property id='description'>Policy: */team
<property id='description'>Policy: */team
Rule: all team members have a right to access document once it has been shared or released</property>
<property id='condition'>python:object.Document_policyApplies('*/team')</property>
<property id='priority'>10</property>
<property id='priority'>10.0</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromAssignment</property>
<multi_property id='category'></multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
<role id='Assignee'>
<property id='title'>Team Collaborators</property>
<property id='description'>Policy: collaborative/team
<property id='description'>Policy: collaborative/team
Rule: all members of the team can edit the document before it is submitted, and can submit it</property>
<property id='condition'>python:object.Document_policyApplies('collaborative/team')</property>
<property id='priority'>10</property>
<property id='priority'>10.0</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromAssignment</property>
<multi_property id='category'></multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
<role id='Assignee'>
<property id='title'>Public Collaborators</property>
<property id='description'>Policy: collaborative/public
<property id='description'>Policy: collaborative/public
Rule: everyone in the organisation (root group) can edit the doc before it is submitted, and can suggest its publication</property>
<property id='condition'>python:object.Document_policyApplies('collaborative/public')</property>
<property id='priority'>10</property>
<property id='priority'>10.0</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryRoot</property>
<multi_property id='category'></multi_property>
<multi_property id='base_category'>group</multi_property>
</role>
<role id='Assignor'>
<property id='title'>Public Reviewer</property>
<property id='description'>Policy: collaborative/public
<property id='description'>Policy: collaborative/public
Rule: any person with knowledge/manager role can publish the document and manage access rights to it</property>
<property id='condition'>python:object.Document_policyApplies('collaborative/public')</property>
<property id='priority'>10</property>
<property id='priority'>10.0</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromAssignment</property>
<multi_property id='category'>function/knowledge/manager</multi_property>
<multi_property id='base_category'>function</multi_property>
......
......@@ -4,8 +4,8 @@
<pickle>
<tuple>
<tuple>
<string>Products.ERP5.Interaction</string>
<string>InteractionDefinition</string>
<string>Products.ERP5Type.ERP5Type</string>
<string>ERP5TypeInformation</string>
</tuple>
<none/>
</tuple>
......@@ -19,79 +19,98 @@
</value>
</item>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
<key> <string>_actions</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
<key> <string>_aliases</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>activate_script_name</string> </key>
<key> <string>_roles</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>acquire_local_roles</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>allowed_content_types</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<key> <string>base_category_list</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>content_icon</string> </key>
<value> <string>folder_icon.gif</string> </value>
</item>
<item>
<key> <string>content_meta_type</string> </key>
<value> <string>ERP5 Folder</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<value> <string>Contribution Tool provides a single place to contribue content to an ERP5 Site.</string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
<key> <string>factory</string> </key>
<value> <string>addFolder</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Registered_file_edit</string> </value>
<key> <string>filter_content_types</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>method_id</string> </key>
<key> <string>group_list</string> </key>
<value>
<list>
<string>_edit</string>
</list>
<tuple/>
</value>
</item>
<item>
<key> <string>portal_type_filter</string> </key>
<key> <string>hidden_content_type_list</string> </key>
<value>
<list>
<string>Drawing</string>
<string>Image</string>
<string>PDF</string>
<string>Presentation</string>
<string>Spreadsheet</string>
<string>Text</string>
</list>
<tuple/>
</value>
</item>
<item>
<key> <string>script_name</string> </key>
<value>
<list>
<string>CheckKnownType</string>
</list>
</value>
<key> <string>id</string> </key>
<value> <string>Contribution Tool</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<key> <string>init_script</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
<key> <string>permission</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>property_sheet_list</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Contribution Tool</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -75,7 +75,9 @@
<item>
<key> <string>group_list</string> </key>
<value>
<tuple/>
<tuple>
<string>document</string>
</tuple>
</value>
</item>
<item>
......
......@@ -67,7 +67,7 @@
</item>
<item>
<key> <string>factory</string> </key>
<value> <string>addPDF</string> </value>
<value> <string>addPDFDocument</string> </value>
</item>
<item>
<key> <string>filter_content_types</string> </key>
......@@ -76,9 +76,7 @@
<item>
<key> <string>group_list</string> </key>
<value>
<tuple>
<string>dms_document</string>
</tuple>
<tuple/>
</value>
</item>
<item>
......
......@@ -82,7 +82,7 @@
<key> <string>group_list</string> </key>
<value>
<tuple>
<string>dms_document</string>
<string>document</string>
</tuple>
</value>
</item>
......
......@@ -82,7 +82,7 @@
<key> <string>group_list</string> </key>
<value>
<tuple>
<string>dms_document</string>
<string>document</string>
</tuple>
</value>
</item>
......
......@@ -9,7 +9,7 @@
</chain>
<chain>
<type>External Web Page</type>
<workflow>edit_workflow, external_document_publication_workflow, external_document_interaction_workflow</workflow>
<workflow>edit_workflow, external_processing_workflow, external_document_interaction_workflow, external_document_publication_workflow</workflow>
</chain>
<chain>
<type>File</type>
......@@ -37,6 +37,6 @@
</chain>
<chain>
<type>Text</type>
<workflow>document_validation_workflow, document_publication_workflow, ooo_interaction_workflow, dms_file_interaction_workflow, local_permission_interaction_workflow, edit_workflow</workflow>
<workflow>document_validation_workflow, document_publication_workflow, ooo_interaction_workflow, dms_file_interaction_workflow, external_processing_workflow, local_permission_interaction_workflow, edit_workflow</workflow>
</chain>
</workflow_chain>
\ No newline at end of file
......@@ -68,73 +68,88 @@
</item>
<item>
<key> <string>_body</string> </key>
<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
<value> <string>"""\n
This script receives a request from advanced search form and \n
puts together a search string in a search syntax, depending on\n
parameters received. It is the reverse of parseSearchString external\n
method.\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
# exact phrase\n
s_phrase=req.get(\'SearchableText_phrase\',\'\')\n
if s_phrase!="":\n
st+=\' "\'+s_phrase+\'"\'\n
# with all words\n
s_all=req.get(\'SearchableText_all\',\'\')\n
if s_all!="":\n
st+=\' \'+\' \'.join(\'+\'+w for w in s_all.split(\' \'))\n
# without words\n
s_without=req.get(\'SearchableText_without\',\'\')\n
if s_without!="":\n
st+=\' \'+\' \'.join(\'-\'+w for w in s_without.split(\' \'))\n
# by creation date\n
daterange=req.get(\'created_within\',\'\')\n
\n
req = context.REQUEST\n
\n
# words to search in \'any of the words\' form - left intact\n
search_string = req.get(\'SearchableText_any\',\'\')\n
\n
# exact phrase to search for - double-quoted\n
search_phrase = req.get(\'SearchableText_phrase\',\'\')\n
if search_phrase != "":\n
search_string += \' "\' + search_phrase + \'"\'\n
\n
# search "with all of the words" - each word prefixed by "+"\n
search_all = req.get(\'SearchableText_all\',\'\')\n
if search_all != "":\n
search_string += \' \' + \' \'.join(\'+\' + word for word in search_all.split(\' \'))\n
\n
# search without these words - every word prefixed by "-"\n
search_without = req.get(\'SearchableText_without\',\'\')\n
if search_without!="":\n
search_string += \' \' + \' \'.join(\'-\' + word for word in search_without.split(\' \'))\n
\n
# search limited to a certain date range - add "created:xxx"\n
daterange = req.get(\'created_within\',\'\')\n
if daterange!=\'\':\n
st+=\' created:\'+daterange\n
# portal type\n
doctype=req.get(\'search_portal_type\')\n
context.log(doctype)\n
if doctype==\'all\':doctype=None\n
if isinstance(doctype,str):\n
doctype=[doctype]\n
if doctype:\n
if len(doctype)==1:\n
st+=\' type:"%s"\' % doctype[0]\n
search_string += \' created:\' + daterange\n
\n
# only given portal_types - add "type:Type" or type:(Type1,Type2...)\n
portal_type_list = req.get(\'search_portal_type\')\n
if portal_type_list == \'all\':\n
portal_type_list=None\n
if isinstance(portal_type_list,str):\n
portal_type_list=[portal_type_list]\n
if portal_type_list:\n
if len(portal_type_list)==1:\n
search_string += \' type:"%s"\' % portal_type_list[0]\n
else:\n
st+=\' type:(%s)\' % \',\'.join(doctype)\n
ref=req.get(\'reference\')\n
if ref:st+=\' reference:%s\' % ref\n
ver=req.get(\'version\')\n
if ver:st+=\' version:%s\' % ver\n
search_string += \' type:(%s)\' % \',\'.join(portal_type_list)\n
\n
# search by reference\n
ref = req.get(\'reference\')\n
if ref:\n
search_string += \' reference:%s\' % ref\n
\n
# search by version\n
ver = req.get(\'version\')\n
if ver:\n
search_string += \' version:%s\' % ver\n
\n
# search by language\n
lng=req.get(\'language\')\n
if lng and lng!=\'0\':\n
st+=\' language:%s\' % lng\n
if lng and lng != \'0\':\n
search_string += \' language:%s\' % lng\n
\n
# category search\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
for category in context.Document_getBaseCategoryList():\n
category_value = req.get(\'search_\' + category)\n
if category_value:\n
search_string += \' %s:%s\' % (category, category_value)\n
\n
#only my docs\n
mine=req.get(\'mine\')\n
mine = req.get(\'mine\')\n
if mine:\n
st+=\' mine:yes\'\n
search_string += \' mine:yes\'\n
\n
# only newest versions\n
newest=req.get(\'newest\')\n
newest = req.get(\'newest\')\n
if newest:\n
st+=\' newest:yes\'\n
search_string += \' newest:yes\'\n
\n
# search mode\n
sm=req.get(\'search_mode\')\n
smmap={\'in_boolean_mode\':\'boolean\',\'with_query_expansion\':\'expanded\'}\n
if sm and smmap.has_key(sm):\n
st+=\' mode:%s\' % smmap[sm]\n
context.log(st)\n
return st\n
search_mode = req.get(\'search_mode\')\n
search_mode_map={\'in_boolean_mode\':\'boolean\',\'with_query_expansion\':\'expanded\'}\n
if search_mode and search_mode_map.has_key(search_mode):\n
search_string += \' mode:%s\' % search_mode_map[search_mode]\n
\n
return search_string\n
</string> </value>
</item>
<item>
......@@ -188,12 +203,12 @@ return st\n
<string>_getattr_</string>
<string>context</string>
<string>req</string>
<string>st</string>
<string>s_phrase</string>
<string>s_all</string>
<string>s_without</string>
<string>search_string</string>
<string>search_phrase</string>
<string>search_all</string>
<string>search_without</string>
<string>daterange</string>
<string>doctype</string>
<string>portal_type_list</string>
<string>None</string>
<string>isinstance</string>
<string>str</string>
......@@ -203,12 +218,12 @@ return st\n
<string>ver</string>
<string>lng</string>
<string>_getiter_</string>
<string>c</string>
<string>cval</string>
<string>category</string>
<string>category_value</string>
<string>mine</string>
<string>newest</string>
<string>sm</string>
<string>smmap</string>
<string>search_mode</string>
<string>search_mode_map</string>
</tuple>
</value>
</item>
......
......@@ -70,112 +70,116 @@
<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
The main search script. Receives one big string - a SearchableText, in\n
the search syntax, parses the string using external method parseSearchString,\n
then does the following:\n
- processes arguments for searching by any category (this requires SQLCatalog patch)\n
- selects search mode\n
- adds creation and modification date clauses\n
- searches\n
- if requested, filters result so that only the user\'s docs are returned\n
- if requested, filters result to return only the newest versions\n
\n
TODO: use catalog to get only the user\'s docs - this implementation is slow.\n
"""\n
\n
# if no args we return empty list\n
# we use only SearchableText - all params are passed through this\n
\n
sstr=context.REQUEST.get(\'SearchableText\')\n
# SearchableText can be supplied in request or stored in selection\n
sstr = context.REQUEST.get(\'SearchableText\')\n
if not sstr:\n
sstr=kw.get(\'SearchableText\')\n
if not sstr:return []\n
context.log(sstr)\n
sstr = kw.get(\'SearchableText\')\n
if not sstr: return []\n
\n
args=context.parseSearchString(sstr)\n
args = context.parseSearchString(sstr)\n
\n
# if no portal type specified, take all\n
if not args.has_key(\'portal_type\') or args[\'portal_type\']==():\n
args[\'portal_type\']=context.Base_getSearchableTypeList()\n
if not args.has_key(\'portal_type\') or args[\'portal_type\'] == ():\n
args[\'portal_type\'] = context.Base_getSearchableTypeList()\n
\n
# process searching by category\n
cats=[]\n
bases=context.portal_categories.getBaseCategoryList()\n
cats = []\n
bases = context.portal_categories.getBaseCategoryList()\n
for k,v in args.items():\n
if k in bases:\n
cats.append(\'/\'.join((k,v)))\n
if cats!=[]:\n
args[\'category\']=cats\n
cats.append(\'/\'.join((k, v)))\n
if cats != []:\n
args[\'category\'] = cats\n
\n
# expand simplified notation of search mode\n
mode=args.get(\'mode\')\n
modemap={\'natural\':0,\'boolean\':\'in_boolean_mode\',\'expanded\':\'with_query_expansion\'}\n
mode = args.get(\'mode\')\n
modemap = {\'natural\':0, \'boolean\':\'in_boolean_mode\', \'expanded\':\'with_query_expansion\'}\n
if mode and modemap.has_key(mode):\n
args[\'search_mode\']=modemap[mode]\n
\n
# user wants only his documents - we try to use Creator from compatibility table\n
if args.get(\'mine\'): \n
context.log(\'mine\')\n
from AccessControl import getSecurityManager\n
sm=getSecurityManager()\n
u=sm.getUser()\n
args[\'Creator\']=str(u)\n
args[\'search_mode\'] = modemap[mode]\n
\n
kw.update(args)\n
\n
# a hack because SQLCatalog wants table.key now \n
# dunno if it is a bug or a feature\n
if kw.has_key(\'SearchableText\'):\n
kw[\'full_text.SearchableText\']=kw[\'SearchableText\']\n
kw[\'full_text.SearchableText\'] = kw[\'SearchableText\']\n
kw.pop(\'SearchableText\')\n
\n
cf=kw.get(\'creation_from\')\n
ct=kw.get(\'creation_to\')\n
mf=kw.get(\'modification_from\')\n
mt=kw.get(\'modification_to\')\n
cf = kw.get(\'creation_from\')\n
ct = kw.get(\'creation_to\')\n
mf = kw.get(\'modification_from\')\n
mt = kw.get(\'modification_to\')\n
\n
wheres=[]\n
wheres = []\n
if cf:\n
wheres.append(\'creation_date>"\'+cf.strftime(\'%Y-%m-%d\')+\'"\')\n
wheres.append(\'creation_date>"\' + cf.strftime(\'%Y-%m-%d\') + \'"\')\n
if ct:\n
wheres.append(\'creation_date<"\'+cf.strftime(\'%Y-%m-%d\')+\'"\')\n
wheres.append(\'creation_date<"\' + cf.strftime(\'%Y-%m-%d\') + \'"\')\n
if mf:\n
wheres.append(\'modification_date>"\'+cf.strftime(\'%Y-%m-%d\')+\'"\')\n
wheres.append(\'modification_date>"\' + cf.strftime(\'%Y-%m-%d\') + \'"\')\n
if mt:\n
wheres.append(\'modification_date<"\'+cf.strftime(\'%Y-%m-%d\')+\'"\')\n
if wheres!=[]:\n
kw[\'where_expression\']=\' AND \'.join(wheres)\n
wheres.append(\'modification_date<"\' + cf.strftime(\'%Y-%m-%d\') + \'"\')\n
if wheres != []:\n
kw[\'where_expression\'] = \' AND \'.join(wheres)\n
\n
# now we search\n
# any language?\n
if kw.get(\'language\')==\'0\':kw.pop(\'language\')\n
if kw.get(\'language\') == \'0\': kw.pop(\'language\')\n
context.log(\'SEARCH:\',args)\n
res=context.portal_catalog(**kw)\n
res = context.portal_catalog(**kw)\n
\n
# user wants only his documents\n
#if args.get(\'mine\'): \n
# context.log(\'mine\')\n
# from AccessControl import getSecurityManager\n
# sm=getSecurityManager()\n
# u=sm.getUser()\n
# # now we need to filter by owner\n
# # some day we will do it in catalog\n
# res=[r for r in res if u.allowed(r.getObject(),(\'Owner\',))]\n
if args.get(\'mine\'): \n
context.log(\'mine\')\n
from AccessControl import getSecurityManager\n
sm = getSecurityManager()\n
u = sm.getUser()\n
# now we need to filter by owner\n
# some day we will do it in catalog\n
res = [r for r in res if u.allowed(r.getObject(), (\'Owner\',))]\n
\n
#...and now we check for only the newest versions\n
# but we need to preserve order\n
if args.get(\'newest\'):\n
context.log(\'newest\')\n
idx={} # for recording what we have where and in which version\n
newest=[]\n
counter=0\n
idx = {} # for keeping the last version of every reference\n
# this way we do reduce the number of docs very fast (without calling catalog)\n
newest = [] # for keeping order as it was\n
counter = 0\n
for r in res:\n
ref=r.getReference()\n
ref = r.getReference()\n
try:\n
ver=int(r.getVersion())\n
ver = int(r.getVersion())\n
except ValueError:\n
continue\n
if idx.has_key(ref):\n
if idx[ref][0]>=ver:\n
if idx[ref][0] >= ver:\n
continue\n
else:\n
del newest[idx[ref][1]]\n
counter-=1\n
counter -= 1\n
newest.append(r)\n
idx[ref]=(ver,counter)\n
counter+=1\n
res=newest\n
idx[ref] = (ver, counter)\n
counter += 1\n
# now that we have only one per reference, we can play with languages and revisions\n
res = [doc.getLatestVersionValue() for doc in newest]\n
\n
\n
return res\n
......@@ -243,11 +247,6 @@ return res\n
<string>v</string>
<string>mode</string>
<string>modemap</string>
<string>AccessControl</string>
<string>getSecurityManager</string>
<string>sm</string>
<string>u</string>
<string>str</string>
<string>cf</string>
<string>ct</string>
<string>mf</string>
......@@ -255,14 +254,21 @@ return res\n
<string>wheres</string>
<string>_apply_</string>
<string>res</string>
<string>AccessControl</string>
<string>getSecurityManager</string>
<string>sm</string>
<string>u</string>
<string>append</string>
<string>$append0</string>
<string>r</string>
<string>idx</string>
<string>newest</string>
<string>counter</string>
<string>r</string>
<string>ref</string>
<string>int</string>
<string>ver</string>
<string>ValueError</string>
<string>doc</string>
</tuple>
</value>
</item>
......@@ -279,7 +285,7 @@ return res\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Document_getAdvancedSearchResultList</string> </value>
<value> <string>Base_getAdvancedSearchResultList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -68,22 +68,30 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
<value> <string>"""\n
we search for docs that reference us in any way (reference only or more specific)\n
by making a union of a number of searches\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
and make sure we get latest/most relevant version\n
should be reimplemented in SQL some sunny day.\n
"""\n
ss=[]\n
if context.getReference() is None: return []\n
\n
ss = []\n
\n
if context.getReference() is None: \n
return []\n
\n
ss.append(context.getReference())\n
\n
if context.getLanguage() is not None:\n
ss.append(context.getReference()+\'-\'+context.getLanguage())\n
ss.append(context.getReference() + \'-\' + context.getLanguage())\n
if context.getVersion() is not None:\n
ss.append(context.getReference()+\'-\'+context.getLanguage()+\'-\'+context.getVersion())\n
ss.append(context.getReference() + \'-\' + context.getLanguage() + \'-\' + context.getVersion())\n
\n
lst=[]\n
for t in ss:\n
lst+=context.portal_catalog(SearchableText=\'%\'+t+\'%\')\n
lst += context.portal_catalog(SearchableText=\'%\' + t + \'%\')\n
\n
return lst\n
</string> </value>
</item>
......@@ -158,7 +166,7 @@ return lst\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Document_findWikiPredecessorList</string> </value>
<value> <string>Base_getImplicitPredecessorValueList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -68,19 +68,45 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>ob=state_change.object\n
kw=ob.REQUEST\n
f=kw.get(\'my_file\',None)\n
ob.log(script.getId(),ob.getRelativeUrl())\n
<value> <string encoding="cdata"><![CDATA[
"""\n
Called by document.getImplicitSuccessorValueList\n
Gets a list of dicts containing reference and/or version and/or language\n
and maybe some more things.\n
Returns a list of objects.\n
\n
if f is not None and f:\n
# if file uploaded, then:\n
fname=f.filename\n
ob.setPropertyListFromFilename(fname)\n
ob.setSourceReference(fname)\n
if not ob.getTitle():\n
ob.setTitle(fname)\n
</string> </value>
dummy simple implementation - if no version, then return the newest in the chosen language\n
or in any language if not specified\n
"""\n
\n
def findDocByReferenceDict(ref_dict):\n
reference=ref_dict.get(\'reference\')\n
if reference is None:\n
return\n
# assuming we want only the highest version:\n
searchargs = dict(reference=reference, portal_type=context.getPortalDocumentTypeList(), sort_on=\'version\', sort_order=\'descending\')\n
language = ref_dict.get(\'language\')\n
if language is not None:\n
searchargs[\'language\'] = language\n
version = ref_dict.get(\'version\')\n
if version is not None:\n
searchargs[\'version\']=version\n
res = list(context.portal_catalog(**searchargs))\n
if len(res)>0:\n
return res[0]\n
\n
res = []\n
\n
for ref_dict in reference_list:\n
ob = findDocByReferenceDict(ref_dict)\n
if ob is not None:\n
res.append(ob)\n
\n
return res\n
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -96,7 +122,7 @@ if f is not None and f:\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
<value> <string>reference_list</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -122,14 +148,14 @@ if f is not None and f:\n
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>state_change</string>
<string>_getattr_</string>
<string>reference_list</string>
<string>findDocByReferenceDict</string>
<string>res</string>
<string>_getiter_</string>
<string>ref_dict</string>
<string>ob</string>
<string>kw</string>
<string>None</string>
<string>f</string>
<string>script</string>
<string>fname</string>
<string>_getattr_</string>
</tuple>
</value>
</item>
......@@ -146,7 +172,7 @@ if f is not None and f:\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SetReferenceFromFilename</string> </value>
<value> <string>Base_getImplicitSuccessorValueList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -72,10 +72,12 @@
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
\n
base_category = context.getProperty(category)\n
if base_category is None:\n
return \'\'\n
\n
ob = context.restrictedTraverse(base_category, 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>
......@@ -129,7 +131,7 @@ return ob is not None and ob.getTitle() or \'\'\n
<string>category</string>
<string>_getattr_</string>
<string>context</string>
<string>cat_value</string>
<string>base_category</string>
<string>None</string>
<string>ob</string>
</tuple>
......
......@@ -72,11 +72,11 @@
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
ob_list = context.Base_getRelatedObjectValueList(category)\n
title_list = [o.getTitle() for o in ob_list]\n
\n
return filter(lambda t:t!=\'\', title_list)\n
</string> </value>
</item>
<item>
......@@ -99,7 +99,7 @@ return filter(lambda t:t!=\'\',title_list)\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>category</string> </value>
<value> <string>base_category</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -125,9 +125,10 @@ return filter(lambda t:t!=\'\',title_list)\n
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>category</string>
<string>base_category</string>
<string>_getattr_</string>
<string>context</string>
<string>category</string>
<string>ob_list</string>
<string>append</string>
<string>$append0</string>
......
......@@ -72,18 +72,17 @@
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
def getValueIfAvailable(cat_value):\n
ob=context.restrictedTraverse(cat_value,None)\n
category_list = context.getPropertyList(base_category)\n
if category_list is None:\n
return []\n
\n
def getValueIfAvailable(category):\n
ob = context.restrictedTraverse(category, None)\n
return ob \n
\n
ob_list=[getValueIfAvailable(c) for c in cat_value_list]\n
return ob_list\n
return [o for o in ob_list if o is not None]\n
ob_list = [getValueIfAvailable(category) for category in category_list]\n
return [o for o in object_list if o is not None]\n
</string> </value>
</item>
<item>
......@@ -106,7 +105,7 @@ return [o for o in ob_list if o is not None]\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>category</string> </value>
<value> <string>base_category</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -132,17 +131,18 @@ return [o for o in ob_list if o is not None]\n
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>category</string>
<string>base_category</string>
<string>_getattr_</string>
<string>context</string>
<string>cat_value_list</string>
<string>category_list</string>
<string>None</string>
<string>getValueIfAvailable</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>c</string>
<string>category</string>
<string>ob_list</string>
<string>object_list</string>
<string>o</string>
</tuple>
</value>
......
......@@ -68,11 +68,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>req=context.REQUEST\n
sstr=context.Base_assembleSearchString()\n
<value> <string>req = context.REQUEST\n
sstr = context.Base_assembleSearchString()\n
context.log(sstr)\n
req.set(\'SearchableText\',sstr)\n
return context.Base_advancedSearchResults()\n
req.set(\'SearchableText\', sstr)\n
return context.Base_viewAdvancedSearchResultList()\n
</string> </value>
</item>
<item>
......
......@@ -70,25 +70,37 @@
<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
This is used in listbox with search results - shows parts of the searchable text\n
of a document which contain searched words, highlighting the words.\n
Calls external method cutFound to get appropriately sliced result.\n
"""\n
tags=(\'<div style="font-weight:bold;display:inline;">\',\'</div>\')\n
trail=5\n
maxlines=5\n
txt=brain.getObject().SearchableText()\n
st=selection.params.get(\'SearchableText\')\n
if st is None:\n
# we should return something\n
return txt[min(len(txt)-300,200):500] # a somewhat arbitrary choice to trim searchable attrs\n
args=context.parseSearchString(st)\n
sw=args.get(\'SearchableText\')\n
if sw is None or sw==\'\':\n
# we should return something\n
return txt[min(len(txt)-300,200):500] # a somewhat arbitrary choice to trim searchable attrs\n
res=context.cutFound(context,txt,sw,tags,trail,maxlines)\n
return \' \'.join(map(str,res))\n
\n
# tags to surround words which were searched for\n
tags = (\'<div style="font-weight:bold;display:inline;">\', \'</div>\')\n
\n
# how many words to include before and after the highlighted word\n
trail = 5\n
\n
# maximum lines to show\n
maxlines = 5\n
\n
txt = brain.getObject().SearchableText()\n
search_string = selection.params.get(\'SearchableText\')\n
if search_string is None:\n
# if the searched text is empty (e.g. because the listbox uses its own method)\n
# we return something\n
return txt[min(len(txt) - 300, 200) : 500] # a somewhat arbitrary choice to trim searchable attrs\n
\n
search_argument_list = context.parseSearchString(search_string)\n
search_words = search_argument_list.get(\'SearchableText\')\n
if search_words is None or search_words == \'\':\n
# if the searched text is empty (e.g. because we used only parameters without pure searchable text)\n
# we return something\n
return txt[min(len(txt) - 300, 200) : 500] # a somewhat arbitrary choice to trim searchable attrs\n
\n
res = context.cutFound(context, txt, search_words, tags, trail, maxlines)\n
return \' \'.join(map(str, res))\n
]]></string> </value>
......@@ -140,14 +152,14 @@ return \' \'.join(map(str,res))\n
<string>maxlines</string>
<string>_getattr_</string>
<string>txt</string>
<string>st</string>
<string>search_string</string>
<string>None</string>
<string>_getitem_</string>
<string>min</string>
<string>len</string>
<string>context</string>
<string>args</string>
<string>sw</string>
<string>search_argument_list</string>
<string>search_words</string>
<string>res</string>
<string>map</string>
<string>str</string>
......
......@@ -68,8 +68,12 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>#XXX-JPS What is the use of this script ?\n
return context.getWikiSuccessorValueList()\n
<value> <string>"""\n
This is proxy to portal_catalog, with the sole purpose\n
of performing calls when proxy roles are needed\n
"""\n
\n
return context.portal_catalog(*a, **kw)\n
</string> </value>
</item>
<item>
......@@ -86,7 +90,19 @@ return context.getWikiSuccessorValueList()\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*a,**kw</string> </value>
<value> <string>*a, **kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Reviewer</string>
</tuple>
</value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -114,6 +130,7 @@ return context.getWikiSuccessorValueList()\n
<tuple>
<string>a</string>
<string>kw</string>
<string>_apply_</string>
<string>_getattr_</string>
<string>context</string>
</tuple>
......@@ -132,7 +149,7 @@ return context.getWikiSuccessorValueList()\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Document_listWikiSuccessor</string> </value>
<value> <string>Base_unrestrictedSearchResults</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -94,12 +94,13 @@
<key> <string>left</string> </key>
<value>
<list>
<string>SearchableText</string>
<string>SearchableText_any</string>
<string>SearchableText_all</string>
<string>SearchableText_phrase</string>
<string>SearchableText_without</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>
......@@ -113,6 +114,7 @@
<string>mine</string>
<string>newest</string>
<string>search_mode</string>
<string>my_created_within</string>
</list>
</value>
</item>
......
......@@ -14,7 +14,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>SearchableText</string> </value>
<value> <string>SearchableText_any</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -575,7 +575,7 @@
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>DMS_getAdvancedSearchResults</string> </value>
<value> <string>Base_getAdvancedSearchResultList</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -4,24 +4,14 @@
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
<string>Products.ERP5Form.Form</string>
<string>ERP5Form</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
......@@ -41,24 +31,7 @@
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
<dictionary/>
</value>
</item>
</dictionary>
......@@ -67,87 +40,112 @@
</value>
</item>
<item>
<key> <string>_body</string> </key>
<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>
<item>
<key> <string>_code</string> </key>
<key> <string>_objects</string> </key>
<value>
<none/>
<tuple/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
<key> <string>action</string> </key>
<value> <string>Base_edit</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>func_code</string> </key>
<key> <string>group_list</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</state>
</object>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
</list>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<key> <string>groups</string> </key>
<value>
<none/>
<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>left</string> </key>
<value>
<list>
<string>my_title</string>
</list>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list>
<string>my_reference</string>
</list>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>OOoDocument_postConversion</string> </value>
<value> <string>Base_viewLocalPermissionList</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Base_viewLocalPermission</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>Local Permissions</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>
......
......@@ -68,15 +68,25 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># customizeable function for incrementing version number\n
# it depends on a chosen version number format\n
# default is %03d\n
# version can be argument or from context\n
# TODO: version number format in preferences (?)\n
# use same pattern for correcting version numbers entered in other ways (Constraint?)\n
<value> <string>typetoext = {\n
\'Text\':(\'doc\', \'sxw\', \'odt\', \'txt\', \'rtf\'),\n
\'Spreadsheet\':(\'xls\', \'sxc\', \'ods\'),\n
\'Presentation\':(\'ppt\', \'odp\'),\n
\'Drawing\':(\'odg\',),\n
\'Image\':(\'jpg\', \'jpeg\', \'gif\', \'bmp\', \'png\'),\n
\'PDF\':(\'pdf\',),\n
}\n
\n
ver=ver or context.getVersion()\n
return \'%03d\' % (int(ver)+1)\n
multitypes = {\n
# \'Text\':(\'Text\', \'Memo\')\n
}\n
context.log(ext)\n
\n
for ptype, ext_list in typetoext.items():\n
if ext in ext_list:\n
return multitypes.get(ptype, (ptype,))\n
\n
return ()\n
</string> </value>
</item>
<item>
......@@ -93,7 +103,7 @@ return \'%03d\' % (int(ver)+1)\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>ver=None</string> </value>
<value> <string>ext</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -119,10 +129,14 @@ return \'%03d\' % (int(ver)+1)\n
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>ver</string>
<string>ext</string>
<string>typetoext</string>
<string>multitypes</string>
<string>_getattr_</string>
<string>context</string>
<string>int</string>
<string>_getiter_</string>
<string>ptype</string>
<string>ext_list</string>
</tuple>
</value>
</item>
......@@ -134,14 +148,12 @@ return \'%03d\' % (int(ver)+1)\n
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
</tuple>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Document_incrementVersion</string> </value>
<value> <string>ContributionTool_getCandidateTypeListByExtension</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -68,10 +68,19 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># implementation specific layer\n
# map document type id to portal type\n
# in stock dms not used\n
return\n
<value> <string>"""\n
Called by portal_contributions.getPropertyDictFromFilename\n
\n
Receives file name and a dict of properties found in file name by\n
using regular expression defined in preferences.\n
\n
If necessary can do additional things (like mapping\n
portal type id to portal type name).\n
\n
Type-based.\n
"""\n
\n
return property_dict\n
</string> </value>
</item>
<item>
......@@ -94,7 +103,7 @@ return\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>doctype_id</string> </value>
<value> <string>file_name, property_dict</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -114,13 +123,14 @@ return\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
<value> <int>2</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>doctype_id</string>
<string>file_name</string>
<string>property_dict</string>
</tuple>
</value>
</item>
......@@ -137,7 +147,7 @@ return\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Document_idToType</string> </value>
<value> <string>ContributionTool_getPropertyDictFromFileName</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -68,50 +68,42 @@
</item>
<item>
<key> <string>_body</string> </key>
<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
<value> <string>"""\n
Processes request of ContributionTool_viewContributeFileDialog\n
does what is necessary and calls portal_contributions.newContent\n
redirects to what is returned\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
props=context.Document_getPropertyListFromContent(context,data,None)\n
doctype=props.get(\'doctype\')\n
# then from filename\n
if doctype is None or doctype==\'\':\n
props=context.Document_getPropertiesFromFilename(context,fname)\n
context.log(props)\n
doctype_id=props.get(\'doctype_id\')\n
if doctype_id is not None:\n
doctype=context.Document_idToType(doctype_id)\n
context.log(doctype)\n
if doctype is None or doctype==\'\':\n
doctype=context.content_type_registry.findTypeName(fname,None,None)\n
context.log(fname,doctype)\n
if doctype is None or doctype==\'\':\n
raise Exception("content type for file %s not registered" % fname)\n
\n
# create content\n
# find appropriate module\n
mod=None\n
modlist=[m for m in context.getPortalObject().objectIds() if m.endswith(\'_module\')]\n
for mod in modlist:\n
mod=context.restrictedTraverse(mod,None)\n
if mod is None:\n
continue\n
if doctype in context.portal_types[mod.getPortalType()].allowed_content_types:\n
break\n
if mod is None:\n
raise Exception(\'could not find module for \'+doctype)\n
# create and populate object\n
ob=mod.newContent(portal_type=doctype)\n
ob.manage_upload(data)\n
ob.Document_setOtherProperties(uname)\n
ob.DMS_ingestFile(fname,data)\n
return ob\n
from Products.Formulator.Errors import FormValidationError\n
\n
translateString = context.Base_translateString\n
request = context.REQUEST\n
\n
# a workaround for a strange problem\n
# (if this line is not here, ZODB raises an exception when\n
# committing transaction)\n
del(kw[\'field_your_file\'])\n
\n
if kw[\'portal_type\'] == \'\':\n
# we don\'t want to set portal_type to \'\' :)\n
del(kw[\'portal_type\'])\n
\n
doc = context.portal_contributions.newContent(file=file, **kw)\n
\n
context.log(doc.getId(), doc.getRelativeUrl())\n
\n
msg = translateString("${portal_type} created successfully.", mapping = {\'portal_type\':doc.getPortalType()})\n
return context.Base_redirect(\'view\', keep_items = {\'portal_status_message\':msg})\n
\n
\n
# we leave this for later, because this way it is easier to debug\n
try:\n
doc = context.portal_contributions.newContent(file=file, **kw)\n
if doc is None:\n
raise ValueError(\'new content could not be generated for unknown reason (check system log)\')\n
except Exception, e:\n
msg = translateString("Sorry, object could not be created. Error returned was: ${exception}.", mapping = {\'exception\':str(e)})\n
return context.Base_redirect(dialog_id, keep_items={\'portal_status_message\':msg})\n
</string> </value>
</item>
<item>
......@@ -128,7 +120,7 @@ return ob\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>fname,data, doctype=None,uname=None</string> </value>
<value> <string>dialog_id=None, form_id=None, file=None, **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -148,30 +140,32 @@ return ob\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>4</int> </value>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>fname</string>
<string>data</string>
<string>doctype</string>
<string>uname</string>
<string>dialog_id</string>
<string>form_id</string>
<string>file</string>
<string>kw</string>
<string>Products.Formulator.Errors</string>
<string>FormValidationError</string>
<string>_getattr_</string>
<string>context</string>
<string>translateString</string>
<string>request</string>
<string>_write_</string>
<string>_getitem_</string>
<string>_apply_</string>
<string>doc</string>
<string>msg</string>
<string>None</string>
<string>props</string>
<string>doctype_id</string>
<string>ValueError</string>
<string>Exception</string>
<string>mod</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>m</string>
<string>modlist</string>
<string>_getitem_</string>
<string>ob</string>
<string>e</string>
<string>str</string>
</tuple>
</value>
</item>
......@@ -186,12 +180,13 @@ return ob\n
<tuple>
<none/>
<none/>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Document_createObjectFromFile</string> </value>
<value> <string>ContributionTool_newContent</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>ContributionTool_newContent</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>your_classification</string>
<string>your_portal_type</string>
<string>your_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>ContributionTool_viewContributeFileDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>ContributionTool_contributeFile</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>Contribute 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>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.Formulator.StandardFields</string>
<string>FileField</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_file</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>File to upload</string> </value>
</item>
</dictionary>
</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>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/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ContributionTool_viewMyContentList</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>ContributionTool_viewMyContentList</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>
......@@ -386,6 +386,18 @@
<string>reference</string>
<string>Reference</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>language</string>
<string>Language</string>
</tuple>
<tuple>
<string>revision</string>
<string>Revision</string>
</tuple>
<tuple>
<string>short_title</string>
<string>Short Title</string>
......@@ -398,10 +410,6 @@
<string>description</string>
<string>Description</string>
</tuple>
<tuple>
<string>version</string>
<string>Version</string>
</tuple>
<tuple>
<string>int_index</string>
<string>Index</string>
......
......@@ -68,19 +68,22 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># XXX-JPS reformat code as explained in Base_assembleSearchString\n
"""\n
XXX-JPS Description here please\n
<value> <string>"""\n
Public interface to convert API method - sets additional headers and returns\n
output (a file in desired format).\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
context.log(\'format\',format)\n
filename=\'%s.%s\' % ((filename or context.title_or_id(), format))\n
if type==\'application/zip\':\n
filename+=\'.zip\'\n
request = context.REQUEST\n
response = request.RESPONSE\n
\n
data = context.index_html(request, response, format=format, force=force)\n
typ = response.headers.get(\'content-type\')\n
\n
filename = \'%s.%s\' % ((filename or context.title_or_id(), format))\n
if typ == \'application/zip\':\n
filename += \'.zip\'\n
\n
\n
request.RESPONSE.setHeader(\'Content-disposition\', \'attachment;; filename="%s"\' % filename)\n
return data\n
</string> </value>
......@@ -99,7 +102,7 @@ return data\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>filename, format</string> </value>
<value> <string>filename=None, format=None, force=0</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -119,7 +122,7 @@ return data\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>2</int> </value>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
......@@ -127,12 +130,13 @@ return data\n
<tuple>
<string>filename</string>
<string>format</string>
<string>force</string>
<string>_getattr_</string>
<string>context</string>
<string>_getiter_</string>
<string>type</string>
<string>data</string>
<string>request</string>
<string>response</string>
<string>data</string>
<string>typ</string>
</tuple>
</value>
</item>
......@@ -144,12 +148,16 @@ return data\n
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
<tuple>
<none/>
<none/>
<int>0</int>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>OOoDocument_getTargetFile</string> </value>
<value> <string>Document_convert</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
......
......@@ -34,7 +34,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Document_getPropertyListFromMail</string> </value>
<value> <string>Document_getPropertyDictFromMail</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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