You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by bu...@apache.org on 2013/11/07 10:38:28 UTC
svn commit: r885721 - in /websites/staging/olingo/trunk/content: ./
doc/tutorials/debug.html
Author: buildbot
Date: Thu Nov 7 09:38:28 2013
New Revision: 885721
Log:
Staging update by buildbot for olingo
Modified:
websites/staging/olingo/trunk/content/ (props changed)
websites/staging/olingo/trunk/content/doc/tutorials/debug.html
Propchange: websites/staging/olingo/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Nov 7 09:38:28 2013
@@ -1 +1 @@
-1539571
+1539572
Modified: websites/staging/olingo/trunk/content/doc/tutorials/debug.html
==============================================================================
--- websites/staging/olingo/trunk/content/doc/tutorials/debug.html (original)
+++ websites/staging/olingo/trunk/content/doc/tutorials/debug.html Thu Nov 7 09:38:28 2013
@@ -82,79 +82,89 @@
<p>For productive uses cases this feature is by default off. The following explains how to enable the feature and gives options to an service implementation to switch if on and off e.g. role based or by configuration.</p>
<h5 id="debugcallback">DebugCallback</h5>
<p>The debug feature can be enabled by the following callback implementation:</p>
-<p><code>public class ScenarioDebugCallback implements ODataDebugCallback {
- @Override
- public boolean isDebugEnabled() {
- boolean isDebug = â¦; // true|configuration|user role check
- return isDebug;
- }
-}</code>
-In your service factory (<code>ODataServiceFactory</code>) implement the following method to register the callback:</p>
-<p>```
-public <T extends ODataCallback> T getCallback(final Class<? extends ODataCallback> callbackInterface) {
- T callback</p>
-<p>if (callbackInterface.isAssignableFrom(ScenarioErrorCallback.class)) {
- callback = (T) new ScenarioErrorCallback();
- } else {
- callback = (T) super.getCallback(callbackInterface);
- }</p>
-<p>return callback;
-}
-```
-If this is in place then the url query option odata-debug=json will return detailed error information in json format for each request.</p>
+<div class="codehilite"><pre><span class="n">public</span> <span class="n">class</span> <span class="n">ScenarioDebugCallback</span> <span class="n">implements</span> <span class="n">ODataDebugCallback</span> <span class="p">{</span>
+ <span class="p">@</span><span class="n">Override</span>
+ <span class="n">public</span> <span class="n">boolean</span> <span class="n">isDebugEnabled</span><span class="p">()</span> <span class="p">{</span>
+ <span class="n">boolean</span> <span class="n">isDebug</span> <span class="p">=</span> â¦<span class="p">;</span> <span class="o">//</span> <span class="n">true</span><span class="o">|</span><span class="n">configuration</span><span class="o">|</span><span class="n">user</span> <span class="n">role</span> <span class="n">check</span>
+ <span class="k">return</span> <span class="n">isDebug</span><span class="p">;</span>
+ <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>In your service factory (<code>ODataServiceFactory</code>) implement the following method to register the callback:</p>
+<div class="codehilite"><pre><span class="kr">public</span> <span class="o"><</span><span class="nx">T</span> <span class="kr">extends</span> <span class="nx">ODataCallback</span><span class="o">></span> <span class="nx">T</span> <span class="nx">getCallback</span><span class="p">(</span><span class="kr">final</span> <span class="nx">Class</span><span class="cp"><?</span> <span class="k">extends</span> <span class="nx">ODataCallback</span><span class="o">></span> <span class="nx">callbackInterface</span><span class="p">)</span> <span class="p">{</span>
+ <span class="nx">T</span> <span class="nx">callback</span>
+
+ <span class="k">if</span> <span class="p">(</span><span class="nx">callbackInterface</span><span class="o">.</span><span class="nx">isAssignableFrom</span><span class="p">(</span><span class="nx">ScenarioErrorCallback</span><span class="o">.</span><span class="nx">class</span><span class="p">))</span> <span class="p">{</span>
+ <span class="nx">callback</span> <span class="o">=</span> <span class="p">(</span><span class="nx">T</span><span class="p">)</span> <span class="k">new</span> <span class="nx">ScenarioErrorCallback</span><span class="p">();</span>
+ <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+ <span class="nx">callback</span> <span class="o">=</span> <span class="p">(</span><span class="nx">T</span><span class="p">)</span> <span class="nx">super</span><span class="o">.</span><span class="nx">getCallback</span><span class="p">(</span><span class="nx">callbackInterface</span><span class="p">);</span>
+ <span class="p">}</span>
+
+ <span class="k">return</span> <span class="nx">callback</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>If this is in place then the url query option odata-debug=json will return detailed error information in json format for each request.</p>
<h5 id="example">Example</h5>
<p>Request url: http://localhost:8080/com.sap.olingo.web/ReferenceScenario.svc/?odata-debug=json</p>
<p>Response:</p>
-<p><code>{
- "body": "<?xml version='1.0' encoding='utf-8'?><service xml:base=\"http://localhost:8080/com.sap.olingo.web/ReferenceScenario.svc/\" xmlns=\"http://www.w3.org/2007/app\" xmlns:atom=\"http://www.w3.org/2005/Atom\"><workspace><atom:title>Default</atom:title><collection href=\"Employees\"><atom:title>Employees</atom:title></collection><collection href=\"Teams\"><atom:title>Teams</atom:title></collection><collection href=\"Rooms\"><atom:title>Rooms</atom:title></collection><collection href=\"Managers\"><atom:title>Managers</atom:title></collection><collection href=\"Buildings\"><atom:title>Buildings</atom:title></collection><collection href=\"Container2.Photos\"><atom:title>Photos</atom:title></collection></workspace></service>",
- "request": {
- "method": "GET",
- "uri": "https://localhost:8080/com.sap.olingo.web/ReferenceScenario.svc/?odata-debug=json",
- "headers": {
- "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
- "accept-encoding": "gzip, deflate",
- "accept-language": "de-de,de;q=0.8,en-us;q=0.5,en;q=0.3",
- "connection": "keep-alive",
- "Content-Type": null,
- "cookie": "JSESSIONID=C6A2403F354B61B1E645744FABCB7FB6C6BC5DA41BC841823647CF2DFF001556; BIGipServerlocalhost=3543090186.26911.0000",
- "host": "localhost:8080",
- "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Firefox/24.0",
- "x-forwarded-for": "173.12.210.11"
+<div class="codehilite"><pre>{
+ "body": "<span class="cp"><?xml version='1.0' encoding='utf-8'?></span><span class="nt"><service</span> <span class="na">xml:base=</span><span class="s">\"http://localhost:8080/com.sap.olingo.web/ReferenceScenario.svc/\"</span> <span class="na">xmlns=</span><span class="s">\"http://www.w3.org/2007/app\"</span> <span class="na">xmlns:atom=</span><span class="s">\"http://www.w3.org/2005/Atom\"</span><span class="nt">><workspace><atom:title></span>Default<span class="nt"></atom:title><collection</span> <span class="na">href=</span><span class="s">\"Employees\"</span><span class="nt">><atom:title></span>Employees<span class="nt"></atom:title></collection><collection</span> <span class="na">href=</span><span class="s">\"Teams\"</span><span class="nt">><atom:title></span>Teams<span class="nt"></atom:title></collection><collecti
on</span> <span class="na">href=</span><span class="s">\"Rooms\"</span><span class="nt">><atom:title></span>Rooms<span class="nt"></atom:title></collection><collection</span> <span class="na">href=</span><span class="s">\"Managers\"</span><span class="nt">><atom:title></span>Managers<span class="nt"></atom:title></collection><collection</span> <span class="na">href=</span><span class="s">\"Buildings\"</span><span class="nt">><atom:title></span>Buildings<span class="nt"></atom:title></collection><collection</span> <span class="na">href=</span><span class="s">\"Container2.Photos\"</span><span class="nt">><atom:title></span>Photos<span class="nt"></atom:title></collection></workspace></service></span>",
+ "request": {
+ "method": "GET",
+ "uri": "https://localhost:8080/com.sap.olingo.web/ReferenceScenario.svc/?odata-debug=json",
+ "headers": {
+ "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
+ "accept-encoding": "gzip, deflate",
+ "accept-language": "de-de,de;q=0.8,en-us;q=0.5,en;q=0.3",
+ "connection": "keep-alive",
+ "Content-Type": null,
+ "cookie": "JSESSIONID=C6A2403F354B61B1E645744FABCB7FB6C6BC5DA41BC841823647CF2DFF001556; BIGipServerlocalhost=3543090186.26911.0000",
+ "host": "localhost:8080",
+ "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Firefox/24.0",
+ "x-forwarded-for": "173.12.210.11"
}
},
- "response": {
- "status": {
- "code": 200,
- "info": "OK"
+ "response": {
+ "status": {
+ "code": 200,
+ "info": "OK"
},
- "headers": {
- "DataServiceVersion": "1.0",
- "Content-Type": "application/xml;charset=utf-8"
+ "headers": {
+ "DataServiceVersion": "1.0",
+ "Content-Type": "application/xml;charset=utf-8"
}
},
- "runtime": [{
- "class": "ODataRequestHandler",
- "method": "handle",
- "duration": 1911,
- "memory": 191,
- "children": [
+ "runtime": [{
+ "class": "ODataRequestHandler",
+ "method": "handle",
+ "duration": 1911,
+ "memory": 191,
+ "children": [
{
- "class": "UriParserImpl",
- "method": "parse",
- "duration": 66,
- "memory": 0,
- "children": {}
+ "class": "UriParserImpl",
+ "method": "parse",
+ "duration": 66,
+ "memory": 0,
+ "children": {}
},
{
- "class": "Dispatcher",
- "method": "dispatch",
- "duration": 1029,
- "memory": 95,
- "children": {}
+ "class": "Dispatcher",
+ "method": "dispatch",
+ "duration": 1029,
+ "memory": 95,
+ "children": {}
}
]
}]
-}</code></p>
+}
+</pre></div>
+
+
+<h3 id="log-and-trace-support">Log and Trace Support</h3>