Web Server URI


If you need to retrieve the web server URI for rending images in HTML emails try this

method GetWebServerURI
   /+ Returns String +/
   Local string &strUrl, &strTabName, &strUrlModified;
   Local string &sRegex, &sReplace;
   Local JavaObject &jRegex, &jUrl;
   
   &strUrlModified = "";
   &strTabName = "DEFAULT";
   &strUrl = GenerateHomepagePortalURL(%Portal, %Node, &strTabName);
   
   /* Regex strings */
   &sRegex = "(.*)/(ps[cp])/(.*)";
   &sReplace = "$1/";
   
   /* Instantiate objects and replace */
   &jRegex = CreateJavaObject("java.lang.String", &sRegex);
   &jUrl = CreateJavaObject("java.lang.String", &strUrl);
   &strUrlModified = &jUrl.replaceAll(&jRegex, &sReplace);
   
   Return &strUrlModified;
   
end-method;

Revision #1
Created Tue, Jul 23, 2019 7:33 PM by PeopleSoft Wiki
Updated Tue, Jul 23, 2019 7:33 PM by PeopleSoft Wiki