Commit afc7917a authored by Cédric de Saint Martin's avatar Cédric de Saint Martin

Merge branch 'master' into slapgrid_test

parents 3a8c83ff fa395f84
...@@ -116,6 +116,9 @@ if filter_kw.keys():\n ...@@ -116,6 +116,9 @@ if filter_kw.keys():\n
# XXX Drop all unexpected keys\n # XXX Drop all unexpected keys\n
query_kw["uid"] = "-1"\n query_kw["uid"] = "-1"\n
\n \n
if test_mode:\n
return bool(len(context.portal_catalog(limit=1, **query_kw)))\n
\n
SQL_WINDOW_SIZE = 50\n SQL_WINDOW_SIZE = 50\n
\n \n
# fetch at mot 50 random Computer Partitions, and check if they are ok\n # fetch at mot 50 random Computer Partitions, and check if they are ok\n
...@@ -154,7 +157,7 @@ return computer_partition.getRelativeUrl()\n ...@@ -154,7 +157,7 @@ return computer_partition.getRelativeUrl()\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>software_release_url, software_type, software_instance_portal_type, filter_kw</string> </value> <value> <string>software_release_url, software_type, software_instance_portal_type, filter_kw, test_mode=False</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -104,6 +104,10 @@ ...@@ -104,6 +104,10 @@
<string>free_partition</string> <string>free_partition</string>
<string>Free Partition Count</string> <string>Free Partition Count</string>
</tuple> </tuple>
<tuple>
<string>allocation_scope_translated_title</string>
<string>Allocation Scope</string>
</tuple>
</list> </list>
</value> </value>
</item> </item>
......
472 474
\ No newline at end of file \ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Section" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>__translation_dict</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>authorization_forced</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>custom_render_method_id</string> </key>
<value> <string>WebSection_viewMonitoring</string> </value>
</item>
<item>
<key> <string>default_page_displayed</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>This page shows the status of your servers and instances</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>monitoring</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value> <int>6</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Section</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Monitoring</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -103,9 +103,7 @@ ...@@ -103,9 +103,7 @@
</item> </item>
<item> <item>
<key> <string>int_index</string> </key> <key> <string>int_index</string> </key>
<value> <value> <int>1</int> </value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
......
...@@ -89,6 +89,10 @@ ...@@ -89,6 +89,10 @@
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_invoices</string> </value> <value> <string>my_invoices</string> </value>
</item> </item>
<item>
<key> <string>int_index</string> </key>
<value> <int>2</int> </value>
</item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Web Section</string> </value> <value> <string>Web Section</string> </value>
......
...@@ -89,6 +89,10 @@ ...@@ -89,6 +89,10 @@
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_servers</string> </value> <value> <string>my_servers</string> </value>
</item> </item>
<item>
<key> <string>int_index</string> </key>
<value> <int>4</int> </value>
</item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
<value> <string>Web Section</string> </value> <value> <string>Web Section</string> </value>
......
...@@ -85,9 +85,7 @@ ...@@ -85,9 +85,7 @@
</item> </item>
<item> <item>
<key> <string>int_index</string> </key> <key> <string>int_index</string> </key>
<value> <value> <int>3</int> </value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
......
...@@ -95,9 +95,7 @@ ...@@ -95,9 +95,7 @@
</item> </item>
<item> <item>
<key> <string>int_index</string> </key> <key> <string>int_index</string> </key>
<value> <value> <int>5</int> </value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Section" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>authorization_forced</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>custom_render_method_id</string> </key>
<value> <string>WebSection_orderVifibERP5</string> </value>
</item>
<item>
<key> <string>default_page_displayed</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Section</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>1</string> </value>
</item>
<item>
<key> <string>visible</string> </key>
<value> <int>0</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
104 106
\ No newline at end of file \ No newline at end of file
...@@ -343,6 +343,66 @@ class InstancePublisher(GenericPublisher): ...@@ -343,6 +343,66 @@ class InstancePublisher(GenericPublisher):
self.REQUEST.response.setBody(jsonify({'status':'processing'})) self.REQUEST.response.setBody(jsonify({'status':'processing'}))
return self.REQUEST.response return self.REQUEST.response
@requireHeader({'Content-Type': '^application/json.*'})
@requireJson(dict(
slave=bool,
software_release=(unicode, encode_utf8),
title=(unicode, encode_utf8),
software_type=(unicode, encode_utf8),
parameter=(dict, etreeXml),
sla=(dict, etreeXml),
status=(unicode, encode_utf8),
))
def __allocable(self):
request_dict = {}
if self.jbody['status'] not in ['started', 'stopped', 'destroyed']:
self.REQUEST.response.setStatus(400)
self.REQUEST.response.setBody(jsonify(
{'status': 'Status shall be one of: started, stopped, destroyed.'}))
return self.REQUEST.response
try:
user = self.restrictedTraverse(self.user_url)
user_portal_type = user.getPortalType()
if user_portal_type == 'Person':
pass
elif user_portal_type == 'Software Instance':
hosting_subscription = user.getSpecialiseValue(
portal_type="Hosting Subscription")
user = hosting_subscription.getDestinationSectionValue(
portal_type="Person")
else:
raise NotImplementedError, "Can not get Person document"
open_order = self.portal_catalog.getResultValue(
portal_type='Open Sale Order',
default_destination_decision_uid=user.getUid(),
validation_state='validated')
tmp_instance = self.software_instance_module.newContent(
portal_type="Software Instance",
sla_xml=self.jbody['sla'],
temp_object=1,
)
result = open_order.OpenSaleOrder_findPartition(
self.jbody['software_release'],
self.jbody['software_type'],
('Software Instance', 'Slave Instance')[int(self.jbody['slave'])],
tmp_instance.getSlaXmlAsDict(),
test_mode=True)
except Exception:
transaction.abort()
LOG('VifibRestApiV1', ERROR,
'Problem with person.allocable:', error=True)
self.REQUEST.response.setStatus(500)
self.REQUEST.response.setBody(jsonify({'error':
'There is system issue, please try again later.'}))
return self.REQUEST.response
self.REQUEST.response.setStatus(200)
self.REQUEST.response.setHeader('Cache-Control',
'no-cache, no-store')
self.REQUEST.response.setBody(jsonify({'result': result}))
return self.REQUEST.response
@extractDocument(['Software Instance', 'Slave Instance']) @extractDocument(['Software Instance', 'Slave Instance'])
@supportModifiedSince('document_url') @supportModifiedSince('document_url')
def __instance_info(self): def __instance_info(self):
...@@ -424,6 +484,9 @@ class InstancePublisher(GenericPublisher): ...@@ -424,6 +484,9 @@ class InstancePublisher(GenericPublisher):
self.__request() self.__request()
elif self.REQUEST['REQUEST_METHOD'] == 'GET': elif self.REQUEST['REQUEST_METHOD'] == 'GET':
if self.REQUEST['traverse_subpath']: if self.REQUEST['traverse_subpath']:
if self.REQUEST['traverse_subpath'][-1] == 'request':
self.__allocable()
else:
self.__instance_info() self.__instance_info()
else: else:
self.__instance_list() self.__instance_list()
......
17 19
\ No newline at end of file \ No newline at end of file
...@@ -825,6 +825,271 @@ class TestInstanceGETcertificate(VifibSlaposRestAPIV1InstanceMixin): ...@@ -825,6 +825,271 @@ class TestInstanceGETcertificate(VifibSlaposRestAPIV1InstanceMixin):
self.assertBasicResponse() self.assertBasicResponse()
self.assertResponseCode(404) self.assertResponseCode(404)
class TestInstanceAllocableGET(VifibSlaposRestAPIV1InstanceMixin):
def test_not_logged_in(self):
self.connection.request(method='GET',
url='/'.join([self.api_path, 'instance', 'request']))
self.prepareResponse()
self.assertBasicResponse()
self.assertResponseCode(401)
self.assertTrue(self.response.getheader('Location') is not None)
auth = self.response.getheader('WWW-Authenticate')
self.assertTrue(auth is not None)
self.assertTrue('Bearer realm="' in auth)
self.assertPersonRequestSimulatorEmpty()
def test_no_json(self):
self.connection.request(method='GET',
url='/'.join([self.api_path, 'instance', 'request']),
headers={'REMOTE_USER': self.customer_reference})
self.prepareResponse()
self.assertBasicResponse()
self.assertResponseCode(400)
self.assertResponseJson()
self.assertEqual({'error': "Data is not json object."}, self.json_response)
self.assertPersonRequestSimulatorEmpty()
def test_bad_json(self):
self.connection.request(method='GET',
url='/'.join([self.api_path, 'instance', 'request']),
body='This is not JSON',
headers={'REMOTE_USER': self.customer_reference})
self.prepareResponse()
self.assertBasicResponse()
self.assertResponseCode(400)
self.assertResponseJson()
self.assertEqual({'error': "Data is not json object."}, self.json_response)
self.assertPersonRequestSimulatorEmpty()
def test_empty_json(self):
self.connection.request(method='GET',
url='/'.join([self.api_path, 'instance', 'request']),
body='{}',
headers={'REMOTE_USER': self.customer_reference})
self.prepareResponse()
self.assertBasicResponse()
self.assertResponseCode(400)
self.assertResponseJson()
self.assertEqual({
"status": "Missing.",
"slave": "Missing.",
"title": "Missing.",
"software_release": "Missing.",
"software_type": "Missing.",
"parameter": "Missing.",
"sla": "Missing."},
self.json_response)
self.assertPersonRequestSimulatorEmpty()
def test_status_slave_missing_json(self):
self.connection.request(method='GET',
url='/'.join([self.api_path, 'instance', 'request']),
body="""
{
"title": "My unique instance",
"software_release": "http://example.com/example.cfg",
"software_type": "type_provided_by_the_software",
"parameter": {
"Custom1": "one string",
"Custom2": "one float",
"Custom3": [
"abc",
"def"
]
},
"sla": {
"computer_id": "COMP-0"
}
}""",
headers={'REMOTE_USER': self.customer_reference})
self.prepareResponse()
self.assertBasicResponse()
self.assertResponseCode(400)
self.assertResponseJson()
self.assertEqual({
"status": "Missing.",
"slave": "Missing."
},
self.json_response)
self.assertPersonRequestSimulatorEmpty()
def test_slave_not_bool(self):
kwargs = {
'parameter': {
'Custom1': 'one string',
'Custom2': 'one float',
'Custom3': ['abc', 'def']},
'title': 'My unique instance',
'software_release': 'http://example.com/example.cfg',
'status': 'started',
'sla': {
'computer_id': 'COMP-0'},
'software_type': 'type_provided_by_the_software',
'slave': "True"}
self.connection.request(method='GET',
url='/'.join([self.api_path, 'instance', 'request']),
body=json.dumps(kwargs),
headers={'REMOTE_USER': self.customer_reference})
self.prepareResponse()
self.assertBasicResponse()
self.assertResponseCode(400)
self.assertResponseJson()
self.assertEqual({
"slave": "unicode is not bool.",
},
self.json_response)
self.assertPersonRequestSimulatorEmpty()
def test_incorrect_status(self):
kwargs = {
'parameter': {
'Custom1': 'one string',
'Custom2': 'one float',
'Custom3': ['abc', 'def']},
'title': 'My unique instance',
'software_release': 'http://example.com/example.cfg',
'status': 'badstatus',
'sla': {
'computer_id': 'COMP-0'},
'software_type': 'type_provided_by_the_software',
'slave': True}
self.connection.request(method='GET',
url='/'.join([self.api_path, 'instance', 'request']),
body=json.dumps(kwargs),
headers={'REMOTE_USER': self.customer_reference})
self.prepareResponse()
self.assertBasicResponse()
self.assertResponseCode(400)
self.assertResponseJson()
self.assertEqual({
"status": "Status shall be one of: started, stopped, destroyed.",
},
self.json_response)
self.assertPersonRequestSimulatorEmpty()
def test_correct(self):
kwargs = {
'parameter': {
'Custom1': 'one string',
'Custom2': 'one float',
'Custom3': ['abc', 'def']},
'title': 'My unique instance',
'software_release': 'http://example.com/example.cfg',
'status': 'started',
'sla': {
'computer_id': 'COMP-0'},
'software_type': 'type_provided_by_the_software',
'slave': True}
self.connection.request(method='GET',
url='/'.join([self.api_path, 'instance', 'request']),
body=json.dumps(kwargs),
headers={'REMOTE_USER': self.customer_reference})
self.prepareResponse()
self.assertBasicResponse()
self.assertResponseCode(200)
self.assertResponseJson()
def test_additional_key_json(self):
kw_request = {
'parameter': {
'Custom1': 'one string',
'Custom2': 'one float',
'Custom3': ['abc', 'def']},
'title': 'My unique instance',
'software_release': 'http://example.com/example.cfg',
'status': 'started',
'sla': {
'computer_id': 'COMP-0'},
'software_type': 'type_provided_by_the_software',
'slave': True}
kwargs = kw_request.copy()
kwargs.update(**{'wrong_key': 'Be ignored'})
self.connection.request(method='GET',
url='/'.join([self.api_path, 'instance', 'request']),
body=json.dumps(kwargs),
headers={'REMOTE_USER': self.customer_reference})
self.prepareResponse()
self.assertBasicResponse()
self.assertResponseCode(200)
self.assertResponseJson()
# def test_correct_server_side_raise(self):
# self.customer.requestSoftwareInstance = \
# RaisingSimulator(AttributeError)
# transaction.commit()
# kwargs = {
# 'parameter': {
# 'Custom1': 'one string',
# 'Custom2': 'one float',
# 'Custom3': ['abc', 'def']},
# 'title': 'My unique instance',
# 'software_release': 'http://example.com/example.cfg',
# 'status': 'started',
# 'sla': {
# 'computer_id': 'COMP-0'},
# 'software_type': 'type_provided_by_the_software',
# 'slave': True}
# self.connection.request(method='GET',
# url='/'.join([self.api_path, 'instance', 'request']),
# body=json.dumps(kwargs),
# headers={'REMOTE_USER': self.customer_reference})
# self.prepareResponse()
# self.assertBasicResponse()
# self.assertResponseCode(500)
# self.assertResponseJson()
# self.assertEqual({
# "error": "There is system issue, please try again later.",
# },
# self.json_response)
# self.assertPersonRequestSimulatorEmpty()
def test_content_negotiation_headers(self):
self.connection = CustomHeaderHTTPConnection(host=self.api_netloc,
custom_header={
'Access-Control-Request-Headers': self.access_control_allow_headers
})
kwargs = {
'parameter': {
'Custom1': 'one string',
'Custom2': 'one float',
'Custom3': ['abc', 'def']},
'title': 'My unique instance',
'software_release': 'http://example.com/example.cfg',
'status': 'started',
'sla': {
'computer_id': 'COMP-0'},
'software_type': 'type_provided_by_the_software',
'slave': True}
self.connection.request(method='GET',
url='/'.join([self.api_path, 'instance', 'request']),
body=json.dumps(kwargs),
headers={'REMOTE_USER': self.customer_reference})
self.prepareResponse()
self.assertBasicResponse()
self.assertResponseCode(400)
self.assertResponseJson()
self.assertEqual({
'Content-Type': "Header with value '^application/json.*' is required."},
self.json_response)
self.assertPersonRequestSimulatorEmpty()
# now check with incorrect headers
self.connection.request(method='GET',
url='/'.join([self.api_path, 'instance', 'request']),
body=json.dumps(kwargs),
headers={'REMOTE_USER': self.customer_reference,
'Content-Type': 'please/complain',
'Accept': 'be/silent'})
self.prepareResponse()
self.assertBasicResponse()
self.assertResponseCode(400)
self.assertResponseJson()
self.assertEqual({
'Content-Type': "Header with value '^application/json.*' is required."},
self.json_response)
self.assertPersonRequestSimulatorEmpty()
# and with correct ones are set by default
def VifibSlaposRestAPIV1BangMixin_afterSetUp(self): def VifibSlaposRestAPIV1BangMixin_afterSetUp(self):
VifibSlaposRestAPIV1BangMixin_afterSetUp(self) VifibSlaposRestAPIV1BangMixin_afterSetUp(self)
self.instance_bang_simulator = tempfile.mkstemp()[1] self.instance_bang_simulator = tempfile.mkstemp()[1]
......
79 80
\ No newline at end of file \ No newline at end of file
...@@ -120,14 +120,18 @@ encode : function (input) {\n ...@@ -120,14 +120,18 @@ encode : function (input) {\n
var created_at = new Date(Date.parse(data.created_at)),\n var created_at = new Date(Date.parse(data.created_at)),\n
now = new Date(),\n now = new Date(),\n
context = $(this);\n context = $(this);\n
console.log(data[\'@document\']);\n // 5 minute for computer. 1 day for instance.\n
if (/#ok/.test(data.text) & (now - created_at < 300000)) {\n if (/#ok/.test(data.text) & /computer_module/.test(data[\'@document\']) & (now - created_at < 300000)) {\n
$(this).attr("class", "monitoring_ok")\n $(this).attr("class", "monitoring_ok")\n
.attr("title", data.text)\n .attr("title", data.text + " (" + created_at + ")" )\n
.html("<a href=\'" + data[\'@document\'] + "\'></a>");\n
} else if (/#ok/.test(data.text) & /software_instance_module/.test(data[\'@document\']) & (now - created_at < 86400000)) {\n
$(this).attr("class", "monitoring_ok")\n
.attr("title", data.text + " (" + created_at + ")" )\n
.html("<a href=\'" + data[\'@document\'] + "\'></a>");\n .html("<a href=\'" + data[\'@document\'] + "\'></a>");\n
} else {\n } else {\n
$(this).attr("class", "monitoring_error")\n $(this).attr("class", "monitoring_error")\n
.attr("title", data.text)\n .attr("title", data.text + " (" + created_at + ")" )\n
.html("<a href=\'" + data[\'@document\'] + "\'></a>");\n .html("<a href=\'" + data[\'@document\'] + "\'></a>");\n
}\n }\n
setTimeout(function () {\n setTimeout(function () {\n
...@@ -181,9 +185,6 @@ encode : function (input) {\n ...@@ -181,9 +185,6 @@ encode : function (input) {\n
});\n });\n
}\n }\n
},\n },\n
error: function(jqXHR, textStatus, errorThrown) {\n
console.log(jqXHR.status);\n
},\n
complete: function() {\n complete: function() {\n
var context = $(this);\n var context = $(this);\n
setTimeout(function () {\n setTimeout(function () {\n
......
<?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[
portal = context.getPortalObject()\n
\n
instance_xml = """<?xml version="1.0" encoding="utf-8"?>\n
<instance>\n
<parameter id="flavour">configurator</parameter>\n
<parameter id="frontend-software-url">http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg</parameter>\n
<parameter id="frontend-instance-guid">SOFTINST-9238</parameter> \n
</instance>\n
"""\n
url = "http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/tags/slapos-0.117:/software/erp5/software.cfg"\n
software_type = "default"\n
\n
person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
\n
request_kw = {}\n
request_kw.update(\n
software_release=url,\n
software_title="ERP5 Instance 00-%i" % portal.portal_ids.generateNewId(id_group=("vifib", "kvm"), default=1),\n
software_type=software_type,\n
instance_xml=instance_xml,\n
sla_xml="",\n
shared=False,\n
state="started",\n
)\n
\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></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSection_orderVifibERP5</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -95,7 +95,8 @@ ...@@ -95,7 +95,8 @@
<key> <string>normal</string> </key> <key> <string>normal</string> </key>
<value> <value>
<list> <list>
<string>your_title</string> <string>my_section_title</string>
<string>my_translated_description</string>
<string>your_ad</string> <string>your_ad</string>
</list> </list>
</value> </value>
......
<?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/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_section_title</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>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_section_title</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>
</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/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_translated_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>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>
</ZopeData>
...@@ -110,6 +110,10 @@ padding-left:100px;\n ...@@ -110,6 +110,10 @@ padding-left:100px;\n
background:url(<tal:block tal:replace="img_folder"/>help_active.png) no-repeat scroll left center transparent;\n background:url(<tal:block tal:replace="img_folder"/>help_active.png) no-repeat scroll left center transparent;\n
padding-left:100px;\n padding-left:100px;\n
}\n }\n
.monitoring h1 {\n
background:url(<tal:block tal:replace="img_folder"/>monitoring_active.png) no-repeat scroll left center transparent;\n
padding-left:100px;\n
}\n
\n \n
#shopping_cart_renderer .listbox tr:nth-child(2n) {\n #shopping_cart_renderer .listbox tr:nth-child(2n) {\n
background:none repeat scroll 0 0 #FFFFFF;\n background:none repeat scroll 0 0 #FFFFFF;\n
......
...@@ -99,7 +99,7 @@ a img{border : 0 none;cursor : pointer;}\n ...@@ -99,7 +99,7 @@ a img{border : 0 none;cursor : pointer;}\n
#vifib_logo{position:absolute;top:2px;left:50%;margin-left:-150px;width:300px;\n #vifib_logo{position:absolute;top:2px;left:50%;margin-left:-150px;width:300px;\n
height:150px;background: url(<tal:block tal:replace="images_path"/>vifib_logo.png) no-repeat top left}\n height:150px;background: url(<tal:block tal:replace="images_path"/>vifib_logo.png) no-repeat top left}\n
\n \n
#login_menu{width:750px;margin:120px auto 0px auto;padding-right:20px;text-align:right;\n #login_menu{width:900px;margin:120px auto 0px auto;padding-right:20px;text-align:right;\n
\tcolor:#bae2e9;height:36px;-moz-border-radius:10px}\n \tcolor:#bae2e9;height:36px;-moz-border-radius:10px}\n
#login_menu li{display:inline;padding:23px;line-height:44px;\n #login_menu li{display:inline;padding:23px;line-height:44px;\n
\tfont-size:16px;font-weight:bold;background:url(<tal:block tal:replace="images_path"/>login_bg.png) repeat-x center left}\n \tfont-size:16px;font-weight:bold;background:url(<tal:block tal:replace="images_path"/>login_bg.png) repeat-x center left}\n
...@@ -108,7 +108,7 @@ a img{border : 0 none;cursor : pointer;}\n ...@@ -108,7 +108,7 @@ a img{border : 0 none;cursor : pointer;}\n
\n \n
#menu li a, #login_menu li a {color:#BAE2E9;text-decoration:none;}\n #menu li a, #login_menu li a {color:#BAE2E9;text-decoration:none;}\n
\n \n
#menu{width:750px;margin:0px auto 0px auto;text-align:center;\n #menu{width:900px;margin:0px auto 0px auto;text-align:center;\n
\tcolor:#bae2e9;height:44px;background:url(<tal:block tal:replace="images_path"/>menu_bg.png) repeat-x top left;\n \tcolor:#bae2e9;height:44px;background:url(<tal:block tal:replace="images_path"/>menu_bg.png) repeat-x top left;\n
\t-moz-border-radius:10px}\n \t-moz-border-radius:10px}\n
#menu ul{list-style:none}\n #menu ul{list-style:none}\n
...@@ -122,7 +122,7 @@ a img{border : 0 none;cursor : pointer;}\n ...@@ -122,7 +122,7 @@ a img{border : 0 none;cursor : pointer;}\n
\n \n
/* Global container */\n /* Global container */\n
#content{text-align:left;position:relative;\n #content{text-align:left;position:relative;\n
left:50%;margin-left:-375px;font-size:1.2em;width:750px;min-height:400px;\n left:50%;margin-left:-450px;font-size:1.2em;width:900px;min-height:400px;\n
background-color:#f3fdff;-moz-border-radius:10px}\n background-color:#f3fdff;-moz-border-radius:10px}\n
#content_padding{padding:20px}\n #content_padding{padding:20px}\n
\n \n
......
436 442
\ No newline at end of file \ 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