...
[14:56:55 CDT(-0500)] <EricDalquist> the JS that is written out includes a portlet resource url
[14:57:16 CDT(-0500)] <EricDalquist> the JS "upload attachment" api POSTs the file upload to the resource url
[14:57:32 CDT(-0500)] <EricDalquist> which accepts the upload, stores it, writes to the db and returns some JSON with the DB key to the new upload
[14:57:39 CDT(-0500)] <EricDalquist> which the other portlet can then use/store/etc
[14:57:57 CDT(-0500)] <cwaymire> The part I had trouble with was getting it to work on a ResourceMapping
[14:58:36 CDT(-0500)] <cwaymire> it didnt seem to send the right parameters across to the mapping
[14:59:07 CDT(-0500)] <cwaymire> i took the working code from the mvc controller and put it under a ResourceMapping and it didnt like the params.
[14:59:12 CDT(-0500)] <EricDalquist> what do you mean?
[14:59:22 CDT(-0500)] <EricDalquist> ah, do you have an example of that?
[14:59:50 CDT(-0500)] <cwaymire> yeah. i can gist it if you want
[14:59:53 CDT(-0500)] <EricDalquist> sure
[15:01:21 CDT(-0500)] <cwaymire> https://gist.github.com/anonymous/5207946
[15:01:21 CDT(-0500)] <cwaymire> https://gist.github.com/anonymous/5207952
[15:01:24 CDT(-0500)] <cwaymire> first one is the mvc controller
[15:01:28 CDT(-0500)] <cwaymire> second is a portlet resource mapping
[15:01:54 CDT(-0500)] <cwaymire> when I attempted to use the resource mapping I got an error saying org.springframework.web.portlet.bind.MissingPortletRequestParameterException: Required MultipartFile parameter 'qqfile' is not present
[15:01:55 CDT(-0500)] <EricDalquist> ok
[15:02:18 CDT(-0500)] <EricDalquist> but it works for the action request version of that?
[15:02:45 CDT(-0500)] <cwaymire> the mvc controller using a RequestMapping works
[15:03:06 CDT(-0500)] <EricDalquist> just out of curiousity
[15:03:06 CDT(-0500)] <cwaymire> at first I tried using an ActionMapping/RenderMapping pair but I need/want to return json
[15:03:12 CDT(-0500)] <EricDalquist> can you try doing this one: https://gist.github.com/anonymous/5207946
[15:03:23 CDT(-0500)] <EricDalquist> but change the ActionReq/Res to ResourceReq/Res
[15:03:35 CDT(-0500)] <EricDalquist> and use a resourceurl instead of an actionurl to call it
[15:03:41 CDT(-0500)] <EricDalquist> just to see if that makes any difference
[15:03:42 CDT(-0500)] <EricDalquist> if not
[15:03:48 CDT(-0500)] <EricDalquist> it is a bug either in spring or in uPortal
[15:04:16 CDT(-0500)] <EricDalquist> file upload is a pita, both spring an uportal have to be super extra careful to not touch the request body before the portlet wants to look at it
[15:04:24 CDT(-0500)] <EricDalquist> or it disappears as you can only read it once
[15:04:59 CDT(-0500)] <cwaymire> I had it working fine in the mvc controller. was able to see the file contents.
[15:05:03 CDT(-0500)] <cwaymire> ok. im going to recompile,d eploy and test
[15:05:31 CDT(-0500)] <EricDalquist> thanks
[15:10:37 CDT(-0500)] <cwaymire> that time I got: org.springframework.web.portlet.NoHandlerFoundException: No handler found for portlet request: mode 'view', phase 'RESOURCE_PHASE', parameters map[[empty]]
[15:10:50 CDT(-0500)] <EricDalquist> hrm
[15:10:59 CDT(-0500)] <EricDalquist> so somehow the parameters are not getting captured
[15:11:03 CDT(-0500)] <EricDalquist> is this code sharable at all?
[15:11:07 CDT(-0500)] <EricDalquist> like could you post it somewhere
[15:11:13 CDT(-0500)] <EricDalquist> and maybe tomorrow morning I could take a look at it?
[15:11:19 CDT(-0500)] <EricDalquist> I'm just worried there is a bug in uportal somwhere
[15:11:37 CDT(-0500)] <cwaymire> yeah. I can push this up to my github repo
[15:12:28 CDT(-0500)] <cwaymire> its frustrating because I had to go through several attempts to get it working properly and now the only blocker is with the MVC controller method I can't see the username.
[15:12:39 CDT(-0500)] <EricDalquist>
[15:12:43 CDT(-0500)] <EricDalquist> right
[15:12:45 CDT(-0500)] <cwaymire> it was the ajax portion that was a bit of a pita
[15:12:46 CDT(-0500)] <EricDalquist> well servlets are just servlets
[15:12:56 CDT(-0500)] <EricDalquist> and completely outside of the scope of the portal
[15:29:31 CDT(-0500)] <cwaymire> if I do it as a ResourceMapping it tells me it can't find the request parameter i'm looking for, but if I look at the http request going out I can see it defined in the request payload as form-data. not sure whats going on there.
[15:30:00 CDT(-0500)] <EricDalquist> yeah
[15:30:05 CDT(-0500)] <EricDalquist> that sounds like either a uportal or spring bug
[16:48:26 CDT(-0500)] <cwaymire> ok I think i have a temporary solution
[16:50:48 CDT(-0500)] <EricDalquist> great
[16:50:53 CDT(-0500)] <EricDalquist> I have to run and catch the bus
[16:51:01 CDT(-0500)] <cwaymire> heh. have fun.
[16:51:05 CDT(-0500)] <EricDalquist> but I'd love to hear about it tomorrow (or via reading chat logs)
[16:59:42 CDT(-0500)] <cwaymire> got it working. just had the AttachmentsPorltet inject the request.getRemoteUser() value into the session at application scope then had the mvc controller pull that value. The design was that the service methods would receive the request object and pull the remote user from there so I just created a class that extends HttpServletRequestWrapper and overrides the getRemoteUser method
[17:00:01 CDT(-0500)] <cwaymire> working great now.