[Erp5-report] r38213 fx.algrain - in /experimental/bt5/erp5_credential: SkinTemplateItem/po...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Sep 9 10:04:37 CEST 2010


Author: fx.algrain
Date: Thu Sep  9 10:04:32 2010
New Revision: 38213

URL: http://svn.erp5.org?rev=38213&view=rev
Log:
Simplify the script in interaction :
- call CredentialRequest_createPersonAndAssignment only
- create an independent script to send notification
- it's  CredentialRequest_createPersonAndAssignment that call this script
=> allow esay override if needed

Added:
    experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_sendAcceptedNotification.xml
Modified:
    experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createPersonAndAssignment.xml
    experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_interaction_workflow/scripts/CredentialRequest_createUserAccount.xml

Modified: experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createPersonAndAssignment.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createPersonAndAssignment.xml?rev=38213&r1=38212&r2=38213&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createPersonAndAssignment.xml [utf8] (original)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createPersonAndAssignment.xml [utf8] Thu Sep  9 10:04:32 2010
@@ -2,10 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <tuple>
-        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
-        <tuple/>
-      </tuple>
+      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -84,6 +81,9 @@ assignment = person.newContent(portal_ty
 # open the assignment\n
 assignment.open()\n
 \n
+#Send notification\n
+credential_request.CredentialRequest_sendAcceptedNotification()\n
+\n
 return person\n
 </string> </value>
         </item>

Added: experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_sendAcceptedNotification.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_sendAcceptedNotification.xml?rev=38213&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_sendAcceptedNotification.xml (added)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_sendAcceptedNotification.xml [utf8] Thu Sep  9 10:04:32 2010
@@ -0,0 +1,138 @@
+<?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># send mail\n
+portal = context.getPortalObjec()\n
+credential_request = context\n
+person = context.getDestinationDecisionValue(portal_type=\'Person\')\n
+\n
+subject = Base_translateString("${instance_name} account created",\n
+    mapping=dict(instance_name=portal.getTitle()))\n
+message = Base_translateString("\\nCongratulation, the creation of you new " \\\n
+    "${instance_name} account \'${user_id}\' is finished.\\n\\nThank you",\n
+    mapping=dict(instance_name=portal.getTitle(), user_id=credential_request.getUserId()))\n
+portal.portal_notifications.sendMessage(sender=None,\n
+    recipient=[person,], subject=subject, message=message)\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>_getattr_</string>
+                            <string>context</string>
+                            <string>portal</string>
+                            <string>credential_request</string>
+                            <string>person</string>
+                            <string>Base_translateString</string>
+                            <string>dict</string>
+                            <string>subject</string>
+                            <string>message</string>
+                            <string>None</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>CredentialRequest_sendAcceptedNotification</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_interaction_workflow/scripts/CredentialRequest_createUserAccount.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_interaction_workflow/scripts/CredentialRequest_createUserAccount.xml?rev=38213&r1=38212&r2=38213&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_interaction_workflow/scripts/CredentialRequest_createUserAccount.xml [utf8] (original)
+++ experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_interaction_workflow/scripts/CredentialRequest_createUserAccount.xml [utf8] Thu Sep  9 10:04:32 2010
@@ -2,10 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <tuple>
-        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
-        <tuple/>
-      </tuple>
+      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -53,19 +50,8 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>portal = context.getPortalObject()\n
-Base_translateString = portal.Base_translateString\n
-credential_request = state_change[\'object\']\n
-person = credential_request.CredentialRequest_createPersonAndAssignment()\n
-\n
-# send mail\n
-subject = Base_translateString("${instance_name} account created",\n
-    mapping=dict(instance_name=portal.getTitle()))\n
-message = Base_translateString("\\nCongratulation, the creation of you new " \\\n
-    "${instance_name} account \'${user_id}\' is finished.\\n\\nThank you",\n
-    mapping=dict(instance_name=portal.getTitle(), user_id=credential_request.getUserId()))\n
-portal.portal_notifications.sendMessage(sender=None,\n
-    recipient=[person,], subject=subject, message=message)\n
+            <value> <string>credential_request = state_change[\'object\']\n
+credential_request.CredentialRequest_createPersonAndAssignment()\n
 </string> </value>
         </item>
         <item>
@@ -111,17 +97,9 @@ portal.portal_notifications.sendMessage(
                         <value>
                           <tuple>
                             <string>state_change</string>
-                            <string>_getattr_</string>
-                            <string>context</string>
-                            <string>portal</string>
-                            <string>Base_translateString</string>
                             <string>_getitem_</string>
                             <string>credential_request</string>
-                            <string>person</string>
-                            <string>dict</string>
-                            <string>subject</string>
-                            <string>message</string>
-                            <string>None</string>
+                            <string>_getattr_</string>
                           </tuple>
                         </value>
                     </item>




More information about the Erp5-report mailing list