[ https://issues.apache.org/jira/browse/OFBIZ-13154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17895643#comment-17895643 ]
ASF subversion and git services commented on OFBIZ-13154: --------------------------------------------------------- Commit d0a5c8e690c5d74ead735d3f518d365d289416d3 in ofbiz-framework's branch refs/heads/trunk from Nicolas Malin [ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=d0a5c8e690 ] Improved: Add uri shortener function (OFBIZ-13154) (#841) 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=m...@ofbiz.org -> 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 use it like it : <@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 a url like this : https://mywebsite.mydomain/s/rytedqzdfd At this time only <@ofbizUrl macro freemarker support it. > 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 > Priority: Major > Labels: freemarker, link, shortener > > 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=m...@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)