X-CGP-ClamAV-Result: CLEAN X-VirusScanner: Niversoft's CGPClamav Helper v1.22.2a (ClamAV engine v0.102.2) X-Junk-Score: 20 [X] X-KAS-Score: 20 [X] From: "Samuel Pelletier" Received: from fortimail.cybercat.ca ([216.13.210.77] verified) by post.selbstdenker.com (CommuniGate Pro SMTP 6.3.3) with ESMTPS id 25424037 for webobjects-dev@wocommunity.org; Wed, 17 Feb 2021 18:40:37 +0100 Received-SPF: none receiver=post.selbstdenker.com; client-ip=216.13.210.77; envelope-from=samuel@samkar.com Received: from [10.70.4.100] (modemcable070.93-179-173.mc.videotron.ca [173.179.93.70]) (user=samuel%samkar.com mech=PLAIN bits=0) by fortimail.cybercat.ca with ESMTP id 11HHeFP8007018-11HHeFP9007018 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 17 Feb 2021 12:40:15 -0500 Content-Type: multipart/alternative; boundary="Apple-Mail=_B1CF6BD6-75CE-4047-87E1-5CDE165E48FA" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: [WO-DEV] Stupid me but how do I generate a fully qualified direct action url for sending out via mail? Date: Wed, 17 Feb 2021 12:40:14 -0500 References: To: WebObjects & WOnder Development In-Reply-To: Message-Id: <11C4C565-C72F-42EF-B739-3AC956C0CBBB@samkar.com> X-Mailer: Apple Mail (2.3608.120.23.2.4) X-FEAS-AUTH-USER: samuel%samkar.com --Apple-Mail=_B1CF6BD6-75CE-4047-87E1-5CDE165E48FA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi, I submitted PR-851, merger in Feb 2018 to handle the background task = host problem. To use these, simply create a context using ERXWOContext sessionLessContext =3D ERXWOContext.newContext(); sessionLessContext.generateCompleteURLs(); String url =3D sessionLessContext.urlWithRequestHandlerKey(...) or create a component with ERXApplication.instantiatePage(String = pageName) or ERMailUtils.instantiatePage() as both will use = ERXWOContext.newContext(); Properties to enable this: ## If your WOHost is not your public host name, specify the public host = to use for complete URL=20 ## generated without a server request like background tasks that send = emails. # er.extensions.ERXApplication.publicHost=3Dwww.yourPublicHost.com ## Set to true to switch default request used in background tasks to = https # er.extensions.ERXApplication.publicHostIsSecure=3Dfalse Regards, Samuel > Le 17 f=C3=A9vr. 2021 =C3=A0 02:33, Stefan G=C3=A4rtner = a =C3=A9crit : >=20 > Two important questions should be considered: >=20 > Do you generate the URL inside of a request-response cycle or possibly = also inside of a background task? > If during a request, WOContext.directActionURLForActionNamed works = fine, as written by Ren=C3=A9 and Ramsey. This works because the = WOContext takes the URL used in the HTTP WORequest. > Else: > Is the host, which the app is running on, the one directly accessed by = users via HTTP? > If yes, you might be able to use = ERXConfigurationManager.defaultManager().hostName() as suggested by = Jesse (it uses InetAddress.getLocalHost().getHostName() internally) > Else: > Just define a configuration property containing the base URL (can = certainly be specified per environment) as written by Paul. >=20 > Best regards, > Stefan >=20 >=20 >> Am 16.02.2021 um 15:39 schrieb Markus Ruggiero (rucotec) = >: >>=20 >> The subject line already says all >>=20 >> Thanks >>=20 >> Markus Ruggiero >>=20 >> rucotec GmbH web https://rucotec.ch = >> Steinenvorstadt 79 email markus.ruggiero@rucotec.ch = >> 4051 Basel / Switzerland mobile +41 79 508 4701 >>=20 >>=20 >>=20 >>=20 >>=20 >>=20 >>=20 >>=20 >=20 >=20 --Apple-Mail=_B1CF6BD6-75CE-4047-87E1-5CDE165E48FA Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
Hi,

I= submitted PR-851, merger in Feb 2018 to handle the background task host = problem.

To = use these, simply create a context using
ERXWOContext = sessionLessContext =3D ERXWOContext.newContext();
sessionLessContext.generateCompleteURLs();
String= url =3D sessionLessContext.urlWithRequestHandlerKey(...)

or create a component with = ERXApplication.instantiatePage(String pageName) or = ERMailUtils.instantiatePage() as both will use = ERXWOContext.newContext();

Properties to = enable this:

## If = your WOHost is not your public host name, specify the public host to use = for complete URL 
## generated without a = server request like background tasks that send emails.
# er.extensions.ERXApplication.publicHost=3Dwww.yourPublicHost.com
## Set to = true to switch default request used in background tasks to = https
# = er.extensions.ERXApplication.publicHostIsSecure=3Dfalse

Regards,

Samuel



Le 17 f=C3=A9vr. 2021 =C3=A0 = 02:33, Stefan G=C3=A4rtner <webobjects-dev@wocommunity.org> a =C3=A9crit = :

Two = important questions should be considered:

  • Do you generate the URL inside of a request-response cycle or = possibly also inside of a background task?
    • If during a request, WOContext.directActionURLForActionNamed works fine, as = written by Ren=C3=A9 and Ramsey. This works because the WOContext = takes the URL used in the HTTP WORequest.
    • Else:
  • Is the host, which the app is = running on, the one directly accessed by users via HTTP?
    • If yes, you might be able to use ERXConfigurationManager.defaultManager().hostName() as = suggested by Jesse (it = uses InetAddress.getLocalHost().getHostName() internally)
    • Else:
  • Just define a configuration = property containing the base URL (can certainly be specified per = environment) as written by Paul.

Best regards,
Stefan


Am = 16.02.2021 um 15:39 schrieb Markus Ruggiero (rucotec) <webobjects-dev@wocommunity.org>:

The subject line = already says all

Thanks

Markus = Ruggiero

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










= --Apple-Mail=_B1CF6BD6-75CE-4047-87E1-5CDE165E48FA--