Frederik Zimmer created OLINGO-860:
--------------------------------------

             Summary: Proxy-Client: Incorrect creation of media entities
                 Key: OLINGO-860
                 URL: https://issues.apache.org/jira/browse/OLINGO-860
             Project: Olingo
          Issue Type: Bug
          Components: odata4-ext
    Affects Versions: (Java) V4 4.1.0
            Reporter: Frederik Zimmer


Creating a media entity must be a POST with the media entity stream as the 
content. Setting properties of a media entity is then done by a PATCH. Thats's 
at least what I undestand.
The proxy-client does a POST with the entity properties, then a PATCH with the 
entity properties and then a PUT with the media entity stream.

The proxy-client doesn't distinguish between entity and media entity creation. 
In AbstractPersistenceManager there is only a queueCreate and not a create for 
media entities with 
service.getClient().getCUDRequestFactory().getMediaEntityCreateRequest. After 
creating the media entity like a normal entity the processEntityContext method 
detects that it is a media entity and it has changed (although it was just 
created) and issues a queueUpdate and then a queueUpdateMediaEntity to update 
the stream.

Create the media entity with 
service.getClient().getCUDRequestFactory().getMediaEntityCreateRequest and if 
the media entity has properties then update the media entity with 
service.getClient().getCUDRequestFactory().getEntityUpdateRequest.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to