[
https://issues.apache.org/jira/browse/OLINGO-1068?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Christian Amend resolved OLINGO-1068.
-------------------------------------
Resolution: Fixed
Assignee: Christian Amend
Hi,
the V2 library was primarily developed as a server library thus you need to set
an ExpandSelectTree to see inline content. On server side this tree is given to
you. On Consumer side you need to build this yourself by using the
ExpandSelectTreeBuilder. Just set your expanded navigation property as an
expanded link there.
Best Regards,
Christian
> EntityProvider writeEntry does not include inline content in ODataResponse
> --------------------------------------------------------------------------
>
> Key: OLINGO-1068
> URL: https://issues.apache.org/jira/browse/OLINGO-1068
> Project: Olingo
> Issue Type: Bug
> Components: odata2-core
> Affects Versions: V2 2.0.8
> Reporter: M Carissimi
> Assignee: Christian Amend
>
> Hello,
> I have an OData client written using the Olingo library that takes a set of
> properties (Map<String,Objects>) and uses it to put data to a OData server.
> The EntityProvider.writeEntry() method is used to obtain an InputStream for
> the set of properties to send to the server:
> {code}
> public ConsumerResponse<Object> updateEntry(String anEntitySetName, String
> anEntryURL, Map<String, Object> someData,
> String aContentType) throws ConsumerException
> {
> ConsumerResponse<Object> myConsumerResponse = null;
> try
> {
> EdmEntityContainer myEntityContainer =
> getMetadata(anEntryURL).getDefaultEntityContainer();
> EntityProviderWriteProperties myWriteProperties =
> EntityProviderWriteProperties.serviceRoot(new
> URI(extractServiceURIFromURL(anEntryURL))).build();
>
> // serialize data into ODataResponse object
> ODataResponse myResponse = EntityProvider.writeEntry(aContentType,
> myEntityContainer.getEntitySet(anEntitySetName), someData,
> myWriteProperties);
> // get entity InputStream
> InputStream myEntity = (InputStream) myResponse.getEntity();
>
> // put data to server
> HttpResponse myHttpResponse = execute(anEntryURL, HTTP_METHOD_PUT,
> myEntity, aContentType);
> ...
> {code}
> This works well for single entries, but it does not work for entries with
> inline content. If the set of properties contain both simple properties (e.g:
> NAME > "MyName") and inline content (e.g. ENTITY_LINK > Map<String,Object>),
> the ODataResponse object returned by the EntityProvider.writeEntry() method,
> does not include the inline content.
> I have attempted to set the inline content as an ODataEntry object rather
> than a Map<String,Object> but the behaviour is the same.
> Why is the inline content not retained by the writeEntry() method?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)