Mailing List webobjects-dev@wocommunity.org Message #459
From: Aaron Rosenzweig <aaron@chatnbike.com>
Subject: Re: [WO-DEV] Return to component from calling an external non-wo app
Date: Tue, 4 Jul 2023 10:29:09 -0400
To: WebObjects & WOnder Development <webobjects-dev@wocommunity.org>
Hi Markus, here’s one idea:

1) Make a direct action (DirectAction.java) 

2) Pass a parameter to that direct action that is either a UUID or a PK of a new EO… let’s call the EO: ReturnFromOutside.plist

3) In that EO you store an FK to the User EO, and whatever other pieces of information that would be important like maybe the name of the WOComponent they were on and a timestamp. 

4) When the Outside service returns flow via your direct action and ID of your ReturnFromOutside EO, you then need to decide if you force re-authentication or not. Maybe you always do. Maybe you do it only if it’s been longer than 15 minutes. Up to you. But then you can create an instance WOComponent the user was previously on. Either because you have a special direct action that knows there is only one WOComponent or because you stored the name of the desired WOComponent in the ReturnFromOutside EO. Populate the ivars the component needs from ReturnFromOutside EO.

On Jul 4, 2023, at 8:03 AM, Markus Ruggiero (rucotec) <markus.ruggiero@rucotec.ch> wrote:

I need to call an external app for some interactive stuff. The call to that app allows to pass a URL that will be called upon the user is done on the external site. Our user is woking inside a complex component and eventually needs to go externally for some specific tasks. Going to said external app happens with a POST request and a ton of XML in the request body. I can do this, that’s all working. One item in the posted XML is an (optional) return URL.

How can I create this return URL so that the user transparently comes back to where they left off? I also need to act on this (the user coming back from the external site) to download info about what the user has done over there. This downloading of the results is another XML posted to the external site, their response however is then an XML which I need to parse (that is not a problem). 

I am looking for strategies and possible code snippets for such a scenario, particularly the creation of the return URL. I want this to kind of work like the user doing a reload on the current page (a.k.a. return null). I was thinking of passing some parameter along with the URL (?comingBack=true) that will then trigger the request to get back the data from the external site. This could be done in appendToResponse() with checking for comingBack == true.

So my primary issue is how to create a URL for the current component that has the same effect as “reload” (and mind you we are inside a (WO)Session and cannot lose this context).

Thanks for your help and ideas
---markus---


Markus Ruggiero

rucotec GmbH                        web https://rucotec.ch
Leonhardsberg 1                   email markus.ruggiero@rucotec.ch
4051 Basel / Switzerland         mobile +41 79 508 4701









Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster