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

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Sep 16 17:20:00 CEST 2010


Author: fx.algrain
Date: Thu Sep 16 17:19:59 2010
New Revision: 38426

URL: http://svn.erp5.org?rev=38426&view=rev
Log:
Add script to process accepted credential update

Added:
    experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialUpdate_updateOrganisationInformation.xml
    experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialUpdate_updatePersonInformation.xml
    experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialUpdate_updateRelatedEntity.xml
    experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_updatePersonPassword.xml

Added: experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialUpdate_updateOrganisationInformation.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialUpdate_updateOrganisationInformation.xml?rev=38426&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialUpdate_updateOrganisationInformation.xml (added)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialUpdate_updateOrganisationInformation.xml [utf8] Thu Sep 16 17:19:59 2010
@@ -0,0 +1,145 @@
+<?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>"""Copy subscription information to related person"""\n
+\n
+organisation = context.getDestinationDecisionValue(portal_type="Organisation")\n
+\n
+#Mapping\n
+organisation_mapping = (\n
+    # (subscription, organisation)\n
+    (\'default_email_text\', \'default_email_text\'),\n
+    (\'default_telephone_text\', \'default_telephone_text\'),\n
+    (\'default_fax_text\', \'default_fax_text\'),\n
+    (\'default_address_street_address\', \'default_address_street_address\'),\n
+    (\'default_address_zip_code\', \'default_address_zip_code\'),\n
+    (\'default_address_city\', \'default_address_city\'),\n
+    (\'default_address_region\', \'default_address_region\'),\n
+    (\'default_mobile_telephone_text\', \'default_mobile_telephone_text\'),\n
+    (\'activity_list\', \'default_career_activity_list\'),\n
+    )\n
+\n
+context.Credential_copyRegistredInformation(organisation, organisation_mapping)\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>_proxy_roles</string> </key>
+            <value>
+              <tuple/>
+            </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>0</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>organisation</string>
+                            <string>organisation_mapping</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>CredentialUpdate_updateOrganisationInformation</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/CredentialUpdate_updatePersonInformation.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialUpdate_updatePersonInformation.xml?rev=38426&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialUpdate_updatePersonInformation.xml (added)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialUpdate_updatePersonInformation.xml [utf8] Thu Sep 16 17:19:59 2010
@@ -0,0 +1,171 @@
+<?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>"""Copy subscription information to related person"""\n
+\n
+context.Credential_checkConsistency([\'Person\'])\n
+person = context.getDestinationDecisionValue(portal_type="Person")\n
+\n
+# Person Mapping\n
+person_mapping = (\n
+    # (credential, person)\n
+    (\'first_name\', \'first_name\'),\n
+    (\'last_name\', \'last_name\'),\n
+    (\'birthday\', \'birthday\'),\n
+    (\'default_email_text\', \'default_email_text\'),\n
+    (\'default_telephone_text\', \'default_telephone_text\'),\n
+    (\'default_fax_text\', \'default_fax_text\'),\n
+    (\'default_address_street_address\', \'default_address_street_address\'),\n
+    (\'default_address_zip_code\', \'default_address_zip_code\'),\n
+    (\'default_address_city\', \'default_address_city\'),\n
+    (\'default_address_region\', \'default_address_region\'),\n
+    (\'default_mobile_telephone_text\', \'default_mobile_telephone_text\'),\n
+    (\'activity_list\', \'default_career_activity_list\'),\n
+    (\'function_list\', \'default_career_function_list\'),\n
+    (\'default_credential_question_answer\', \'default_credential_question_answer\'),\n
+    (\'default_credential_question_question\', \'default_credential_question_question\'),\n
+    (\'default_credential_question_question_free_text\', \'default_credential_question_question_free_text\'),\n
+    )\n
+\n
+context.Credential_copyRegistredInformation(person, person_mapping)\n
+\n
+if context.getPassword():\n
+  context.Credential_updatePersonPassword()\n
+\n
+#We update his assignment too\n
+assignment_mapping = (\n
+    # (credential, assignment)\n
+    (\'activity_list\', \'activity_list\'),\n
+    (\'function_list\', \'function_list\'),\n
+    )\n
+\n
+for assingment in person.searchFolder(portal_type="Assignment", validation_state="open"):\n
+  context.Credential_copyRegistredInformation(assignment, assignment_mapping,copy_empty_value=False,erase_empty_value=False)\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>_proxy_roles</string> </key>
+            <value>
+              <tuple/>
+            </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>0</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>person</string>
+                            <string>person_mapping</string>
+                            <string>assignment_mapping</string>
+                            <string>_getiter_</string>
+                            <string>assingment</string>
+                            <string>assignment</string>
+                            <string>False</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>CredentialUpdate_updatePersonInformation</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/CredentialUpdate_updateRelatedEntity.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialUpdate_updateRelatedEntity.xml?rev=38426&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialUpdate_updateRelatedEntity.xml (added)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialUpdate_updateRelatedEntity.xml [utf8] Thu Sep 16 17:19:59 2010
@@ -0,0 +1,127 @@
+<?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>"""Update relative entity with a credential update. Allow to update a organisation or a person for exemple"""\n
+#Use list and getattr to do generic purpose\n
+for destination_decision in context.getDestinationDecisionValueList():\n
+  portal_type = destination_decision.getPortalType().replace(\' \',\'\')\n
+  geattr(context,\'CredentialUpdate_update%sInformation\' % portal_type)()\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string></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>0</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>_getiter_</string>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>destination_decision</string>
+                            <string>portal_type</string>
+                            <string>geattr</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>CredentialUpdate_updateRelatedEntity</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_updatePersonPassword.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_updatePersonPassword.xml?rev=38426&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_updatePersonPassword.xml (added)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_updatePersonPassword.xml [utf8] Thu Sep 16 17:19:59 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>"""Use script with Proxy Role Manager to update password of related person. \n
+Clear \'erp5_content_short\' cache too."""\n
+\n
+person = credential_update.getDestinationDecisionValue(portal_type="Person")\n
+\n
+if credential.getPassword():\n
+  person.setEncodedPassword(credential.getPassword())\n
+  context.portal_caches.clearCache((\'erp5_content_short\',))\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>_proxy_roles</string> </key>
+            <value>
+              <tuple>
+                <string>Manager</string>
+              </tuple>
+            </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>0</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>_getattr_</string>
+                            <string>credential_update</string>
+                            <string>person</string>
+                            <string>credential</string>
+                            <string>context</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Credential_updatePersonPassword</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