Commit cb677ff1 authored by Łukasz Nowak's avatar Łukasz Nowak

Use request to start/stop/delete.

parent 2ffcf1d6
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return context.SoftwareInstance_callWorkflowAction(\'stop\')\n
<value> <string>return context.HostingSubscription_requestPerson(\'destroyed\')\n
</string> </value>
</item>
<item>
......@@ -59,7 +59,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_requestStop</string> </value>
<value> <string>HostingSubscription_requestDestroy</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -50,16 +50,25 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return context.absolute_url() + \'/SoftwareInstance_callWorkflowAction?action=destroy\'\n
<value> <string>person = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
person.requestSoftwareInstance(\n
state=state,\n
software_release=context.getRootSoftwareReleaseUrl(),\n
software_title=context.getTitle(),\n
software_type=context.getSourceReference(),\n
instance_xml=context.getTextContent(),\n
sla_xml=context.getSlaXml(),\n
shared=context.isRootSlave()\n
)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args, **kw</string> </value>
<value> <string>state</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_getDestroyUrl</string> </value>
<value> <string>HostingSubscription_requestPerson</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return context.SoftwareInstance_callWorkflowAction(\'start\')\n
<value> <string>return context.HostingSubscription_requestPerson(\'started\')\n
</string> </value>
</item>
<item>
......@@ -59,7 +59,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_requestStart</string> </value>
<value> <string>HostingSubscription_requestStart</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>return context.SoftwareInstance_callWorkflowAction(\'destroy\')\n
<value> <string>return context.HostingSubscription_requestPerson(\'stopped\')\n
</string> </value>
</item>
<item>
......@@ -59,7 +59,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_requestDestroy</string> </value>
<value> <string>HostingSubscription_requestStop</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -74,7 +74,9 @@
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
<list>
<string>my_destroy_button</string>
</list>
</value>
</item>
<item>
......@@ -88,11 +90,7 @@
<value>
<list>
<string>listbox_status</string>
<string>listbox_start_button</string>
<string>listbox_destroy_button</string>
<string>listbox_stop_button</string>
<string>listbox_image</string>
<string>listbox_action_button</string>
</list>
</value>
</item>
......@@ -102,6 +100,7 @@
<list>
<string>my_title</string>
<string>listbox</string>
<string>your_status</string>
<string>last_event_listbox</string>
</list>
</value>
......@@ -109,7 +108,10 @@
<item>
<key> <string>right</string> </key>
<value>
<list/>
<list>
<string>my_start_button</string>
<string>my_stop_button</string>
</list>
</value>
</item>
</dictionary>
......@@ -125,11 +127,11 @@
</item>
<item>
<key> <string>name</string> </key>
<value> <string>OpenSaleOrderLine_viewAsWeb</string> </value>
<value> <string>HostingSubscription_viewAsWeb</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_view</string> </value>
<value> <string>form_view_editable</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
......
......@@ -17,7 +17,6 @@
<string>select</string>
<string>selection_name</string>
<string>title</string>
<string>url_columns</string>
</list>
</value>
</item>
......@@ -113,10 +112,6 @@
<key> <string>editable_columns</string> </key>
<value>
<list>
<tuple>
<string>action_button</string>
<string>Action</string>
</tuple>
<tuple>
<string>image</string>
<string>image</string>
......@@ -158,25 +153,6 @@
<key> <string>title</string> </key>
<value> <string>My Software Instances</string> </value>
</item>
<item>
<key> <string>url_columns</string> </key>
<value>
<list>
<tuple>
<string>start_button</string>
<string>SoftwareInstance_getStartUrl</string>
</tuple>
<tuple>
<string>stop_button</string>
<string>SoftwareInstance_getStopUrl</string>
</tuple>
<tuple>
<string>destroy_button</string>
<string>SoftwareInstance_getDestroyUrl</string>
</tuple>
</list>
</value>
</item>
</dictionary>
</value>
</item>
......
......@@ -129,7 +129,7 @@
</item>
<item>
<key> <string>name</string> </key>
<value> <string>SoftwareInstance_requestDestroy:method</string> </value>
<value> <string>HostingSubscription_requestDestroy:method</string> </value>
</item>
<item>
<key> <string>target</string> </key>
......@@ -153,7 +153,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: context.SoftwareInstance_getStatus() not in (\'Destroyed\', \'Destruction in progress\')</string> </value>
<value> <string>python: here.getSlapState() != \'destroy_requested\'</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -129,7 +129,7 @@
</item>
<item>
<key> <string>name</string> </key>
<value> <string>SoftwareInstance_requestStart:method</string> </value>
<value> <string>HostingSubscription_requestStart:method</string> </value>
</item>
<item>
<key> <string>target</string> </key>
......@@ -153,7 +153,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: context.SoftwareInstance_getStatus() == "Stopped"</string> </value>
<value> <string>python: here.getSlapState() != \'destroy_requested\'</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -129,7 +129,7 @@
</item>
<item>
<key> <string>name</string> </key>
<value> <string>SoftwareInstance_requestStop:method</string> </value>
<value> <string>HostingSubscription_requestStop:method</string> </value>
</item>
<item>
<key> <string>target</string> </key>
......@@ -153,7 +153,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: context.SoftwareInstance_getStatus() == "Started"</string> </value>
<value> <string>python: here.getSlapState() != \'destroy_requested\'</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -2,13 +2,13 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="RawTextAreaField" module="Products.Formulator.StandardFields"/>
<global name="StringField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_destroy_button</string> </value>
<value> <string>your_status</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
......@@ -49,6 +49,14 @@
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
......@@ -65,10 +73,6 @@
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
......@@ -97,10 +101,6 @@
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -118,17 +118,25 @@
</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>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
......@@ -142,10 +150,6 @@
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
......@@ -174,10 +178,6 @@
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
......@@ -191,19 +191,27 @@
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string>nolabel negative widthAuto</string> </value>
<value> <string>inline</string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string>Destroy</string> </value>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_maxwidth</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>display_width</string> </key>
<value> <int>20</int> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
......@@ -217,10 +225,6 @@
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>5</int> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
......@@ -235,7 +239,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Destroy</string> </value>
<value> <string>Status</string> </value>
</item>
<item>
<key> <string>truncate</string> </key>
......@@ -249,10 +253,6 @@
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>40</int> </value>
</item>
</dictionary>
</value>
</item>
......@@ -270,7 +270,7 @@
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: context.SoftwareInstance_getStatus() in (\'started\', \'stopped\')</string> </value>
<value> <string>here/SoftwareInstance_getStatus</string> </value>
</item>
</dictionary>
</pickle>
......
<?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>if action == \'start\':\n
context.requestStartComputerPartition()\n
message = \'Starting\'\n
if action == \'stop\':\n
context.requestStopComputerPartition()\n
message = \'Stopping\'\n
if action == \'destroy\':\n
context.requestDestroyComputerPartition()\n
message = \'Destroying\'\n
return context.Base_redirect(keep_items=dict(portal_status_message=message))\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>action</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_callWorkflowAction</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>return context.absolute_url() + \'/SoftwareInstance_callWorkflowAction?action=start\'\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_getStartUrl</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>return context.absolute_url() + \'/SoftwareInstance_callWorkflowAction?action=stop\'\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_getStopUrl</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -74,11 +74,7 @@
<item>
<key> <string>center</string> </key>
<value>
<list>
<string>my_start_button</string>
<string>my_stop_button</string>
<string>my_destroy_button</string>
</list>
<list/>
</value>
</item>
<item>
......
370
\ No newline at end of file
371
\ 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