[Erp5-report] r38411 fx.algrain - in /experimental/bt5/erp5_credential: SkinTemplateItem/po...
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Sep 16 11:22:10 CEST 2010
Author: fx.algrain
Date: Thu Sep 16 11:22:07 2010
New Revision: 38411
URL: http://svn.erp5.org?rev=38411&view=rev
Log:
Split CredentialRequest_createPersonAndAssignment in multiple script.
Try to be generic much as possible with this split and in each new script
Add script for the jump
Added:
experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_checkConsistency.xml
experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_closePersonAssignment.xml
experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_copyRegistredInformation.xml
experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createUser.xml
experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setDefaultDestinationDecision.xml
experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToOrganisation.xml
experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToPerson.xml
experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_updatePersonAssignment.xml
experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Person_getCredentialRequestUrl.xml
Modified:
experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createPersonAndAssignment.xml
experimental/bt5/erp5_credential/bt/revision
Added: experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_checkConsistency.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_checkConsistency.xml?rev=38411&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_checkConsistency.xml (added)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_checkConsistency.xml [utf8] Thu Sep 16 11:22:07 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>"""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
+\n
+ destination = context.getDestinationDecisionValue(portal_type=portal_type)\n
+ if destination is None:\n
+ raise ValueError, \'Credential request must be in relation with a %s\' % destination.lower()\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>CredentialRequest_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/CredentialRequest_closePersonAssignment.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_closePersonAssignment.xml?rev=38411&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_closePersonAssignment.xml (added)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_closePersonAssignment.xml [utf8] Thu Sep 16 11:22:07 2010
@@ -0,0 +1,157 @@
+<?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>"""Close all person assignemnt \n
+Parameters:\n
+role -- Role category item (List of String, default: [])\n
+comment -- Workflow transition comment (String, default: "")\n
+Return opened assignment list\n
+"""\n
+\n
+person = context.getDestinationDecisionValue(portal_type="Person")\n
+\n
+# Check current assignment\n
+\n
+current_assignment_list = person.searchFolder(portal_type=\'Assignment\',\n
+ validation_state = "open")\n
+open_assignment = []\n
+\n
+for assignment in current_assignment_list:\n
+ assignment = assignment.getObject()\n
+ if assignment.getRole() in role:\n
+ assignment.close(comment)\n
+ else:\n
+ open_assignment.append(assignment)\n
+\n
+return open_assignment\n
+</string> </value>
+ </item>
+ <item>
+ <key> <string>_code</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_params</string> </key>
+ <value> <string>role=[],comment=""</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>2</int> </value>
+ </item>
+ <item>
+ <key> <string>co_varnames</string> </key>
+ <value>
+ <tuple>
+ <string>role</string>
+ <string>comment</string>
+ <string>_getattr_</string>
+ <string>context</string>
+ <string>person</string>
+ <string>current_assignment_list</string>
+ <string>open_assignment</string>
+ <string>_getiter_</string>
+ <string>assignment</string>
+ </tuple>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_defaults</string> </key>
+ <value>
+ <tuple>
+ <list/>
+ <string></string>
+ </tuple>
+ </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>CredentialRequest_closePersonAssignment</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/CredentialRequest_copyRegistredInformation.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_copyRegistredInformation.xml?rev=38411&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_copyRegistredInformation.xml (added)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_copyRegistredInformation.xml [utf8] Thu Sep 16 11:22:07 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 a list of tuple to copy information from credential request to an object"""\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
+ setter = getattr(destination_document, \'set%s\' % destination_accessor)\n
+ setter(value)\n
+\n
+def copyDocument(source_document, destination_document, mapping):\n
+ for source_accessor, destination_accessor in mapping:\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</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>2</int> </value>
+ </item>
+ <item>
+ <key> <string>co_varnames</string> </key>
+ <value>
+ <tuple>
+ <string>source</string>
+ <string>mapping</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>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>CredentialRequest_copyRegistredInformation</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
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=38411&r1=38410&r2=38411&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 16 11:22:07 2010
@@ -50,41 +50,30 @@
</item>
<item>
<key> <string>_body</string> </key>
- <value> <string>credential_request = context\n
-portal = context.getPortalObject()\n
+ <value> <string>"""For a credential request as context, we set the related person informations,\n
+the assignments of the person and send notificaiton email"""\n
\n
-# create a person corresponding to the request\n
-person_module = portal.getDefaultModule(\'Person\')\n
-person_kw = { \'reference\':credential_request.getReference(),\n
- \'first_name\':credential_request.getFirstName(),\n
- \'last_name\':credential_request.getLastName(),\n
- \'email_text\':credential_request.getEmailText(),\n
- \'default_career_role_list\':credential_request.getRoleList(),\n
- \'default_credential_question_answer\':credential_request.getDefaultCredentialQuestionAnswer(),\n
- \'default_credential_question_question_free_text\':credential_request.getDefaultCredentialQuestionQuestionFreeText(),\n
- \'default_credential_question_question\':credential_request.getDefaultCredentialQuestionQuestion(),\n
- }\n
-\n
-person = person_module.newContent(portal_type=\'Person\',\n
- **person_kw)\n
-person.setEncodedPassword(credential_request.getPassword())\n
-credential_request.setDestinationDecisionValue(person)\n
-\n
-# create assignment\n
-assignment = person.newContent(portal_type=\'Assignment\',\n
- function = credential_request.getFunction(),\n
- site = credential_request.getSite(),\n
- activity_list = credential_request.getActivityList(),\n
- start_date=DateTime(),\n
- stop_date=DateTime() + 365*100) # open the assignement for 100 years\n
+if context.getCorporateName():\n
+ related_portal_type.append(\'Organisation\')\n
\n
-# open the assignment\n
-assignment.open()\n
+#Create related object\n
+context.CredentialRequest_setDefaultDestinationDecision(related_portal_type)\n
\n
-#Send notification\n
-credential_request.CredentialRequest_sendAcceptedNotification()\n
+#Check consistency of the subscription\n
+context.CredentialRequest_checkConsistency(related_portal_type)\n
+\n
+#Fill related object with credential request\n
+for portal_type in related_portal_type:\n
+ geattr(context,\'CredentialRequest_setRegisteredInformationTo\' % portal_type.replace(\' \',\'\'))()\n
+\n
+#Create assignment\n
+context.CredentialRequest_updatePersonAssignment()\n
+\n
+#Create account\n
+login, password = context.CredentialRequest_createUser()\n
\n
-return person\n
+#Send notification\n
+context.CredentialRequest_sendAcceptedNotification(login,password)\n
</string> </value>
</item>
<item>
@@ -95,14 +84,12 @@ return person\n
</item>
<item>
<key> <string>_params</string> </key>
- <value> <string></string> </value>
+ <value> <string>related_portal_type = [\'Person\']</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
- <tuple>
- <string>Manager</string>
- </tuple>
+ <tuple/>
</value>
</item>
<item>
@@ -123,22 +110,20 @@ return person\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
- <value> <int>0</int> </value>
+ <value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
- <string>context</string>
- <string>credential_request</string>
+ <string>related_portal_type</string>
<string>_getattr_</string>
- <string>portal</string>
- <string>person_module</string>
- <string>person_kw</string>
- <string>_apply_</string>
- <string>person</string>
- <string>DateTime</string>
- <string>assignment</string>
+ <string>context</string>
+ <string>_getiter_</string>
+ <string>portal_type</string>
+ <string>geattr</string>
+ <string>login</string>
+ <string>password</string>
</tuple>
</value>
</item>
@@ -150,7 +135,11 @@ return person\n
<item>
<key> <string>func_defaults</string> </key>
<value>
- <none/>
+ <tuple>
+ <list>
+ <string>Person</string>
+ </list>
+ </tuple>
</value>
</item>
<item>
Added: experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createUser.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createUser.xml?rev=38411&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createUser.xml (added)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createUser.xml [utf8] Thu Sep 16 11:22:07 2010
@@ -0,0 +1,152 @@
+<?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>"""Just set reference and password to create a user"""\n
+person = context.getDestinationDecisionValue(portal_type="Person")\n
+\n
+#Set login\n
+login = context.getReference()\n
+person.setReference(login)\n
+\n
+#Set password\n
+if context.getPassword():\n
+ #User has fill a password\n
+ password = None\n
+ person.setEncodedPassword(context.getPassword())\n
+else:\n
+ #We should generate a password\n
+ password = Person_generatePassword()\n
+ person.setPassword(password)\n
+\n
+return login, password\n
+</string> </value>
+ </item>
+ <item>
+ <key> <string>_code</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_params</string> </key>
+ <value> <string>reference,password=None</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>2</int> </value>
+ </item>
+ <item>
+ <key> <string>co_varnames</string> </key>
+ <value>
+ <tuple>
+ <string>reference</string>
+ <string>password</string>
+ <string>_getattr_</string>
+ <string>context</string>
+ <string>person</string>
+ <string>login</string>
+ <string>None</string>
+ <string>Person_generatePassword</string>
+ </tuple>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_defaults</string> </key>
+ <value>
+ <tuple>
+ <none/>
+ </tuple>
+ </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>CredentialRequest_createUser</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/CredentialRequest_setDefaultDestinationDecision.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setDefaultDestinationDecision.xml?rev=38411&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setDefaultDestinationDecision.xml (added)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setDefaultDestinationDecision.xml [utf8] Thu Sep 16 11:22:07 2010
@@ -0,0 +1,165 @@
+<?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>"""Create the related person and the related organisation\n
+Return related person and related organisation"""\n
+\n
+destination_list = context.getDestinationDecisionValueList()\n
+\n
+\n
+for destination in destination_list:\n
+ try:\n
+ create_portal_type.remove(destination.getPortalType())\n
+ except ValueError:\n
+ #Portal type is not present\n
+ pass\n
+\n
+if "Organisation" in create_portal_type:\n
+ #Try to find existant organisation\n
+ organisation_title = context.getCorporateName()\n
+ organisation_list = module.searchFolder(title=organisation_title)\n
+ #be sure we have the same title and no %title%\n
+ organisation_list = [x.getObject() for x in organisation_list if x.getObject().getTitle() == organisation_title ]\n
+ if organisation_list:\n
+ destination_list.append(organisation_list[0]) \n
+ create_portal_type.remove("Organisation")\n
+\n
+for portal_type in create_portal_type:\n
+ module = context.getDefaultModule(portal_type) \n
+ obj = module.newContent(portal_type=portal_type)\n
+ destination_list.append(obj)\n
+\n
+context.setDestinationDecisionValueList(destination_list)\n
+</string> </value>
+ </item>
+ <item>
+ <key> <string>_code</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_params</string> </key>
+ <value> <string>create_portal_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>create_portal_type</string>
+ <string>_getattr_</string>
+ <string>context</string>
+ <string>destination_list</string>
+ <string>_getiter_</string>
+ <string>destination</string>
+ <string>ValueError</string>
+ <string>organisation_title</string>
+ <string>module</string>
+ <string>organisation_list</string>
+ <string>append</string>
+ <string>$append0</string>
+ <string>x</string>
+ <string>_getitem_</string>
+ <string>portal_type</string>
+ <string>obj</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>CredentialRequest_setDefaultDestinationDecision</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/CredentialRequest_setRegisteredInformationToOrganisation.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToOrganisation.xml?rev=38411&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToOrganisation.xml (added)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToOrganisation.xml [utf8] Thu Sep 16 11:22:07 2010
@@ -0,0 +1,150 @@
+<?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.CredentialRequest_checkConsistency([\'Organisation\'])\n
+organisation = context.getDestinationDecisionValue(portal_type="Organisation")\n
+person = context.getDestinationDecisionValue(portal_type="Person")\n
+\n
+#Mapping\n
+organisation_mapping = (\n
+ # (subscription, organisation)\n
+ (\'CorporateName\', \'Title\'),\n
+ )\n
+\n
+context.CredentialRequest_copyRegistredInformation(organisation, organisation_mapping)\n
+\n
+#Attach the organisation to the person if we have a person\n
+if person:\n
+ person.setCareerSubordination(organisation.getRelativeUrl())\n
+\n
+#Try to validate\n
+try:\n
+ organisation.validate()\n
+except:\n
+ pass\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>person</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>CredentialRequest_setRegisteredInformationToOrganisation</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/CredentialRequest_setRegisteredInformationToPerson.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToPerson.xml?rev=38411&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToPerson.xml (added)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_setRegisteredInformationToPerson.xml [utf8] Thu Sep 16 11:22:07 2010
@@ -0,0 +1,165 @@
+<?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.CredentialRequest_checkConsistency([\'Person\'])\n
+\n
+# Person Mapping\n
+person_mapping = (\n
+ # (subscription, person)\n
+ (\'FirstName\', \'FirstName\'),\n
+ (\'LastName\', \'LastName\'),\n
+ (\'DefaultEmailText\', \'DefaultEmailText\'),\n
+ (\'DefaultTelephoneText\', \'DefaultTelephoneText\'),\n
+ (\'DefaultFaxText\', \'DefaultFaxText\'),\n
+ (\'DefaultAddressStreetAddress\', \'DefaultAddressStreetAddress\'),\n
+ (\'DefaultAddressZipCode\', \'DefaultAddressZipCode\'),\n
+ (\'DefaultAddressCity\', \'DefaultAddressCity\'),\n
+ (\'DefaultAddressRegion\', \'DefaultAddressRegion\'),\n
+ (\'DefaultMobileTelephoneText\', \'DefaultMobileTelephoneText\'),\n
+ (\'ActivityList\', \'DefaultCareerActivityList\'),\n
+ (\'FunctionList\', \'DefaultCareerFunctionList\'),\n
+ (\'RoleList\', \'DefaultCareerRoleList\'),\n
+ (\'DefaultCredentialQuestionAnswer\', \'DefaultCredentialQuestionAnswer\'),\n
+ (\'DefaultCredentialQuestionQuestion\', \'DefaultCredentialQuestionQuestion\'),\n
+ (\'DefaultCredentialQuestionQuestionFreeText\', \'DefaultCredentialQuestionQuestionFreeText\'),\n
+ )\n
+\n
+context.CredentialRequest_copyRegistredInformation(person, person_mapping)\n
+\n
+\n
+#Try to validate\n
+\n
+try:\n
+ person.validate()\n
+except:\n
+ pass\n
+\n
+try:\n
+ person.getDefaultCareer().validate()\n
+except:\n
+ pass\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_mapping</string>
+ <string>person</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_setRegisteredInformationToPerson</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/CredentialRequest_updatePersonAssignment.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_updatePersonAssignment.xml?rev=38411&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_updatePersonAssignment.xml (added)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_updatePersonAssignment.xml [utf8] Thu Sep 16 11:22:07 2010
@@ -0,0 +1,191 @@
+<?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>"""Create an assingment for the person depending credential request configuration"""\n
+\n
+person = context.getDestinationDecisionValue(portal_type="Person")\n
+\n
+assignment_configuration = {}\n
+#Look on current assignement\n
+old_role_list = [x.getId() for x in context.portal_categories.role.searchFolder()]\n
+for role in context.getRoleList():\n
+ has_assignment = person.countFolder(portal_type=\'Assignment\',\n
+ role = role,\n
+ validation_state = \'open\')\n
+\n
+ assignment_configuration[role] = boolean(has_assignment)\n
+ close_role_list.remove(role)\n
+ \n
+#Close old assignement\n
+context.CredentialRequest_closePersonAssignment(old_role_list)\n
+ \n
+\n
+#Initialisation\n
+assignment_duration = int(context.WebSite_getLayoutProperty(\'layout_assignment_validation_duration\', \'365\'))\n
+today = DateTime()\n
+delay = today+assignment_duration\n
+for role,create_assingment in assignment_configuration.items():\n
+ if create_assingment:\n
+ assignment_for_website = person.newContent(\n
+ portal_type=\'Assignment\',\n
+ title = \'%s assignment\' % role,\n
+ role = role, \n
+ site = context.getSite(),\n
+ activity = context.getActivityList(),\n
+ function = context.getFunctionList(),\n
+ destination_uid = organisation.getUid(),\n
+ start_date = today,\n
+ stop_date = delay\n
+ )\n
+\n
+ assignment_for_website.open()\n
+ else: \n
+ #Update assignment \n
+ current_assignment_list = person.searchFolder(portal_type=\'Assignment\',\n
+ role = role,\n
+ validation_state = \'open\')\n
+ for assignment in current_assignment_list:\n
+ assignment.getObject().setStopDate(delay)\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>assignment_configuration</string>
+ <string>append</string>
+ <string>$append0</string>
+ <string>_getiter_</string>
+ <string>x</string>
+ <string>old_role_list</string>
+ <string>role</string>
+ <string>has_assignment</string>
+ <string>boolean</string>
+ <string>_write_</string>
+ <string>close_role_list</string>
+ <string>int</string>
+ <string>assignment_duration</string>
+ <string>DateTime</string>
+ <string>today</string>
+ <string>delay</string>
+ <string>create_assingment</string>
+ <string>organisation</string>
+ <string>assignment_for_website</string>
+ <string>current_assignment_list</string>
+ <string>assignment</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_updatePersonAssignment</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/Person_getCredentialRequestUrl.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Person_getCredentialRequestUrl.xml?rev=38411&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Person_getCredentialRequestUrl.xml (added)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Person_getCredentialRequestUrl.xml [utf8] Thu Sep 16 11:22:07 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 encoding="cdata"><![CDATA[
+
+""" Return url of subscription request attach to current object.\n
+Usefull in jump list"""\n
+from ZTUtils import make_query\n
+\n
+result = context.portal_catalog(\n
+ portal_type=\'Subscription Request\',\n
+ destination_decision_uid=context.getUid()\n
+ )\n
+\n
+length = len(result)\n
+if length==1:\n
+ return result[0].absolute_url()\n
+elif length>1:\n
+ return \'%s?%s\' % (context.subscription_request_module.absolute_url(),\n
+ make_query(reset=1,\n
+ destination_decision_uid=context.getUid())\n
+ )\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>ZTUtils</string>
+ <string>make_query</string>
+ <string>_getattr_</string>
+ <string>context</string>
+ <string>result</string>
+ <string>len</string>
+ <string>length</string>
+ <string>_getitem_</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>Person_getCredentialRequestUrl</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: experimental/bt5/erp5_credential/bt/revision
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/bt/revision?rev=38411&r1=38410&r2=38411&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/bt/revision [utf8] (original)
+++ experimental/bt5/erp5_credential/bt/revision [utf8] Thu Sep 16 11:22:07 2010
@@ -1 +1 @@
-142
\ No newline at end of file
+143
\ No newline at end of file
More information about the Erp5-report
mailing list