You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Christian Amend (JIRA)" <ji...@apache.org> on 2015/05/20 10:57:59 UTC

[jira] [Commented] (OLINGO-662) Attachments support in olingo

    [ https://issues.apache.org/jira/browse/OLINGO-662?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14552025#comment-14552025 ] 

Christian Amend commented on OLINGO-662:
----------------------------------------

Hi,

I am not sure what you mean by attachement. Could you please clarify?

For example would you like to have an entity set where for each entity you can persist not only properties but additional content/ If yes than media entities are the correct approach. Although there you can only have one "attachment" per entity.

Best Regards,
Christian

> Attachments support in olingo
> -----------------------------
>
>                 Key: OLINGO-662
>                 URL: https://issues.apache.org/jira/browse/OLINGO-662
>             Project: Olingo
>          Issue Type: Bug
>          Components: MISC, odata2-annotation, odata2-core, odata4-server
>    Affects Versions: V2 2.0.3
>            Reporter: Prashanth
>            Assignee: Christian Amend
>            Priority: Blocker
>              Labels: attachments
>
> This question is about the support for attachments uploading and downloading via Olingo Service ( Olingo V2 2.0.3 ). I have gone the olingo docs but didn't find any clue on how to provide support for uploading and downloading of attachments using olingo . 
> Does olingo supports this functionality ? If olingo supports , how to implements this ? 
> Following are some basics which i came to know by debugging the core library :
> -> Media type support : We can provide support for custom content types by overriding the method getCustomContentTypes() in processor class. 
> -> Implementation : we can implement createEntity as following in processor class :
> @Override
> 	public ODataResponse createEntity(PostUriInfo uriInfo, InputStream content, 
> 	String requestContentType, String contentType) throws ODataException { ... } 
> 	
> 	But here content is giving the requestBody , not actual file/attachment.
> Note : Here the support for attachments means - ex : in case of Rest , CXF provides some api which can be seen in following snippet :
> 	@POST
> 	@Consumes( {MediaType.MULTIPART_FORM_DATA })
> 	@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
> 	public Response create(@Context HttpHeaders httpHeaders, @Context UriInfo uriInfo,
> 			MultipartBody multipartBody)
> Here @Consumes media type provides consumption of multipart formdata and MultipartBody parameter can give us the attachments. 
> Similar to above , Does Olingo V2 2.0.3 provides any API ?How can we implement the support for attachments in Olingo V2 2.0.3 ? Please share us an example !



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