Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

[15:10:01 CDT(-0500)] <drewwills> sure... then how do i know which context to call? string arg?

[15:10:43 CDT(-0500)] <EricDalquist> um ... how are you getting the servlet context to call right now?

[15:10:46 CDT(-0500)] <EricDalquist> I missed that bit (smile)

[15:10:49 CDT(-0500)] <EricDalquist> looking ...

[15:10:54 CDT(-0500)] <drewwills> parsing the string

[15:11:01 CDT(-0500)] <drewwills> /uPortal/api/...

[15:11:16 CDT(-0500)] <drewwills> lol, yes i can continue to do that

[15:11:21 CDT(-0500)] <EricDalquist> right

[15:11:32 CDT(-0500)] <EricDalquist> so this isn't a solution to that part of the code

[15:11:34 CDT(-0500)] <drewwills> i thought this whole thread of discussion was about not having to parse that

[15:11:36 CDT(-0500)] <EricDalquist> no

[15:11:52 CDT(-0500)] <EricDalquist> it is about not doing "req.getSession().getServletContext()" (smile)

[15:12:04 CDT(-0500)] <EricDalquist> since the webapp has that value at init time

[15:12:16 CDT(-0500)] <drewwills> ok – well we can do it for that

[15:12:20 CDT(-0500)] <EricDalquist> as for the parsing out of "/uPortal"

[15:12:33 CDT(-0500)] <EricDalquist> that would probably be best as a property placeholder for now

[15:12:43 CDT(-0500)] <EricDalquist> if we really publish this as an API for portlets

[15:12:53 CDT(-0500)] <EricDalquist> we'll look at providing the portal's context path as a portlet request property

[15:13:19 CDT(-0500)] <EricDalquist> so you could do:

[15:13:19 CDT(-0500)] <EricDalquist> String portalContextPath = portletRequest.getProperty("org.jasig.portal.context_path")

[15:13:32 CDT(-0500)] <drewwills> i think that would be helpful

[15:13:40 CDT(-0500)] <EricDalquist> yeah that is very easy to do

[15:14:00 CDT(-0500)] <drewwills> but doesn't that just help me construct a string like "/uPortal/api/...?"

[15:14:47 CDT(-0500)] <drewwills> I wasn't thinking to make the code in the ApiInvokerImpl uP context specific... doesn't seem like it needs to be

[15:15:12 CDT(-0500)] <EricDalquist> so your client controller should be doing:

[15:15:12 CDT(-0500)] <EricDalquist> invoke(req, res, "/api/person", params)

[15:15:54 CDT(-0500)] <EricDalquist> then your SimpleCrossContextRestApiInvoker (lets assume portlet req/res) does:

[15:16:05 CDT(-0500)] <drewwills> that would be uP specific i think, unless i did <property name="contextName">/uPortal</property>

[15:16:54 CDT(-0500)] <drewwills> (on the SimpleCrossContextRestApiInvoker wiring)

[15:17:01 CDT(-0500)] <EricDalquist> right

[15:17:04 CDT(-0500)] <EricDalquist> it depends on your goals

[15:17:10 CDT(-0500)] <EricDalquist> easy of config or portability

[15:17:17 CDT(-0500)] <EricDalquist> and if you want it callable just from portlets

[15:17:19 CDT(-0500)] <EricDalquist> or from servlets too

[15:17:34 CDT(-0500)] <EricDalquist> if you're talking portlets and easy of config

[15:17:47 CDT(-0500)] <drewwills> yeah let's see how it goes... with time comes greater clarity

[15:18:33 CDT(-0500)] <EricDalquist> your invoker impl does:

[15:18:33 CDT(-0500)] <EricDalquist> String portalContext = req.getProperty("org.jasig.portal.context_path");

[15:18:33 CDT(-0500)] <EricDalquist> ServletContext portalContext = injectedAppContext.getConext(portalContext);

[15:18:33 CDT(-0500)] <EricDalquist> RequestDispatcher rd = portalContext.getRequestDispatcher(uri);

[15:19:01 CDT(-0500)] <EricDalquist> where injectedAppContext is the ServletContext of the caller app injected via the constructor

[15:21:30 CDT(-0500)] <drewwills> roger