diff --git a/bt5/erp5_data_set/ActionTemplateItem/portal_types/Data%20Set%20Module/view.xml b/bt5/erp5_data_set/ActionTemplateItem/portal_types/Data%20Set%20Module/view.xml new file mode 100644 index 0000000000000000000000000000000000000000..fa004cbe2813005822b431edab90d563e8170d1f --- /dev/null +++ b/bt5/erp5_data_set/ActionTemplateItem/portal_types/Data%20Set%20Module/view.xml @@ -0,0 +1,83 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ActionInformation" module="Products.CMFCore.ActionInformation"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>action</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>categories</string> </key> + <value> + <tuple> + <string>action_type/object_list</string> + </tuple> + </value> + </item> + <item> + <key> <string>category</string> </key> + <value> <string>object_list</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>portal_type</string> </key> + <value> <string>Action Information</string> </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> + <global name="Expression" module="Products.CMFCore.Expression"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>text</string> </key> + <value> <string>string:${object_url}/DataSetModule_viewDataSetList</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/ActionTemplateItem/portal_types/Data%20Set/view.xml b/bt5/erp5_data_set/ActionTemplateItem/portal_types/Data%20Set/view.xml new file mode 100644 index 0000000000000000000000000000000000000000..3dc432a062bdc021e09a4680afa447cf4fd790eb --- /dev/null +++ b/bt5/erp5_data_set/ActionTemplateItem/portal_types/Data%20Set/view.xml @@ -0,0 +1,85 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ActionInformation" module="Products.CMFCore.ActionInformation"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>action</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>categories</string> </key> + <value> + <tuple> + <string>action_type/object_view</string> + </tuple> + </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> + <none/> + </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>portal_type</string> </key> + <value> <string>Action Information</string> </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> + <global name="Expression" module="Products.CMFCore.Expression"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>text</string> </key> + <value> <string>string:${object_url}/DataSet_view</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/DocumentTemplateItem/DataSet.py b/bt5/erp5_data_set/DocumentTemplateItem/DataSet.py new file mode 100644 index 0000000000000000000000000000000000000000..5a691de632f9f35b9e68701fc02b7b4685b45042 --- /dev/null +++ b/bt5/erp5_data_set/DocumentTemplateItem/DataSet.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2010 Nexedi SA and Contributors. All Rights Reserved. +# Fabien Morin <fabien@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +from AccessControl import ClassSecurityInfo +from Products.ERP5Type import Permissions, PropertySheet +from Products.ERP5.Document.Resource import Resource + +class DataSet(Resource): + """ + """ + + meta_type = 'ERP5 Data Set' + portal_type = 'Data Set' + add_permission = Permissions.AddPortalContent + + # Declarative security + security = ClassSecurityInfo() + security.declareObjectProtected(Permissions.AccessContentsInformation) + + # Declarative properties + property_sheets = ( PropertySheet.TextDocument, + PropertySheet.Document, + PropertySheet.Version, + PropertySheet.Url, + PropertySheet.Data, + PropertySheet.Task, + PropertySheet.TranslatableDescription, + PropertySheet.DataSet, + ) + # content_type property is also a method from PortalFolder, so we need a + # valid type by default. + content_type = '' diff --git a/bt5/erp5_data_set/ModuleTemplateItem/data_set_module.xml b/bt5/erp5_data_set/ModuleTemplateItem/data_set_module.xml new file mode 100644 index 0000000000000000000000000000000000000000..b7d09aa81f52ee7c3a2b8b43a96e3cba31cf3e60 --- /dev/null +++ b/bt5/erp5_data_set/ModuleTemplateItem/data_set_module.xml @@ -0,0 +1,100 @@ +<module> + <category_list> + <category>business_application/data_publica</category> + </category_list> + <id>data_set_module</id> + <permission_list> + <permission type='tuple'> + <name>Access Transient Objects</name> + <role>Assignee</role> + <role>Assignor</role> + <role>Associate</role> + <role>Auditor</role> + <role>Author</role> + <role>Manager</role> + </permission> + <permission type='tuple'> + <name>Access contents information</name> + <role>Anonymous</role> + <role>Assignee</role> + <role>Assignor</role> + <role>Associate</role> + <role>Auditor</role> + <role>Author</role> + <role>Manager</role> + </permission> + <permission type='tuple'> + <name>Access session data</name> + <role>Assignee</role> + <role>Assignor</role> + <role>Associate</role> + <role>Auditor</role> + <role>Author</role> + <role>Manager</role> + </permission> + <permission type='tuple'> + <name>Add portal content</name> + <role>Assignor</role> + <role>Author</role> + <role>Manager</role> + </permission> + <permission type='tuple'> + <name>Add portal folders</name> + <role>Assignor</role> + <role>Author</role> + <role>Manager</role> + </permission> + <permission type='tuple'> + <name>Change local roles</name> + <role>Assignor</role> + <role>Manager</role> + </permission> + <permission type='tuple'> + <name>Copy or Move</name> + <role>Assignee</role> + <role>Assignor</role> + <role>Associate</role> + <role>Auditor</role> + <role>Author</role> + <role>Manager</role> + </permission> + <permission type='tuple'> + <name>Delete objects</name> + <role>Assignor</role> + <role>Manager</role> + </permission> + <permission type='tuple'> + <name>List folder contents</name> + <role>Assignee</role> + <role>Assignor</role> + <role>Associate</role> + <role>Auditor</role> + <role>Author</role> + <role>Manager</role> + </permission> + <permission type='tuple'> + <name>Modify portal content</name> + <role>Assignor</role> + <role>Manager</role> + </permission> + <permission type='tuple'> + <name>View</name> + <role>Assignee</role> + <role>Assignor</role> + <role>Associate</role> + <role>Auditor</role> + <role>Manager</role> + </permission> + <permission type='tuple'> + <name>View History</name> + <role>Assignee</role> + <role>Assignor</role> + <role>Associate</role> + <role>Auditor</role> + <role>Author</role> + <role>Manager</role> + </permission> + </permission_list> + <portal_type>Data Set Module</portal_type> + <title>Data Sets</title> +</module> \ No newline at end of file diff --git a/bt5/erp5_data_set/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml b/bt5/erp5_data_set/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml new file mode 100644 index 0000000000000000000000000000000000000000..499f04404d27e473a2bc18477c0f27df2284d1d8 --- /dev/null +++ b/bt5/erp5_data_set/PortalTypeAllowedContentTypeTemplateItem/allowed_content_types.xml @@ -0,0 +1,9 @@ +<allowed_content_type_list> + <portal_type id="Data Set"> + <item>Purchase Supply Line</item> + <item>Sale Supply Line</item> + </portal_type> + <portal_type id="Data Set Module"> + <item>Data Set</item> + </portal_type> +</allowed_content_type_list> \ No newline at end of file diff --git a/bt5/erp5_data_set/PortalTypeBaseCategoryTemplateItem/base_category_list.xml b/bt5/erp5_data_set/PortalTypeBaseCategoryTemplateItem/base_category_list.xml new file mode 100644 index 0000000000000000000000000000000000000000..a4bd49876a7d1d460c77ee04c7f68e655de62112 --- /dev/null +++ b/bt5/erp5_data_set/PortalTypeBaseCategoryTemplateItem/base_category_list.xml @@ -0,0 +1,5 @@ +<base_category_list> + <portal_type id="Data Set Module"> + <item>business_application</item> + </portal_type> +</base_category_list> \ No newline at end of file diff --git a/bt5/erp5_data_set/PortalTypeHiddenContentTypeTemplateItem/hidden_content_type_list.xml b/bt5/erp5_data_set/PortalTypeHiddenContentTypeTemplateItem/hidden_content_type_list.xml new file mode 100644 index 0000000000000000000000000000000000000000..513abc9f50d690f8ef690aee3251ab6a185f8965 --- /dev/null +++ b/bt5/erp5_data_set/PortalTypeHiddenContentTypeTemplateItem/hidden_content_type_list.xml @@ -0,0 +1,6 @@ +<hidden_content_type_list> + <portal_type id="Data Set"> + <item>Purchase Supply Line</item> + <item>Sale Supply Line</item> + </portal_type> +</hidden_content_type_list> \ No newline at end of file diff --git a/bt5/erp5_data_set/PortalTypeTemplateItem/portal_types/Data%20Set%20Module.xml b/bt5/erp5_data_set/PortalTypeTemplateItem/portal_types/Data%20Set%20Module.xml new file mode 100644 index 0000000000000000000000000000000000000000..25e78e5018027dfc79269979aab277e0a395ee41 --- /dev/null +++ b/bt5/erp5_data_set/PortalTypeTemplateItem/portal_types/Data%20Set%20Module.xml @@ -0,0 +1,137 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Base Type" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_property_domain_dict</string> </key> + <value> + <dictionary> + <item> + <key> <string>short_title</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>title</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>content_icon</string> </key> + <value> <string>folder_icon.gif</string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string>\n + A Folder is a subclass of Base but not of XMLObject.\n + Folders are not considered as documents and are therefore\n + not synchronisable.\n +\n + ERP5 folders are implemented as CMFBTreeFolder objects\n + and can store up to a million documents on a standard\n + computer.\n + ERP5 folders will eventually use in the near future the\n + AdaptableStorage implementation in order to reach performances\n + of 10 or 100 millions of documents in a single folder.\n +\n + ERP5 folders include an automatic id generation feature\n + which allows user not to define an id when they create\n + a new document in a folder.\n +\n + ERP5 folders use the ZSQLCatalog to search for objects\n + or display content. This requires a method called\n + *z_search_folder* to be put inside the ZSQLCatalog object\n + of the ERP5 portal.\n +\n + An ERP5 Binder document class will eventually be defined\n + in order to implement a binder of documents which can itself\n + be categorized.\n +</string> </value> + </item> + <item> + <key> <string>factory</string> </key> + <value> <string>addFolder</string> </value> + </item> + <item> + <key> <string>group_list</string> </key> + <value> + <tuple> + <string>module</string> + </tuple> + </value> + </item> + <item> + <key> <string>icon</string> </key> + <value> <string>document_icon.gif</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Data Set Module</string> </value> + </item> + <item> + <key> <string>immediate_view</string> </key> + <value> <string>Folder_view</string> </value> + </item> + <item> + <key> <string>meta_type</string> </key> + <value> <string>ERP5 Folder</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Base Type</string> </value> + </item> + <item> + <key> <string>product</string> </key> + <value> <string>ERP5Type</string> </value> + </item> + <item> + <key> <string>type_class</string> </key> + <value> <string>Folder</string> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>domain_name</string> </key> + <value> <string>erp5_ui</string> </value> + </item> + <item> + <key> <string>property_name</string> </key> + <value> <string>short_title</string> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="3" aka="AAAAAAAAAAM="> + <pickle> + <global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>domain_name</string> </key> + <value> <string>erp5_ui</string> </value> + </item> + <item> + <key> <string>property_name</string> </key> + <value> <string>title</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/PortalTypeTemplateItem/portal_types/Data%20Set.xml b/bt5/erp5_data_set/PortalTypeTemplateItem/portal_types/Data%20Set.xml new file mode 100644 index 0000000000000000000000000000000000000000..c4c8f8fa2f1bb86d1ad4f155f0d5f95a12b0527c --- /dev/null +++ b/bt5/erp5_data_set/PortalTypeTemplateItem/portal_types/Data%20Set.xml @@ -0,0 +1,176 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Base Type" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_property_domain_dict</string> </key> + <value> + <dictionary> + <item> + <key> <string>description</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>short_title</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> + </item> + <item> + <key> <string>title</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> + </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>content_icon</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string>ERP5 default document. Supports synchronisation and XML.</string> </value> + </item> + <item> + <key> <string>factory</string> </key> + <value> <string>addDataSet</string> </value> + </item> + <item> + <key> <string>group_list</string> </key> + <value> + <tuple> + <string>product</string> + </tuple> + </value> + </item> + <item> + <key> <string>icon</string> </key> + <value> <string>document_icon.gif</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Data Set</string> </value> + </item> + <item> + <key> <string>immediate_view</string> </key> + <value> <string>XMLObject_view</string> </value> + </item> + <item> + <key> <string>init_script</string> </key> + <value> <string>Document_setStartDate</string> </value> + </item> + <item> + <key> <string>meta_type</string> </key> + <value> <string>ERP5 XML Object</string> </value> + </item> + <item> + <key> <string>permission</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Base Type</string> </value> + </item> + <item> + <key> <string>product</string> </key> + <value> <string>ERP5Type</string> </value> + </item> + <item> + <key> <string>searchable_text_method_id</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>searchable_text_property_id</string> </key> + <value> + <tuple> + <string>title</string> + <string>description</string> + <string>subject_list</string> + </tuple> + </value> + </item> + <item> + <key> <string>type_class</string> </key> + <value> <string>DataSet</string> </value> + </item> + <item> + <key> <string>type_interface</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>type_mixin</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>domain_name</string> </key> + <value> <string>content_translation</string> </value> + </item> + <item> + <key> <string>property_name</string> </key> + <value> <string>description</string> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="3" aka="AAAAAAAAAAM="> + <pickle> + <global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>domain_name</string> </key> + <value> <string>erp5_content</string> </value> + </item> + <item> + <key> <string>property_name</string> </key> + <value> <string>short_title</string> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="4" aka="AAAAAAAAAAQ="> + <pickle> + <global name="TranslationInformation" module="Products.ERP5Type.TranslationProviderBase"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>domain_name</string> </key> + <value> <string>content_translation</string> </value> + </item> + <item> + <key> <string>property_name</string> </key> + <value> <string>title</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml b/bt5/erp5_data_set/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml new file mode 100644 index 0000000000000000000000000000000000000000..b7924397b8e41d29cdeb473393c342550f8f3144 --- /dev/null +++ b/bt5/erp5_data_set/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml @@ -0,0 +1,6 @@ +<workflow_chain> + <chain> + <type>Data Set</type> + <workflow>document_publication_workflow, edit_workflow</workflow> + </chain> +</workflow_chain> \ No newline at end of file diff --git a/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet.xml b/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet.xml new file mode 100644 index 0000000000000000000000000000000000000000..7bd300fc64e319adbed180a355e7e208fc9b2cd9 --- /dev/null +++ b/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet.xml @@ -0,0 +1,64 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Property Sheet" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_count</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>_mt_index</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> + </item> + <item> + <key> <string>_tree</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>DataSet</string> </value> + </item> + <item> + <key> <string>last_id</string> </key> + <value> <string>5</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Property Sheet</string> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="Length" module="BTrees.Length"/> + </pickle> + <pickle> <int>0</int> </pickle> + </record> + <record id="3" aka="AAAAAAAAAAM="> + <pickle> + <global name="OOBTree" module="BTrees.OOBTree"/> + </pickle> + <pickle> + <none/> + </pickle> + </record> + <record id="4" aka="AAAAAAAAAAQ="> + <pickle> + <global name="OOBTree" module="BTrees.OOBTree"/> + </pickle> + <pickle> + <none/> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet/activity_category.xml b/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet/activity_category.xml new file mode 100644 index 0000000000000000000000000000000000000000..1f4a98224406dd284bc503788d0761b06abfa0f1 --- /dev/null +++ b/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet/activity_category.xml @@ -0,0 +1,20 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Category Property" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>activity_category</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Category Property</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet/mime_type_category.xml b/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet/mime_type_category.xml new file mode 100644 index 0000000000000000000000000000000000000000..85125a119ec7acbe92aa9a34d22c8a03d77c34e5 --- /dev/null +++ b/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet/mime_type_category.xml @@ -0,0 +1,20 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Category Property" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>mime_type_category</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Category Property</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet/publication_section_category.xml b/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet/publication_section_category.xml new file mode 100644 index 0000000000000000000000000000000000000000..ff7f68015db33d9502f8e8c3bf536d1e23e6b2de --- /dev/null +++ b/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet/publication_section_category.xml @@ -0,0 +1,20 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Category Property" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>publication_section_category</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Category Property</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet/purchase_supply_line_property.xml b/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet/purchase_supply_line_property.xml new file mode 100644 index 0000000000000000000000000000000000000000..42a2fc4e913cfcf1c4eac757084fafd8eb5d6a83 --- /dev/null +++ b/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet/purchase_supply_line_property.xml @@ -0,0 +1,97 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Acquired Property" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_local_properties</string> </key> + <value> + <tuple> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>mode</string> </value> + </item> + <item> + <key> <string>type</string> </key> + <value> <string>string</string> </value> + </item> + </dictionary> + </tuple> + </value> + </item> + <item> + <key> <string>acquisition_base_category</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>acquisition_object_id</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>alt_accessor_id</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>categories</string> </key> + <value> + <tuple> + <string>elementary_type/content</string> + </tuple> + </value> + </item> + <item> + <key> <string>content_acquired_property_id</string> </key> + <value> + <tuple> + <string>source_uid</string> + <string>source_title</string> + <string>source_value_list</string> + </tuple> + </value> + </item> + <item> + <key> <string>content_portal_type</string> </key> + <value> <string>python: (\'Purchase Supply Line\',)</string> </value> + </item> + <item> + <key> <string>content_translation_acquired_property_id</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>purchase_supply_line_property</string> </value> + </item> + <item> + <key> <string>mode</string> </key> + <value> <string>w</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Acquired Property</string> </value> + </item> + <item> + <key> <string>storage_id</string> </key> + <value> <string>default_psl</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet/region_category.xml b/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet/region_category.xml new file mode 100644 index 0000000000000000000000000000000000000000..cd217bd988a42cb78baf7964679248d5c61d0371 --- /dev/null +++ b/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet/region_category.xml @@ -0,0 +1,20 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Category Property" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>region_category</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Category Property</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet/sale_supply_line_property.xml b/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet/sale_supply_line_property.xml new file mode 100644 index 0000000000000000000000000000000000000000..e316366de041f3e57c4ed55ebb8653e34b2c9827 --- /dev/null +++ b/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/DataSet/sale_supply_line_property.xml @@ -0,0 +1,127 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Acquired Property" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_local_properties</string> </key> + <value> + <tuple> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>mode</string> </value> + </item> + <item> + <key> <string>type</string> </key> + <value> <string>string</string> </value> + </item> + </dictionary> + </tuple> + </value> + </item> + <item> + <key> <string>acquisition_base_category</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>acquisition_object_id</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>alt_accessor_id</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>categories</string> </key> + <value> + <tuple> + <string>elementary_type/content</string> + </tuple> + </value> + </item> + <item> + <key> <string>content_acquired_property_id</string> </key> + <value> + <tuple> + <string>base_price</string> + <string>id</string> + <string>priced_quantity</string> + <string>price_currency</string> + <string>price_currency_title</string> + <string>source</string> + <string>destination</string> + <string>source_title</string> + <string>destination_title</string> + <string>source_value</string> + <string>destination_value</string> + <string>quantity_step</string> + <string>priced_quantity</string> + <string>start_date</string> + <string>stop_date</string> + <string>start_date_range_max</string> + <string>start_date_range_min</string> + <string>comment</string> + <string>source_reference</string> + <string>destination_reference</string> + <string>p_variation_base_category_list</string> + <string>source_account</string> + <string>min_delay</string> + <string>max_delay</string> + <string>min_flow</string> + <string>max_flow</string> + <string>min_stock</string> + <string>max_stock</string> + <string>aggregate</string> + <string>aggregate_value</string> + <string>aggregate_value_list</string> + <string>aggregate_title</string> + <string>aggregate_uid</string> + </tuple> + </value> + </item> + <item> + <key> <string>content_portal_type</string> </key> + <value> <string>python: (\'Sale Supply Line\',)</string> </value> + </item> + <item> + <key> <string>content_translation_acquired_property_id</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>sale_supply_line_property</string> </value> + </item> + <item> + <key> <string>mode</string> </key> + <value> <string>w</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Acquired Property</string> </value> + </item> + <item> + <key> <string>storage_id</string> </key> + <value> <string>default_ssl</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/TranslatableDescription.xml b/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/TranslatableDescription.xml new file mode 100644 index 0000000000000000000000000000000000000000..b6b98e9592694c7b7751e2e7494fa7e39b3dd092 --- /dev/null +++ b/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/TranslatableDescription.xml @@ -0,0 +1,64 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Property Sheet" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_count</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>_mt_index</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> + </item> + <item> + <key> <string>_tree</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>TranslatableDescription</string> </value> + </item> + <item> + <key> <string>last_id</string> </key> + <value> <string>1</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Property Sheet</string> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="Length" module="BTrees.Length"/> + </pickle> + <pickle> <int>0</int> </pickle> + </record> + <record id="3" aka="AAAAAAAAAAM="> + <pickle> + <global name="OOBTree" module="BTrees.OOBTree"/> + </pickle> + <pickle> + <none/> + </pickle> + </record> + <record id="4" aka="AAAAAAAAAAQ="> + <pickle> + <global name="OOBTree" module="BTrees.OOBTree"/> + </pickle> + <pickle> + <none/> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/TranslatableDescription/description_property.xml b/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/TranslatableDescription/description_property.xml new file mode 100644 index 0000000000000000000000000000000000000000..18950c4694d8ebe257eff5b1bbc70c674fe7d571 --- /dev/null +++ b/bt5/erp5_data_set/PropertySheetTemplateItem/portal_property_sheets/TranslatableDescription/description_property.xml @@ -0,0 +1,63 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Standard Property" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_local_properties</string> </key> + <value> + <tuple> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>mode</string> </value> + </item> + <item> + <key> <string>type</string> </key> + <value> <string>string</string> </value> + </item> + </dictionary> + </tuple> + </value> + </item> + <item> + <key> <string>categories</string> </key> + <value> + <tuple> + <string>elementary_type/text</string> + </tuple> + </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>description_property</string> </value> + </item> + <item> + <key> <string>mode</string> </key> + <value> <string>w</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Standard Property</string> </value> + </item> + <item> + <key> <string>property_default</string> </key> + <value> <string>python: \'\'</string> </value> + </item> + <item> + <key> <string>translatable</string> </key> + <value> <int>1</int> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set.xml b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set.xml new file mode 100644 index 0000000000000000000000000000000000000000..9e4d556c0294c036bb993b3fa51435a1531db26e --- /dev/null +++ b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set.xml @@ -0,0 +1,32 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Folder" module="OFS.Folder"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_local_properties</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>_objects</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>erp5_data_set</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSetModule_viewDataSetList.xml b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSetModule_viewDataSetList.xml new file mode 100644 index 0000000000000000000000000000000000000000..55ccedc0b6003b139c43d4db613dab321fcf1493 --- /dev/null +++ b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSetModule_viewDataSetList.xml @@ -0,0 +1,152 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ERP5Form" module="Products.ERP5Form.Form"/> + </pickle> + <pickle> + <dictionary> + <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>Base_doSelect</string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>edit_order</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>encoding</string> </key> + <value> <string>UTF-8</string> </value> + </item> + <item> + <key> <string>enctype</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>group_list</string> </key> + <value> + <list> + <string>left</string> + <string>right</string> + <string>center</string> + <string>bottom</string> + <string>hidden</string> + </list> + </value> + </item> + <item> + <key> <string>groups</string> </key> + <value> + <dictionary> + <item> + <key> <string>bottom</string> </key> + <value> + <list> + <string>listbox</string> + </list> + </value> + </item> + <item> + <key> <string>center</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>left</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>right</string> </key> + <value> + <list/> + </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>DataSetModule_viewDataSetList</string> </value> + </item> + <item> + <key> <string>method</string> </key> + <value> <string>POST</string> </value> + </item> + <item> + <key> <string>name</string> </key> + <value> <string>DataSetModule_viewDataSetList</string> </value> + </item> + <item> + <key> <string>pt</string> </key> + <value> <string>form_list</string> </value> + </item> + <item> + <key> <string>row_length</string> </key> + <value> <int>4</int> </value> + </item> + <item> + <key> <string>stored_encoding</string> </key> + <value> <string>UTF-8</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Data Sets</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> + <item> + <key> <string>update_action_title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSetModule_viewDataSetList/listbox.xml b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSetModule_viewDataSetList/listbox.xml new file mode 100644 index 0000000000000000000000000000000000000000..6b1b5a793cd4d374cae5cbe0941a8936fb8ce253 --- /dev/null +++ b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSetModule_viewDataSetList/listbox.xml @@ -0,0 +1,214 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>delegated_list</string> </key> + <value> + <list> + <string>columns</string> + <string>css_class</string> + <string>domain_root_list</string> + <string>domain_tree</string> + <string>portal_types</string> + <string>search_columns</string> + <string>selection_name</string> + <string>title</string> + </list> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>listbox</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>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>columns</string> </key> + <value> + <list> + <tuple> + <string>title</string> + <string>Title</string> + </tuple> + <tuple> + <string>reference</string> + <string>Reference</string> + </tuple> + <tuple> + <string>region_title</string> + <string>Region</string> + </tuple> + <tuple> + <string>activity_title</string> + <string>Activity</string> + </tuple> + <tuple> + <string>creation_date</string> + <string>Date</string> + </tuple> + <tuple> + <string>translated_validation_state_title</string> + <string>State</string> + </tuple> + </list> + </value> + </item> + <item> + <key> <string>css_class</string> </key> + <value> <string>hidden_label</string> </value> + </item> + <item> + <key> <string>domain_root_list</string> </key> + <value> + <list> + <tuple> + <string>update_frequency</string> + <string>Update Frequency</string> + </tuple> + <tuple> + <string>activity</string> + <string>Activity</string> + </tuple> + </list> + </value> + </item> + <item> + <key> <string>domain_tree</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>field_id</string> </key> + <value> <string>my_list_mode_listbox</string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string>Base_viewFieldLibrary</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> + <list> + <tuple> + <string>Data Set</string> + <string>Data Set</string> + </tuple> + </list> + </value> + </item> + <item> + <key> <string>portal_types</string> </key> + <value> + <list> + <tuple> + <string>Data Set</string> + <string>Data Set</string> + </tuple> + </list> + </value> + </item> + <item> + <key> <string>search_columns</string> </key> + <value> + <list> + <tuple> + <string>title</string> + <string>Title</string> + </tuple> + <tuple> + <string>reference</string> + <string>Reference</string> + </tuple> + <tuple> + <string>region_title</string> + <string>Region</string> + </tuple> + <tuple> + <string>activity_title</string> + <string>Activity</string> + </tuple> + <tuple> + <string>creation_date</string> + <string>Date</string> + </tuple> + <tuple> + <string>translated_validation_state_title</string> + <string>State</string> + </tuple> + </list> + </value> + </item> + <item> + <key> <string>selection_name</string> </key> + <value> <string>data_set_module_selection</string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string>Click to edit the target</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Data Sets</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view.xml b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view.xml new file mode 100644 index 0000000000000000000000000000000000000000..7c1ae5803c07c27b7046804742e3eaa46ddc4665 --- /dev/null +++ b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view.xml @@ -0,0 +1,165 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ERP5Form" module="Products.ERP5Form.Form"/> + </pickle> + <pickle> + <dictionary> + <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>Base_edit</string> </value> + </item> + <item> + <key> <string>description</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>edit_order</string> </key> + <value> + <list/> + </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 (Document Reference)</string> + <string>right (Publication Information)</string> + <string>center</string> + <string>bottom (Preview)</string> + <string>hidden</string> + </list> + </value> + </item> + <item> + <key> <string>groups</string> </key> + <value> + <dictionary> + <item> + <key> <string>bottom (Preview)</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>center</string> </key> + <value> + <list> + <string>my_url_string</string> + <string>my_description</string> + </list> + </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>left (Document Reference)</string> </key> + <value> + <list> + <string>my_title</string> + <string>my_reference</string> + <string>my_content_type</string> + <string>my_update_frequency</string> + <string>my_default_purchase_supply_line_source_title</string> + <string>my_default_sale_supply_line_aggregate_title</string> + </list> + </value> + </item> + <item> + <key> <string>right (Publication Information)</string> </key> + <value> + <list> + <string>my_activity_list</string> + <string>my_region_list</string> + <string>my_subject_list</string> + <string>my_translated_validation_state_title</string> + </list> + </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>DataSet_view</string> </value> + </item> + <item> + <key> <string>method</string> </key> + <value> <string>POST</string> </value> + </item> + <item> + <key> <string>name</string> </key> + <value> <string>DataSet_view</string> </value> + </item> + <item> + <key> <string>pt</string> </key> + <value> <string>form_view</string> </value> + </item> + <item> + <key> <string>row_length</string> </key> + <value> <int>4</int> </value> + </item> + <item> + <key> <string>stored_encoding</string> </key> + <value> <string>UTF-8</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Data Set</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> + <item> + <key> <string>update_action_title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_activity_list.xml b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_activity_list.xml new file mode 100644 index 0000000000000000000000000000000000000000..9b6b03e543ac90f512daa06bab6b31df627bf881 --- /dev/null +++ b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_activity_list.xml @@ -0,0 +1,96 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>delegated_list</string> </key> + <value> + <list> + <string>title</string> + </list> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>my_activity_list</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>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string>my_function_list</string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string>Document_viewFieldLibrary</string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string>Click to edit the target</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Activities</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_content_type.xml b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_content_type.xml new file mode 100644 index 0000000000000000000000000000000000000000..1c1eb4e8d4976546968022dc1fccad30296b0146 --- /dev/null +++ b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_content_type.xml @@ -0,0 +1,111 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>delegated_list</string> </key> + <value> + <list> + <string>description</string> + <string>display_width</string> + <string>editable</string> + <string>title</string> + </list> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>my_content_type</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>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>description</string> </key> + <value> <string>Mime type of the file, defined which kind of document it is</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>field_id</string> </key> + <value> <string>my_string_field</string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string>Base_viewWebFieldLibrary</string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string>Click to edit the target</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Format</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_default_purchase_supply_line_source_title.xml b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_default_purchase_supply_line_source_title.xml new file mode 100644 index 0000000000000000000000000000000000000000..66f75a3d141e7279b151163020c885c08c952436 --- /dev/null +++ b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_default_purchase_supply_line_source_title.xml @@ -0,0 +1,619 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="RelationStringField" module="Products.ERP5Form.RelationField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>my_default_purchase_supply_line_source_title</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> + <item> + <key> <string>line_too_long</string> </key> + <value> <string>A line was too long.</string> </value> + </item> + <item> + <key> <string>relation_result_ambiguous</string> </key> + <value> <string>Select appropriate document in the list.</string> </value> + </item> + <item> + <key> <string>relation_result_empty</string> </key> + <value> <string>No such document was found.</string> </value> + </item> + <item> + <key> <string>relation_result_too_long</string> </key> + <value> <string>Too many documents were found.</string> </value> + </item> + <item> + <key> <string>required_not_found</string> </key> + <value> <string>Input is required but no input given.</string> </value> + </item> + <item> + <key> <string>too_long</string> </key> + <value> <string>You entered too many characters.</string> </value> + </item> + <item> + <key> <string>too_many_lines</string> </key> + <value> <string>You entered too many lines.</string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>overrides</string> </key> + <value> + <dictionary> + <item> + <key> <string>allow_creation</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>allow_jump</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>base_category</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>catalog_index</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>columns</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>container_getter_id</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>extra_item</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>first_item</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>items</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>jump_method</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>list_method</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_linelength</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_lines</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>parameter_list</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>proxy_listbox_ids</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>relation_form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>relation_setter_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>size</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>sort</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>update_method</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>allow_creation</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>allow_jump</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>base_category</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>catalog_index</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> + </item> + <item> + <key> <string>columns</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>container_getter_id</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> + <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> + </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>extra_item</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>first_item</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>items</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>jump_method</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>list_method</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_linelength</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_lines</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>parameter_list</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>proxy_listbox_ids</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>relation_form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>relation_setter_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>size</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>sort</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>update_method</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>allow_creation</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>allow_jump</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>base_category</string> </key> + <value> <string>(tales)</string> </value> + </item> + <item> + <key> <string>catalog_index</string> </key> + <value> <string>(tales)</string> </value> + </item> + <item> + <key> <string>columns</string> </key> + <value> + <list> + <tuple> + <string>title</string> + <string>Title</string> + </tuple> + <tuple> + <string>description</string> + <string>Description</string> + </tuple> + <tuple> + <string>translated_portal_type</string> + <string>Type</string> + </tuple> + <tuple> + <string>translated_simulation_state_title</string> + <string>State</string> + </tuple> + </list> + </value> + </item> + <item> + <key> <string>container_getter_id</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>extra_item</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>first_item</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>items</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>jump_method</string> </key> + <value> <string>Base_jumpToRelatedDocument</string> </value> + </item> + <item> + <key> <string>list_method</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_linelength</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_lines</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>parameter_list</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> + <list> + <tuple> + <string>Person</string> + <string>Person</string> + </tuple> + <tuple> + <string>Organisation</string> + <string>Organisation</string> + </tuple> + <tuple> + <string>Project</string> + <string>Project</string> + </tuple> + </list> + </value> + </item> + <item> + <key> <string>proxy_listbox_ids</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>relation_form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>relation_setter_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>size</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>sort</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Editor</string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>update_method</string> </key> + <value> <string>Base_validateRelation</string> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <int>0</int> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="TALESMethod" module="Products.Formulator.TALESField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_text</string> </key> + <value> <string>python: field.Base_getFieldParameterDict()[\'base_category\']</string> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="3" aka="AAAAAAAAAAM="> + <pickle> + <global name="TALESMethod" module="Products.Formulator.TALESField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_text</string> </key> + <value> <string>python: field.Base_getFieldParameterDict()[\'catalog_index\']</string> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="4" aka="AAAAAAAAAAQ="> + <pickle> + <global name="TALESMethod" module="Products.Formulator.TALESField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_text</string> </key> + <value> <string>python: preferences.getPreference(\'preferred_string_field_width\', 30)</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_default_sale_supply_line_aggregate_title.xml b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_default_sale_supply_line_aggregate_title.xml new file mode 100644 index 0000000000000000000000000000000000000000..97024341337a1584a20ae636f5c8120964b4776c --- /dev/null +++ b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_default_sale_supply_line_aggregate_title.xml @@ -0,0 +1,599 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="RelationStringField" module="Products.ERP5Form.RelationField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>my_default_sale_supply_line_aggregate_title</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> + <item> + <key> <string>line_too_long</string> </key> + <value> <string>A line was too long.</string> </value> + </item> + <item> + <key> <string>relation_result_ambiguous</string> </key> + <value> <string>Select appropriate document in the list.</string> </value> + </item> + <item> + <key> <string>relation_result_empty</string> </key> + <value> <string>No such document was found.</string> </value> + </item> + <item> + <key> <string>relation_result_too_long</string> </key> + <value> <string>Too many documents were found.</string> </value> + </item> + <item> + <key> <string>required_not_found</string> </key> + <value> <string>Input is required but no input given.</string> </value> + </item> + <item> + <key> <string>too_long</string> </key> + <value> <string>You entered too many characters.</string> </value> + </item> + <item> + <key> <string>too_many_lines</string> </key> + <value> <string>You entered too many lines.</string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>overrides</string> </key> + <value> + <dictionary> + <item> + <key> <string>allow_creation</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>allow_jump</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>base_category</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>catalog_index</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>columns</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>container_getter_id</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>extra_item</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>first_item</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>items</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>jump_method</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>list_method</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_linelength</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_lines</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>parameter_list</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>proxy_listbox_ids</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>relation_form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>relation_setter_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>size</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>sort</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>update_method</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>allow_creation</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>allow_jump</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>base_category</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>catalog_index</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> + </value> + </item> + <item> + <key> <string>columns</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>container_getter_id</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> + <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> + </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>extra_item</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>first_item</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>items</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>jump_method</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>list_method</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_linelength</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_lines</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>parameter_list</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>proxy_listbox_ids</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>relation_form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>relation_setter_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>size</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>sort</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>update_method</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>allow_creation</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>allow_jump</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>alternate_name</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>base_category</string> </key> + <value> <string>(tales)</string> </value> + </item> + <item> + <key> <string>catalog_index</string> </key> + <value> <string>(tales)</string> </value> + </item> + <item> + <key> <string>columns</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>container_getter_id</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>extra_item</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>first_item</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>hidden</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>items</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>jump_method</string> </key> + <value> <string>Base_jumpToRelatedDocument</string> </value> + </item> + <item> + <key> <string>list_method</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_linelength</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>max_lines</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>parameter_list</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> + <list> + <tuple> + <string>Software Licence</string> + <string>Software Licence</string> + </tuple> + </list> + </value> + </item> + <item> + <key> <string>proxy_listbox_ids</string> </key> + <value> + <list> + <tuple> + <string>SoftwareLicenceModule_viewSoftwareLicenceList/listbox</string> + <string>Software Licences</string> + </tuple> + </list> + </value> + </item> + <item> + <key> <string>relation_form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>relation_setter_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>size</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>sort</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Software Licence</string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>update_method</string> </key> + <value> <string>Base_validateRelation</string> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <int>0</int> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="TALESMethod" module="Products.Formulator.TALESField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_text</string> </key> + <value> <string>python: field.Base_getFieldParameterDict()[\'base_category\']</string> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="3" aka="AAAAAAAAAAM="> + <pickle> + <global name="TALESMethod" module="Products.Formulator.TALESField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_text</string> </key> + <value> <string>python: field.Base_getFieldParameterDict()[\'catalog_index\']</string> </value> + </item> + </dictionary> + </pickle> + </record> + <record id="4" aka="AAAAAAAAAAQ="> + <pickle> + <global name="TALESMethod" module="Products.Formulator.TALESField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_text</string> </key> + <value> <string>python: preferences.getPreference(\'preferred_string_field_width\', 30)</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_description.xml b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_description.xml new file mode 100644 index 0000000000000000000000000000000000000000..577966a1a7390a7d8bb341a493dde6bd6ca0466c --- /dev/null +++ b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_description.xml @@ -0,0 +1,96 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>delegated_list</string> </key> + <value> + <list> + <string>width</string> + </list> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>my_description</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>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string>my_description</string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string>Document_viewFieldLibrary</string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string>Click to edit the target</string> </value> + </item> + <item> + <key> <string>width</string> </key> + <value> <int>55</int> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_reference.xml b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_reference.xml new file mode 100644 index 0000000000000000000000000000000000000000..4999930f2dbed6aa263356aeb703dca4e08c65e9 --- /dev/null +++ b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_reference.xml @@ -0,0 +1,84 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>my_reference</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>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string>my_reference</string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string>Document_viewFieldLibrary</string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string>Click to edit the target</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_region_list.xml b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_region_list.xml new file mode 100644 index 0000000000000000000000000000000000000000..64230440065bdd3519fd3823546123078fc0ad5e --- /dev/null +++ b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_region_list.xml @@ -0,0 +1,96 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>delegated_list</string> </key> + <value> + <list> + <string>title</string> + </list> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>my_region_list</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>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string>my_function_list</string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string>Document_viewFieldLibrary</string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string>Click to edit the target</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Regions</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_subject_list.xml b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_subject_list.xml new file mode 100644 index 0000000000000000000000000000000000000000..c1d3e895151df3040db0892b019bd6f7ec7985f0 --- /dev/null +++ b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_subject_list.xml @@ -0,0 +1,90 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>delegated_list</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>my_subject_list</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>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string>my_subject_list</string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string>Document_viewFieldLibrary</string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string>Click to edit the target</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_title.xml b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_title.xml new file mode 100644 index 0000000000000000000000000000000000000000..6f0b72bca48d2913f1b11a3257bfe091a05b486c --- /dev/null +++ b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_title.xml @@ -0,0 +1,90 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>delegated_list</string> </key> + <value> + <list/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>my_title</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>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string>my_title</string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string>Document_viewFieldLibrary</string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string>Click to edit the target</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_translated_validation_state_title.xml b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_translated_validation_state_title.xml new file mode 100644 index 0000000000000000000000000000000000000000..aeb0d6704727579e2b16345d74bc0354b2634fd9 --- /dev/null +++ b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_translated_validation_state_title.xml @@ -0,0 +1,115 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>delegated_list</string> </key> + <value> + <list> + <string>css_class</string> + </list> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>my_translated_validation_state_title</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>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>css_class</string> </key> + <value> + <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> + </value> + </item> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>css_class</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>field_id</string> </key> + <value> <string>my_translated_validation_state_title</string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string>Document_viewFieldLibrary</string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string>Click to edit the target</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> + <record id="2" aka="AAAAAAAAAAI="> + <pickle> + <global name="TALESMethod" module="Products.Formulator.TALESField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_text</string> </key> + <value> <string>python: \'status %s\' % context.getValidationState()</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_update_frequency.xml b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_update_frequency.xml new file mode 100644 index 0000000000000000000000000000000000000000..4ca574aae5277ef1ff1b401649f57d19b6223b10 --- /dev/null +++ b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_update_frequency.xml @@ -0,0 +1,101 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>delegated_list</string> </key> + <value> + <list> + <string>size</string> + <string>title</string> + </list> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>my_update_frequency</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>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>tales</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </value> + </item> + <item> + <key> <string>values</string> </key> + <value> + <dictionary> + <item> + <key> <string>field_id</string> </key> + <value> <string>my_category</string> </value> + </item> + <item> + <key> <string>form_id</string> </key> + <value> <string>Base_viewFieldLibrary</string> </value> + </item> + <item> + <key> <string>size</string> </key> + <value> <int>1</int> </value> + </item> + <item> + <key> <string>target</string> </key> + <value> <string>Click to edit the target</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>Frequency Update</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_url_string.xml b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_url_string.xml new file mode 100644 index 0000000000000000000000000000000000000000..bc5dad46c22c822df4f924f9fec5388c846d6337 --- /dev/null +++ b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/DataSet_view/my_url_string.xml @@ -0,0 +1,260 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="StringField" module="Products.Formulator.StandardFields"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>my_url_string</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> + <item> + <key> <string>required_not_found</string> </key> + <value> <string>Input is required but no input given.</string> </value> + </item> + <item> + <key> <string>too_long</string> </key> + <value> <string>Too much input was given.</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>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>whitespace_preserve</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>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>whitespace_preserve</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>55</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>max_length</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>required</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>URL</string> </value> + </item> + <item> + <key> <string>truncate</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>unicode</string> </key> + <value> <int>0</int> </value> + </item> + <item> + <key> <string>whitespace_preserve</string> </key> + <value> <int>0</int> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/Document_setStartDate.xml b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/Document_setStartDate.xml new file mode 100644 index 0000000000000000000000000000000000000000..a477c3b761abf68da386920bbad62fc82415b4f2 --- /dev/null +++ b/bt5/erp5_data_set/SkinTemplateItem/portal_skins/erp5_data_set/Document_setStartDate.xml @@ -0,0 +1,75 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>Script_magic</string> </key> + <value> <int>3</int> </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> + <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> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>_body</string> </key> + <value> <string encoding="cdata"><![CDATA[ + +document = context\n +from DateTime import DateTime\n +current_date = DateTime()\n +if document.getStartDate() is None or document.getStartDate() > current_date:\n + document.setStartDate(current_date)\n + + +]]></string> </value> + </item> + <item> + <key> <string>_params</string> </key> + <value> <string>**kw</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Document_setStartDate</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_data_set/bt/change_log b/bt5/erp5_data_set/bt/change_log new file mode 100644 index 0000000000000000000000000000000000000000..511120d9b6940bb16dfacaeb2a25fb19ad79a263 --- /dev/null +++ b/bt5/erp5_data_set/bt/change_log @@ -0,0 +1,9 @@ +01-06-2011 Lucas +* Added the reference column on data set module listbox. +* Added the reference field to be consistent with DMS. + +24-05-2011 Lucas +* Added business template properties. + +24-05-2011 Lucas +* Initial Import. \ No newline at end of file diff --git a/bt5/erp5_data_set/bt/copyright_list b/bt5/erp5_data_set/bt/copyright_list new file mode 100644 index 0000000000000000000000000000000000000000..5291cb4c27f7c056102df0d8c21726854de742ac --- /dev/null +++ b/bt5/erp5_data_set/bt/copyright_list @@ -0,0 +1 @@ +Nexedi 2011 \ No newline at end of file diff --git a/bt5/erp5_data_set/bt/dependency_list b/bt5/erp5_data_set/bt/dependency_list new file mode 100644 index 0000000000000000000000000000000000000000..afa4f31c90be38a1ae559425921f2f67dc3a40b0 --- /dev/null +++ b/bt5/erp5_data_set/bt/dependency_list @@ -0,0 +1,2 @@ +erp5_dms +erp5_pdm \ No newline at end of file diff --git a/bt5/erp5_data_set/bt/description b/bt5/erp5_data_set/bt/description new file mode 100644 index 0000000000000000000000000000000000000000..867d8760b34f31ce64234a359e14f7835125328f --- /dev/null +++ b/bt5/erp5_data_set/bt/description @@ -0,0 +1 @@ +Provide the generic content to use Data Set portal type. \ No newline at end of file diff --git a/bt5/erp5_data_set/bt/license b/bt5/erp5_data_set/bt/license new file mode 100644 index 0000000000000000000000000000000000000000..c20143a6dbcc94c2756d7f2e72cb019171b18ba1 --- /dev/null +++ b/bt5/erp5_data_set/bt/license @@ -0,0 +1 @@ +Proprietary \ No newline at end of file diff --git a/bt5/erp5_data_set/bt/revision b/bt5/erp5_data_set/bt/revision new file mode 100644 index 0000000000000000000000000000000000000000..c7930257dfef505fd996e1d6f22f2f35149990d0 --- /dev/null +++ b/bt5/erp5_data_set/bt/revision @@ -0,0 +1 @@ +7 \ No newline at end of file diff --git a/bt5/erp5_data_set/bt/template_action_path_list b/bt5/erp5_data_set/bt/template_action_path_list new file mode 100644 index 0000000000000000000000000000000000000000..b8c18ffe6b30daf6591448ad5cc17ccf2b5ddc1e --- /dev/null +++ b/bt5/erp5_data_set/bt/template_action_path_list @@ -0,0 +1,2 @@ +Data Set Module | view +Data Set | view \ No newline at end of file diff --git a/bt5/erp5_data_set/bt/template_document_id_list b/bt5/erp5_data_set/bt/template_document_id_list new file mode 100644 index 0000000000000000000000000000000000000000..0e8d10a4782d423de39d9e8a874535ec15bf63c0 --- /dev/null +++ b/bt5/erp5_data_set/bt/template_document_id_list @@ -0,0 +1 @@ +DataSet \ No newline at end of file diff --git a/bt5/erp5_data_set/bt/template_format_version b/bt5/erp5_data_set/bt/template_format_version new file mode 100644 index 0000000000000000000000000000000000000000..56a6051ca2b02b04ef92d5150c9ef600403cb1de --- /dev/null +++ b/bt5/erp5_data_set/bt/template_format_version @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/bt5/erp5_data_set/bt/template_module_id_list b/bt5/erp5_data_set/bt/template_module_id_list new file mode 100644 index 0000000000000000000000000000000000000000..24cba2ffcfad309aa8a24d7deff34438a120d3e7 --- /dev/null +++ b/bt5/erp5_data_set/bt/template_module_id_list @@ -0,0 +1 @@ +data_set_module \ No newline at end of file diff --git a/bt5/erp5_data_set/bt/template_portal_type_allowed_content_type_list b/bt5/erp5_data_set/bt/template_portal_type_allowed_content_type_list new file mode 100644 index 0000000000000000000000000000000000000000..50d610ab0a26ffb91d581d88b2eeac26a3f59ee4 --- /dev/null +++ b/bt5/erp5_data_set/bt/template_portal_type_allowed_content_type_list @@ -0,0 +1,3 @@ +Data Set Module | Data Set +Data Set | Purchase Supply Line +Data Set | Sale Supply Line \ No newline at end of file diff --git a/bt5/erp5_data_set/bt/template_portal_type_base_category_list b/bt5/erp5_data_set/bt/template_portal_type_base_category_list new file mode 100644 index 0000000000000000000000000000000000000000..80048d1b4b84d4e45747ef4299ce1c73c7581daa --- /dev/null +++ b/bt5/erp5_data_set/bt/template_portal_type_base_category_list @@ -0,0 +1 @@ +Data Set Module | business_application \ No newline at end of file diff --git a/bt5/erp5_data_set/bt/template_portal_type_hidden_content_type_list b/bt5/erp5_data_set/bt/template_portal_type_hidden_content_type_list new file mode 100644 index 0000000000000000000000000000000000000000..76ffc7b292e3f8d073ae9107b018e1b012c412b0 --- /dev/null +++ b/bt5/erp5_data_set/bt/template_portal_type_hidden_content_type_list @@ -0,0 +1,2 @@ +Data Set | Purchase Supply Line +Data Set | Sale Supply Line \ No newline at end of file diff --git a/bt5/erp5_data_set/bt/template_portal_type_id_list b/bt5/erp5_data_set/bt/template_portal_type_id_list new file mode 100644 index 0000000000000000000000000000000000000000..8b312928fa1ad0ac00761bff600cfcff18220691 --- /dev/null +++ b/bt5/erp5_data_set/bt/template_portal_type_id_list @@ -0,0 +1,2 @@ +Data Set +Data Set Module \ No newline at end of file diff --git a/bt5/erp5_data_set/bt/template_portal_type_workflow_chain_list b/bt5/erp5_data_set/bt/template_portal_type_workflow_chain_list new file mode 100644 index 0000000000000000000000000000000000000000..95f8df076aa6378d440238d8def282f86468db56 --- /dev/null +++ b/bt5/erp5_data_set/bt/template_portal_type_workflow_chain_list @@ -0,0 +1,2 @@ +Data Set | document_publication_workflow +Data Set | edit_workflow \ No newline at end of file diff --git a/bt5/erp5_data_set/bt/template_property_sheet_id_list b/bt5/erp5_data_set/bt/template_property_sheet_id_list new file mode 100644 index 0000000000000000000000000000000000000000..8a87ff5efe5169ca9ac8c7499b597a50ae437dc1 --- /dev/null +++ b/bt5/erp5_data_set/bt/template_property_sheet_id_list @@ -0,0 +1,2 @@ +DataSet +TranslatableDescription \ No newline at end of file diff --git a/bt5/erp5_data_set/bt/template_skin_id_list b/bt5/erp5_data_set/bt/template_skin_id_list new file mode 100644 index 0000000000000000000000000000000000000000..c69bbc9f49c86b9649314acb60b387815723e53f --- /dev/null +++ b/bt5/erp5_data_set/bt/template_skin_id_list @@ -0,0 +1 @@ +erp5_data_set \ No newline at end of file diff --git a/bt5/erp5_data_set/bt/title b/bt5/erp5_data_set/bt/title new file mode 100644 index 0000000000000000000000000000000000000000..c69bbc9f49c86b9649314acb60b387815723e53f --- /dev/null +++ b/bt5/erp5_data_set/bt/title @@ -0,0 +1 @@ +erp5_data_set \ No newline at end of file diff --git a/bt5/erp5_data_set/bt/version b/bt5/erp5_data_set/bt/version new file mode 100644 index 0000000000000000000000000000000000000000..48360de846a2e022a0b981d250895f20d3480d34 --- /dev/null +++ b/bt5/erp5_data_set/bt/version @@ -0,0 +1 @@ +5.4.7 \ No newline at end of file diff --git a/bt5/erp5_web_shacache/ExtensionTemplateItem/ShaCache.py b/bt5/erp5_web_shacache/ExtensionTemplateItem/ShaCache.py new file mode 100644 index 0000000000000000000000000000000000000000..bcb75d30f8a32fc58b69dde5234d6b4bcb863421 --- /dev/null +++ b/bt5/erp5_web_shacache/ExtensionTemplateItem/ShaCache.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (c) 20011 Nexedi SA and Contributors. All Rights Reserved. +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + + +import hashlib + + +def WebSection_getDocumentValue(self, key, portal=None, language=None,\ + validation_state=None, **kw): + """ + API SHACACHE + + - POST /<key> + + parameters required: + * data: it is the file content + The key is the file name. + + - GET /<key> + The key is the sha512sum. + + Return raw content. + Raise HTTP error (404) if key does not exist + """ + if portal is None: + portal = self.getPortalObject() + + # Return the document, if the document exists. + if validation_state is None: + validation_state = ('released', 'released_alive', 'published', + 'published_alive', 'shared', 'shared_alive', + 'public', 'validated') + + kw['portal_type'] = portal.getPortalDocumentTypeList() + kw['validation_state'] = validation_state + kw['reference'] = key + + document_list = self.getDocumentValueList(limit=1, **kw) + if len(document_list): + return document_list[0] + + return None + + +def WebSection_setObject(self, id, ob, **kw): + """ + Add any change of the file uploaded. + """ + ob.publishAlive() + ob.setContentType('application/octet-stream') + ob.setFilename(id) + + sha512sum = hashlib.sha512() + self.REQUEST._file.seek(0) + while True: + d = self.REQUEST._file.read(sha512sum.block_size) + if not d: + break + sha512sum.update(d) + + reference = sha512sum.hexdigest() + if reference != id: + raise ValueError('The content does not match with sha512sum provided.') + + ob.setReference(reference) + return ob + +def WebSection_putFactory(self, name, typ, body): + """ + XXX + """ + portal = self.getPortalObject() + group = ('networkcache',) + new_id = str(portal.portal_ids.generateNewId(id_group=group)) + registry = portal.portal_contribution_registry + portal_type = registry.findPortalTypeName(filename=name, + content_type=typ) + if portal_type is None: + return None + + # The code bellow is inspired from ERP5Type.Core.Folder.newContent + pt = self._getTypesTool() + myType = pt.getTypeInfo(self) + if myType is not None and not myType.allowType( portal_type ) and \ + 'portal_contributions' not in self.getPhysicalPath(): + raise ValueError('Disallowed subobject type: %s' % portal_type) + container = portal.getDefaultModule(portal_type) + pt.constructContent(type_name=portal_type, + container=container, + id=new_id) + + document = container._getOb(new_id) + return document diff --git a/bt5/erp5_web_shacache/RegisteredSkinSelectionTemplateItem/registered_skin_selection.xml b/bt5/erp5_web_shacache/RegisteredSkinSelectionTemplateItem/registered_skin_selection.xml new file mode 100644 index 0000000000000000000000000000000000000000..67a16d90e6134b633a1256344db190470af945e6 --- /dev/null +++ b/bt5/erp5_web_shacache/RegisteredSkinSelectionTemplateItem/registered_skin_selection.xml @@ -0,0 +1,18 @@ +<registered_skin_selection> + <skin_folder_selection> + <skin_folder>erp5_web_download_theme</skin_folder> + <skin_selection>SHACACHE</skin_selection> + </skin_folder_selection> + <skin_folder_selection> + <skin_folder>erp5_web_shacache</skin_folder> + <skin_selection>SHACACHE</skin_selection> + </skin_folder_selection> + <skin_folder_selection> + <skin_folder>erp5_web_shacache_core</skin_folder> + <skin_selection>View,SHACACHE</skin_selection> + </skin_folder_selection> + <skin_folder_selection> + <skin_folder>erp5_xhtml_style</skin_folder> + <skin_selection>SHACACHE</skin_selection> + </skin_folder_selection> +</registered_skin_selection> \ No newline at end of file diff --git a/bt5/erp5_web_shacache/SkinTemplateItem/portal_skins/erp5_web_shacache.xml b/bt5/erp5_web_shacache/SkinTemplateItem/portal_skins/erp5_web_shacache.xml new file mode 100644 index 0000000000000000000000000000000000000000..5f89c3e943f35c8a867b200688c22f734e0bf6a7 --- /dev/null +++ b/bt5/erp5_web_shacache/SkinTemplateItem/portal_skins/erp5_web_shacache.xml @@ -0,0 +1,47 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Folder" module="OFS.Folder"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_local_properties</string> </key> + <value> + <tuple> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>business_template_skin_layer_priority</string> </value> + </item> + <item> + <key> <string>type</string> </key> + <value> <string>float</string> </value> + </item> + </dictionary> + </tuple> + </value> + </item> + <item> + <key> <string>_objects</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>business_template_skin_layer_priority</string> </key> + <value> <float>36.0</float> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>erp5_web_shacache</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_web_shacache/SkinTemplateItem/portal_skins/erp5_web_shacache/Base_setObject.xml b/bt5/erp5_web_shacache/SkinTemplateItem/portal_skins/erp5_web_shacache/Base_setObject.xml new file mode 100644 index 0000000000000000000000000000000000000000..06c6be4a09c84a2b62ea77e10347df6562e5dc16 --- /dev/null +++ b/bt5/erp5_web_shacache/SkinTemplateItem/portal_skins/erp5_web_shacache/Base_setObject.xml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_function</string> </key> + <value> <string>WebSection_setObject</string> </value> + </item> + <item> + <key> <string>_module</string> </key> + <value> <string>ShaCache</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Base_setObject</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_web_shacache/SkinTemplateItem/portal_skins/erp5_web_shacache/WebSection_getDocumentValue.xml b/bt5/erp5_web_shacache/SkinTemplateItem/portal_skins/erp5_web_shacache/WebSection_getDocumentValue.xml new file mode 100644 index 0000000000000000000000000000000000000000..71153827a79144dfd91cc3e6a484ed0abdc550fe --- /dev/null +++ b/bt5/erp5_web_shacache/SkinTemplateItem/portal_skins/erp5_web_shacache/WebSection_getDocumentValue.xml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_function</string> </key> + <value> <string>WebSection_getDocumentValue</string> </value> + </item> + <item> + <key> <string>_module</string> </key> + <value> <string>ShaCache</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>WebSection_getDocumentValue</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_web_shacache/SkinTemplateItem/portal_skins/erp5_web_shacache_core.xml b/bt5/erp5_web_shacache/SkinTemplateItem/portal_skins/erp5_web_shacache_core.xml new file mode 100644 index 0000000000000000000000000000000000000000..3207085d3361f2cfd05eea4e70c82472d9f2c7b5 --- /dev/null +++ b/bt5/erp5_web_shacache/SkinTemplateItem/portal_skins/erp5_web_shacache_core.xml @@ -0,0 +1,32 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Folder" module="OFS.Folder"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_local_properties</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>_objects</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>erp5_web_shacache_core</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_web_shacache/SkinTemplateItem/portal_skins/erp5_web_shacache_core/Base_putFactory.xml b/bt5/erp5_web_shacache/SkinTemplateItem/portal_skins/erp5_web_shacache_core/Base_putFactory.xml new file mode 100644 index 0000000000000000000000000000000000000000..315851f806350ca06aa947e8e0c39247e2e10fd5 --- /dev/null +++ b/bt5/erp5_web_shacache/SkinTemplateItem/portal_skins/erp5_web_shacache_core/Base_putFactory.xml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_function</string> </key> + <value> <string>WebSection_putFactory</string> </value> + </item> + <item> + <key> <string>_module</string> </key> + <value> <string>ShaCache</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Base_putFactory</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_web_shacache/TestTemplateItem/ShaCacheMixin.py b/bt5/erp5_web_shacache/TestTemplateItem/ShaCacheMixin.py new file mode 100644 index 0000000000000000000000000000000000000000..09c600ca69a29599b4cd6730f8036a1598d21abb --- /dev/null +++ b/bt5/erp5_web_shacache/TestTemplateItem/ShaCacheMixin.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2011 Nexedi SA and Contributors. All Rights Reserved. +# Lucas Carvalho <lucas@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + + +import hashlib + + +class ShaCacheMixin(object): + """ + ShaCache - Mixin Class + """ + + def getBusinessTemplateList(self): + """ + Return the list of required business templates. + """ + return ('erp5_full_text_myisam_catalog', + 'erp5_base', + 'erp5_jquery', + 'erp5_ingestion_mysql_innodb_catalog', + 'erp5_ingestion', + 'erp5_web', + 'erp5_dms', + 'erp5_web_download_theme', + 'erp5_web_shacache',) + + def afterSetUp(self): + """ + Initialize the ERP5 site. + """ + self.login() + self.portal = self.getPortal() + + module = self.portal.web_site_module + shacache = getattr(module, 'shacache', None) + if shacache is None: + shacache = module.newContent(portal_type='Web Site', + id='shacache', + title='SHA Cache Server', + skin_selection_name='SHACACHE') + + isTransitionPossible = self.portal.portal_workflow.isTransitionPossible + if isTransitionPossible(shacache, 'publish'): + shacache.publish() + self.stepTic() + + self.shacache = shacache + + self.data = 'Random Content. %s' % self.portal.Base_generateRandomString() + self.key = hashlib.sha512(self.data).hexdigest() diff --git a/bt5/erp5_web_shacache/TestTemplateItem/testShaCache.py b/bt5/erp5_web_shacache/TestTemplateItem/testShaCache.py new file mode 100644 index 0000000000000000000000000000000000000000..d48c87e8dffb19a889d73afbc23dcad24c7b881d --- /dev/null +++ b/bt5/erp5_web_shacache/TestTemplateItem/testShaCache.py @@ -0,0 +1,114 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2011 Nexedi SA and Contributors. All Rights Reserved. +# Lucas Carvalho <lucas@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + + +import transaction +from StringIO import StringIO +from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase +from ShaCacheMixin import ShaCacheMixin + + +class TestShaCache(ShaCacheMixin, ERP5TypeTestCase): + """ + ShaCache - HTTP File Cache server + """ + + def getTitle(self): + """ + Return the title of the current test set. + """ + return "SHACACHE - HTTP File Cache Server" + + def beforeTearDown(self): + """ + Clear everything for next test. + """ + for module in ('document_module',): + folder = self.portal[module] + folder.manage_delObjects(list(folder.objectIds())) + transaction.commit() + self.tic() + + def postFile(self, key=None): + """ + Post the file + """ + if key is None: + key = self.key + + try: + data_file = StringIO() + data_file.write(self.data) + data_file.seek(0) + + self.portal.changeSkin('SHACACHE') + self.shacache.REQUEST.set('method', 'POST') + self.shacache.REQUEST.set('Content-Type', 'application/json') + self.shacache.REQUEST._file = data_file + self.shacache.WebSection_getDocumentValue(key) + self.stepTic() + finally: + data_file.close() + + def getFile(self, key=None): + """ + Get the file calling the Python Script. + It simulates the real usage. + """ + if key is None: + key = self.key + + self.portal.changeSkin('SHACACHE') + self.shacache.REQUEST.set('method', 'GET') + return self.shacache.WebSection_getDocumentValue(key) + + def test_post_file(self): + """ + Check if the posted file has all the properties defined. + """ + self.postFile() + self.assertEquals(1, len(self.portal.document_module)) + + document = self.portal.document_module.contentValues()[0] + self.assertEquals(self.key, document.getTitle()) + self.assertEquals(self.key, document.getReference()) + self.assertEquals(self.data, document.getData()) + self.assertEquals('application/octet-stream', document.getContentType()) + + def test_get_file(self): + """ + Check if the file returned is the correct. + """ + self.test_post_file() + self.assertEquals(1, len(self.portal.document_module)) + + document = self.getFile() + self.assertNotEquals(None, document) + + self.assertEquals(self.data, document.getData()) diff --git a/bt5/erp5_web_shacache/bt/change_log b/bt5/erp5_web_shacache/bt/change_log new file mode 100644 index 0000000000000000000000000000000000000000..ed52a6820c97b85100068b295375ee4d604a3676 --- /dev/null +++ b/bt5/erp5_web_shacache/bt/change_log @@ -0,0 +1,5 @@ +2011-05-25 Lucas +* Depends of erp5_data_set business template. + +2011-05-23 Lucas +* Initial import. \ No newline at end of file diff --git a/bt5/erp5_web_shacache/bt/copyright_list b/bt5/erp5_web_shacache/bt/copyright_list new file mode 100644 index 0000000000000000000000000000000000000000..5291cb4c27f7c056102df0d8c21726854de742ac --- /dev/null +++ b/bt5/erp5_web_shacache/bt/copyright_list @@ -0,0 +1 @@ +Nexedi 2011 \ No newline at end of file diff --git a/bt5/erp5_web_shacache/bt/dependency_list b/bt5/erp5_web_shacache/bt/dependency_list new file mode 100644 index 0000000000000000000000000000000000000000..b1c25ad73105b283f7885d4caed56b42511ba827 --- /dev/null +++ b/bt5/erp5_web_shacache/bt/dependency_list @@ -0,0 +1 @@ +erp5_web_download_theme \ No newline at end of file diff --git a/bt5/erp5_web_shacache/bt/license b/bt5/erp5_web_shacache/bt/license new file mode 100644 index 0000000000000000000000000000000000000000..c20143a6dbcc94c2756d7f2e72cb019171b18ba1 --- /dev/null +++ b/bt5/erp5_web_shacache/bt/license @@ -0,0 +1 @@ +Proprietary \ No newline at end of file diff --git a/bt5/erp5_web_shacache/bt/maintainer_list b/bt5/erp5_web_shacache/bt/maintainer_list new file mode 100644 index 0000000000000000000000000000000000000000..4cff0242c606a1fb373bdac4499d08b488182205 --- /dev/null +++ b/bt5/erp5_web_shacache/bt/maintainer_list @@ -0,0 +1,2 @@ +rafael +lucas \ No newline at end of file diff --git a/bt5/erp5_web_shacache/bt/revision b/bt5/erp5_web_shacache/bt/revision new file mode 100644 index 0000000000000000000000000000000000000000..597975b413303a8c3cb711640e290794dc8077a8 --- /dev/null +++ b/bt5/erp5_web_shacache/bt/revision @@ -0,0 +1 @@ +35 \ No newline at end of file diff --git a/bt5/erp5_web_shacache/bt/template_extension_id_list b/bt5/erp5_web_shacache/bt/template_extension_id_list new file mode 100644 index 0000000000000000000000000000000000000000..6705d71007348f678761229321665d03bb5d8b95 --- /dev/null +++ b/bt5/erp5_web_shacache/bt/template_extension_id_list @@ -0,0 +1 @@ +ShaCache \ No newline at end of file diff --git a/bt5/erp5_web_shacache/bt/template_format_version b/bt5/erp5_web_shacache/bt/template_format_version new file mode 100644 index 0000000000000000000000000000000000000000..56a6051ca2b02b04ef92d5150c9ef600403cb1de --- /dev/null +++ b/bt5/erp5_web_shacache/bt/template_format_version @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/bt5/erp5_web_shacache/bt/template_registered_skin_selection_list b/bt5/erp5_web_shacache/bt/template_registered_skin_selection_list new file mode 100644 index 0000000000000000000000000000000000000000..33fe534e49b30239b04a25677c40fa9bc719d39a --- /dev/null +++ b/bt5/erp5_web_shacache/bt/template_registered_skin_selection_list @@ -0,0 +1,5 @@ +erp5_web_download_theme | SHACACHE +erp5_web_shacache | SHACACHE +erp5_web_shacache_core | SHACACHE +erp5_web_shacache_core | View +erp5_xhtml_style | SHACACHE \ No newline at end of file diff --git a/bt5/erp5_web_shacache/bt/template_skin_id_list b/bt5/erp5_web_shacache/bt/template_skin_id_list new file mode 100644 index 0000000000000000000000000000000000000000..44b9534f485e461c46fdf68f5c596d2d2b26bcb4 --- /dev/null +++ b/bt5/erp5_web_shacache/bt/template_skin_id_list @@ -0,0 +1,2 @@ +erp5_web_shacache +erp5_web_shacache_core \ No newline at end of file diff --git a/bt5/erp5_web_shacache/bt/template_test_id_list b/bt5/erp5_web_shacache/bt/template_test_id_list new file mode 100644 index 0000000000000000000000000000000000000000..7352cb6f2509bc4c32f56f6281f261def3b6addb --- /dev/null +++ b/bt5/erp5_web_shacache/bt/template_test_id_list @@ -0,0 +1,2 @@ +testShaCache +ShaCacheMixin \ No newline at end of file diff --git a/bt5/erp5_web_shacache/bt/title b/bt5/erp5_web_shacache/bt/title new file mode 100644 index 0000000000000000000000000000000000000000..8863ef3e6671bafdfc42d2e08516eb50ebac5d73 --- /dev/null +++ b/bt5/erp5_web_shacache/bt/title @@ -0,0 +1 @@ +erp5_web_shacache \ No newline at end of file diff --git a/bt5/erp5_web_shacache/bt/version b/bt5/erp5_web_shacache/bt/version new file mode 100644 index 0000000000000000000000000000000000000000..48360de846a2e022a0b981d250895f20d3480d34 --- /dev/null +++ b/bt5/erp5_web_shacache/bt/version @@ -0,0 +1 @@ +5.4.7 \ No newline at end of file diff --git a/bt5/erp5_web_shadir/ExtensionTemplateItem/ShaDir.py b/bt5/erp5_web_shadir/ExtensionTemplateItem/ShaDir.py new file mode 100644 index 0000000000000000000000000000000000000000..5be44aa81e9b9cf683abb359951b441936a7e992 --- /dev/null +++ b/bt5/erp5_web_shadir/ExtensionTemplateItem/ShaDir.py @@ -0,0 +1,108 @@ +############################################################################## +# +# Copyright (c) 20011 Nexedi SA and Contributors. All Rights Reserved. +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + + +import hashlib +import json +import validictory +from Products.ERP5Type.Document import newTempFile + + +def WebSection_getDocumentValue(self, key, portal=None, language=None,\ + validation_state=None, **kw): + """ + API SHADIR + + - POST /<key> + + parameters required: + * file: the name of the file + * urlmd5: mdsum of orginal url + * sha512: the hash (sha512) of the file content + + + parameters not required: + * valid-until: the date which the file must be expired + * architecture: computer architecture + + Used to add information on shadir server. + + + - GET /<key> + Return list of information for a given key + Raise HTTP error (404) if key does not exist + """ + if portal is None: + portal = self.getPortalObject() + + data_set = portal.portal_catalog.getResultValue(portal_type='Data Set', + reference=key) + + # Return the SIGNATURE file, if the document exists. + if data_set is not None: + document_list = [json.loads(document.getData()) \ + for document in data_set.getFollowUpRelatedValueList()] + + temp_file = newTempFile(self, '%s.txt' % key) + temp_file.setData(json.dumps(document_list)) + temp_file.setContentType('application/json') + return temp_file.getObject() + + return None + +def WebSection_setObject(self, id, ob, **kw): + """ + Make any change related to the file uploaded. + """ + portal = self.getPortalObject() + + data = self.REQUEST.get('BODY') + schema = self.WebSite_getJSONSchema() + structure = json.loads(data) + validictory.validate(structure, schema) + + property_dict = structure[0] + file_name = property_dict.get('file', None) + ob.setFilename(file_name) + + expiration_date = property_dict.get('expiration_date', None) + if expiration_date is not None: + ob.setExpirationDate(expiration_date) + + ob.publishAlive() + ob.setContentType('application/json') + + data_set = portal.portal_catalog.getResultValue(portal_type='Data Set', + reference=id) + if data_set is None: + data_set = portal.data_set_module.newContent(portal_type='Data Set', + reference=id) + data_set.publish() + ob.setFollowUp(data_set.getRelativeUrl()) + + reference = hashlib.sha512(data).hexdigest() + ob.setReference(reference) + + return ob diff --git a/bt5/erp5_web_shadir/RegisteredSkinSelectionTemplateItem/registered_skin_selection.xml b/bt5/erp5_web_shadir/RegisteredSkinSelectionTemplateItem/registered_skin_selection.xml new file mode 100644 index 0000000000000000000000000000000000000000..9507631de94531e19689ac97ecbebbdcd0c95839 --- /dev/null +++ b/bt5/erp5_web_shadir/RegisteredSkinSelectionTemplateItem/registered_skin_selection.xml @@ -0,0 +1,18 @@ +<registered_skin_selection> + <skin_folder_selection> + <skin_folder>erp5_web_download_theme</skin_folder> + <skin_selection>SHADIR</skin_selection> + </skin_folder_selection> + <skin_folder_selection> + <skin_folder>erp5_web_shacache_core</skin_folder> + <skin_selection>SHADIR</skin_selection> + </skin_folder_selection> + <skin_folder_selection> + <skin_folder>erp5_web_shadir</skin_folder> + <skin_selection>SHADIR</skin_selection> + </skin_folder_selection> + <skin_folder_selection> + <skin_folder>erp5_xhtml_style</skin_folder> + <skin_selection>SHADIR</skin_selection> + </skin_folder_selection> +</registered_skin_selection> \ No newline at end of file diff --git a/bt5/erp5_web_shadir/SkinTemplateItem/portal_skins/erp5_web_shadir.xml b/bt5/erp5_web_shadir/SkinTemplateItem/portal_skins/erp5_web_shadir.xml new file mode 100644 index 0000000000000000000000000000000000000000..cae95caec1beb8e62701c4305d3a6fad22b603bd --- /dev/null +++ b/bt5/erp5_web_shadir/SkinTemplateItem/portal_skins/erp5_web_shadir.xml @@ -0,0 +1,47 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Folder" module="OFS.Folder"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_local_properties</string> </key> + <value> + <tuple> + <dictionary> + <item> + <key> <string>id</string> </key> + <value> <string>business_template_skin_layer_priority</string> </value> + </item> + <item> + <key> <string>type</string> </key> + <value> <string>float</string> </value> + </item> + </dictionary> + </tuple> + </value> + </item> + <item> + <key> <string>_objects</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>business_template_skin_layer_priority</string> </key> + <value> <float>36.0</float> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>erp5_web_shadir</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_web_shadir/SkinTemplateItem/portal_skins/erp5_web_shadir/Base_setObject.xml b/bt5/erp5_web_shadir/SkinTemplateItem/portal_skins/erp5_web_shadir/Base_setObject.xml new file mode 100644 index 0000000000000000000000000000000000000000..7ce36114eb9043bc981bc9d9d927d71e6e5b751b --- /dev/null +++ b/bt5/erp5_web_shadir/SkinTemplateItem/portal_skins/erp5_web_shadir/Base_setObject.xml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_function</string> </key> + <value> <string>WebSection_setObject</string> </value> + </item> + <item> + <key> <string>_module</string> </key> + <value> <string>ShaDir</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>Base_setObject</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_web_shadir/SkinTemplateItem/portal_skins/erp5_web_shadir/WebSection_getDocumentValue.xml b/bt5/erp5_web_shadir/SkinTemplateItem/portal_skins/erp5_web_shadir/WebSection_getDocumentValue.xml new file mode 100644 index 0000000000000000000000000000000000000000..50ac3a49192eac6576e001587f5cc1ed46c07817 --- /dev/null +++ b/bt5/erp5_web_shadir/SkinTemplateItem/portal_skins/erp5_web_shadir/WebSection_getDocumentValue.xml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_function</string> </key> + <value> <string>WebSection_getDocumentValue</string> </value> + </item> + <item> + <key> <string>_module</string> </key> + <value> <string>ShaDir</string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>WebSection_getDocumentValue</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string></string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_web_shadir/SkinTemplateItem/portal_skins/erp5_web_shadir/WebSite_getJSONSchema.xml b/bt5/erp5_web_shadir/SkinTemplateItem/portal_skins/erp5_web_shadir/WebSite_getJSONSchema.xml new file mode 100644 index 0000000000000000000000000000000000000000..cfb68b02c4248a1dd73e9b94165debc40b249e66 --- /dev/null +++ b/bt5/erp5_web_shadir/SkinTemplateItem/portal_skins/erp5_web_shadir/WebSite_getJSONSchema.xml @@ -0,0 +1,105 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="PythonScript" module="Products.PythonScripts.PythonScript"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>Script_magic</string> </key> + <value> <int>3</int> </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> + <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> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>_body</string> </key> + <value> <string>return {\n + \'type\': \'array\',\n + \'items\': [\n + {\'type\': \'object\',\n + \'properties\':{\n + \'file\':{\n + \'type\': \'string\',\n + \'required\': True,\n + },\n + \'urlmd5\': {\n + \'type\': \'string\',\n + \'required\': True,\n + },\n + \'sha512\': {\n + \'type\': \'string\',\n + \'required\': True,\n + },\n + \'creation_date\': {\n + \'type\': \'string\',\n + \'required\': False,\n + },\n + \'expiration_date\': {\n + \'type\': \'string\',\n + \'required\': False,\n + },\n + \'distribution\': {\n + \'type\': \'string\',\n + \'required\': False,\n + },\n + \'architecture\': {\n + \'type\': \'string\',\n + \'required\': False,\n + },\n + }\n + },\n + {\'type\': \'string\',\n + \'blank\': True},\n + ]\n +}\n +</string> </value> + </item> + <item> + <key> <string>_params</string> </key> + <value> <string></string> </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>WebSite_getJSONSchema</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_web_shadir/TestTemplateItem/ShaDirMixin.py b/bt5/erp5_web_shadir/TestTemplateItem/ShaDirMixin.py new file mode 100644 index 0000000000000000000000000000000000000000..4eab1d9f677ec22c563cb9cb4554766a1e4b636a --- /dev/null +++ b/bt5/erp5_web_shadir/TestTemplateItem/ShaDirMixin.py @@ -0,0 +1,105 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2011 Nexedi SA and Contributors. All Rights Reserved. +# Lucas Carvalho <lucas@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + + +import hashlib +import json +import platform +from DateTime import DateTime + + +class ShaDirMixin(object): + """ + ShaDir - Mixin Class + """ + + def getBusinessTemplateList(self): + """ + Return the list of required business templates. + """ + return ('erp5_full_text_myisam_catalog', + 'erp5_base', + 'erp5_jquery', + 'erp5_ingestion_mysql_innodb_catalog', + 'erp5_ingestion', + 'erp5_web', + 'erp5_dms', + 'erp5_pdm', + 'erp5_data_set', + 'erp5_web_download_theme', + 'erp5_web_shacache', + 'erp5_web_shadir',) + + + def afterSetUp(self): + """ + Initialize the ERP5 site. + """ + self.login() + self.portal = self.getPortal() + + self.key = self.portal.Base_generateRandomString() + self.file_name = 'file.txt' + self.urlmd5 = hashlib.md5(self.key).hexdigest() + self.file_content = 'This is the content.' + self.file_sha512sum = hashlib.sha512(self.file_content).hexdigest() + self.distribution = 'pypi' + self.creation_date = DateTime() + self.expiration_date = self.creation_date + 30 + + libc_version = '%s %s' % (platform.libc_ver()[0], platform.libc_ver()[1]) + self.architecture = '%s %s' % (platform.machine(), libc_version) + + self.data_list = [{'file': self.file_name, + 'urlmd5': self.urlmd5, + 'sha512': self.file_sha512sum, + 'creation_date': str(self.creation_date), + 'expiration_date': str(self.expiration_date), + 'distribution': self.distribution, + 'architecture': self.architecture}, + "User SIGNATURE goes here."] + + self.data = json.dumps(self.data_list) + self.sha512sum = hashlib.sha512(self.data).hexdigest() + + module = self.portal.web_site_module + shadir = getattr(module, 'shadir', None) + if shadir is None: + shadir = module.newContent(portal_type='Web Site', + id='shadir', + title='SHA Dir Server', + skin_selection_name='SHADIR') + + + isTransitionPossible = self.portal.portal_workflow.isTransitionPossible + if isTransitionPossible(shadir, 'publish'): + shadir.publish() + self.stepTic() + + self.shadir = shadir diff --git a/bt5/erp5_web_shadir/TestTemplateItem/testShaDir.py b/bt5/erp5_web_shadir/TestTemplateItem/testShaDir.py new file mode 100644 index 0000000000000000000000000000000000000000..67d5dc8b30cf15a351cf6ec4b9c6b4abe56cb795 --- /dev/null +++ b/bt5/erp5_web_shadir/TestTemplateItem/testShaDir.py @@ -0,0 +1,192 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2011 Nexedi SA and Contributors. All Rights Reserved. +# Lucas Carvalho <lucas@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + + +import json +import transaction +from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase +from StringIO import StringIO +from ShaDirMixin import ShaDirMixin + + +class TestShaDir(ShaDirMixin, ERP5TypeTestCase): + """ + ShaDir - HTTP Information Cache server + """ + + def getTitle(self): + """ + Return the title of the current test set. + """ + return "SHADIR - HTTP Information Cache Server" + + def postInformation(self, key=None): + """ + Post the information calling the Python Script. + It simulates the real usage. + """ + if key is None: + key = self.key + + try: + data_file = StringIO() + data_file.write(self.data) + data_file.seek(0) + + self.portal.changeSkin('SHADIR') + self.shadir.REQUEST.set('method', 'POST') + self.shadir.REQUEST.set('Content-Type', 'application/json') + self.shadir.REQUEST._file = data_file + self.shadir.WebSection_getDocumentValue(key) + self.stepTic() + finally: + data_file.close() + + def getInformation(self, key=None): + """ + Get the information calling the Python Script. + It simulates the real usage. + """ + if key is None: + key = self.key + + self.portal.changeSkin('SHADIR') + self.shadir.REQUEST.set('method', 'GET') + return self.shadir.WebSection_getDocumentValue(key) + + def beforeTearDown(self): + """ + Clear everything for next test. + """ + for module in ('data_set_module', + 'document_module',): + folder = self.portal[module] + folder.manage_delObjects(list(folder.objectIds())) + transaction.commit() + self.tic() + + def test_post_information(self): + """ + Check if posting information is working. + """ + self.postInformation() + + # Asserting Data Set + data_set = self.portal.data_set_module.contentValues()[0] + self.assertEquals(self.key, data_set.getReference()) + self.assertEquals('Published', data_set.getValidationStateTitle()) + + # Asserting Document + document = self.portal.document_module.contentValues()[0] + self.assertEquals(self.sha512sum, document.getTitle()) + self.assertEquals(self.sha512sum, document.getReference()) + self.assertEquals(self.data, document.getData()) + self.assertEquals(data_set, document.getFollowUpValue()) + self.assertEquals(self.expiration_date, document.getExpirationDate()) + self.assertEquals('application/json', document.getContentType()) + + def test_get_information(self): + """ + check if return the temp document with text content. + """ + self.postInformation() + + document = self.getInformation() + self.assertNotEquals(None, document) + + data = document.getData() + information_list = json.loads(data) + + self.assertEquals(1, len(information_list)) + self.assertEquals(json.dumps(information_list[0]), self.data) + + def test_post_information_more_than_once(self): + """ + Check if posting information is working. + """ + self.assertEquals(0, len(self.portal.data_set_module)) + self.assertEquals(0, len(self.portal.document_module)) + for x in xrange(10): + self.postInformation() + + self.assertEquals(1, len(self.portal.data_set_module)) + data_set = self.portal.data_set_module.contentValues()[0] + self.assertEquals(self.key, data_set.getReference()) + self.assertEquals('Published', data_set.getValidationStateTitle()) + + self.assertEquals(10, len(self.portal.document_module)) + + def test_get_information_for_single_data_set(self): + """ + check if return the temp document with text content. + """ + self.postInformation() + + document = self.getInformation() + self.assertNotEquals(None, document) + + data = document.getData() + information_list = json.loads(data) + + self.assertEquals(1, len(information_list)) + self.assertEquals(json.dumps(information_list[0]), self.data) + + def test_get_information_from_different_data_set(self): + """ + POST information to /information and to /information2 + It must create two Data Set and two Text documents. + + When the user retrieve the content of a given key, + it must return only the Text document related to the key. + + This relation is controlled by Data Set object. + """ + self.assertEquals(0, len(self.portal.data_set_module)) + self.assertEquals(0, len(self.portal.document_module)) + + self.postInformation() + self.assertEquals(1, len(self.portal.data_set_module)) + self.assertEquals(1, len(self.portal.document_module)) + + self.postInformation(key='information2') + self.assertEquals(2, len(self.portal.data_set_module)) + self.assertEquals(2, len(self.portal.document_module)) + + document = self.getInformation() + self.assertEquals(1, len(json.loads(document.getData()))) + + document2 = self.getInformation('information2') + self.assertEquals(1, len(json.loads(document2.getData()))) + + self.postInformation() + self.assertEquals(2, len(self.portal.data_set_module)) + self.assertEquals(3, len(self.portal.document_module)) + + document3 = self.getInformation() + self.assertEquals(2, len(json.loads(document3.getData()))) diff --git a/bt5/erp5_web_shadir/bt/change_log b/bt5/erp5_web_shadir/bt/change_log new file mode 100644 index 0000000000000000000000000000000000000000..9f4663929f4605349825cb6c8912aaca4f3e567b --- /dev/null +++ b/bt5/erp5_web_shadir/bt/change_log @@ -0,0 +1,15 @@ +2011-05-26 Lucas +* Removed _setSuperSecurityManager, security must be defined. + +2011-05-26 Lucas +* Added basic tests for shadir implementation. + +2011-05-26 Lucas +* SHADIR must handle POST from any client supporting application/json content type. +For each POST method for an unknown PATH it must create a Data Set (if does not exists), store the DATA in DMS, and set the follow up relation from such document to the Data Set. + +2011-05-25 Lucas +* Depends of erp5_data_set business template. + +2011-05-24 Lucas +* Initial import. \ No newline at end of file diff --git a/bt5/erp5_web_shadir/bt/copyright_list b/bt5/erp5_web_shadir/bt/copyright_list new file mode 100644 index 0000000000000000000000000000000000000000..5291cb4c27f7c056102df0d8c21726854de742ac --- /dev/null +++ b/bt5/erp5_web_shadir/bt/copyright_list @@ -0,0 +1 @@ +Nexedi 2011 \ No newline at end of file diff --git a/bt5/erp5_web_shadir/bt/dependency_list b/bt5/erp5_web_shadir/bt/dependency_list new file mode 100644 index 0000000000000000000000000000000000000000..12f076d202f054ad00126e1452c0a25bd7084c61 --- /dev/null +++ b/bt5/erp5_web_shadir/bt/dependency_list @@ -0,0 +1,3 @@ +erp5_data_set +erp5_web_download_theme +erp5_web_shacache \ No newline at end of file diff --git a/bt5/erp5_web_shadir/bt/description b/bt5/erp5_web_shadir/bt/description new file mode 100644 index 0000000000000000000000000000000000000000..8b137891791fe96927ad78e64b0aad7bded08bdc --- /dev/null +++ b/bt5/erp5_web_shadir/bt/description @@ -0,0 +1 @@ + diff --git a/bt5/erp5_web_shadir/bt/license b/bt5/erp5_web_shadir/bt/license new file mode 100644 index 0000000000000000000000000000000000000000..c20143a6dbcc94c2756d7f2e72cb019171b18ba1 --- /dev/null +++ b/bt5/erp5_web_shadir/bt/license @@ -0,0 +1 @@ +Proprietary \ No newline at end of file diff --git a/bt5/erp5_web_shadir/bt/maintainer_list b/bt5/erp5_web_shadir/bt/maintainer_list new file mode 100644 index 0000000000000000000000000000000000000000..4cff0242c606a1fb373bdac4499d08b488182205 --- /dev/null +++ b/bt5/erp5_web_shadir/bt/maintainer_list @@ -0,0 +1,2 @@ +rafael +lucas \ No newline at end of file diff --git a/bt5/erp5_web_shadir/bt/revision b/bt5/erp5_web_shadir/bt/revision new file mode 100644 index 0000000000000000000000000000000000000000..f70d7bba4ae1f07682e0358bd7a2068094fc023b --- /dev/null +++ b/bt5/erp5_web_shadir/bt/revision @@ -0,0 +1 @@ +42 \ No newline at end of file diff --git a/bt5/erp5_web_shadir/bt/template_extension_id_list b/bt5/erp5_web_shadir/bt/template_extension_id_list new file mode 100644 index 0000000000000000000000000000000000000000..ac522a01b35d3153299fc1499c6e7f3d68540146 --- /dev/null +++ b/bt5/erp5_web_shadir/bt/template_extension_id_list @@ -0,0 +1 @@ +ShaDir \ No newline at end of file diff --git a/bt5/erp5_web_shadir/bt/template_format_version b/bt5/erp5_web_shadir/bt/template_format_version new file mode 100644 index 0000000000000000000000000000000000000000..56a6051ca2b02b04ef92d5150c9ef600403cb1de --- /dev/null +++ b/bt5/erp5_web_shadir/bt/template_format_version @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/bt5/erp5_web_shadir/bt/template_registered_skin_selection_list b/bt5/erp5_web_shadir/bt/template_registered_skin_selection_list new file mode 100644 index 0000000000000000000000000000000000000000..873fa3f36f91b233afa250834fbd72805f9abe77 --- /dev/null +++ b/bt5/erp5_web_shadir/bt/template_registered_skin_selection_list @@ -0,0 +1,4 @@ +erp5_web_download_theme | SHADIR +erp5_web_shacache_core | SHADIR +erp5_web_shadir | SHADIR +erp5_xhtml_style | SHADIR \ No newline at end of file diff --git a/bt5/erp5_web_shadir/bt/template_skin_id_list b/bt5/erp5_web_shadir/bt/template_skin_id_list new file mode 100644 index 0000000000000000000000000000000000000000..6aea7c010abaa992d25975fa976aa61e26f771cd --- /dev/null +++ b/bt5/erp5_web_shadir/bt/template_skin_id_list @@ -0,0 +1 @@ +erp5_web_shadir \ No newline at end of file diff --git a/bt5/erp5_web_shadir/bt/template_test_id_list b/bt5/erp5_web_shadir/bt/template_test_id_list new file mode 100644 index 0000000000000000000000000000000000000000..e1b2b73d0a035043795e0db3b7bf94b9c28f14c9 --- /dev/null +++ b/bt5/erp5_web_shadir/bt/template_test_id_list @@ -0,0 +1,2 @@ +ShaDirMixin +testShaDir \ No newline at end of file diff --git a/bt5/erp5_web_shadir/bt/title b/bt5/erp5_web_shadir/bt/title new file mode 100644 index 0000000000000000000000000000000000000000..6aea7c010abaa992d25975fa976aa61e26f771cd --- /dev/null +++ b/bt5/erp5_web_shadir/bt/title @@ -0,0 +1 @@ +erp5_web_shadir \ No newline at end of file diff --git a/bt5/erp5_web_shadir/bt/version b/bt5/erp5_web_shadir/bt/version new file mode 100644 index 0000000000000000000000000000000000000000..48360de846a2e022a0b981d250895f20d3480d34 --- /dev/null +++ b/bt5/erp5_web_shadir/bt/version @@ -0,0 +1 @@ +5.4.7 \ No newline at end of file diff --git a/bt5/networkcache_erp5/LocalRolesTemplateItem/data_set_module.xml b/bt5/networkcache_erp5/LocalRolesTemplateItem/data_set_module.xml new file mode 100644 index 0000000000000000000000000000000000000000..86139c0b4d020e8c519ffb8d6734161c8e5dfccd --- /dev/null +++ b/bt5/networkcache_erp5/LocalRolesTemplateItem/data_set_module.xml @@ -0,0 +1,7 @@ +<local_roles_item> + <local_roles> + <role id='shadir'> + <item>Author</item> + </role> + </local_roles> +</local_roles_item> \ No newline at end of file diff --git a/bt5/networkcache_erp5/LocalRolesTemplateItem/document_module.xml b/bt5/networkcache_erp5/LocalRolesTemplateItem/document_module.xml new file mode 100644 index 0000000000000000000000000000000000000000..ce2f0ad7033fc568f59756094f24a8fc5d261343 --- /dev/null +++ b/bt5/networkcache_erp5/LocalRolesTemplateItem/document_module.xml @@ -0,0 +1,10 @@ +<local_roles_item> + <local_roles> + <role id='shacache'> + <item>Author</item> + </role> + <role id='shadir'> + <item>Author</item> + </role> + </local_roles> +</local_roles_item> \ No newline at end of file diff --git a/bt5/networkcache_erp5/LocalRolesTemplateItem/image_module.xml b/bt5/networkcache_erp5/LocalRolesTemplateItem/image_module.xml new file mode 100644 index 0000000000000000000000000000000000000000..69ecafb9bbb1c1bb3136760af0b2f126838c8a64 --- /dev/null +++ b/bt5/networkcache_erp5/LocalRolesTemplateItem/image_module.xml @@ -0,0 +1,10 @@ +<local_roles_item> + <local_roles> + <role id='shacache'> + <item>Author</item> + </role> + <role id='zope'> + <item>Owner</item> + </role> + </local_roles> +</local_roles_item> \ No newline at end of file diff --git a/bt5/networkcache_erp5/LocalRolesTemplateItem/portal_contributions.xml b/bt5/networkcache_erp5/LocalRolesTemplateItem/portal_contributions.xml new file mode 100644 index 0000000000000000000000000000000000000000..ce2f0ad7033fc568f59756094f24a8fc5d261343 --- /dev/null +++ b/bt5/networkcache_erp5/LocalRolesTemplateItem/portal_contributions.xml @@ -0,0 +1,10 @@ +<local_roles_item> + <local_roles> + <role id='shacache'> + <item>Author</item> + </role> + <role id='shadir'> + <item>Author</item> + </role> + </local_roles> +</local_roles_item> \ No newline at end of file diff --git a/bt5/networkcache_erp5/PathTemplateItem/portal_categories/group/shacache.xml b/bt5/networkcache_erp5/PathTemplateItem/portal_categories/group/shacache.xml new file mode 100644 index 0000000000000000000000000000000000000000..aab0a9d43ca8189616d1f4bef73f7fe1054031f2 --- /dev/null +++ b/bt5/networkcache_erp5/PathTemplateItem/portal_categories/group/shacache.xml @@ -0,0 +1,81 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Category" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_Add_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Add_portal_folders_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Copy_or_Move_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Delete_objects_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Modify_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignee</string> + <string>Assignor</string> + <string>Manager</string> + <string>Owner</string> + </tuple> + </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>shacache</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Category</string> </value> + </item> + <item> + <key> <string>short_title</string> </key> + <value> <string>ShaCache</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>SHACACHE</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/networkcache_erp5/PathTemplateItem/portal_categories/group/shadir.xml b/bt5/networkcache_erp5/PathTemplateItem/portal_categories/group/shadir.xml new file mode 100644 index 0000000000000000000000000000000000000000..1177a1c482ce1cf6f527eb7426cccc8c3bfdb051 --- /dev/null +++ b/bt5/networkcache_erp5/PathTemplateItem/portal_categories/group/shadir.xml @@ -0,0 +1,89 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <global name="Category" module="erp5.portal_type"/> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>_Add_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Add_portal_folders_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Copy_or_Move_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Delete_objects_Permission</string> </key> + <value> + <tuple> + <string>Assignor</string> + <string>Manager</string> + </tuple> + </value> + </item> + <item> + <key> <string>_Modify_portal_content_Permission</string> </key> + <value> + <tuple> + <string>Assignee</string> + <string>Assignor</string> + <string>Manager</string> + <string>Owner</string> + </tuple> + </value> + </item> + <item> + <key> <string>categories</string> </key> + <value> + <tuple> + <string>group/shadir</string> + </tuple> + </value> + </item> + <item> + <key> <string>description</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>shadir</string> </value> + </item> + <item> + <key> <string>portal_type</string> </key> + <value> <string>Category</string> </value> + </item> + <item> + <key> <string>short_title</string> </key> + <value> <string>ShaDir</string> </value> + </item> + <item> + <key> <string>title</string> </key> + <value> <string>SHADIR</string> </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Contribution%20Tool.xml b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Contribution%20Tool.xml new file mode 100644 index 0000000000000000000000000000000000000000..cb33b070b72781303b5b8ea1e97fe7fbb4748b4c --- /dev/null +++ b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Contribution%20Tool.xml @@ -0,0 +1,12 @@ +<type_roles> + <role id='Author'> + <property id='title'>Any From ShaCache Group</property> + <property id='description'>Any user which has a valid assignment where the group is shacache must have Author role.</property> + <multi_property id='category'>group/shacache</multi_property> + </role> + <role id='Author'> + <property id='title'>Any From ShaDir Group</property> + <property id='description'>Any user which has a valid assignment where the group is shadir must have Author role.</property> + <multi_property id='category'>group/shadir</multi_property> + </role> +</type_roles> \ No newline at end of file diff --git a/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Data%20Set%20Module.xml b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Data%20Set%20Module.xml new file mode 100644 index 0000000000000000000000000000000000000000..ba8190be96b59faf421dac8e4b00639cdbb48888 --- /dev/null +++ b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Data%20Set%20Module.xml @@ -0,0 +1,7 @@ +<type_roles> + <role id='Author'> + <property id='title'>Any From ShaDir Group</property> + <property id='description'>Any user which has a valid assignment where the group is shadir must have Author role.</property> + <multi_property id='category'>group/shadir</multi_property> + </role> +</type_roles> \ No newline at end of file diff --git a/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Data%20Set.xml b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Data%20Set.xml new file mode 100644 index 0000000000000000000000000000000000000000..853f361c244bc90ba23a9e653ebad04711740bfc --- /dev/null +++ b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Data%20Set.xml @@ -0,0 +1,12 @@ +<type_roles> + <role id='Auditor'> + <property id='title'>Any From ShaDir Group</property> + <property id='description'>Any user which has a valid assignment where the group is shadir must have Auditor role.</property> + <multi_property id='category'>group/shadir</multi_property> + </role> + <role id='Auditor'> + <property id='title'>Any From Shadir Group</property> + <property id='description'>Any user which has a valid assignment where the group is shadir* must have Auditor role.</property> + <multi_property id='category'>group/shadir</multi_property> + </role> +</type_roles> \ No newline at end of file diff --git a/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Document%20Module.xml b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Document%20Module.xml new file mode 100644 index 0000000000000000000000000000000000000000..cb33b070b72781303b5b8ea1e97fe7fbb4748b4c --- /dev/null +++ b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Document%20Module.xml @@ -0,0 +1,12 @@ +<type_roles> + <role id='Author'> + <property id='title'>Any From ShaCache Group</property> + <property id='description'>Any user which has a valid assignment where the group is shacache must have Author role.</property> + <multi_property id='category'>group/shacache</multi_property> + </role> + <role id='Author'> + <property id='title'>Any From ShaDir Group</property> + <property id='description'>Any user which has a valid assignment where the group is shadir must have Author role.</property> + <multi_property id='category'>group/shadir</multi_property> + </role> +</type_roles> \ No newline at end of file diff --git a/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Drawing.xml b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Drawing.xml new file mode 100644 index 0000000000000000000000000000000000000000..3712be64d32b7034c210fd9a67972886d8d93aca --- /dev/null +++ b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Drawing.xml @@ -0,0 +1,7 @@ +<type_roles> + <role id='Auditor'> + <property id='title'>Any From ShaCache Group</property> + <property id='description'>Any user which has a valid assignment where the group is shacache must have Auditor role.</property> + <multi_property id='category'>group/shacache</multi_property> + </role> +</type_roles> \ No newline at end of file diff --git a/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/File.xml b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/File.xml new file mode 100644 index 0000000000000000000000000000000000000000..3712be64d32b7034c210fd9a67972886d8d93aca --- /dev/null +++ b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/File.xml @@ -0,0 +1,7 @@ +<type_roles> + <role id='Auditor'> + <property id='title'>Any From ShaCache Group</property> + <property id='description'>Any user which has a valid assignment where the group is shacache must have Auditor role.</property> + <multi_property id='category'>group/shacache</multi_property> + </role> +</type_roles> \ No newline at end of file diff --git a/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Image%20Module.xml b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Image%20Module.xml new file mode 100644 index 0000000000000000000000000000000000000000..ec6a234ce88a153980646d37eff7c2cafe5fe9e3 --- /dev/null +++ b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Image%20Module.xml @@ -0,0 +1,7 @@ +<type_roles> + <role id='Author'> + <property id='title'>Any From ShaCache Group</property> + <property id='description'>Any user which has a valid assignment where the group is shacache must have Author role.</property> + <multi_property id='category'>group/shacache</multi_property> + </role> +</type_roles> \ No newline at end of file diff --git a/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Image.xml b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Image.xml new file mode 100644 index 0000000000000000000000000000000000000000..3712be64d32b7034c210fd9a67972886d8d93aca --- /dev/null +++ b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Image.xml @@ -0,0 +1,7 @@ +<type_roles> + <role id='Auditor'> + <property id='title'>Any From ShaCache Group</property> + <property id='description'>Any user which has a valid assignment where the group is shacache must have Auditor role.</property> + <multi_property id='category'>group/shacache</multi_property> + </role> +</type_roles> \ No newline at end of file diff --git a/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/PDF.xml b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/PDF.xml new file mode 100644 index 0000000000000000000000000000000000000000..3712be64d32b7034c210fd9a67972886d8d93aca --- /dev/null +++ b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/PDF.xml @@ -0,0 +1,7 @@ +<type_roles> + <role id='Auditor'> + <property id='title'>Any From ShaCache Group</property> + <property id='description'>Any user which has a valid assignment where the group is shacache must have Auditor role.</property> + <multi_property id='category'>group/shacache</multi_property> + </role> +</type_roles> \ No newline at end of file diff --git a/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Presentation.xml b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Presentation.xml new file mode 100644 index 0000000000000000000000000000000000000000..3712be64d32b7034c210fd9a67972886d8d93aca --- /dev/null +++ b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Presentation.xml @@ -0,0 +1,7 @@ +<type_roles> + <role id='Auditor'> + <property id='title'>Any From ShaCache Group</property> + <property id='description'>Any user which has a valid assignment where the group is shacache must have Auditor role.</property> + <multi_property id='category'>group/shacache</multi_property> + </role> +</type_roles> \ No newline at end of file diff --git a/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Spreadsheet.xml b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Spreadsheet.xml new file mode 100644 index 0000000000000000000000000000000000000000..3712be64d32b7034c210fd9a67972886d8d93aca --- /dev/null +++ b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Spreadsheet.xml @@ -0,0 +1,7 @@ +<type_roles> + <role id='Auditor'> + <property id='title'>Any From ShaCache Group</property> + <property id='description'>Any user which has a valid assignment where the group is shacache must have Auditor role.</property> + <multi_property id='category'>group/shacache</multi_property> + </role> +</type_roles> \ No newline at end of file diff --git a/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Text.xml b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Text.xml new file mode 100644 index 0000000000000000000000000000000000000000..0a63b58b5922ed364397c19e2c94be269fe7d141 --- /dev/null +++ b/bt5/networkcache_erp5/PortalTypeRolesTemplateItem/Text.xml @@ -0,0 +1,12 @@ +<type_roles> + <role id='Auditor'> + <property id='title'>Any From ShaCache Group</property> + <property id='description'>Any user which has a valid assignment where the group is shacache must have Auditor role.</property> + <multi_property id='category'>group/shacache</multi_property> + </role> + <role id='Auditor'> + <property id='title'>Any From ShaDir Group</property> + <property id='description'>Any user which has a valid assignment where the group is shadir must have Author role.</property> + <multi_property id='category'>group/shadir</multi_property> + </role> +</type_roles> \ No newline at end of file diff --git a/bt5/networkcache_erp5/TestTemplateItem/ShaSecurityMixin.py b/bt5/networkcache_erp5/TestTemplateItem/ShaSecurityMixin.py new file mode 100644 index 0000000000000000000000000000000000000000..5d42fa7ae3c8bfe800dcfb4a8d4a0556db7cd52f --- /dev/null +++ b/bt5/networkcache_erp5/TestTemplateItem/ShaSecurityMixin.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2011 Nexedi SA and Contributors. All Rights Reserved. +# Lucas Carvalho <lucas@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + + +from AccessControl.SecurityManagement import newSecurityManager + + +class ShaSecurityMixin(object): + """ + ShaSecurity - Mixin Class + """ + + def afterSetUp(self): + """ + Initialize the ERP5 site. + """ + self.lucas_user = 'lucas' + self.createUser(self.lucas_user, self.lucas_user) + + self.toto_user = 'toto' + self.createUser(self.toto_user, self.toto_user) + + def createUser(self, reference, password): + """ + Create a user with basic information + """ + person = self.portal.portal_catalog.getResultValue(portal_type='Person', + reference=reference) + if person is None: + person = self.portal.person_module.newContent(portal_type='Person') + person.edit(first_name=reference, + reference=reference, + password=password) + self.stepTic() + assignment = person.newContent(portal_type='Assignment') + assignment.edit(start_date='10/10/2000', + stop_date='10/10/2100', + group=self.group) + assignment.open() + self.stepTic() + + def changeUser(self, user_id): + """ + Change the current user to user_id + """ + user_folder = self.getPortal().acl_users + user = user_folder.getUserById(user_id).__of__(user_folder) + newSecurityManager(None, user) + + diff --git a/bt5/networkcache_erp5/TestTemplateItem/testShaCacheExternal.py b/bt5/networkcache_erp5/TestTemplateItem/testShaCacheExternal.py new file mode 100644 index 0000000000000000000000000000000000000000..e1e1aeec2b812ef97ea5779dc2e2cc573cbbc57b --- /dev/null +++ b/bt5/networkcache_erp5/TestTemplateItem/testShaCacheExternal.py @@ -0,0 +1,143 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2011 Nexedi SA and Contributors. All Rights Reserved. +# Lucas Carvalho <lucas@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + + +import base64 +import os +import transaction +import httplib +from DateTime import DateTime +from Products.ERP5Type.tests.ERP5TypeLiveTestCase import ERP5TypeLiveTestCase +from ShaCacheMixin import ShaCacheMixin +from ShaSecurityMixin import ShaSecurityMixin + + +class TestShaCacheExternal(ShaCacheMixin, ShaSecurityMixin, ERP5TypeLiveTestCase): + """ + ShaCache - HTTP File Cache server + We must simulate the real usage of ShaCache using httplib. + """ + + def getTitle(self): + """ + Return the title of the current test set. + """ + return "SHACACHE External - Real Usage Of ShaCache" + + def afterSetUp(self): + """ + Initialize the ERP5 site. + """ + self.expected_content_type = 'application/octet-stream' + self.group = 'shacache' + ShaCacheMixin.afterSetUp(self) + ShaSecurityMixin.afterSetUp(self) + + # Define POST headers with Authentication + self.content_type = 'application/json' + authentication_string = '%s:%s' % (self.lucas_user, self.lucas_user) + base64string = base64.encodestring(authentication_string).strip() + self.header_dict = {'Authorization': 'Basic %s' % base64string, + 'Content-Type': self.content_type} + + # HTTP Connection properties + self.host = self.portal.REQUEST.get('SERVER_NAME') + self.port = self.portal.REQUEST.get('SERVER_PORT') + web_site_path = self.portal.data_set_module.web_site_module.shacache.getPath() + self.path = os.path.join(web_site_path, self.key) + + def test_external_post(self): + """ + Test the external usage to POST information + """ + now = DateTime() + connection = httplib.HTTPConnection('%s:%s' % (self.host, self.port)) + try: + connection.request('PUT', self.path, self.data, self.header_dict) + result = connection.getresponse() + transaction.commit() + self.tic() + data = result.read() + finally: + connection.close() + self.assertEquals('', data) + self.assertEquals(201, result.status) + + # Check Document + document = self.portal.portal_catalog.getResultValue(portal_type='File', + reference=self.key, + creation_date=' >= "%s"' % now) + self.assertNotEquals(None, document) + self.assertEquals(self.data, document.getData()) + self.assertEquals('File', document.getPortalType()) + self.assertEquals('Published Alive', document.getValidationStateTitle()) + self.assertEquals(self.expected_content_type, document.getContentType()) + + def test_external_get(self, annonymous=False): + """ + Test the external usage to retrive the information + """ + self.test_external_post() + header_dict = {} + if not annonymous: + header_dict = self.header_dict + + connection = httplib.HTTPConnection('%s:%s' % (self.host, self.port)) + try: + connection.request('GET', self.path, headers=header_dict) + result = connection.getresponse() + data = result.read() + finally: + connection.close() + self.assertEquals(self.data, data) + self.assertEquals(200, result.status) + self.assertEquals(self.expected_content_type, + result.getheader("content-type")) + + def test_external_get_anonymous(self): + """ + Test the external usage to retrive information + accessing as Anonymous User. + """ + self.test_external_get(annonymous=True) + + def test_external_post_anonymous(self): + """ + Anonymous should not be able to POST a file. + """ + connection = httplib.HTTPConnection('%s:%s' % (self.host, self.port)) + header_dict = {'Content-Type': self.content_type} + try: + connection.request('PUT', self.path, self.data, header_dict) + result = connection.getresponse() + transaction.commit() + self.tic() + finally: + connection.close() + self.assertEquals(302, result.status) diff --git a/bt5/networkcache_erp5/TestTemplateItem/testShaCacheSecurity.py b/bt5/networkcache_erp5/TestTemplateItem/testShaCacheSecurity.py new file mode 100644 index 0000000000000000000000000000000000000000..b6893d543425cf258a3832303cdd436c8b2d7572 --- /dev/null +++ b/bt5/networkcache_erp5/TestTemplateItem/testShaCacheSecurity.py @@ -0,0 +1,218 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2011 Nexedi SA and Contributors. All Rights Reserved. +# Lucas Carvalho <lucas@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + + +import transaction +from AccessControl import Unauthorized +from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase +from ShaCacheMixin import ShaCacheMixin +from ShaSecurityMixin import ShaSecurityMixin + + +class TestShaCacheSecurity(ShaCacheMixin, ShaSecurityMixin, SecurityTestCase): + """ + ShaCache Security Test Case + """ + + def getTitle(self): + """ + Return the title of the current test set. + """ + return "SHADIR Security Test Case" + + def getBusinessTemplateList(self): + """ + Return the list of required business templates. + """ + return ShaCacheMixin().getBusinessTemplateList() + \ + ('erp5_pdm', + 'erp5_data_set', + 'erp5_web_shadir', + 'networkcache_erp5',) + + def afterSetUp(self): + """ + Initialize the ERP5 site. + """ + self.group = 'shacache' + ShaCacheMixin.afterSetUp(self) + ShaSecurityMixin.afterSetUp(self) + + def beforeTearDown(self): + """ + Clear everything for next test. + """ + for module in ('person_module', + 'image_module', + 'document_module',): + folder = self.portal[module] + folder.manage_delObjects(list(folder.objectIds())) + transaction.commit() + self.tic() + + # Tests + def test_anonymous_can_not_create_document(self): + """ + Annonymous should not be able to create any kind of document + under document_module and image_module. + """ + self.logout() + self.assertTrue(self.portal.portal_membership.isAnonymousUser()) + + for module in ('image_module', 'document_module',): + module = getattr(self.portal, module) + for portal_type in module.getVisibleAllowedContentTypeList(): + def tryToCreateDataSet(): + module.newContent(portal_type=portal_type, + reference=self.key) + + self.assertRaises(Unauthorized, tryToCreateDataSet) + + def test_anonymous_can_not_view_document_module(self): + """ + Anonymous should not be able to view document module. + """ + self.logout() + self.assertTrue(self.portal.portal_membership.isAnonymousUser()) + self.assertRaises(Unauthorized, self.portal.document_module.view) + self.assertRaises(Unauthorized, self.portal.document_module) + + def test_anonymous_can_not_view_image_module(self): + """ + Anonymous should not be able to view image module. + """ + self.logout() + self.assertTrue(self.portal.portal_membership.isAnonymousUser()) + self.assertRaises(Unauthorized, self.portal.image_module.view) + self.assertRaises(Unauthorized, self.portal.image_module) + + + def test_anonymous_can_not_read_document_list(self): + """ + Anonymous can not read any document object under document_module + and image_module. + """ + for module in ('image_module', 'document_module',): + module = getattr(self.portal, module) + for portal_type in module.getVisibleAllowedContentTypeList(): + self.login() + self.assertFalse(self.portal.portal_membership.isAnonymousUser()) + + document = module.newContent(portal_type=portal_type) + document.publishAlive() + self.stepTic() + + self.logout() + self.assertTrue(self.portal.portal_membership.isAnonymousUser()) + + self.assertRaises(Unauthorized, document.view) + self.assertRaises(Unauthorized, document) + + def test_user_can_create_and_view_document_list(self): + """ + User must be able to create and view any document object under + document_module and image_module. + + It also must check if document can be published alive. + """ + self.changeUser(self.lucas_user) + for module in ('image_module', 'document_module',): + module = getattr(self.portal, module) + for portal_type in module.getVisibleAllowedContentTypeList(): + document = module.newContent(portal_type=portal_type) + + document() + document.view() + + document.publishAlive() + self.stepTic() + + self.assertEquals('Published Alive', + document.getValidationStateTitle()) + + self.assertUserHaveRoleOnDocument(self.lucas_user, 'Auditor', document) + + def test_user_can_not_view_document_module(self): + """ + User must not be able to see document module. + Author can not view the module. + """ + self.changeUser(self.lucas_user) + self.assertRaises(Unauthorized, self.portal.document_module.view) + self.assertRaises(Unauthorized, self.portal.document_module) + + self.assertUserHaveRoleOnDocument(self.lucas_user, 'Author', + self.portal.document_module) + + def test_user_can_not_view_image_module(self): + """ + User must not be able to see image module. + Author can not view the module. + """ + self.changeUser(self.lucas_user) + self.assertRaises(Unauthorized, self.portal.image_module.view) + self.assertRaises(Unauthorized, self.portal.image_module) + + self.assertUserHaveRoleOnDocument(self.lucas_user, 'Author', + self.portal.image_module) + + def test_user_can_view_published_alive_document_from_other_users(self): + """ + If the user A creates a document object, and set it as published alive. + The user B must be able to view the object. + """ + for module in ('image_module', 'document_module',): + module = getattr(self.portal, module) + for portal_type in module.getVisibleAllowedContentTypeList(): + + self.changeUser(self.toto_user) + document = module.newContent(portal_type=portal_type) + document.publishAlive() + self.stepTic() + + self.changeUser(self.lucas_user) + document() + document.view() + + # Contribution Tool + def test_user_create_document_using_contribution_tool(self): + """ + User must be able to create a document using contribution. + """ + self.changeUser(self.lucas_user) + contribution_tool = self.portal.portal_contributions + self.assertUserHaveRoleOnDocument(self.lucas_user, 'Author', + contribution_tool) + document = self.portal.portal_contributions.newContent( + filename='test.txt', + data='test content', + reference='test-reference') + document() + document.view() + self.assertUserHaveRoleOnDocument(self.lucas_user, 'Auditor', document) diff --git a/bt5/networkcache_erp5/TestTemplateItem/testShaDirExternal.py b/bt5/networkcache_erp5/TestTemplateItem/testShaDirExternal.py new file mode 100644 index 0000000000000000000000000000000000000000..adcefb111d059dfa048a1c18ca0b6209cf6c7a85 --- /dev/null +++ b/bt5/networkcache_erp5/TestTemplateItem/testShaDirExternal.py @@ -0,0 +1,173 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2011 Nexedi SA and Contributors. All Rights Reserved. +# Lucas Carvalho <lucas@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + + +import base64 +import json +import os +import transaction +import httplib +from DateTime import DateTime +from Products.ERP5Type.tests.ERP5TypeLiveTestCase import ERP5TypeLiveTestCase +from ShaDirMixin import ShaDirMixin +from ShaSecurityMixin import ShaSecurityMixin + + +class TestShaDirExternal(ShaDirMixin, ShaSecurityMixin, ERP5TypeLiveTestCase): + """ + ShaDir - HTTP Information Cache server + We must simulate the real usage of ShaDir using httplib. + """ + + def getTitle(self): + """ + Return the title of the current test set. + """ + return "SHADIR External - Real Usage Of ShaDir" + + def afterSetUp(self): + """ + Initialize the ERP5 site. + """ + self.group = 'shadir' + ShaDirMixin.afterSetUp(self) + ShaSecurityMixin.afterSetUp(self) + + # Define POST headers with Authentication + self.content_type = 'application/json' + authentication_string = '%s:%s' % (self.lucas_user, self.lucas_user) + base64string = base64.encodestring(authentication_string).strip() + self.header_dict = {'Authorization': 'Basic %s' % base64string, + 'Content-Type': self.content_type} + + # HTTP Connection properties + self.host = self.portal.REQUEST.get('SERVER_NAME') + self.port = self.portal.REQUEST.get('SERVER_PORT') + web_site_path = self.portal.web_site_module.shadir.getPath() + self.path = os.path.join(web_site_path, self.key) + + def test_external_post(self): + """ + Test the external usage to POST information + """ + now = DateTime() + connection = httplib.HTTPConnection('%s:%s' % (self.host, self.port)) + try: + connection.request('PUT', self.path, self.data, self.header_dict) + result = connection.getresponse() + transaction.commit() + self.tic() + data = result.read() + finally: + connection.close() + self.assertEquals('', data) + self.assertEquals(201, result.status) + + # Check Data Set + data_set = self.portal.portal_catalog.getResultValue( + portal_type='Data Set', + reference=self.key) + self.assertNotEquals(None, data_set) + self.assertEquals('Published', data_set.getValidationStateTitle()) + + # Check Document + document = self.portal.portal_catalog.getResultValue(portal_type='File', + reference=self.sha512sum, + creation_date=' >= "%s"' % now) + self.assertNotEquals(None, document) + self.assertEquals(self.data, document.getData()) + self.assertEquals(str(self.expiration_date), + str(document.getExpirationDate())) + self.assertEquals(data_set, document.getFollowUpValue()) + self.assertEquals('File', document.getPortalType()) + self.assertEquals('Published Alive', document.getValidationStateTitle()) + + def test_external_get(self, annonymous=False): + """ + Test the external usage to retrive the information + """ + self.test_external_post() + header_dict = {} + if not annonymous: + header_dict = self.header_dict + + connection = httplib.HTTPConnection('%s:%s' % (self.host, self.port)) + try: + connection.request('GET', self.path, headers=header_dict) + result = connection.getresponse() + data = result.read() + finally: + connection.close() + self.assertEquals(json.dumps([json.loads(self.data)]), data) + self.assertEquals(200, result.status) + self.assertEquals(self.content_type, result.getheader("content-type")) + + def test_external_get_anonymous(self): + """ + Test the external usage to retrive information + accessing as Anonymous User. + """ + self.test_external_get(annonymous=True) + + def test_external_post_anonymous(self): + """ + """ + connection = httplib.HTTPConnection('%s:%s' % (self.host, self.port)) + header_dict = {'Content-Type': self.content_type} + try: + connection.request('PUT', self.path, self.data, header_dict) + result = connection.getresponse() + transaction.commit() + self.tic() + finally: + connection.close() + self.assertEquals(302, result.status) + + def test_external_post_with_wrong_data(self): + """ + The data which is sent to the server must follow a JSON schema. + If the data does not follow the schema it must return the error. + """ + # Removing a required property + self.data_list[0].pop('file') + self.data = json.dumps(self.data_list) + + connection = httplib.HTTPConnection('%s:%s' % (self.host, self.port)) + try: + connection.request('PUT', self.path, self.data, self.header_dict) + result = connection.getresponse() + transaction.commit() + self.tic() + data = result.read() + finally: + connection.close() + self.assertTrue("Required field 'file' is missing" in data, data) + self.assertEquals(500, result.status) + self.assertEquals('text/html; charset=utf-8', + result.getheader("content-type")) diff --git a/bt5/networkcache_erp5/TestTemplateItem/testShaDirSecurity.py b/bt5/networkcache_erp5/TestTemplateItem/testShaDirSecurity.py new file mode 100644 index 0000000000000000000000000000000000000000..2e4daf229745326365f776dee2d262e4ead9ba2b --- /dev/null +++ b/bt5/networkcache_erp5/TestTemplateItem/testShaDirSecurity.py @@ -0,0 +1,228 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2011 Nexedi SA and Contributors. All Rights Reserved. +# Lucas Carvalho <lucas@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + + +import transaction +from AccessControl import Unauthorized +from Products.ERP5Type.tests.SecurityTestCase import SecurityTestCase +from ShaDirMixin import ShaDirMixin +from ShaSecurityMixin import ShaSecurityMixin + + +class TestShaDirSecurity(ShaDirMixin, ShaSecurityMixin, SecurityTestCase): + """ + ShaDir Security Test Case + """ + + def getTitle(self): + """ + Return the title of the current test set. + """ + return "SHADIR Security Test Case" + + def getBusinessTemplateList(self): + """ + Return the list of required business templates. + """ + return ShaDirMixin().getBusinessTemplateList() + \ + ('networkcache_erp5',) + + def afterSetUp(self): + """ + Initialize the ERP5 site. + """ + self.group = 'shadir' + ShaDirMixin.afterSetUp(self) + ShaSecurityMixin.afterSetUp(self) + + def beforeTearDown(self): + """ + Clear everything for next test. + """ + for module in ('person_module', + 'data_set_module', + 'document_module',): + folder = self.portal[module] + folder.manage_delObjects(list(folder.objectIds())) + transaction.commit() + self.tic() + + # Tests + def test_anonymous_can_not_create_data_set(self): + """ + Annonymous should not be able to create data set and it also should not + be able to view data_set_module. + """ + self.logout() + self.assertTrue(self.portal.portal_membership.isAnonymousUser()) + + def tryToCreateDataSet(): + self.portal.data_set_module.newContent( + portal_type='Data Set', + reference=self.key) + + self.assertRaises(Unauthorized, tryToCreateDataSet) + + def test_anonymous_can_not_view_data_set_module(self): + """ + Anonymous should not be able to view data set module. + """ + self.logout() + self.assertTrue(self.portal.portal_membership.isAnonymousUser()) + self.assertRaises(Unauthorized, self.portal.data_set_module.view) + + def test_anonymous_can_read_data_set_object(self): + """ + Anonymous can read a data set object if it is in published state. + """ + self.login() + self.assertFalse(self.portal.portal_membership.isAnonymousUser()) + + data_set = self.portal.data_set_module.newContent(portal_type='Data Set', + reference=self.key) + data_set.publish() + self.stepTic() + + self.logout() + self.assertTrue(self.portal.portal_membership.isAnonymousUser()) + + data_set.view() + data_set() + + def test_user_can_create_and_view_data_set(self): + """ + User must be able to create and view a data set object + It also must check if data set can be published. + """ + self.changeUser(self.lucas_user) + data_set = self.portal.data_set_module.newContent( + portal_type='Data Set', + reference=self.key) + self.stepTic() + + data_set() + data_set.view() + + data_set.publish() + self.stepTic() + self.assertEquals('Published', data_set.getValidationStateTitle()) + + self.assertUserHaveRoleOnDocument(self.lucas_user, 'Auditor', data_set) + + def test_user_can_not_view_data_set_module(self): + """ + User must not be able to see data set module. + Author can not view the module. + """ + self.changeUser(self.lucas_user) + self.assertRaises(Unauthorized, self.portal.data_set_module.view) + self.assertRaises(Unauthorized, self.portal.data_set_module) + + self.assertUserHaveRoleOnDocument(self.lucas_user, 'Author', + self.portal.data_set_module) + + def test_user_can_view_published_data_set_from_other_users(self): + """ + If the user A creates a Data Set object, and publish it. + The user B must be able to view the object. + """ + self.changeUser(self.toto_user) + data_set = self.portal.data_set_module.newContent( + portal_type='Data Set', + reference=self.key) + data_set.publish() + self.stepTic() + + self.changeUser(self.lucas_user) + data_set() + data_set.view() + + # Text Document + def test_user_can_create_and_view_document(self): + """ + User must be able to create and view a text document object + It also must check if the document can be published alive. + """ + self.changeUser(self.lucas_user) + document = self.portal.document_module.newContent(portal_type='Text') + self.stepTic() + + document() + document.view() + + document.publishAlive() + self.stepTic() + + self.assertEquals('Published Alive', document.getValidationStateTitle()) + self.assertUserHaveRoleOnDocument(self.lucas_user, 'Auditor', document) + + def test_user_can_not_view_document_module(self): + """ + User must not be able to see document module. + Author can not view the module. + """ + self.changeUser(self.lucas_user) + self.assertRaises(Unauthorized, self.portal.document_module.view) + self.assertRaises(Unauthorized, self.portal.document_module) + self.assertUserHaveRoleOnDocument(self.lucas_user, 'Author', + self.portal.document_module) + + def test_user_can_view_published_alive_text_from_other_users(self): + """ + If the user A creates a Text object, and publish it. + The user B must be able to view the object. + """ + self.changeUser(self.toto_user) + document = self.portal.document_module.newContent(portal_type='Text') + document.publishAlive() + self.stepTic() + + self.changeUser(self.lucas_user) + document() + document.view() + + # Contribution Tool + def test_user_create_text_document_using_contribution_tool(self): + """ + User must be able to create a text document using contribution. + """ + self.changeUser(self.lucas_user) + contribution_tool = self.portal.portal_contributions + self.assertUserHaveRoleOnDocument(self.lucas_user, 'Author', + contribution_tool) + data_set = self.portal.data_set_module.newContent(portal_type='Data Set') + document = self.portal.portal_contributions.newContent( + filename='test.txt', + data='test content', + reference='test-reference', + discover_metadata=False, + follow_up_list=[data_set.getRelativeUrl()]) + document() + document.view() + self.assertUserHaveRoleOnDocument(self.lucas_user, 'Auditor', document) diff --git a/bt5/networkcache_erp5/bt/change_log b/bt5/networkcache_erp5/bt/change_log new file mode 100644 index 0000000000000000000000000000000000000000..c2e7dbaadb594e8364fc6d2b2e8cf8b8b8d35d4e --- /dev/null +++ b/bt5/networkcache_erp5/bt/change_log @@ -0,0 +1,2 @@ +27-05-2011 Lucas +* Initial Import \ No newline at end of file diff --git a/bt5/networkcache_erp5/bt/copyright_list b/bt5/networkcache_erp5/bt/copyright_list new file mode 100644 index 0000000000000000000000000000000000000000..5291cb4c27f7c056102df0d8c21726854de742ac --- /dev/null +++ b/bt5/networkcache_erp5/bt/copyright_list @@ -0,0 +1 @@ +Nexedi 2011 \ No newline at end of file diff --git a/bt5/networkcache_erp5/bt/dependency_list b/bt5/networkcache_erp5/bt/dependency_list new file mode 100644 index 0000000000000000000000000000000000000000..4f6c92662ea3c76c13924fc52bef442b111c4001 --- /dev/null +++ b/bt5/networkcache_erp5/bt/dependency_list @@ -0,0 +1,2 @@ +erp5_web_shacache +erp5_web_shadir \ No newline at end of file diff --git a/bt5/networkcache_erp5/bt/license b/bt5/networkcache_erp5/bt/license new file mode 100644 index 0000000000000000000000000000000000000000..c20143a6dbcc94c2756d7f2e72cb019171b18ba1 --- /dev/null +++ b/bt5/networkcache_erp5/bt/license @@ -0,0 +1 @@ +Proprietary \ No newline at end of file diff --git a/bt5/networkcache_erp5/bt/revision b/bt5/networkcache_erp5/bt/revision new file mode 100644 index 0000000000000000000000000000000000000000..8e2afd342773582f9484b796cdc0b84736e8194e --- /dev/null +++ b/bt5/networkcache_erp5/bt/revision @@ -0,0 +1 @@ +17 \ No newline at end of file diff --git a/bt5/networkcache_erp5/bt/template_format_version b/bt5/networkcache_erp5/bt/template_format_version new file mode 100644 index 0000000000000000000000000000000000000000..56a6051ca2b02b04ef92d5150c9ef600403cb1de --- /dev/null +++ b/bt5/networkcache_erp5/bt/template_format_version @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/bt5/networkcache_erp5/bt/template_local_role_list b/bt5/networkcache_erp5/bt/template_local_role_list new file mode 100644 index 0000000000000000000000000000000000000000..a06e4b0ba488f8c1c099045e0912582186a9a928 --- /dev/null +++ b/bt5/networkcache_erp5/bt/template_local_role_list @@ -0,0 +1,4 @@ +data_set_module +document_module +image_module +portal_contributions \ No newline at end of file diff --git a/bt5/networkcache_erp5/bt/template_local_roles_list b/bt5/networkcache_erp5/bt/template_local_roles_list new file mode 100644 index 0000000000000000000000000000000000000000..a06e4b0ba488f8c1c099045e0912582186a9a928 --- /dev/null +++ b/bt5/networkcache_erp5/bt/template_local_roles_list @@ -0,0 +1,4 @@ +data_set_module +document_module +image_module +portal_contributions \ No newline at end of file diff --git a/bt5/networkcache_erp5/bt/template_path_list b/bt5/networkcache_erp5/bt/template_path_list new file mode 100644 index 0000000000000000000000000000000000000000..d726e531a4f9396fcb0b6a6dea5bbfc6a942135f --- /dev/null +++ b/bt5/networkcache_erp5/bt/template_path_list @@ -0,0 +1,4 @@ +portal_categories/group/shacache +portal_categories/group/shacache/** +portal_categories/group/shadir +portal_categories/group/shadir/** \ No newline at end of file diff --git a/bt5/networkcache_erp5/bt/template_portal_type_role_list b/bt5/networkcache_erp5/bt/template_portal_type_role_list new file mode 100644 index 0000000000000000000000000000000000000000..4f348e861de5c7d0a2297deee3e0dccde9b54626 --- /dev/null +++ b/bt5/networkcache_erp5/bt/template_portal_type_role_list @@ -0,0 +1,12 @@ +Contribution Tool +Data Set +Data Set Module +Document Module +Drawing +File +Image +Image Module +PDF +Presentation +Spreadsheet +Text \ No newline at end of file diff --git a/bt5/networkcache_erp5/bt/template_portal_type_roles_list b/bt5/networkcache_erp5/bt/template_portal_type_roles_list new file mode 100644 index 0000000000000000000000000000000000000000..4f348e861de5c7d0a2297deee3e0dccde9b54626 --- /dev/null +++ b/bt5/networkcache_erp5/bt/template_portal_type_roles_list @@ -0,0 +1,12 @@ +Contribution Tool +Data Set +Data Set Module +Document Module +Drawing +File +Image +Image Module +PDF +Presentation +Spreadsheet +Text \ No newline at end of file diff --git a/bt5/networkcache_erp5/bt/template_test_id_list b/bt5/networkcache_erp5/bt/template_test_id_list new file mode 100644 index 0000000000000000000000000000000000000000..7208580d16ec962aceb702472c3f4d9681faf92a --- /dev/null +++ b/bt5/networkcache_erp5/bt/template_test_id_list @@ -0,0 +1,5 @@ +testShaCacheSecurity +testShaDirSecurity +testShaDirExternal +testShaCacheExternal +ShaSecurityMixin \ No newline at end of file diff --git a/bt5/networkcache_erp5/bt/title b/bt5/networkcache_erp5/bt/title new file mode 100644 index 0000000000000000000000000000000000000000..61f21bcf139569918312064efe1a07a2887f001b --- /dev/null +++ b/bt5/networkcache_erp5/bt/title @@ -0,0 +1 @@ +networkcache_erp5 \ No newline at end of file diff --git a/bt5/networkcache_erp5/bt/version b/bt5/networkcache_erp5/bt/version new file mode 100644 index 0000000000000000000000000000000000000000..48360de846a2e022a0b981d250895f20d3480d34 --- /dev/null +++ b/bt5/networkcache_erp5/bt/version @@ -0,0 +1 @@ +5.4.7 \ No newline at end of file diff --git a/product/ERP5/mixin/virtual_folder.py b/product/ERP5/mixin/virtual_folder.py new file mode 100644 index 0000000000000000000000000000000000000000..ba66a481939687e3492a1ec3b23cf97c1e0be4ee --- /dev/null +++ b/product/ERP5/mixin/virtual_folder.py @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (c) 2011 Nexedi SA and Contributors. All Rights Reserved. +# Lucas Carvalho <lucas@nexedi.com> +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + + +_marker=[] + +from AccessControl import ClassSecurityInfo +from Products.ERP5Type.Core.Folder import Folder +from Products.ERP5Type.TransactionalVariable import getTransactionalVariable + + +class VirtualFolderMixin: + """ + Virtual Folder Mixin is a class which allows to customize the _setObject + and _getOb methods for a given portal type. + """ + + security = ClassSecurityInfo() + + security.declarePrivate('PUT_factory') + def PUT_factory(self, name, typ, body): + """ Factory for PUT requests to objects which do not yet exist. + + Used by NullResource.PUT. + + Returns -- Bare and empty object of the appropriate type (or None, if + we don't know what to do) + """ + method = getattr(self, 'Base_putFactory', None) + if method is not None: + return method(name, typ, body) + + return Folder.PUT_factory(self, name, typ, body) + + security.declarePrivate('_setObject') + def _setObject(self, id, ob, **kw): + """ + XXX + """ + tv = getTransactionalVariable() + key = (id, ) + tv[key] = ob.__of__(self).getRelativeUrl() + + method = getattr(self, 'Base_setObject', None) + if method is not None: + return method(id, ob, **kw) + + return Folder._setObject(self, id, ob, **kw) + + security.declarePrivate('_getOb') + def _getOb(self, id, default=_marker, **kw): + """ + XXX + """ + tv = getTransactionalVariable() + document_url = tv.get((id,), None) + if document_url is not None: + return self.getPortalObject().unrestrictedTraverse(document_url) + + return Folder._getOb(self, id, **kw)