X-CGP-ClamAV-Result: CLEAN X-VirusScanner: Niversoft's CGPClamav Helper v1.22.2a (ClamAV engine v0.102.2) X-Junk-Score: 0 [] X-KAS-Score: 0 [] From: "Jesse Tayler" Received: from mail-qv1-f44.google.com ([209.85.219.44] verified) by selbstdenker.ag (CommuniGate Pro SMTP 6.3.3) with ESMTPS id 25418860 for webobjects-dev@wocommunity.org; Wed, 17 Feb 2021 00:16:34 +0100 Received-SPF: none receiver=post.selbstdenker.com; client-ip=209.85.219.44; envelope-from=jtayler@oeinc.com Received: by mail-qv1-f44.google.com with SMTP id c25so5475327qvb.4 for ; Tue, 16 Feb 2021 15:16:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oeinc-com.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id; bh=XWfQBJMaTy5E8vUkKuGBb80BgbxHfedbCwxF/awLO6g=; b=F7VJPSJ6cHr/23fg9VLNqsXFFnN/Z7NrraQnwgivteak+1HURcQ6/8NGdrgv2iTOOm T+JfzLE0gmHJOPOty8VhmXjPSpW94MwV85ZIfMo3kQR0NnZypl2PJYTqcwRhfNfhSsRg KPQvQ16+Ru0EjJ2MwiYWS3Is3rxorCsUUgZi0O2w+kUYGNDLFm45XMu/EZcjv07w7ss7 09Ik+nmNPn7NyEUn9NKvy7Mcy2FM55fhjgqdh61uFozY4skKeJnWuTBSHh8y/cGZ37vt nxysMJZfuF/qTvizFuc9mbbWEA7iFEAz8Jlqoa/C1Nbd/sJ1NAAlGuT5rjo1bUiGprPI yRrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=XWfQBJMaTy5E8vUkKuGBb80BgbxHfedbCwxF/awLO6g=; b=GonGwCCuASaeth7GMWREp/0DaPQw/3HHdd2goMcz/drc973tyH6eshFWwCrNzRX92Q ldDo/lxYdaNN8jQPoskffn3ggyslawHB0sGk0R0od3B0JyekL/deEZ4TMQrT9PDDQsJb abyf0dBPnetGfI5NBe9za2VOATrcYkdyAG7R676TZGNNBQJD2em6eoluLWMNE94qxZ/L HQbHhdBYDhUxgqQV1yXGVu9pldsGgG0QxubdYGLz4WLl1UYsVsWL4T0lPkxfxvCe8K77 +1ph8QRTB43l4/tYpHDHOG4TlwCVmNtMvOtaDIBsmNZ4bECgDCCkasqmj5MZrxsMG4SX X5JQ== X-Gm-Message-State: AOAM530CrUjh5456/62sZvJ0S7MJmnV7r/RrfQCNfUreZTKkB8ngmYWB UBFsG2oIv7QdbhwRDDwgfxENQ1xmOAFBfg== X-Google-Smtp-Source: ABdhPJwudzZ7achvMfSuNjFAL2KYC2tiTsy1W/ed3dpiej4qrJ8xu9PmB5cbYSIq9BYu0yrwwEQoEQ== X-Received: by 2002:ad4:4366:: with SMTP id u6mr22183986qvt.51.1613517372852; Tue, 16 Feb 2021 15:16:12 -0800 (PST) Return-Path: Received: from [192.168.1.16] ([69.169.5.176]) by smtp.gmail.com with ESMTPSA id t6sm321028qkd.127.2021.02.16.15.16.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Feb 2021 15:16:12 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.60.0.2.2\)) Subject: Re: [WO-DEV] Stupid me but how do I generate a fully qualified direct action url for sending out via mail? Date: Tue, 16 Feb 2021 18:16:11 -0500 References: To: WebObjects & WOnder Development In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3654.60.0.2.2) I went to see what I was doing maybe this helps.=20 ERX class here handles deployment URLs properly so I don=E2=80=99t need = to fuss there if I generate my URL from here ERXRouteUrlUtils.actionUrlForEntity I have a simple function public static String cleanedLink(String link) { That actually uses D2W to contain a dictionary of replacements, to = shorten specific URLs that likely match to an apache rule that unpacks = it to the full endpoint URL in WO and I might use it for simple static = page DA urls "truanon/wa/about" =3D "about=E2=80=9D;=20 That=E2=80=99s how I seem to do very short links in production, while = not having issue while in development and seems to work fine. I get the domain from an ERX class String applicationHost =3D = ERXConfigurationManager.defaultManager().hostName(); Because I run staging and developer machines etc. "http://" + applicationHost + "/verify? Produces a shortened URL I can send in email that is expected to run on = whichever host sent it. > On Feb 16, 2021, at 5:44 PM, Paul Hoadley = wrote: >=20 > On 17 Feb 2021, at 01:21, Susanne Schneider = wrote: >=20 >> this is indeed not so trivial as you could think, at least I did not = find an easy way. You can ask the application to get the name of itself, = ask the WOAdaptor for the adaptor part, but you cannot find out the name = of the server, especially if your installation is behind a firewall or = proxy and the external server name is different from the internal name. >>=20 >> We finally used a custom configuration parameter to get the server = name (including the adaptor path) and startet from there on, something = like: >> url =3D servername + applicationname + ".woa/wa/" + yourActionName >=20 > And then if you're using re-writing to shorten the URL, it gets even = more complicated to do it in a general way. We pretty much gave up = completely, and most apps now have a property like this: >=20 > net.logicsquad.example.directActionUrl=3Dhttps://example.com/app/wa >=20 >=20 > --=20 > Paul Hoadley > https://logicsquad.net/ > https://www.linkedin.com/company/logic-squad/ >=20 >=20 >=20