This content has been marked as final. Show 12 replies
In chapter 9 of the UI Customization Guide there is a section on creating Gateway URLs.
The code in the UI guide is not helping me at all. It references creating a "ConstructPrefPageLink". That's not what I'm doing. I also tried "CreateGatewayFriendlyURL", but that doesn't seem to do anything.
Any help please??? I have to get this finished quickly. There has to be an easy way, I'm just not finding it.Thanks,Jason
ConstructPrefPageLink might be slightly misleading name for it, but example in the guide shows that you should use the same method to construct any gateway link. GatewayHelpers.NOFLAGS argument tells the function that what you are trying to construct is a generic gateway link, not a link to any of the pref pages.
Taking the following sample from the guide
String strGWURL = GatewayHelpers.ConstructPrefPageLink(m_asOwner, 134, iCurrentCommunityID, iCurrentPageID, GatewayHelpers.NOFLAGS, PT_CLASSIDS.PT_GADGET_ID) + GatewayHelpers.CreateGatewayFriendlyURL(http://myserver/gadget134/page.asp);
and replacing http://myserver/gadget134/page.aspwith the real URL should be a good start. Playing with iCurrentCommunityID and iCurrentPageID should give you exactly the URL that you want.
Thanks for the quick reply. I am getting a null reference exception thrown when using the PEI. I'm assuming it's referring to the m_asOwner parameter. I currently have it set at ...private AActivitySpace m_asOwner;... which would be null because it is never assigned to. How do I get this value?Thanks,Jason Odom
According to the UI guide:"The AActivitySpace object (com.plumtree.uiinfrastructure.activityspace) is passed to all PEI functions except those in ILoginActions."So how do I get m_asOwner in the onAfterLogin PEI to return a redirect to a gatewayed portlet???Thanks,Jason
Here is some sample code:
publicRedirect OnAfterLogin(Object oUserSession, ApplicationData appData)
Redirect redirect = newRedirect();
redirect.SetLinkToExternalURL(CreateGatewayURL(4204, 4476, 0, 0, 43) + "http%3B/qbugs/bug/filebug1.jsp");
privateString CreateGatewayURL(int_nPrefType, int_nPortletID, int_nCommunityID, int_nPageID, int_nClassID)
String strAppBaseURL = "http://portal.plumtree.com/portal/server.pt/gateway/PTARGS_0_";
returnstrAppBaseURL + nPrefType + ""+ _nPortletID + "_"+ _nCommunityID + "_"+ _nPageID + "_"+ _nClassID + "/";
We have also filed an enhancement request to provide a version of the GatewayHelpers.ConstructPrefPageLink() method that will work from the Login PEI.
When I run the code above, this is the gatewayed URL returned (as a redirect):
My portlet ID is 336. I am not sure what the 4204 and 43 correspond to. Point is, it's working, but not as expected. 369 is the portletID of a Daily News portlet, not our profiling portlet (but the profiling portlet displays in the redirected URL). If I leave the portletID of the profiling portlet (336), I get an extended error that tells me the portlet has been disabled, which is not true. I can also put in 370 as the portletID and it works (portletID of Employee Directory portlet), but if I put in 10000 (no corresponding portlet) it does not. I need to understand why this works, not just that it does work. Any ideas?Thanks,Jason Odom
I would like an answer to the above question if someone from Plumtree (or anyone who knows the answer) gets a chance.Thanks,Jason Odom
4204 is the user ID and 43 is the class ID for portlets, i.e. it tells the gateway that 369 is a portlet ID.
When you use the wrong portlet ID, you will still see the page as long as the URL matches one of the gateway prefixes for that portlet, but you'll get the prefences, security, etc. of the other portlet so that's not really what you want. The real question is why you get the disabled error when you use the right portlet ID, we'd probably need a PTSpy error to diagnose that further.
I have a question that is not related to this issue. I want to deploy a SIP redirect server in BEA Weblogic sip server. Is there any one available or I have to code by from the scratch? (the Registrar and HomeProxy server in Weblogic Sip Server have on Redirect function)
Tks in Adv.
Just a hunch, but you might have better success with your question if you didn't bury it at the bottom of a several year old thread that has nothing to do with your question and is in a completely separate newsgroup altogether.