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/06/08 14:29:00 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=14577102#comment-14577102 ] 

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

Hi,

I think you are already using everything the best you can. Given your setup I don`t think there is currently a way to do it better.

You can get the httpServletRequest from the context try: HttpServletRequest r = (HttpServletRequest) ctx.getParameter(ODataContext.HTTP_SERVLET_REQUEST_OBJECT);

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)