Get Navigation Nodes for specific Role

Hi, after reading and doing Prakash Singh's weblog on creating a portal sitemap:
Create a SITEMAP for your portal
I want it to do more. After implementing it I saw that it loaded every role I have, which is exactly what it should do.  But I want to be able to specify the role, maybe as an iView property, and only load the roles specified if the user has access.  I am new to java programming and I can't figure out how to change the code to do this. Any help is appreciated. Will reward points. Thanks in advance.
Peter

Hi Peter,
In the doProcessBeforeOutput() method, Prakash gets all the initial nodes. Then, for each one he calls getRestofNodes().
Instead, in the doProcessBeforeOutput() method, just get a single role. Something like this:
//GET PROPERTY
String roleFilter = request.getComponentContext().getProfile().getProperty("myRole");
//IF NO ROLE IS SPECIFIED GET ALL ROLES
if (roleFilter == null || roleFilter.equals("") ) {
   .... do what Prakash does
//IF ROLE IS SPECIFIED GET THIS ROLE
else {
   try {
      INavigationService navigationservice = (INavigationService)PortalRuntime.getRuntimeResources().getService("com.sap.portal.navigation.service.navigation");
      INavigationNode myRole = navigationservice.getNode(getEnvironment(request), roleFilter);
      //COPY PRAKASH'S CODE FOR RENDERING ROLE
      //    (instead of rootNode variable use myRole)
      String title =  myRole.getTitle(Locale.ENGLISH);
      Tree tree = new Tree(title, "");
      tree.setRootNodeIsVisible(true);
      GridLayoutCell cell = new GridLayoutCell(myRole.getName());
      String text = "" + title + "";
      TreeNode root = new TreeNode(myRole.getName(), text);
      root.setEncode(false);
      root.setOpen(true);
      tree.setRootNode(root);
      getRestofNodes(myRole,root);
      cell.setVAlignment(CellVAlign.TOP);
      cell.setContent(tree);
      gl.addCell(1, 1, cell);
   catch (Exception e) {}
Add a property for the component in the portalapp.xml, like this:
Hope this helps.
Daniel

Similar Messages

  • Hiding Options in Context Menu for Specific Roles

    Hi SDN,
    We have navigation iview assigned to some of the users. There appears context menu and the items in it. We need to remove some of the options like copy, move for the specific users.
    How to achieve this specific requirement of hiding few of the items in context menu of KM Folders and files for specific users or roles?
    Thanks in advance
    Regards,
    Ganesh N

    Hello!
    In Portal KM, set Permissions on folders for this users (Group of users) - Read.
    Other way - you can edit Ui Commands of Layoutset - which is used in iView,then create copy of iView (not delta link) and delete commands you don't want to show, then assigne iView to your specific role
    Best regards, Ivan
    Edited by: Ivan Kalahryu on Dec 16, 2008 10:05 AM

  • How do I get time & date for specific web sites visits from the fire fox history?

    how do I get history information for the time and date I went to specific web sites from firefox?

    The 'View' menu at the top, select Sidebar > History. At the right top of the sidebar that appears, click "View" button, select "View by date" or "View by date and site".

  • Get column value for specific columns

    I want to change the default behavior of a IKM. In a specific step, I need to call a PLSQL procedure inside the loop below, and that procedure will substitute the insert clause. The procedure uses only some attributes, and I need to check the name of each one when I use the getColList method.
         for aRecord in myCursor loop
              insert into      <%=snpRef.getTable("L","TARG_NAME","A")%>
                   <%=snpRef.getColList("", "[COL_NAME]", ",\n\t\t\t", "", "((INS AND (NOT TRG)) AND REW)")%>
                   <%=snpRef.getColList(",", "[COL_NAME]", ",\n\t\t\t", "", "((INS AND TRG) AND REW)")%>
              values
                   <%=snpRef.getColList("", "aRecord.[COL_NAME]", ", \n\t\t\t", "", "((INS AND (NOT TRG)) AND REW)")%>
                   <%=snpRef.getColList(",", "aRecord.[COL_NAME]", ", \n\t\t\t", "", "((INS AND TRG) AND REW)")%>
         end loop;
    For example, to call the procedure I do that: schema.proc_1(col1, col2, col3). However, I have more than 3 columns, and I need to restrict them when I use the getColList method. I would like to know if there is a way to get only specific columns, giving these names. I pass the name of the column, and the method should return its value. Can I use the getColList to do that? Is there any other way to do that?

    Hi Luciene,
    You can use the UD flags to do this. If you click on one of your mappings in the Diagram tab of your interface you will notice several UD flags (UD1 to UD5) you can use those to flag the columns you want to use in proc_1.
    To summarize:
    - at the interface level flag the columns you want to use in your PL/SQL code -> check UD1 for all of them
    - modify your IKM code:
    <%=odiRef.getColList(",", "COL_NAME", ",\n\t\t\t", "", "((INS AND TRG) AND REW AND UD1)")%> <- retrieve columns flagged with insert, not read only, mapped on target and with UD1 flagged. The "AND UD1" part can be used in other getColList.
    Hope this helps.
    Thanks,
    Julien

  • SCOM Powershell get alert count for specific groups

    Hello good people,
    im looking for a powershell script (to use in powershell widget):
    ive got 3 groups which generate alerts, for example group1 group2 group3
    now i need to get all new alerts and closed alerts per group
    groupid  new  closed
    group1    12     100
    group2    10       50
    group3    3         6
    thx for your help in advanced

    you may consider using the following powershell cmdlet to count number of closed alert
    $gp1closed=get-scommonitoringobject|where-object{$_.displayname -eq 'group1'} | get-scomalert | whereobject$_.resolutionstate -eq '255'} |measure
    $gp1open=get-scommonitoringobject|where-object{$_.displayname -eq 'group1'} | get-scomalert | whereobject$_.resolutionstate -eq '0'} |measure
    $gp2closed=get-scommonitoringobject|where-object{$_.displayname -eq 'group2'} | get-scomalert | whereobject$_.resolutionstate -eq '255'} |measure
    $gp2open=get-scommonitoringobject|where-object{$_.displayname -eq 'group2'} | get-scomalert | whereobject$_.resolutionstate -eq '0'} |measure
    $gp3closed=get-scommonitoringobject|where-object{$_.displayname -eq 'group3'} | get-scomalert | whereobject$_.resolutionstate -eq '255'} |measure
    $gp3open=get-scommonitoringobject|where-object{$_.displayname -eq 'group3'} | get-scomalert | whereobject$_.resolutionstate -eq '0'} |measure
    'Group1' + '  '+ $gp1open + '  '+ $gp1closed
    'Group2' + '  '+ $gp2open + '  '+ $gp2closed
    'Group3' + '  '+ $gp3open + '  '+ $gp3closed
    Roger

  • Get actual time for specific time zone

    Dear experts,
    is it possible to get the actual time for a given time zone? We need to know the time of a certain plant and we are searching for a standard function module which calculates the time based on the plants time zone.
    Thanks in advance,
    David
    Edited by: David Claes on Apr 12, 2010 5:05 PM

    You can use TIME ZONE statement for this.
    DATA: time_stamp_s TYPE string,
                time_stamp     TYPE timestamp,
                tzone              TYPE timezone,
               wf_date_conv TYPE sy-datum,
               wf_time_conv TYPE sy-uzeit.
    tzone = 'CET'.
    CONCATENATE sy-datlo   "Local Date
                              sy-timlo    "Local Time
                      INTO time_stamp_s.
    time_stamp = time_stamp_s.
    CONVERT TIME STAMP time_stamp TIME ZONE tzone INTO DATE wf_date_conv TIME wf_time_conv.
    Otherwise FM IB_CONVERT_INTO_TIMESTAMP/IB_CONVERT_FROM_TIMESTAMP can bne used for same.
    Edited by: Satyajit on Apr 13, 2010 1:31 PM

  • Can I get the participants of the role of some activity using PAPI?

    Hi all,
    Can I get all participants who have the role of one activity using PAPI? how?
    thanks and regards.

    Hello,
    I have the same problem, how to get the participants of specific role using PAPI ?
    Thanks

  • OLAP API to get child nodes ?

    Hi, I am new to OLAP API (Java), I spend some months in Hyperrion Essbase JAPI, now turn to Oracle but feel quite confused about a lot of concept. Here is a task in my hand that is to present the dimension tree in XML format, just like:
    <?xml version="1.0" encoding="GBK"?>
         <Member name="Market" gen="1">
              <Member name="East" gen="2">
                   <Member name="New_York" gen="3" />
                   <Member name="Boston" gen="3" />
                   <Member name="Chicago" gen="3" />
              </Member>
              <Member name="West" gen="2">
                   <Member name="San_Francisco" gen="3" />
                   <Member name="Seattle" gen="3" />
                   <Member name="Denver" gen="3" />
                   <Member name="Los_Angeles" gen="3" />
              </Member>
              <Member name="South" gen="2">
                   <Member name="Dallas" gen="3" />
                   <Member name="Houston" gen="3" />
                   <Member name="Phoenix" gen="3" />
              </Member>
         </Member>
         <Member name="Product" gen="1">
              <Member name="Audio" gen="2">
                   <Member name="Stereo" gen="3" />
    I didn't find ways on how to get child nodes for a given node, for example, how can I get East,West,South,North nodes (called "member" in Essbase) from "Market" node?

    Hi, I am new to OLAP API (Java), I spend some months in Hyperrion Essbase JAPI, now turn to Oracle but feel quite confused about a lot of concept. Here is a task in my hand that is to present the dimension tree in XML format, just like:
    <?xml version="1.0" encoding="GBK"?>
         <Member name="Market" gen="1">
              <Member name="East" gen="2">
                   <Member name="New_York" gen="3" />
                   <Member name="Boston" gen="3" />
                   <Member name="Chicago" gen="3" />
              </Member>
              <Member name="West" gen="2">
                   <Member name="San_Francisco" gen="3" />
                   <Member name="Seattle" gen="3" />
                   <Member name="Denver" gen="3" />
                   <Member name="Los_Angeles" gen="3" />
              </Member>
              <Member name="South" gen="2">
                   <Member name="Dallas" gen="3" />
                   <Member name="Houston" gen="3" />
                   <Member name="Phoenix" gen="3" />
              </Member>
         </Member>
         <Member name="Product" gen="1">
              <Member name="Audio" gen="2">
                   <Member name="Stereo" gen="3" />
    I didn't find ways on how to get child nodes for a given node, for example, how can I get East,West,South,North nodes (called "member" in Essbase) from "Market" node?

  • Table for tcodes for a role at object level

    Hi Expert,
    In production we have one role that doesnot have any tcodes at menu level.We are able to find tcodes at object level s_tcode.
    I have tried in agr_tcodes table i am getting zero tcods for that role.
    Is there any way to find out tcodes for particular role which is maintained in s_tcode object.
    Thanks,

    I know you already got the answer from akshay..Still wonder why the thread is still open.. I could not resist my self to say few words....
    AGR_TCODES - Gives transaction that is added in role menu and appear in S_TCODE with standard status.
    AGR_1251 (with role name and S_TCODE) - Gives you above as well as manually added S_TCODE values.
    Also keep eye in the status for S_TCODE in output of AGR_1251 (Rest for you to explore) so no need to enter the role manually to see whether the object is added manually or standard....
    Arpan

  • Log transactions for specific users

    Hi, How can I get the log for specific users, such as SAP_ALL : I want to know which transactions they have accessed in the last month for example or if they have accessed to a specific transaction.
    Thks !

    Hi,
    try tranction ST03N (Workload Monitor)and select "User Profile" in the Analysis View. There, you can see a list of Users. Double click on any of them to see the accessed transactions.
    Kind regards
    Dirk

  • Merging Navigation Nodes and Defining the Sequence

    We are merging several portal roles on the top level.  However, we do not seem to be able to define the sequence of the second level tabs.  Each role contains a folder which is the entry point and each folder contains one page. 
    How is the sequence of the second level navigation determined for merged roles?  Is there any way to changed the sequence?

    Yes, I think so. Did you try the attribute "Sort Priority"? The higher the number (e.g. 100.0), the later the tab appears, i.e. a folder with 90.0 will appear to left of a folder with 100.0
    Same goes for third level navigation.

  • How to get the assignees for a specific role in process in BPM 11g

    Hi, Gurus,
    I am using BPM 11g. I am trying to retrieve all the assignees for a a specific role in process. It will be a parameter for a business rule to do further routing rule. But it seems there is no way to get the information. I found that there are Identity Service Functions in Human Task Assignment. But Identity Service Functions are not listed in Business Rule Activity, neither listed in other activities except Human Task Assignment. I cannot get the assignees in my process.
    Is there any way to get all the assignees for a role? I also tried to retrieve the assignees out engine with Worklist API, but it cannot get either. Actually we can get all the assignees information in automatic activity in OBPM 10g. Maybe I am still not familiar with 11g. Any advice is appreciated.
    FYI:
    My scenario:
    Suppose we have a role named ApprovalTeam. In this role, there will be several different department manager (BPM User) added in the role through Workspace. At run time, a request (With department info) with go through the approval by ApprovalTeam. A Business Rule Activity with decide which department manager will approve this request. Different department request will be dispatched dedicate managers, not all the managers in the role. I have an external JavaBean to get the department information from LDAP. To do the routing, I also need know all the department managers (BPM User) in the ApprovalTeam role. Then I can compare which department manager is matched with the request and assign the task to him.
    Thanks a lot,
    James
    Edited by: James Piao on May 31, 2010 6:25 PM

    or this?
    SQL> select text from ALL_VIEWS
      2  where VIEW_NAME
      3  ='EMP_VIEW';
    TEXT
    SELECT empno,ename FROM EMP
    WHERE empno=10

  • How do I get a list of users for a specific role in EP 6.0

    Hi,
    I'm trying to find a table or an API that I can use to get a list of users for a role that I have created in the portal. There are about 940 users tied to this role that I would like to dump to an excel or text file. My goal is to get these users into a security group and tie the role to the group instead of each user. Thanks!

    Hi Chris,
    first, welcome on SDN!
    UMFactory.getInstance().getRoleFactory(roleID).getUserMembers() returns the users which are members of the role, see http://media.sdn.sap.com/html/submitted_docs/60_sp2_javadocs/ume/com/sap/security/api/IRole.html
    addGroupMember(...) adds a group.
    removeUserMember(...) removes a user from a role.
    Corresponding method exist for the groups.
    Hope it helps
    Detlev
    PS: Please consider rewarding points for helpful answers on SDN. Thanks in advance!
    PPS: Wrong forum, should have been EP DEV for example. It's not a question in conjunction with KM.

  • Tooltip for the Navigation Node - language dependent / translation?

    Is it possible to provide language dependent Tooltip for the Navigation Node.
    I tried the Portal content translation, but there was no possibility to translate the tooltip.
    Talking about this:
    Property ID: com.sap.portal.navigation.Tooltip
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/49/32a70ee8c45aaae10000000a42189d/frameset.htm

    Hi Van Vi,
    when I get your question right, you are looking for a possibility to change the text of the navigation items, not the text inside a content page, correct?
    I am using MII 12.0.2. The workaround for me was to create different roles like "XMII User EN", "XMII User DE" which contain the navigation item in the according language. The content pages contain tags like Michael mentioned, e.g. {##LBL_KEYWORD} in an *.irpt page. Those tags are set using the language set for the user in the NetWeaver UME.
    Michael, is there a possibility to use this {} notation in the navigation in 12.1, so I do not have to create language based roles?
    Michael

  • No Content available for this navigation node message after Portal Upgrade

    Hi,
    After Portal upgrade to 7.01 EHP1 SP7, when we are clicking on any role at the TLN, the Portal Content area is showing the message " No Content available for this navigation node". However before upgrade when we are clicking on any TLN role the content area used to show the first iview in the folder in the detailed navigation.
    Please help as we are in a very critical state.
    Best

    Ameya Pimpalgaonkar wrote:
    Hello Mahesh,
    >
    > Did  you happen to see this thread:
    >
    > Hide "No content available for this navigation node" message
    >
    > Ameya
    Hi Amiya,
    I already gone through this thread but iwe will get an empty page if we will change the value of default content to null in the Content Area iview. My requirement is to expand the folder in the detail navigation area and display the first iview in that folder in the content area whenever we click on any role in the TLN.
    Mahesh

Maybe you are looking for