[PORTLETSPEC3-67] Add Multipart Support Created: 29/Jan/16  Updated: 30/May/16

Status: Reopened
Project: portletspec3
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major
Reporter: msnicklous Assignee: msnicklous
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

See PORTLETSPEC3-59 for method descriptions.

Multipart requests should be supported to allow file uploads, etc.

Add the following methods:

ClientDataRequest#getParts
ClientDataRequest#getPart

Configuration:

1) Add a Multipart annotation that can only be used within an @PortletConfiguration annotation
to provide the required configuration data.

@Multipart(location="/tmp", fileSizeThreshold=1024*1024, 
    maxFileSize=1024*1024*5, maxRequestSize=1024*1024*5*5)

2) Allow the same info to be specified through the portlet deployment descriptor
on a per-portlet basis.

<portlet>
   ...
   <multipart-config>
       <location>/tmp</location>
       <max-file-size>20848820</max-file-size>
       <max-request-size>418018841</max-request-size>
       <file-size-threshold>1048576</file-size-threshold>
   </multipart-config>
</portlet>

The alternative to adding a new annotation would be to just require use of
the javax.servlet.annotation.MultipartConfig annotation. However, I think
that might be a problem, since it is not specified how a servlet container
has to react when this annotation is applied to a non-Servlet class. Some servlet
containers might just ignore it, while others might reject the whole application
at deployment time. So I think it would be better to add our own annotation.



 Comments   
Comment by Neil Griffin [ 29/Feb/16 ]

+1 for this issue in general, but here are some additional items...

1) Adding a multipart-config element will require a change to the portlet-app_3_0.xsd schema document.

2) I think we should rely on javax.servlet.http.Part since there is no need to redefine a portlet analog and portlet.jar already has one dependency on the Servlet API with javax.servlet.http.Cookie.

3) Rather than add another annotation like @Multipart, I think it might be simpler to add attributes like location, max-file-size, etc. to the @PortletConfiguration annotation.

Comment by Neil Griffin [ 02/Mar/16 ]

During the EG call on 29 Feb 2016 I think we decided to pursue #1, #2, and #3 from my comments above and that we would not create a new @Multipart annotation.

Comment by msnicklous [ 20/May/16 ]

Please see the API documentation describing these methods here.

A reference implementation snapshot implementing the methods is located here.

A portlet specification snapshot describing the new methods is available here.

Comment by Neil Griffin [ 27/May/16 ]

@msnicklous: I'm temporarily re-opening this issue in order to ask a question:

As discussed in the comment above, during an EG call we decided against the @Multipart annotation, but I see that the latest version of the Portlet 3.0 JavaDoc includes the annotation. Should it have been removed? Thanks, Neil

Comment by msnicklous [ 30/May/16 ]

The portlet 3.0 javadoc does contain an @Multipart annotation, but it has @Target(value=ANNOTATION_TYPE) so it can only be used within another annotation, and not stand-alone. In particular, it is used in the @PortletConfiguration annotation. I thought of going with @MultipartPortlet instead, but to me it just seemed to make the the configuration more verbose without really adding clarity.

If there are other opinions, or a different idea for a short name, we can discuss.





Generated at Sat Aug 27 17:00:44 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.