[Erp5-report] r38420 fx.algrain - /experimental/bt5/erp5_credential/SkinTemplateItem/portal...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Sep 16 16:31:26 CEST 2010


Author: fx.algrain
Date: Thu Sep 16 16:31:26 2010
New Revision: 38420

URL: http://svn.erp5.org?rev=38420&view=rev
Log:
Rename script to be used by credential request or credential update

Added:
    experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_checkConsistency.xml
    experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_copyRegistredInformation.xml

Added: experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_checkConsistency.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_checkConsistency.xml?rev=38420&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_checkConsistency.xml (added)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_checkConsistency.xml [utf8] Thu Sep 16 16:31:26 2010
@@ -0,0 +1,137 @@
+<?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>"""Check credential consistency. Usefull before make some actions\n
+By default, just a related person is required, please override this script if you want more.\n
+Parameter: \n
+destination_decision_type - List of portal type required in destination decision value list"""\n
+\n
+for portal_type in destination_decision_type:\n
+  destination = context.getDestinationDecisionValue(portal_type=portal_type)\n
+  if destination is None:\n
+    raise ValueError, \'%s request must  be in relation with a %s\' % (context.getPortalType(),portal_type)\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>destination_decision_type=[\'Person\']</string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>1</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>destination_decision_type</string>
+                            <string>_getiter_</string>
+                            <string>portal_type</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>destination</string>
+                            <string>None</string>
+                            <string>ValueError</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <tuple>
+                <list>
+                  <string>Person</string>
+                </list>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Credential_checkConsistency</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_copyRegistredInformation.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_copyRegistredInformation.xml?rev=38420&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_copyRegistredInformation.xml (added)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_copyRegistredInformation.xml [utf8] Thu Sep 16 16:31:26 2010
@@ -0,0 +1,148 @@
+<?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>"""Use a list of tuple to copy information from credential request to an object"""\n
+def getAccessor(property):\n
+  return "".join([x.capitalize() for x in property.split(\'_\')])\n
+\n
+def copyValue(source_document, source_accessor,\n
+              destination_document, destination_accessor):\n
+    getter = getattr(source_document, \'get%s\' % source_accessor)\n
+    value = getter()\n
+    if not value and copy_empty_value or value:\n
+      setter = getattr(destination_document, \'set%s\' % destination_accessor)\n
+      setter(value)\n
+\n
+def copyDocument(source_document, destination_document, mapping):\n
+    for source_property, destination_property in mapping:\n
+        source_accessor, destination_accessor = getAccessor(source_property), getAccessor(destination_property)\n
+        copyValue(source_document, source_accessor,\n
+                  destination_document, destination_accessor)\n
+\n
+\n
+\n
+copyDocument(context, source, mapping)\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>source,mapping,copy_empty_value=True,erase_empty_value=True</string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>4</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>source</string>
+                            <string>mapping</string>
+                            <string>copy_empty_value</string>
+                            <string>erase_empty_value</string>
+                            <string>getAccessor</string>
+                            <string>copyValue</string>
+                            <string>copyDocument</string>
+                            <string>context</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <tuple>
+                <int>1</int>
+                <int>1</int>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Credential_copyRegistredInformation</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>




More information about the Erp5-report mailing list