X-CGP-ClamAV-Result: CLEAN X-VirusScanner: Niversoft's CGPClamav Helper v1.25a (ClamAV 0.103.8/26959) X-Junk-Score: 0 [] X-KAS-Score: 0 [] Return-Path: Received: from mail-qk1-f170.google.com ([209.85.222.170] verified) by selbstdenker.ag (CommuniGate Pro SMTP 6.3.18) with ESMTPS id 30996953 for webobjects-dev@wocommunity.org; Tue, 04 Jul 2023 16:29:32 +0200 Received-SPF: pass receiver=post.selbstdenker.com; client-ip=209.85.222.170; envelope-from=recurve@cocoanutstech.com Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-765942d497fso538767685a.1 for ; Tue, 04 Jul 2023 07:29:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chatnbike.com; s=chatnbike; t=1688480950; x=1691072950; h=references:to:in-reply-to:subject:date:mime-version:message-id:from :from:to:cc:subject:date:message-id:reply-to; bh=j8AMApzBW/8Y7erubwQG10yF7ctdAatwAD0SHeKG71g=; b=GdbGPzr6o50jcKXHZpPQvWC9MMm6MUsfFpy+5cDJyFOs0Jq/wA/9Kkum19nvcR94+o p9DrcvDcWmqtMoZS3ZBnBLa8OIX/fc5KrDCc4DnoXXyzP6ur/l+iM56MtU3o9bMlVwoE oh1oBWQ49wcFhbj9qzWHrs/vwT5E0+lKi2c3w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688480950; x=1691072950; h=references:to:in-reply-to:subject:date:mime-version:message-id:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=j8AMApzBW/8Y7erubwQG10yF7ctdAatwAD0SHeKG71g=; b=ZctEsXbabLl0SbavM6D6HnIzuOMlXs4OtAfMp6brU64mrBdZPi6jUeIvns5PWczYIe cLrb4LrfS6ND3CHFkrIF5hYy2Jy9UiQDrz4uOBGTNwfKk/goPFFVz4MrsGI9R3TQNjQD OtFBX4prvZwuco5/Q5V/D2RBVki9h4eF3kHpLNTYt8L2M1IghT0dsicecFw8+0ooAje6 yAiLGSQ1H3MBlC3cXuHAox/yPFM1aTn/yV3+iLRKaXMSSMsCNhRETLhynetRqw5+FXKM yvTBDE2BRRpAAwDOyiES0vkpOsxFEQKP6OvdRliyO+KT5c4lzYwmok+cM2s6aM938jKh 04DQ== X-Gm-Message-State: ABy/qLY5AdcekKGZyFg8+e21O9twhMtlhIXRKF+YAHvsCiSBwrHpGvHy 9nEdgyP3UAsqPKNFSofaaJpLz4NWS6mF51gLcFs= X-Google-Smtp-Source: APBJJlGW4lmY/h+lynHp3HJpHjidzlkc2RX77IsVYL2Ju3ciYzqd3O1FoTmyX3WLUUfX6OjngQzISA== X-Received: by 2002:a05:6214:1c45:b0:635:e113:a0fc with SMTP id if5-20020a0562141c4500b00635e113a0fcmr17978626qvb.34.1688480950252; Tue, 04 Jul 2023 07:29:10 -0700 (PDT) Return-Path: Received: from smtpclient.apple (pool-173-79-19-72.washdc.fios.verizon.net. [173.79.19.72]) by smtp.gmail.com with ESMTPSA id l11-20020a0cc20b000000b00632266b569esm12557512qvh.87.2023.07.04.07.29.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2023 07:29:09 -0700 (PDT) From: Aaron Rosenzweig Message-Id: <5225AA09-953A-43CC-8250-239C323BA073@chatnbike.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_A4AD7DB3-63B0-406C-A26B-DAA686F414F6" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.3\)) Date: Tue, 4 Jul 2023 10:29:09 -0400 Subject: Re: [WO-DEV] Return to component from calling an external non-wo app In-Reply-To: To: WebObjects & WOnder Development References: X-Mailer: Apple Mail (2.3696.120.41.1.3) --Apple-Mail=_A4AD7DB3-63B0-406C-A26B-DAA686F414F6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Markus, here=E2=80=99s one idea: 1) Make a direct action (DirectAction.java)=20 2) Pass a parameter to that direct action that is either a UUID or a PK = of a new EO=E2=80=A6 let=E2=80=99s 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.=20 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=E2=80=99s 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) = wrote: >=20 > 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=E2=80=99s all working. One item in the posted = XML is an (optional) return URL. >=20 > 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).=20 >=20 > 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=3Dtrue) 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 =3D=3D true. >=20 > So my primary issue is how to create a URL for the current component = that has the same effect as =E2=80=9Creload=E2=80=9D (and mind you we = are inside a (WO)Session and cannot lose this context). >=20 > Thanks for your help and ideas > ---markus--- >=20 >=20 > Markus Ruggiero >=20 > rucotec GmbH web https://rucotec.ch > Leonhardsberg 1 email markus.ruggiero@rucotec.ch > 4051 Basel / Switzerland mobile +41 79 508 4701 >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 --Apple-Mail=_A4AD7DB3-63B0-406C-A26B-DAA686F414F6 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hi = Markus, here=E2=80=99s 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=E2=80=A6 = let=E2=80=99s 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=E2=80=99s 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=E2=80=99s 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=3Dtrue) 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 =3D=3D true.

So my primary issue is = how to create a URL for the current component that has the same effect = as =E2=80=9Creload=E2=80=9D (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









= --Apple-Mail=_A4AD7DB3-63B0-406C-A26B-DAA686F414F6--