Discussion
Send link in Email
I have a requirement in my project to send a link in an email to Business User. On click of that link, the user should be directed to the home page of his Portal. This is an Intranet application and Business User will be in the corporate domain for accessing the email and application. I don't think Directed Web Access feature is required.
I tried building the URL using a function as shown below
PublicAPI tools = null;
PRThread thisThread = (PRThread)ThreadContainer.get();
if (thisThread != null) {
tools = thisThread.getPublicAPI();
}
ClipboardPage requestorPage = tools.findPage("pxRequestor");
String reqContextURI = requestorPage.getString("pxReqContextURI");
ClipboardPage threadPage = tools.findPage("pxThread");
String reqServletName = threadPage.getString("pxReqServletName");
String querySubString = "?pyActivity=Embed-PortalLayout.RedirectAndRun&ThreadName=OpenPortal&Location=pyActivity%3DData-Portal.ShowSelectedPortal%26portal%3D"+portalName+"%2526Name%253D%2520"+harnessName+"%26pzSkinName%3D%26developer%3Dfalse%26ThreadName%3DOpenPortal&bPurgeTargetThread=true";
String linkURL = "<a href='"+reqContextURI+reqServletName+pega_rules_utilities.encodeURLParameter(querySubString)+"'>"+linkText+"</a>";
return linkURL;
Note: portalName and harnessName are passed as input parameters to the function for including in the URL.
The function returns the complete URL. While tracing, what ever URL the above function is returned, if I try to open in IE, it is opening the Developer portal instead of User Portal.
It seems threadPage.getString("pxReqServletName"); is not giving the User Portal path.
Please let me know how to fix this (or) If there is any better approach for this requirement.
Thanks
Vinay
Vinay,
I am not very clear about the requirement you have. Just trying to help you -
do you want to bypass the authentication of the User?
If the user has to redirect to his respective portal, you can just give the url of the system, so the user logs in and opens the respective portal as guided by users access group (AG).
If you try in IE, did you try using new session ? otherwise your existing session will direct the new url you requested. Also when you try to login, it takes the default AG on the user you logged in.
Thanks,
Ashok