7 Replies Latest reply: Oct 22, 2010 1:54 PM by Tushar Sinha RSS

How to modify com.sap.portal.navigation.pagetoolbar.par

shivas bhan
Currently Being Moderated

Hi Experts,

 

           I have to create a link on the Page Toolbar(Next to "History") by the name "Add Favorites" which has the same functionality as that of the "Add to Portal Favorites" button present in the Option Menu in sap portal.

 

I have imported the com.sap.portal.navigation.pagetoolbar.par in to my nwds , but i am not sure if this is the correct par.

 

please tell me where exactly the modification needs to be done.

 

Thanks in advance .

 

Regards

Shivas

  • Re: How to modify com.sap.portal.navigation.pagetoolbar.par
    Vaibhav Khairnar
    Currently Being Moderated

    Hi Shivas,

     

    PageToolbar.class file can be found under com.sap.portal.navigation.pagetoolbar\private\lib\com.sap.portal.navigation.pagetoolbar_core.jar file

     

    Decompile the file and redeploy the par after making the changes.

     

    Regards,

    Vaibhav

  • Re: How to modify com.sap.portal.navigation.pagetoolbar.par
    Tobias Hofmann
    Currently Being Moderated

    Hi,

     

    the PAR you are looking for is: com.sap.portal.pageToolbar

     

    As for the code: copy & paste the standard SAP code. For adding the page to the portal favorites:

    AddToPortalFavorites(). The code looks like:

    function AddToPortalFavorites(target , title, mode)
    {
         try
         {
              
              var obj = EPCM.getSAPTop().gHistoryFrameworkObj.GetActiveTrackingEntryValue();
              var context = obj.context;
              if(! target)
              {
                   target = obj.getUrl();
                   title = GetUnescapedTitle(obj.title);
              }
              var url = "/irj/servlet/prt/portal/prtroot/com.sap.km.cm.remote?ServiceType=PortalFavorites&";
              url += ("NavigationTarget=" + escape(target));
              url += ("&Title=" + encodeURIComponent(title));
    .
    .
    .

     

    -> the JS with this code is located ar:

    /irj/portalapps/com.sap.portal.navigation.helperservice/scripts/FrameworkSupport.js

     

     

    To add the page to the browser's favorites:

    pageTitleBar.AddToFavorites("location")

     

    br,

    Tobias

    • Re: How to modify com.sap.portal.navigation.pagetoolbar.par
      shivas bhan
      Currently Being Moderated

      Hi Tobias

       

      Can u please help me to navigate to the com.sap.portal.pageToolbar.par all i can find is com.sap.portal.pagebuilder.par related to the page.

       

       

      Regards

      Shivas

      • Re: How to modify com.sap.portal.navigation.pagetoolbar.par
        Tobias Hofmann
        Currently Being Moderated

        sorry, the name of the iView is: com.sap.portal.pageToolbar

         

        The PAR is: com.sap.portal.navigation.pagetoolbar.par.

        The java class for creating the HTML: com.sapportals.portal.navigation.PageToolbar, located inside the PAR at:

        PORTAL-INF\private\lib\com.sap.portal.navigation.pagetoolbar_core.jar\com\sapportals\portal\navigation\PageToolbar.class

         

        When you decompile this class, you'll see that the pagetoolbar isn't using a JSP file for creating the HTML output. It's using HTMLB:

        com.sapportals.htmlb.Document myDocument = myContext.createDocument("pageTitlebarDocu");
        com.sapportals.htmlb.Form myForm = myContext.createFormDocument("pageTitlebar");

        and for the Javascripts:

        if(showFavorites)
           scriptBuffer.append("pageTitleBar.showFavorites = true;");
        if(showPortalFavorites)
           scriptBuffer.append("pageTitleBar.showPortalFavorites = true;");

         

        br,

        Tobias

  • Re: How to modify com.sap.portal.navigation.pagetoolbar.par
    Tushar Sinha
    Currently Being Moderated

    Hi Tobias,

     

    we are also having same requirement of adding the Favorites Tab separately on the toolBar beside the History and back/forward button.

     

    we have only one JSP lighttoolbar.jsp in the standard par downloaded from portal.

     

    i assume we should create a new JSP for toolbar but i am not sure where to refer the same.

     

    please give us your valuable inputs .

     

    guide us through procedure how to get a link "add to favorites" on the tool bar itself calling the functionality

     

    With Regards,

    Tushar.

Actions