cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the iview(or page) PCD ID of TLN(toplevelnavigation)?

Former Member
0 Kudos

Hi!

I need PCD ID in the toplevelnavigationJS.jsp File.

- ex) pcd:portal_content/mycomp/iview/com.mycomp.sap_portal.iview.notice

like in the Source

var visibleTitle = this.title;

this.title ==> (iview or page)'s Title

this.name ==> uid

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi,

To get the PCDPath of the IView in your jsp, you can call this:

<%
IPortalComponentRequest  currentRequest  = (IPortalComponentRequest)pageContext.getAttribute(javax.servlet.jsp.PageContext.REQUEST);
String pcdPath = currentRequest .getComponentContext().getContextName();
%>

Greetings,

Praveen Gudapati

p.s. Points are always welcome for helpful answers

Former Member
0 Kudos

thanks

but, I want each pcd id like menu's title(Home, SystemAdmin...)

source

function render(level, id, isActive, isHover, isLast, firstLevelStyle) {

.........................

var visibleTitle = this.title;

........................

<b>//var pcd = this.PCD_ID; // ???here </b>

return "<TD nowrap id=\"navNode_" + level + "_" + id + "\" " +

"onkeydown=\"navNodeKeyDownHandler(" + level + ", " + id + ")\" " +

"class=\"" + tdClassName + "\" " + onMouseClickEvent + onMouseEnterEvent + ">" +

"<A id=\"navNodeAnchor_" + level + "_" + id + "\" " + title508 + " href=\"#\" " + nodeName + " class=\"" + aClassName + "\" tabIndex=\"" + tabIndex + "\" " + ">" + visibleTitle + "</A>" +

"</TD>" + sepTD + lastTD;

}

0 Kudos

Hi,

Check the NavigationEventsHelperService, it has alot of helpful methods, to get NavigationNodes:

NavigationEventsHelperService service = (NavigationEventsHelperService)
    PortalRuntime.getRuntimeResources().getService(
    NavigationEventsHelperService.KEY);
 
INavigationNode currNode = service.getCurrentContextNavNode(request);

<b>or</b>

NavigationNodes navNodes =
   (NavigationNodes) service.getNavNodesListForPath(request, INavigationConstants.NAVIGATION_CONTEXT_ATTR);

Check all methods of NavigationEventsHelperService to know more.

https://forums.sdn.sap.com/thread.jspa?threadID=309083

So once you have INavigationNode, you can call INavigationNode.getName() to get the navigation path.

Once you have Navigation path, you can get the pcd path from it by removing the "ROLES://" prefix and adding "pcd:" prefix.

example NavPath = ROLES://portalcontent/yourrole/mypage

example PCDPath = pcd:portalcontent/yourrole/mypage

Greetings,

Praveen Gudapati

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks you ~!!

Message was edited by:

SeungHyun Pahng