URL of the current portal page loaded using Javascript ?

Hello:
I am trying to add programmatically the url of the current
page loaded in the portal to the 'Favorites List'. There
is a pre-built KM iview to store your 'favorites'.
I can extract and write to this 'favorites' using KM java
API. But only challenge is to extract the current loaded
page URL and title using Javascript.
I would appreciate any help in this regard.
Thank you very much,
Prasad Nutalapati

Dude i was having the exact same problem. I solved it using the SAP-provided EPCM (javascript client framework).
Javascript Code
var pageName = "";
var URL = "";
function bookmarkPage()
     /* page url */
     var fullURL = "https://<%=request.getServerName()%>/irj/portal?NavigationTarget=" + URL;
     /* IE bookmark */
     if(EPCM.getUAType() == EPCM.MSIE)
          window.external.AddFavorite(fullURL , pageName);
     else
          var msg = "Sorry. The \"Add To Favorites\" feature only works with Internet Explorer. " +
                      "The URL to this page is " + fullURL;
          alert(msg);
/* get pagename from eventObject from subscribed event */
function getPageObject(eventObj) {
    pageName = eventObj.dataObject.title;
    URL = eventObj.dataObject.URL;
/* subscribe to event in pagetoolbar area */
EPCM.subscribeEvent("urn:com.sapportals:navigation", "AddNavTargetAllowDuplicate", getPageObject);
End of code
Basically, what this does is that everytime a page loads, the innerpage, where the content is, raises an event using  the EPCM.raiseEvent() method. EPCM.subscribeEvent subscribes to an event called AddNavTargetAllowDuplicate which has an object holding the page information (i.e. page title and URL (ROLE://...)). Everytime that it notices an event raised, the function getPageObject gets called to go get data from the event object that is available globally in the framework.
You should be able to put this code anywhere in any iview and it should work. Thou i have only tried putting it in the masthead. Try and if you still have questions please let me know.

Similar Messages

  • Multiple Portal page loads cause Param to become undefined

    Sirs,
    I am new to this so please bear with me. I was very please to
    get SPRY "tab" and "accordion" panels to work in our PORTAL
    (oracle). The only roadblock I came across is beyond my control.
    The portal pages load twice. I cannot change that. On each page I
    have two "separate" tab panels. I need to reference one tab panel
    on another page and am using using "SpryURLUtils" param object to
    do this. The second portal page load cancels it out and instead,
    the last TABBED panel to load (no matter what ID is referenced on
    it) receives the call and opens that panel instead.
    How can I keep the "?tab=0&panel=1#OPENTHECORRECTPANEL"
    in play when coming from another page? I have tried to use the
    "javascript: undefined" but I am new to Javascript and cannot get
    it to work. (I know enough to understand what is going on but have
    no real experience in creating my own code.) Has anyone else
    experienced this and how have you overcome it.
    Any help would be greatly appreciated.

    Hi, we have the same problem. Our setting with the mdc.host works allready. But we must start the iview directly by url without out the portal around.
    We use this Url:
    https://<portal>/irj/servlet/prt/portal/prteventname/Navigate/prtroot/pcd!3aportal_content!2fevery_user!2fgeneral!2fdefaultDesktop!2fframeworkPages!2fframeworkpage!2fcom.sap.portal.innerpage!2fcom.sap.portal.contentarea?NavigationTarget=ROLES://...
    Now we have the problem that the second cookie in the other domain, will not be created?
    Have you any solution?

  • Return url for the current page

    Hi,
    I would like to know how to return the url for the current page?

    These are my preferred choices:
    request.getRequestURI() will give you the relative path from root. For example:
    /mypages/thepageIamon.jsp
    request.getRequestURL().toString() will give you the full path. For example:
    http://www.mysite.com/mypages/thepageIamon.jsp
    Hope this helps.

  • On the zynga game, mafia wars, every time i click on something within the game a get a popup that says "Requested URL not found: 400" all pages load fine it just gives the message every time i click something, how can i stop this?

    on the zynga game, mafia wars, every time i click on something within the game a get a popup that says "Requested URL not found: 400" all pages load fine it just gives the message every time i click something, how can i stop this?

    Sorry, the above thread should have been a "new" post, not a reply post.

  • I'm using firefox version 6 and for the last three days the add-ons manager page won't load. my question is why won't the add-ons page load? is the server down on your end?

    i'm using firefox version 6 and for the last three days the add-ons manager page won't load. my question is why won't the add-ons page load? is the server down on your end?

    Click on something below the Get Add-ons menu item on the left side of the Add-ons Manager tab.

  • Refreshing a single portlet rather than the whole portal page

    Ok, here's my situation.
    I have two pdk portlets on my portal that communicate through page parameters. Portlet A has a bunch of search fields, a customer drop-down list, parts drop-down list, division, etc. Portlet B takes those parameters, queries the database, and displays the results. I would like to be able to refresh portlet B without reloading the whole portal page.
    I have onchange events on all of my drop-downs that will do a javascript post back to portal, which will in turn set my page parameters, and I see there is a 'refreshPortlet' function in a javascript file that portal provides that will refresh a single portlet based on a portletReferenceId. It is normally called when a refresh button is clicked in the portlet header, but I don't see any reason I can't call it after my javascript post, that is, if I had the portletReferenceId for the other portlet. I thought about making a hidden html table on the page that, I could fill with the portlet names and ids for each portlet as they load, that way I could reference that list from any portlet. The problem is I can't figure out where the ids are coming from. Based on the code behind the button, the function is looking for something like this 646_701285_646_1_701271, but the closest thing I can come up with is this 676114_POSTCONTENTPORTLET_467414915 which I got from PortletRenderRequest.getPortletInstance().getInstanceName(). As you can see, it's not even close. Does anyone know where the correct id could be coming from? It's got to be available to me somewhere, doesn't it?
    The only other option I can think of to accomplish my goal is to use straight up ajax to display portlet B, but that kind of defeats the purpose of portal doesn't it?
    Any help would be greatly appreciated.
    Thanks,
    Doug

    You can use Ctrl+F4 to close the current tab. I don't think that you can change the Alt+F4 action with Keyconfig.

  • How to load a class dynamically in the current/system class loader

    I need to dynamically load a new jdbc driver jar to the current/system class loader... Please note that creating a new classloader will not help since the DriverManager refers to the systemclassloader itself.
    Restarting the application by appending the jar to its classpath will solve the problem but I want to avoid doing this.

    Did you then create a ClassLoader to load the JDBC
    driver and then install it into the system as
    directed by the JDBC specification (ie
    Class.forName(someClassName))?
    And then try to use it from a class loaded fromsome
    other ClassLoader (i.e. the system class loader)?
    If you did not try this please explain why not.O.K. I just looked at the source to
    java.sql.DriverManager. I did not know what I was
    talking about, as what I suggested above will not
    work.
    This is my new Idea:
    Create a URLClassLoader to load the JDBC driver also
    in this ClassLoader you need to place a helper class
    that does the following:
    public class Helper {
    public Driver getJDBCDriver(String driverClassName,
    String url) {
    try {
    Class.forName(driverClassName);
    Driver d = DriverManager.getDriver(url);
    return d;
    catch(Exception ex) {
    ex.printStackTrace();
    return null;
    }Now create an instance of the Helper class in the new
    ClassLoader, and call its getJDBCDriver method to get
    an instance of the driver (you will probably have to
    create an interface in the root class loader that the
    Helper implements so that you can easily call it).
    Now from the root classloader you can make calls
    directly to the returned Driver and bypass the
    DriverManager and its restrictions on cross
    ClassLoader access.
    The only catch here is that you would have to call to
    the returned Driver directly and not use the Driver
    Manager.This sounds like will work but I did not want to load DriverManager in a new classloader.. I did a hack
    I unzip the jar dynamically in a previously known location (which I included in my classpath when launching the app). The classLoader finds the class now though it did not exist when the app was launched !
    A hack of-course but works eh ..

  • How to open NEW PORTAL PAGE from current portal page ?

    I'm very confuse with my problem.
    I have 2 portal page.
    portal page I has 2 portlet : portlet A & portlet C.
    portal page II has 2 portlet : portlet B & portlet C.
    Now my customer want : start with portal page I, when i submit portlet A, program will open portal page II.
    I don't know the way to call new portal page from current portal page. Help me, please.
    Thanks.
    Edited by: young_hero on Oct 30, 2008 1:12 AM

    Could you please help me how to call a .html page
    from a Pl/Sql procedure or trigger ?
    Thanks & Regards
    Kalyani KothaKalyani,
    Could you explain a little more exactly what you're trying to acheive? I'm not quite sure what it is you're asking for. Are you asking: "how would you/can you open a browser and direct it to a URL with PL/SQL?"
    Earl

  • How do I open a duplicate tab or window that points to the same URL as the current tab?

    In earlier versions of browsers, not necessarily Firefox, it used to be possible to launch a new tab or window with the same URL as the current window. I can't find a way to do this in Firefox. It always opens new windows with no URL specified.

    Hold down the control key, then drag the tab that you want to duplicate onto the tab bar.

  • How to apply different styles to Portlets on the same Portal page?

    How do you apply different styles to Portlets on the same Portal page?
    I'm new to this kind of thing, but understand that something called "cascading style sheets" can help here?
    What are these, how do you use them, and can you make different Portlets (all types - PL/SQL, Java, Applications, etc) on the same Portal page have different styles assigned?
    Thanks!

    Jeff,
    Apply Oracle Portal styles at the region level. Your portlets within each region will inherit the style defined for the region.
    You may want to check out Report #40050 at portalcenter.oracle.com, "Design an Attractive and Compelling Portal Interface" for a good overview of the various design features of Oracle Portal.
    Here is the link:
    http://portalcenter.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/OTN_CONTENT/MAINPAGE/OWSF_2003_PAPERS/40050_STOVER.PDF
    Regards,
    Jay

  • Reduce width of the entire portal page

    Hi All
    I'm trying to modify the width of the entire portal page (this includes masthead, TLN, content area) from 100% to 75%. I change the width property in the used css class, but the changes are not reflected.
    If I have to change the width in the jsp page, which par file should I change? I checked the light_franework.jsp in com.sap.portal.layouts.frameworktest.par, but it does not have any html tags at all. Im looking for a table which uses prtlHeaderCon as the css class.
    WIll be thankful for any help.
    Thanks
    J

    I am also facing same issue with my portal. I need to change the width to 99% from 100% in order to get rid of an extra scroll bar. So can you please tell me what html code you implemented in light_framework.jsp to alter the width of the table.
    Thanks,
    Harish.K.

  • How can i find the requested portal page in custom login.jsp

    We are using a customized login, logout and change password page built in JSP.
    The wwsso_ls_configuration_info$ has been updated to point to the customized
    JSP pages. Everything works fine so far but we would like to show different
    content inside the customized login page depending on which portal page that
    was requested.
    eg suppose the user requested a page that belong to page group X we want to
    show login page with html content relevant to page group X. If page group Y is
    requested, then it show relevant information for Y.
    The ssousername, password field and other parameter needed for login page will
    be left to the standard names defined by oracle login requirements.
    For this purpose, we need to find which portal page was requested by user in
    the customized login.jsp( as users tend to bookmark the portal page eg.
    http://domain/portal/page?_pageid=33,30983,33_30985&_dad=portal&_schema=PORTAL)
    Once i know the requested portal page, i can parse the _pageid to get the page group.

    Were you ever able to get this issue resolved? I would be interested in the solution if one was ever found. Thanks.

  • How can I set up new sites to open in new pages and not over the top of the current open page?

    how can I set up new sites to open in new pages and not over the top of the current open page?

    Middle-click ''(press down mouse scroll wheel)'' <br />
    or <br />
    {Ctrl + Click} <br />
    or <br />
    Right-click and use '''''Open in a New Tab'''''

  • NWDS EE5 Edition Database Studio: The currently displayed page contains ...

    Hello,
    I get the following error when I choose 'Usermanagement" in Preferences --> Database Studio:
    The currently displayed page contains invalid values
    in the log file I see the following errors:
    !ENTRY org.eclipse.jface 4 2 2007-02-14 10:57:02.165
    !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
    !STACK 0
    java.lang.NullPointerException
         at com.sap.sdb.tools.usermanagement.UM_Configuration.<init>(UM_Configuration.java:83)
         at com.sap.sdb.tools.ui.usermanagement.properties.ULMPropertiesComposite.<init>(ULMPropertiesComposite.java:57)
         at com.sap.sdb.tools.ui.usermanagement.preferences.UM_PreferencePage.createContents(UM_PreferencePage.java:73)
         at org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:233)
         at org.eclipse.jface.preference.PreferenceDialog.createPageControl(PreferenceDialog.java:1403)
         at org.eclipse.jface.preference.PreferenceDialog$12.run(PreferenceDialog.java:1162)
         at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
         at org.eclipse.core.runtime.Platform.run(Platform.java:843)
         at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
         at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
         at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1156)
         at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:439)
         at org.eclipse.jface.preference.PreferenceDialog$8.selectionChanged(PreferenceDialog.java:661)
         at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:839)
         at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
         at org.eclipse.core.runtime.Platform.run(Platform.java:843)
         at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
         at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
         at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:837)
         at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1143)
         at org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(StructuredViewer.java:1163)
         at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:236)
         at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:230)
         at org.eclipse.jface.util.OpenStrategy$3.run(OpenStrategy.java:404)
         at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
         at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
         at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3325)
         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
         at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
         at org.eclipse.jface.window.Window.open(Window.java:796)
         at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:65)
         at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
         at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
         at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
         at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
         at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
         at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
         at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
         at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
         at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
         at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
         at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
         at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
         at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
         at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
         at org.eclipse.core.launcher.Main.run(Main.java:977)
         at org.eclipse.core.launcher.Main.main(Main.java:952)
    !ENTRY org.eclipse.jface 4 0 2007-02-14 10:57:07.681
    !MESSAGE java.lang.NullPointerException
    !STACK 0
    java.lang.NullPointerException
         at com.sap.sdb.tools.ui.usermanagement.preferences.UM_PreferencePage.performOk(UM_PreferencePage.java:85)
         at org.eclipse.jface.preference.PreferenceDialog$11.run(PreferenceDialog.java:889)
         at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
         at org.eclipse.core.runtime.Platform.run(Platform.java:843)
         at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
         at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
         at org.eclipse.jface.preference.PreferenceDialog.okPressed(PreferenceDialog.java:869)
         at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.okPressed(FilteredPreferenceDialog.java:377)
         at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.okPressed(WorkbenchPreferenceDialog.java:164)
         at org.eclipse.jface.preference.PreferenceDialog.buttonPressed(PreferenceDialog.java:230)
         at org.eclipse.jface.dialogs.Dialog$3.widgetSelected(Dialog.java:660)
         at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
         at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
         at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
         at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
         at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
         at org.eclipse.jface.window.Window.open(Window.java:796)
         at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:65)
         at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
         at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
         at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
         at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
         at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
         at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
         at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
         at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
         at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
         at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
         at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
         at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
         at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
         at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
         at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
         at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
         at org.eclipse.core.launcher.Main.run(Main.java:977)
         at org.eclipse.core.launcher.Main.main(Main.java:952)
    Any ideas?
    Thanks in advance
    Holger

    So you're saying that whatever you use to output the <pre> tag, it's escaping it into &lt;pre&gt; because it thinks it's supposed to be text and not markup? Then use that thing differently. It's hard to say more without seeing the code you're using.

  • Hi, problem occurs when I'm clicking a button or a new url on the current site. For instance, when i clicked that "Ask This" button on this web site, It redirects me to the default homepage. I cant go back and I'm losing the previous web site HELP PLEASE!

    Hi, problem occurs when I'm clicking a button or a new url on the current site. For instance, when i clicked that "Ask This" button on this web site, It redirects me to the default homepage. I cant go back and I'm losing the previous web site HELP PLEASE!

    Try the Firefox SafeMode. <br />
    ''A troubleshooting mode, which disables most Add-ons.'' <br />
    ''(If you're not using it, switch to the Default Theme.)''
    # You can open the Firefox 4.0 SafeMode by holding the '''Shft''' key when you use the Firefox desktop or Start menu shortcut.
    # Or use the Help menu item, click on '''Restart with Add-ons Disabled...''' while Firefox is running. <br />
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before using the Firefox shortcut (without the Shft key) to open it again.''
    If it is good in the Firefox SafeMode, your problem is probably caused by an extension, and you need to figure out which one. <br />
    http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes

Maybe you are looking for