Commit 3b0ba9e6 authored by Romain Courteaud's avatar Romain Courteaud

Drop the customer informations form.

Move the instance parameters filling at the end of the process.
parent c4330fb6
......@@ -57,31 +57,9 @@ if len(uids) != 1:\n
return context.Base_redirect(dialog_id,\n
keep_items={\'portal_status_message\':context.Base_translateString("Please select one service.")})\n
\n
if not service_title:\n
return context.Base_redirect(dialog_id,\n
keep_items={\'portal_status_message\':context.Base_translateString("You have to provide Service Title.")})\n
\n
cleanup_resource = portal.portal_preferences.getPreferredInstanceCleanupResource()\n
software_instance_list = []\n
hosting_subscription = portal.portal_catalog.getResultValue(\n
portal_type=\'Hosting Subscription\',\n
validation_state="validated",\n
select_expression=\'title\',\n
title={\'query\': service_title, \'key\': \'ExactMatch\'}\n
)\n
\n
if hosting_subscription is not None:\n
return context.Base_redirect(dialog_id,\n
keep_items={\'portal_status_message\':context.Base_translateString(\n
"You already have service named ${service_title}. Please choose different unique name.", mapping={\'service_title\': service_title})})\n
\n
session = context.WebSection_getVifibSession()\n
params = portal.portal_selections.getSelectionParamsFor(\'vifib_session_id\')\n
params["instance_software_product_uid"] = uids[0]\n
params["service_title"] = service_title\n
params["instance_xml"] = instance_xml\n
params["shared"] = shared\n
params["computer"] = computer\n
portal.portal_selections.setSelectionParamsFor(\'vifib_session_id\', params)\n
\n
if kw.has_key(\'came_from\'):\n
......@@ -93,7 +71,7 @@ context.WebSection_viewNextStep()\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>dialog_id, service_title, instance_xml, computer=\'\', uids=[], shared=0, quantity=1, reset_shopping_cart=True, **kw</string> </value>
<value> <string>dialog_id, uids=[], quantity=1, reset_shopping_cart=True, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
<?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[
# dialog_id, service_title, instance_xml, computer=\'\', uids=[], shared=0, quantity=1, reset_shopping_cart=True, **kw\n
"""Set the instance request parameter"""\n
portal = context.getPortalObject()\n
\n
if not service_title:\n
return context.Base_redirect(dialog_id,\n
keep_items={\'portal_status_message\':context.Base_translateString("You have to provide Service Title.")})\n
\n
hosting_subscription = portal.portal_catalog.getResultValue(\n
portal_type=\'Hosting Subscription\',\n
validation_state="validated",\n
select_expression=\'title\',\n
title={\'query\': service_title, \'key\': \'ExactMatch\'}\n
)\n
\n
if hosting_subscription is not None:\n
return context.Base_redirect(dialog_id,\n
keep_items={\'portal_status_message\':context.Base_translateString(\n
"You already have service named ${service_title}. Please choose different unique name.", mapping={\'service_title\': service_title})})\n
\n
\n
# return context.WebSection_viewNextStep()\n
session = context.WebSection_getVifibSession()\n
params = portal.portal_selections.getSelectionParamsFor(\'vifib_session_id\')\n
instance_software_release_uid = params[\'instance_software_release_uid\']\n
software_release = portal.portal_catalog.getResultValue(uid=instance_software_release_uid)\n
\n
request_kw = {}\n
request_kw.update(\n
software_release=software_release.getUrlString(),\n
software_title=service_title,\n
software_type="RootSoftwareInstance",\n
instance_xml=instance_xml,\n
sla_xml="",\n
shared=False,\n
state="started",\n
)\n
\n
if computer:\n
computer = context.restrictedTraverse(computer)\n
request_kw[\'sla_xml\'] = """<?xml version=\'1.0\' encoding=\'utf-8\'?>\n
<instance>\n
<parameter id="computer_guid">%s</parameter>\n
</instance>""" % computer.getReference()\n
\n
person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
person.requestSoftwareInstance(**request_kw)\n
\n
message = context.Base_translateString("Your instance is under creation. Please wait few minutes for partitions to appear.")\n
return context.REQUEST.get(\'request_hosting_subscription\').Base_redirect(keep_items={\'portal_status_message\': message})\n
]]></string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>dialog_id, service_title, instance_xml, computer=\'\', shared=0, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSection_setInstanceParameter</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/>
</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>WebSection_setInstanceParameter</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>normal</string>
<string>left</string>
<string>right</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>hidden</string> </key>
<value>
<list>
<string>your_shared</string>
</list>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>normal</string> </key>
<value>
<list>
<string>my_description</string>
<string>your_service_title</string>
<string>your_instance_xml</string>
<string>your_computer</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>WebSection_viewInstanceParameterDialog</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>WebSection_viewCustomerInformationsDialog</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_dialog</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>Continue</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>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>default</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_description</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>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_translated_description</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewWebFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[
python:"<h1>%s</h1>" % (context.Base_translateString(context.getDescription()))
]]></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -118,7 +118,9 @@
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -257,4 +259,17 @@
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: "Instance %i" % DateTime().millis()</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_slave</string> </value>
<value> <string>your_shared</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......
......@@ -99,10 +99,6 @@
<value>
<list>
<string>my_description</string>
<string>your_service_title</string>
<string>your_instance_xml</string>
<string>your_computer</string>
<string>your_shared</string>
</list>
</value>
</item>
......
453
\ No newline at end of file
454
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment