cancel
Showing results for 
Search instead for 
Did you mean: 

Getting PCD location of a navigation target from short URL

Amey-Mogare
Contributor
0 Kudos

Hello,

My requirement is to get actual pcd location or actual full path of a navigation node from it's short url.

I have a JSPDynpage DC where I am using EPCM API to get navigation using below code: -

EPCM.subscribeEvent("urn:com.sapportals:navigation", "Navigate", NavigationEvent);

function NavigationEvent(evntInput){

  var pathArray = EPCM.getSAPTop().LSAPI.AFPPlugin.model.getCurrentSelectedPath();

  var path = pathArray[0].getTitle() ;

  for(var index = 1; index < pathArray.length; index++)

  {

    path = path +">" + pathArray[index].getName();

  }

}

Now, this getName method of navigation node is returning value like "navurl://fhwrfgh6756734bhvbhvgeygrfgg463"

From this 'path', I some how need to get node's PCD location or direct actual URL.

Is there any way to get it?

Thanks & Regards,

Amey

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If pathArray[index] is a launchable navigation node, then you can try getting the PCD location by pathArray[index].getLaunchURL(). If it is not a launchable navigation node (folder, role, etc), then it will return null.

Best Regards,

Kosta Slobodkin.

Amey-Mogare
Contributor
0 Kudos

Hello Kosta,

Thanks a ton for this reply. It was indeed very helpful and solved our problem.

Could you please let me know what all other methods that we have in this pathArray[index] object?

Like for example, you suggested, getLaunchURL, what are other methods available along with their functionality?

Thanks & Regards,

Amey

Answers (2)

Answers (2)

tamar_kolner
Explorer
0 Kudos

I just saw that Kosta answered already

Amey-Mogare
Contributor
0 Kudos

yes   it solved the problem.

Could you please also have a look at my reply to it and suggest if you know something about it?

Could you please let me know what all other methods that we have in this pathArray[index] object?

Like for example, you suggested, getLaunchURL, what are other methods available along with their functionality?

I tried googling on this but I couldn't see any useful javadoc or explanations on these methods.

former_member193577
Active Contributor
0 Kudos

Hi,

You can find some additional methods available in NavigationNode here:

NavigationNode Object - Portal - SAP Library

Best Regards,

Tal

tamar_kolner
Explorer
0 Kudos

In addition to the documentation, you can see all the methods in debug and test the returned value, I'm using Chrome Developer Tools but any JS debugger will do...

But keep in mind that only the documented API's are supported.

Former Member
0 Kudos

I also was able to fetch this as a table through plain DB access for a customer of us. Dont remember the table name, I have done a SQL trace as far I remember. This could be usefull if you need to collect all available short URL with one select.

cheers

Amey-Mogare
Contributor
0 Kudos

Thanks Tamar.

tamar_kolner
Explorer
0 Kudos

Hi Amey,

Try node.getLaunchURL().

Regards,

Tamar