summaryrefslogtreecommitdiff
path: root/doc/api_integration.rst
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2014-11-17 17:40:38 +0100
committerXavier Morel <xmo@openerp.com>2014-11-17 17:43:26 +0100
commit5ed0739e7368d6525ee5e7b22cd8fa621cb0ae20 (patch)
tree1c4e966ad4b786854b745644d299d4f1a0709e82 /doc/api_integration.rst
parent86a6619dc8cd473342b8fbbffb48363d154df416 (diff)
[FIX] doc: latex building
* add latex support for exercise admonition * latex freezes/crashes on {HEAVY WIDE-HEADED RIGHTWARDS ARROW} so replace them by more manual arrows * add some preamble configuration, may not even be necessary * generate WS setup code only in HTML output. WS doc in latex still isn't great as it displays all 4 languages one after the other, ideally they should be tagged or something, so only one language at a time is generated in non-HTML outputs
Diffstat (limited to 'doc/api_integration.rst')
-rw-r--r--doc/api_integration.rst92
1 files changed, 47 insertions, 45 deletions
diff --git a/doc/api_integration.rst b/doc/api_integration.rst
index 12c5b56737e..4a9835fa743 100644
--- a/doc/api_integration.rst
+++ b/doc/api_integration.rst
@@ -24,64 +24,66 @@ Connection and authentication
.. kinda gross because it duplicates existing bits
-.. rst-class:: setupcode hidden
+.. only:: html
- .. code-block:: python
+ .. rst-class:: setupcode hidden
- import xmlrpclib
- info = xmlrpclib.ServerProxy('https://demo.odoo.com/start').start()
- url, db, username, password = \
- info['host'], info['database'], info['user'], info['password']
- common = xmlrpclib.ServerProxy('{}/xmlrpc/2/common'.format(url))
- uid = common.authenticate(db, username, password, {})
- models = xmlrpclib.ServerProxy('{}/xmlrpc/2/object'.format(url))
+ .. code-block:: python
- .. code-block:: ruby
+ import xmlrpclib
+ info = xmlrpclib.ServerProxy('https://demo.odoo.com/start').start()
+ url, db, username, password = \
+ info['host'], info['database'], info['user'], info['password']
+ common = xmlrpclib.ServerProxy('{}/xmlrpc/2/common'.format(url))
+ uid = common.authenticate(db, username, password, {})
+ models = xmlrpclib.ServerProxy('{}/xmlrpc/2/object'.format(url))
- require "xmlrpc/client"
- info = XMLRPC::Client.new2('https://demo.odoo.com/start').call('start')
- url, db, username, password = \
- info['host'], info['database'], info['user'], info['password']
- common = XMLRPC::Client.new2("#{url}/xmlrpc/2/common")
- uid = common.call('authenticate', db, username, password, {})
- models = XMLRPC::Client.new2("#{url}/xmlrpc/2/object").proxy
+ .. code-block:: ruby
- .. code-block:: php
+ require "xmlrpc/client"
+ info = XMLRPC::Client.new2('https://demo.odoo.com/start').call('start')
+ url, db, username, password = \
+ info['host'], info['database'], info['user'], info['password']
+ common = XMLRPC::Client.new2("#{url}/xmlrpc/2/common")
+ uid = common.call('authenticate', db, username, password, {})
+ models = XMLRPC::Client.new2("#{url}/xmlrpc/2/object").proxy
- require_once('ripcord.php');
- $info = ripcord::client('https://demo.odoo.com/start')->start();
- list($url, $db, $username, $password) =
- array($info['host'], $info['database'], $info['user'], $info['password']);
- $common = ripcord::client("$url/xmlrpc/2/common");
- $uid = $common->authenticate($db, $username, $password, array());
- $models = ripcord::client("$url/xmlrpc/2/object");
+ .. code-block:: php
- .. code-block:: java
+ require_once('ripcord.php');
+ $info = ripcord::client('https://demo.odoo.com/start')->start();
+ list($url, $db, $username, $password) =
+ array($info['host'], $info['database'], $info['user'], $info['password']);
+ $common = ripcord::client("$url/xmlrpc/2/common");
+ $uid = $common->authenticate($db, $username, $password, array());
+ $models = ripcord::client("$url/xmlrpc/2/object");
- final XmlRpcClient client = new XmlRpcClient();
+ .. code-block:: java
- final XmlRpcClientConfigImpl start_config = new XmlRpcClientConfigImpl();
- start_config.setServerURL(new URL("https://demo.odoo.com/start"));
- final Map<String, String> info = (Map<String, String>)client.execute(
- start_config, "start", Collections.emptyList());
+ final XmlRpcClient client = new XmlRpcClient();
- final String url = info.get("host"),
- db = info.get("database"),
- username = info.get("user"),
- password = info.get("password");
+ final XmlRpcClientConfigImpl start_config = new XmlRpcClientConfigImpl();
+ start_config.setServerURL(new URL("https://demo.odoo.com/start"));
+ final Map<String, String> info = (Map<String, String>)client.execute(
+ start_config, "start", Collections.emptyList());
- final XmlRpcClientConfigImpl common_config = new XmlRpcClientConfigImpl();
- common_config.setServerURL(new URL(String.format("%s/xmlrpc/2/common", url)));
+ final String url = info.get("host"),
+ db = info.get("database"),
+ username = info.get("user"),
+ password = info.get("password");
- int uid = (int)client.execute(
- common_config, "authenticate", Arrays.asList(
- db, username, password, Collections.emptyMap()));
+ final XmlRpcClientConfigImpl common_config = new XmlRpcClientConfigImpl();
+ common_config.setServerURL(new URL(String.format("%s/xmlrpc/2/common", url)));
- final XmlRpcClient models = new XmlRpcClient() {{
- setConfig(new XmlRpcClientConfigImpl() {{
- setServerURL(new URL(String.format("%s/xmlrpc/2/object", url)));
- }});
- }};
+ int uid = (int)client.execute(
+ common_config, "authenticate", Arrays.asList(
+ db, username, password, Collections.emptyMap()));
+
+ final XmlRpcClient models = new XmlRpcClient() {{
+ setConfig(new XmlRpcClientConfigImpl() {{
+ setServerURL(new URL(String.format("%s/xmlrpc/2/object", url)));
+ }});
+ }};
Configuration
-------------