[Erp5-report] r31841 kazuhiko - in /erp5/trunk/bt5/erp5_simulation: ActionTemplateItem/port...
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Jan 20 15:06:47 CET 2010
Author: kazuhiko
Date: Wed Jan 20 15:06:47 2010
New Revision: 31841
URL: http://svn.erp5.org?rev=31841&view=rev
Log:
Solver Decision's configuration action uses always the same URL. all dynamic part should be included by FormBox, that will be also used in solver decision fast input UI.
Added:
erp5/trunk/bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/Base_editConfiguration.xml
erp5/trunk/bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/SolverDecision_viewConfiguration/
erp5/trunk/bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/SolverDecision_viewConfiguration.xml
erp5/trunk/bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/SolverDecision_viewConfiguration/my_configuration.xml
Modified:
erp5/trunk/bt5/erp5_simulation/ActionTemplateItem/portal_types/Solver%20Decision/configuration.xml
Modified: erp5/trunk/bt5/erp5_simulation/ActionTemplateItem/portal_types/Solver%20Decision/configuration.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_simulation/ActionTemplateItem/portal_types/Solver%2520Decision/configuration.xml?rev=31841&r1=31840&r2=31841&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_simulation/ActionTemplateItem/portal_types/Solver%20Decision/configuration.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_simulation/ActionTemplateItem/portal_types/Solver%20Decision/configuration.xml [utf8] Wed Jan 20 15:06:47 2010
@@ -81,7 +81,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
- <value> <string>python:object.SolverDecision_getConfigurationUrl()</string> </value>
+ <value> <string>string:${object_url}/SolverDecision_viewConfiguration</string> </value>
</item>
</dictionary>
</pickle>
@@ -97,7 +97,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
- <value> <string>python:object.SolverDecision_getConfigurationUrl()</string> </value>
+ <value> <string>python:object.getSolver() and object.getSolverValue().getConfigurationFormId()</string> </value>
</item>
</dictionary>
</pickle>
Added: erp5/trunk/bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/Base_editConfiguration.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/Base_editConfiguration.xml?rev=31841&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/Base_editConfiguration.xml (added)
+++ erp5/trunk/bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/Base_editConfiguration.xml [utf8] Wed Jan 20 15:06:47 2010
@@ -1,0 +1,227 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+ <tuple/>
+ </tuple>
+ </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[
+
+# Updates attributes of an Zope document\n
+# which is in a class inheriting from ERP5 Base\n
+#\n
+# TODO\n
+# - Implement validation of matrix fields\n
+# - Implement validation of list fields\n
+#\n
+from Products.Formulator.Errors import ValidationError, FormValidationError\n
+from ZTUtils import make_query\n
+\n
+request=context.REQUEST\n
+\n
+try:\n
+ # Define form basic fields\n
+ form = getattr(context,form_id)\n
+ # Validate\n
+ form.validate_all_to_request(request)\n
+ # Basic attributes\n
+ kw = {}\n
+ # Parse attributes\n
+ for f in form.get_fields():\n
+ k = f.id\n
+ v = getattr(request,k,None)\n
+ if v is not None:\n
+ if k[0:3] == \'my_\':\n
+ # We only take into account\n
+ # the object attributes\n
+ k = k[3:]\n
+ if getattr(v, \'as_dict\'): # FormBox\n
+ kw.update(v.as_dict())\n
+ else:\n
+ kw[k] = v\n
+ # Update basic attributes\n
+ context.log(repr(kw))\n
+ context.updateConfiguration(**kw)\n
+ context.reindexObject()\n
+except FormValidationError, validation_errors:\n
+ # Pack errors into the request\n
+ field_errors = form.ErrorFields(validation_errors)\n
+ request.set(\'field_errors\', field_errors)\n
+ return form(request)\n
+else:\n
+ # for web mode, we should use \'view\' instead of passed form_id\n
+ # after \'Save & View\'.\n
+ if context.REQUEST.get(\'is_web_mode\', False) and \\\n
+ not editable_mode:\n
+ form_id = \'view\'\n
+\n
+ if not selection_index:\n
+ redirect_url = \'%s/%s?%s\' % (\n
+ context.absolute_url(),\n
+ form_id,\n
+ make_query({\'ignore_layout\':ignore_layout,\n
+ \'editable_mode\':editable_mode,\n
+ \'portal_status_message\':\'Data Updated.\',\n
+ })\n
+ )\n
+ else:\n
+ redirect_url = \'%s/%s?%s\' % (\n
+ context.absolute_url(),\n
+ form_id,\n
+ make_query({\'selection_index\':selection_index,\n
+ \'selection_name\':selection_name,\n
+ \'ignore_layout\':ignore_layout,\n
+ \'editable_mode\':editable_mode,\n
+ \'portal_status_message\':\'Data Updated.\',\n
+ })\n
+ )\n
+\n
+request[ \'RESPONSE\' ].redirect( redirect_url )\n
+
+
+]]></string> </value>
+ </item>
+ <item>
+ <key> <string>_code</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_params</string> </key>
+ <value> <string>form_id, selection_index=0, selection_name=\'\', ignore_layout=0, editable_mode=1</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>5</int> </value>
+ </item>
+ <item>
+ <key> <string>co_varnames</string> </key>
+ <value>
+ <tuple>
+ <string>form_id</string>
+ <string>selection_index</string>
+ <string>selection_name</string>
+ <string>ignore_layout</string>
+ <string>editable_mode</string>
+ <string>Products.Formulator.Errors</string>
+ <string>ValidationError</string>
+ <string>FormValidationError</string>
+ <string>ZTUtils</string>
+ <string>make_query</string>
+ <string>_getattr_</string>
+ <string>context</string>
+ <string>request</string>
+ <string>getattr</string>
+ <string>form</string>
+ <string>kw</string>
+ <string>_getiter_</string>
+ <string>f</string>
+ <string>k</string>
+ <string>None</string>
+ <string>v</string>
+ <string>_getitem_</string>
+ <string>_write_</string>
+ <string>repr</string>
+ <string>_apply_</string>
+ <string>validation_errors</string>
+ <string>field_errors</string>
+ <string>False</string>
+ <string>redirect_url</string>
+ </tuple>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_defaults</string> </key>
+ <value>
+ <tuple>
+ <int>0</int>
+ <string></string>
+ <int>0</int>
+ <int>1</int>
+ </tuple>
+ </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>Base_editConfiguration</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Added: erp5/trunk/bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/SolverDecision_viewConfiguration.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/SolverDecision_viewConfiguration.xml?rev=31841&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/SolverDecision_viewConfiguration.xml (added)
+++ erp5/trunk/bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/SolverDecision_viewConfiguration.xml [utf8] Wed Jan 20 15:06:47 2010
@@ -1,0 +1,155 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <global name="ERP5Form" module="Products.ERP5Form.Form"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>_bind_names</string> </key>
+ <value>
+ <object>
+ <klass>
+ <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+ </klass>
+ <tuple/>
+ <state>
+ <dictionary>
+ <item>
+ <key> <string>_asgns</string> </key>
+ <value>
+ <dictionary/>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>_objects</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ <item>
+ <key> <string>action</string> </key>
+ <value> <string>Base_editConfiguration</string> </value>
+ </item>
+ <item>
+ <key> <string>description</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>edit_order</string> </key>
+ <value>
+ <list/>
+ </value>
+ </item>
+ <item>
+ <key> <string>encoding</string> </key>
+ <value> <string>UTF-8</string> </value>
+ </item>
+ <item>
+ <key> <string>enctype</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>group_list</string> </key>
+ <value>
+ <list>
+ <string>left</string>
+ <string>right</string>
+ <string>center</string>
+ <string>bottom</string>
+ <string>hidden</string>
+ </list>
+ </value>
+ </item>
+ <item>
+ <key> <string>groups</string> </key>
+ <value>
+ <dictionary>
+ <item>
+ <key> <string>bottom</string> </key>
+ <value>
+ <list/>
+ </value>
+ </item>
+ <item>
+ <key> <string>center</string> </key>
+ <value>
+ <list/>
+ </value>
+ </item>
+ <item>
+ <key> <string>hidden</string> </key>
+ <value>
+ <list/>
+ </value>
+ </item>
+ <item>
+ <key> <string>left</string> </key>
+ <value>
+ <list>
+ <string>my_configuration</string>
+ </list>
+ </value>
+ </item>
+ <item>
+ <key> <string>right</string> </key>
+ <value>
+ <list/>
+ </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>SolverDecision_viewConfiguration</string> </value>
+ </item>
+ <item>
+ <key> <string>method</string> </key>
+ <value> <string>POST</string> </value>
+ </item>
+ <item>
+ <key> <string>name</string> </key>
+ <value> <string>SolverDecision_view</string> </value>
+ </item>
+ <item>
+ <key> <string>pt</string> </key>
+ <value> <string>form_view</string> </value>
+ </item>
+ <item>
+ <key> <string>row_length</string> </key>
+ <value> <int>4</int> </value>
+ </item>
+ <item>
+ <key> <string>stored_encoding</string> </key>
+ <value> <string>UTF-8</string> </value>
+ </item>
+ <item>
+ <key> <string>title</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>unicode_mode</string> </key>
+ <value> <int>0</int> </value>
+ </item>
+ <item>
+ <key> <string>update_action</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>update_action_title</string> </key>
+ <value> <string></string> </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Added: erp5/trunk/bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/SolverDecision_viewConfiguration/my_configuration.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/SolverDecision_viewConfiguration/my_configuration.xml?rev=31841&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/SolverDecision_viewConfiguration/my_configuration.xml (added)
+++ erp5/trunk/bt5/erp5_simulation/SkinTemplateItem/portal_skins/erp5_simulation/SolverDecision_viewConfiguration/my_configuration.xml [utf8] Wed Jan 20 15:06:47 2010
@@ -1,0 +1,193 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <global name="FormBox" module="Products.ERP5Form.FormBox"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>my_configuration</string> </value>
+ </item>
+ <item>
+ <key> <string>message_values</string> </key>
+ <value>
+ <dictionary>
+ <item>
+ <key> <string>external_validator_failed</string> </key>
+ <value> <string>The input failed the external validator.</string> </value>
+ </item>
+ <item>
+ <key> <string>form_invalidated</string> </key>
+ <value> <string>Form invalidated.</string> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ <item>
+ <key> <string>overrides</string> </key>
+ <value>
+ <dictionary>
+ <item>
+ <key> <string>alternate_name</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>css_class</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>default</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>description</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>editable</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>enabled</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>external_validator</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>formbox_target_id</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>hidden</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>title</string> </key>
+ <value> <string></string> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ <item>
+ <key> <string>tales</string> </key>
+ <value>
+ <dictionary>
+ <item>
+ <key> <string>alternate_name</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>css_class</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>default</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>description</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>editable</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>enabled</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>external_validator</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>formbox_target_id</string> </key>
+ <value>
+ <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+ </value>
+ </item>
+ <item>
+ <key> <string>hidden</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>title</string> </key>
+ <value> <string></string> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ <item>
+ <key> <string>values</string> </key>
+ <value>
+ <dictionary>
+ <item>
+ <key> <string>alternate_name</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>css_class</string> </key>
+ <value> <string>invisible</string> </value>
+ </item>
+ <item>
+ <key> <string>default</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>description</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>editable</string> </key>
+ <value> <int>1</int> </value>
+ </item>
+ <item>
+ <key> <string>enabled</string> </key>
+ <value> <int>1</int> </value>
+ </item>
+ <item>
+ <key> <string>external_validator</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>formbox_target_id</string> </key>
+ <value> <string>Solver_viewConfiguration</string> </value>
+ </item>
+ <item>
+ <key> <string>hidden</string> </key>
+ <value> <int>0</int> </value>
+ </item>
+ <item>
+ <key> <string>title</string> </key>
+ <value> <string>my_configuration</string> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+ <record id="2" aka="AAAAAAAAAAI=">
+ <pickle>
+ <tuple>
+ <global name="TALESMethod" module="Products.Formulator.TALESField"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>_text</string> </key>
+ <value> <string>python:here.getSolverValue().getConfigurationFormId()</string> </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
More information about the Erp5-report
mailing list