You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by sk...@apache.org on 2013/12/03 12:59:09 UTC
svn commit: r1547353 -
/incubator/olingo/site/trunk/content/doc/tutorials/Olingo_Tutorial_Advanced_Service_Resolution.mdtext
Author: sklevenz
Date: Tue Dec 3 11:59:08 2013
New Revision: 1547353
URL: http://svn.apache.org/r1547353
Log:
CMS commit to olingo by sklevenz
Added:
incubator/olingo/site/trunk/content/doc/tutorials/Olingo_Tutorial_Advanced_Service_Resolution.mdtext (with props)
Added: incubator/olingo/site/trunk/content/doc/tutorials/Olingo_Tutorial_Advanced_Service_Resolution.mdtext
URL: http://svn.apache.org/viewvc/incubator/olingo/site/trunk/content/doc/tutorials/Olingo_Tutorial_Advanced_Service_Resolution.mdtext?rev=1547353&view=auto
==============================================================================
--- incubator/olingo/site/trunk/content/doc/tutorials/Olingo_Tutorial_Advanced_Service_Resolution.mdtext (added)
+++ incubator/olingo/site/trunk/content/doc/tutorials/Olingo_Tutorial_Advanced_Service_Resolution.mdtext Tue Dec 3 11:59:08 2013
@@ -0,0 +1,82 @@
+Title:
+Notice: Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ .
+ http://www.apache.org/licenses/LICENSE-2.0
+ .
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+# Service Resolution
+
+An OData service usually starts with "/" which delivers the service document while all preceding path segments belong to the servlet and servlet mapping of a web application.
+
+Some service providers would like to get control over the path hierarchy and we call this service resolution. Actually it means a OData path can start on any hierarchy path level after the service mapping.
+
+A uri schema with and without service resolution is shown here:
+
+**[Graphic: tbd]**
+
+A service inti parameter (com.sap.core.odata.path.split) can be set for servlet configuration (see web.xml) and define how many path segments are not interpreted as OData path segments. In the example the split is 2 and the resulting service resolution uses two segments for <namespace> and <service>.
+
+ <?xmlversion="1.0"encoding="UTF-8"?>
+ <web-appxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://java.sun.com/xml/ns/javaee"xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ id="WebApp_ID"version="2.5">
+ <display-name>org.odata4j.ext.web</display-name>
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+ <servlet>
+ <servlet-name>ODataServlet</servlet-name>
+ <servlet-class>org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet</servlet-class>
+ <init-param>
+ <param-name>javax.ws.rs.Application</param-name>
+ <param-value>com.sap.core.odata.core.ODataApplication</param-value>
+ </init-param>
+ <init-param>
+ <param-name>com.sap.core.odata.service.factory</param-name>
+ <param-value>com.sap.core.odata.ref.processor.ScenarioServiceFactory</param-value>
+ </init-param>
+ <init-param>
+ <param-name>com.sap.core.odata.path.split</param-name>
+ <param-value>2</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>ODataServlet</servlet-name>
+ <url-pattern>/odata.svc/*</url-pattern>
+ </servlet-mapping>
+ </web-app>
+
+A processor implementation (e.g. ODataSingleProcessor) does have access to a ODataContext object which will deliver a ODataUriInfo object. From this class a processor implementation can access the service resolution information which is as following:
+
+- URI: *http://localhost:8080/odata.svc/[namespace]/[system]/Room('1')/Size/$value*
+- preceding path segments: *[namespace], [system]*
+- OData path segments: *Room('1'), Size, $value*
+- base URI: *http://localhost:8080/odata.svc/[namespace]/[system]/*
+
+**Sample Code**
+
+ public interface ODataContext {
+ ODataService getService() throws ODataException;
+ ODataUriInfo getUriInfo() throws ODataException;
+ }
+
+ public interface ODataUriInfo {
+ List<ODataPathSegment> getPrecedingPathSegmentList();
+ List<ODataPathSegment> getODataPathSegmentList();
+ URI getBaseUri();
+ }
+
Propchange: incubator/olingo/site/trunk/content/doc/tutorials/Olingo_Tutorial_Advanced_Service_Resolution.mdtext
------------------------------------------------------------------------------
svn:eol-style = native