Skip to Content

How to generate URL for an iView in PCD.

I have come across situations where portal iView has to be launched from java iView. The following technique can be used to launch an iView based on PCD object from another Java iView.   Step 1:  Obtain the Portal Component URI  IPortalComponentURI portalCompURI = componentRequest.createPortalComponentURI();  Step 2: Specify the PCD location of the object  String pcdLocation=”pcd://portal_content/….”;     Step 3: Provide “End user permission” for your users (based on role/group/users) target PCD object. This can be done by editing the target PCD object.  Step 4: Set the context of portal component URI object and obtain the URL.  portalCompURI.setContextName(pcdLocation);  s_Url =   portalCompURI.toString();       Note: This technique can be used to replace old URL generator service One example is to generate URL for Transactions as mentioned in https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2510. [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] However same can be used to launch webdynpro or any appintegrator based iViews.
6 Comments
You must be Logged on to comment or reply to a post.
  • Hi Arul,
    I have the same requirement. I have to call one pcd iview in java iview. I am new to development side. I ve created one jspdynpage and i ve written ur code there, wat else i ve to write to call that pcd iview ?

    regards
    Amit

    • You don’t have to write anything more.Make sure the at the PCD location of the target iView is correct. Just deploy your par file and either preview or create an iView.

      • Hi Arul,

        I have written the code before doinitialization. It is showing syntax error in following line

        portalCompURI.setContextName(pcdLocation);

        can u plz tell me the reason.

        regards

  • Hi,

    This is my code:
    public class UserInstructions extends AbstractPortalComponent
    {
        public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
        {
         IPortalComponentURI portalCompURI = request.createPortalComponentURI();
         String pcdLocation = “pcd:portal_content/AWMASN/goog”;
         portalCompURI.setContextName(pcdLocation);
        }
    }

    I am trying to invoke the iview “pcd:portal_content/AWMASN/goog” from this component. When I run preview UserInstructions component, it just opens a blank page and no error. Should I do anything to invoke the iview?

    Thanks, VP

    • The piece of code given above only creates a URL . To create a URL , you need to add another line String url=portalCompURI.toString(); and use this generated URL in the javascript window.open(); or use this URL in the JSPDYNPage to redirect the jspdynpage to this new URL