You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2015/09/08 14:36:29 UTC
svn commit: r1701788 -
/olingo/site/trunk/content/doc/odata4/tutorials/write/tutorial_write.mdtext
Author: chrish
Date: Tue Sep 8 12:36:29 2015
New Revision: 1701788
URL: http://svn.apache.org/r1701788
Log:
CMS commit to olingo by chrish
Modified:
olingo/site/trunk/content/doc/odata4/tutorials/write/tutorial_write.mdtext
Modified: olingo/site/trunk/content/doc/odata4/tutorials/write/tutorial_write.mdtext
URL: http://svn.apache.org/viewvc/olingo/site/trunk/content/doc/odata4/tutorials/write/tutorial_write.mdtext?rev=1701788&r1=1701787&r2=1701788&view=diff
==============================================================================
--- olingo/site/trunk/content/doc/odata4/tutorials/write/tutorial_write.mdtext (original)
+++ olingo/site/trunk/content/doc/odata4/tutorials/write/tutorial_write.mdtext Tue Sep 8 12:36:29 2015
@@ -140,8 +140,7 @@ Please find below the sample code for th
// 2. create the data in backend
// 2.1. retrieve the payload from the POST request for the entity to create and deserialize it
InputStream requestInputStream = request.getBody();
- ODataFormat requestODataFormat = ODataFormat.fromContentType(requestFormat);
- ODataDeserializer deserializer = this.odata.createDeserializer(requestODataFormat);
+ ODataDeserializer deserializer = this.odata.createDeserializer(requestFormat);
DeserializerResult result = deserializer.entity(requestInputStream, edmEntityType);
Entity requestEntity = result.getEntity();
// 2.2 do the creation in backend, which returns the newly created entity
@@ -152,8 +151,7 @@ Please find below the sample code for th
// expand and select currently not supported
EntitySerializerOptions options = EntitySerializerOptions.with().contextURL(contextUrl).build();
- ODataFormat oDataFormat = ODataFormat.fromContentType(responseFormat);
- ODataSerializer serializer = this.odata.createSerializer(oDataFormat);
+ ODataSerializer serializer = this.odata.createSerializer(responseFormat);
SerializerResult serializedResponse = serializer.entity(serviceMetadata, edmEntityType, createdEntity, options);
//4. configure the response object
@@ -200,8 +198,7 @@ The difference is that case of update op
// 2. update the data in backend
// 2.1. retrieve the payload from the PUT request for the entity to be updated
InputStream requestInputStream = request.getBody();
- ODataFormat requestODataFormat = ODataFormat.fromContentType(requestFormat);
- ODataDeserializer deserializer = this.odata.createDeserializer(requestODataFormat);
+ ODataDeserializer deserializer = this.odata.createDeserializer(requestFormat);
DeserializerResult result = deserializer.entity(requestInputStream, edmEntityType);
Entity requestEntity = result.getEntity();
// 2.2 do the modification in backend