cancel
Showing results for 
Search instead for 
Did you mean: 

PCD Location of Page Dynamically

Former Member
0 Kudos

Can you please let me know how could you retrieve the PCD location of a page dynamically? I need to do this in my webdynpro application.

Accepted Solutions (0)

Answers (1)

Answers (1)

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

Hi Aditya,

What version of SAP NetWeaver are you using?

If you can get a hold of PRT services, you can do one of the following:

  • The IPortalComponentRequest object gives the current PCD location of the component running, which you can use to find the page:

request.getComponentContext().getContextName

  • Use the navigation helper service (not public but used by some) to find the current node:

NavigationEventsHelperService navHelperService = (NavigationEventsHelperService)PortalRuntime.getRuntimeResources().getService(NavigationEventsHelperService.KEY);

INavigationNode myNode = navHelperService.getCurrentNavNode(request);

I'm not sure all of this is possible within WD iView. If you are on 2004s, you may have additional options.

Daniel

Former Member
0 Kudos

I am using 2004 not 2004s.

Can you pls explain the 2nd option a bit detail.

In my WD application i am using WDPortalNavigation.navigateAbsolute. To this i need to pass the pcd location of the page. Although i call only one page always, i want to pass this dynamically because when i transport my iviews/pages to QA and Prod i found that the pcdlocation is differing. To hardcode the pcd location path, I couldn't find a way to make sure that pcd location path remains the same across Dev, QA, Production.

if there is a way to ensure that the pcd location path remains same Or to dynamicaly retrieve the pcd location, my problem will be solved.

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

Hi,

How will know what page to retrieve? Is it always the same relative path from the current iView/page?

Daniel

Former Member
0 Kudos

Yes. It is always the same page i call. I have two iviews A and B. In the A iview i have a button Show document. When i click on this it should load B iview on the same page overwriting the iveiw A. For this i used the above method. Everything works fine except that i have to change the pcd location when i am deploying to Dev, QA and Prod.

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos

Hi,

If you can get a hold of the navigation service, you can cast it into INavigationNamingHandler, which provide a method called composeName, which provides the URL (navigation target) for a node relative to the current node.

See Javadocs at https://media.sdn.sap.com/javadocs/NW04/SPS15/ep/index.html and look at com.sap.portal.navigation.

Daniel