ofbiz-framework
ofbiz-framework copied to clipboard
Improved: Add uri shortener function (OFBIZ-13154)
This improvement offer the possibility to use an url shortener to call ofbiz when it render an url.
The origin requirement is to send by email an url to contact OFBiz without any information on technical or functionnal context like JWToken, userLogin, orderId, partyId and so on. OFBiz forwards 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&[email protected] -> s/epsserlner
When a request arrive in OFBiz with the pattern s/{shortener}, the request handler forward to matched uri.
To generate a shortener on freemarker template just define it like that :
<@ofbizUrl pathShortener="true">${MyBigUriToSecure}/@ofbizUrl
For email template it's ugly recommand to use webSiteId and fullPath
<@ofbizUrl webSiteId="MyWebSite" fullPath="true" pathShortener="true">${MyBigUriToSecure}/@ofbizUrl
With this you can have an url like this : https://mywebsite.mydomain/s/rytedqzdfd
At this time only <@ofbizUrl macro freemarker support it.