You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Nicolas Malin (Jira)" <ji...@apache.org> on 2024/10/19 13:08:00 UTC

[jira] [Created] (OFBIZ-13154) Add uri shortener function

Nicolas Malin created OFBIZ-13154:
-------------------------------------

             Summary: Add uri shortener function
                 Key: OFBIZ-13154
                 URL: https://issues.apache.org/jira/browse/OFBIZ-13154
             Project: OFBiz
          Issue Type: Improvement
          Components: framework
            Reporter: Nicolas Malin
            Assignee: Nicolas Malin


This improvement offer the possibility to use a shortener url to call ofbiz when it render a url.

The origin requirement is to send by email a url to contact OFBiz without any information on technical or functionnal context like JWToken, userLogin, orderId, partyId and so on. OFBiz forward only a short reference that match the actual uri wanted.

Example : 
  * ecommerce/myaccount/order/ORD10034 -> s/tiozerzaze
  * ecommerce/myaccount?token=JWT[more..than..100]axdr&userLoginId=Me@ofbiz.org -> s/epsserlner
 
When a request arrive in OFBiz with the pattern
{noformat}
 s/{shortener}
{noformat}
, the request handler forward to matched uri.

To generate a shortener on freemarker template just use it like it :
{code}
   <@ofbizUrl pathShortener="true">${MyBigUriToSecure}</...@ofbizUrl>
{code}
For email template it's ugly recommand to use *webSiteId* and *fullPath*

{code}
   <@ofbizUrl webSiteId="MyWebSite" fullPath="true" pathShortener="true">${MyBigUriToSecure}</...@ofbizUrl>
{code}
With this you can have a url like this : https://mywebsite.mydomain/s/rytedqzdfd
 
At this time only *<@ofbizUrl *macro freemarker support it.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)