Complete URL of an iView Component !!

Environment : EP 6.0 Sp2
Following is the complete url of an iview ...
http://<servername>:<port>/irj/servlet/prt/portal/prtroot/<componentName>.default
I am using the following code to get the url ...
IPortalUrlGenerator portalGen = null;
IUrlGeneratorService urlGen = (IUrlGeneratorService)componentRequest.getService(IUrlGeneratorService.KEY);
ISpecializedUrlGenerator specUrlGen2 = urlGen.getSpecializedUrlGenerator(IPortalUrlGenerator.KEY);
if (specUrlGen2 instanceof IPortalUrlGenerator)
   portalGen = (IPortalUrlGenerator) specUrlGen2;     
String strUrl = new String();          
if (portalGen != null)
   strUrl = portalGen.generatePortalComponentUrl(componentRequest, "ComponentName.default");
with the above code, the url I am getting ( in strUrl vaiable) is ...
"/irj/servlet/prt/portal/prtroot/<componentName>.default"
How can I get the url part "<servername>:<port>" so that I append it to the above string to get the complete url of the portal component or is there any other way to get a complete URL of a component ??
I appreciate your help !!

Use the HttpServletRequest object to get the bits you need:
String strUrl = "/blah/blah";
HttpServletRequest srq = componentRequest.getServletRequest();
String url = srq.getScheme()+"://" +
     srq.getServerName() + ":" +
     srq.getServerPort() ;
response.write (url + strUrl);

Similar Messages

  • How to get the URL of an iView using AbstractPortalComponent

    Hi All,
    I need to get the URL of an iView using AbstractPortalComponent using the following code.
    But i am unable to open the URL from the Browser
    This is the following code snippet
    public class AbsClass extends AbstractPortalComponent
        public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
    IPortalComponentURI componentURI = request.createPortalComponentURI();
    componentURI.setContextName("pcd:portal_content/LOG_Viewer/LogViewer");
    String URI=componentURI.toString();
    response.write(URI);
    The output i got from the browser is:
    /irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fLOG_Viewer!2fLogViewer
    Actual Path: pcd:portal_content/LOG_Viewer/LogViewer
    Output Path: /irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fLOG_Viewer!2fLogViewer
    Why some extra numerics are embeded in the output path when compare with the Actual Path.
    Can any one send me the modified code and your suggestions, how to achieve this problem.
    Regards
    Phani

    Hi,
    Now i need to get the URL of this component.
    IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
    IPortalComponentURI componentURI = request.createPortalComponentURi();
    componentURI.setContextName("com.sap.portal.appintegrator.sap.bwc.Transaction");
    String URI=componentURI.toString();
    response.write(URI);
    I export this component into Portal and i tested with an iView based on this par file, i got the URL in the Preview.
    But when i tried to run this URL by adding the http://<IPADDRESS>:<PORTNO>+URL
    I am facing one AccessDenied Exception for this Object. ( USER/GUEST)
    Is there any security zone, or other Permissions Problem, if so can you plz guide me what are the settings i have to change inorder to resolve this exception
    Regards
    Phani

  • URL mixup for iViews

    Hello,
    we've got quite strange problem recently, hope someone knows why could it happen and how to fix it:
    - we've got a portal application with set of WebDynpro iViews.
    - users comming to the server either from LAN, using local name of machine (e.g. http://LAN-NAME:50000/irj) or externally, specifying external url of the server (e.g. http://bla-bla.com:50000/irj, where bla-bla is registered on DynDNS, so it's mapped to the computer IP).
    the constallation worked for couple month, but recently it stopped to work for the reason, that users now get EP frames with randomly loaded iViews from both locations.
    E.g. I go to http://LAN-NAME:50000/irj and see (right mouse button in InternetExplorer on WebDynpro iView, then "Properties") that some are properly loaded from http://LAN-NAME:50000/... and some have URL http://bla-bla.com:50000/...
    Those iViews don't share sessions, application doesn't work anymore...
    Restarts of servers/clients didn't help. Even if server is restarted and first login via one of the EP URLs returns messed iViews, so LAN/WAN addresses are persisted somewhere.
    NW SP10.
    Thanks for any help!
    Nick

    Hi Jurgen,
    thanks a lot for your help!
    Unfortunately neither point matches our situation:
    - there is no hardcoded URLs and moreover, different users get different set of "URLs", i.e. I see one iView loaded from "LAN" and other user sees the same iView loaded from "WAN".
    - No network configuration (AFAIK) has been changed, there was from the very beginning sort of a proxy - it's our router, which forwards requests from WAN to local IP of the server. I.e. user accesses a DynDNS site with port 50000, it goes to the router, which maps port 50000 to intranet IP of the server with port 50000. Could it be the problem? And as I wrote, everything was ok for about 2 month as we installed SP10, and before the same installation worked well for quite long time on SP7.
    - NW installation was fresh SR1 (SP9) upgraded to SP10. No further SPs, fixes or updates were applied on any of the components.
    I've collected from colleagues all what they did in past time with the server, may be one of these could point you on idea, where the problem could be:
    1. On the same machine second J2EE instance was installed, let's call it J3E, when "problematic" one is J2E (different DB instance, 50300) - btw, it works well with our application.
    2. There were some attempts to install SSO certificate on J2E to accept tickets issued by J3E (on J2E NWDI is running and there is need to have access to the services of it).
    3. There was stress testing for the application in place - particularly concurrent access tests were running. Several users (programmatically) simultaneously try to access the system.
    Again, I'm guessing where the server could keep URLs, i.e. when I restart completely the server and access application I already get mixed URLs, which means that the URLs are persisted somewhere. Since I can't find URL textually in the '/usr' folder, it means they are stored in the DB. Which means I can't reinstall only EP or J2EE Engine without reinitialization of DB (which is shared also by NWDI, it means our development sources will be lost on reinstallation). Which is quite bad...
    Best regards,
    Nick

  • SSO for a BSP-appl that is called by a complete URL?

    Hi,
    is it possible to use SSO while calling URL's? The called URL is another BSP-application on the same WAS.
    I have a special situation:
    My BSP-application has only one "html"-page that has a frameset in which another BSP-application is loaded. The outer BSP-application is inside a BSP-iView and SSO works fine for it. This outer BSP-appl. is only a wrapper for portal-events. It has a JavaScript-function that receives the portal-event.
    Depending on the events the outer BSP-appl. loads another BSP-application with some parameters inside the frameset. This application will be called with a whole URL like:
    First I need to destroy the session: http://mycompany.com:8000/sap/bc/bsp/sap/z_test_start.htm&sap-sessioncmd=CANCEL
    Then I will load the BSP-appl new: http://mycompany.com:8000/sap/bc/bsp/sap/z_test_start.htm
    But now I must enter user/pw in the pop-up window. Is it now possible to add/send the SSO-ticket to the called URL? The BSP-application I call with the whole URL is situated on the same WAS as the other BSP-appl for which SSO works fine.
    Thanks a lot for any idea.
    Regards,
    Henning

    Hi,
    the parameters are set.
    SSO is working correct with other iViews. One iView shows a Java Web Dynpro application which is running on the same server. Even transaction iViews work fine. --> ABAP part is set correctly for accepting/creating SSO
    Even the BSP is working with SSO if I include it within an BSP iView. Only if I change the whole URL within the iView it is not working correct any longer.
    I do the following within the BSP-iView. It's a wrapper for portal events, that opens another BSP application with the whole URL. The URL is sent to the iView from another portal application.
    <%@page language="abap"%>
    <%@extension name="htmlb" prefix="htmlb"%>
    <SCRIPT src="epcfproxy.js"></SCRIPT>
    <script language="javascript">
    if(window.document.domain == window.location.hostname){
    document.domain = document.domain.substring(document.domain.indexOf('.')+1);
        EPCMPROXY.subscribeEvent("urn:com.company:DCEvents","testevent", window, "event_test_handler");
        function event_test_handler( eventObj )
            var pernr = eventObj.dataObject;
            ocument.getElementById('iframetest').src=eventObj.dataObject;
    </script>
    <htmlb:content design="design2003">
      <htmlb:page title = "Test">
        <iframe src="" width="100%" height="700" name="iframetest"></iframe>
      </htmlb:page>
    </htmlb:content>
    Henning

  • Not able to get the complete URL in mail content

    Hi All,
    I want to give the below link in mail which is sent from workflow, so on click of it, the user will be able to open the particular opportunity directly.
    https://<sys_host>%3Fcrm-object-type%3DBT111_OPPT%26crm-object-action%3DB%26crm-object-keyname%3DGUID%26crm-object-value%3DXXXXXXXXXXXX
    XXXXX here is GUID of the Opportunity of 32 character.
    For this, I have created a attribute of type BAPITGB-LINE. When inserting this expression into the mail activity of the WF, I have chosen the data to be exported as "All lines as cont. text".
    In this attribute, when I concatenate the values and the guid, I get only part of the link as below which is 133 characters.
    https://<sys_host>%3fcrm-object-type%3dbt111_oppt%26crm-object-action%3db%26crm-object-keyname%3dguid%26cr
    When I try to append it in a internal table of type BAPITGB, I am getting the complete URL but with a space between every line in the internal table as below.
    https://<sys_host>%3Fcrm-object-type%3DBT111_OPPT[SPACE]%26crm-object-action%3DB[SPACE]
    %26crm-object-keyname%3DGUID[SPACE]%26crm-object-value%3D
    DFD60A8AD0E53DF1918F0050569F0324
    Please let me know, how to avoid this space in append statements. Also, the concatenate is taking only 132 characters, after which it cuts the URL, leaving it incomplete.Kindly correct me if I was wrong somewhere.
    Thanks,
    Ramya
    Edited by: Gali Kling Schneider on Jul 11, 2011 9:47 AM

    Hi Sanjay,
    As suggested, I have split the URL into 3 links in WF container having the initial values as below.
    Link1 -> <sys_host>.%3Fcrm-object-type%3DBT111_OPPT
    Link2 -> %26crm-object-action%3DB %26crm-object-keyname%3DGUID
    Link3 -> %26crm-object-value%3D
    In the mail activity, I have given the link as: &LINK1&&LINK2&&LINK3&&GUID&
    &GUID&-> GUID of the opportunity.
    When I tested this in log-> List with technical details-> mail, it had the correct value without space as below.
    https://<sys_host>.%3Fcrm-object
    -type%3DBT111_OPPT%26crm-object-action%3DB
    %26crm-object-keyname%3DGUID%26crm-object-value%3DDFD60A8AD0E53DF1918F00505
    69F0324
    But in SOST, when I checked for the link it is having spaces as below:
    https://<sys_host>%20%3Fcrm-object-type%3DBT111_OPPT%20%26crm-object-action%3DB%26crm-object-keyname%3DGUID%20%26crm-object-value%3D%20DFD60A8AD0E53DF1918F0050569F0324
    Kindly advice.
    Thanks,
    Ramya
    Edited by: Gali Kling Schneider on Jul 11, 2011 9:48 AM

  • How can I stop safari from auto completing url's on my iphone 4 and ipad2?

    How can I stop safari from auto completing url's on my iphone 4 and ipad2?  On both devices I have cleared history, I have gone into settings-safari-and cleared history and cleared cookies & data, tried turning my devices on and off and I also have private browsing turned on. Both devices are operating on iOS 5.  When I type in a url I don't want anything to show and auto complete.  Any suggestions?

    This indicates corrupt files.
    A restore should resolve.

  • How can I do a backup listing of all of my bookmarks, with complete URLs to print out from a wordpressing program?

    == Issue
    ==
    I have a problem with my bookmarks, cookies, history or settings
    == Description
    ==
    How can I make a backup listing of all of my Firefox bookmarks, with complete URLs, so I can print it out from a word precessing document? Please email me the answer-
    [email protected]
    == Firefox version
    ==
    2.0.0.4
    == Operating system
    ==
    PPC Mac OS X Mach-O
    == User Agent
    ==
    Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
    == Plugins installed
    ==
    *-Netscape Navigator Default Plug-in
    *Runs Java applets using the latest installed versions of Java. For more information: Java Embedding Plugin. Run version test: Test Your JVM.
    *Plugin that plays RealMedia content
    *The QuickTime Plugin allows you to view a wide variety of multimedia content in web pages. For more information, visit the QuickTime Web site.
    *Shockwave Flash 9.0 r260
    *Provides support for Digital Rights Management
    *Provides support for Windows Media.
    *Java 1.3.1 Plug-in (CFM)
    *Macromedia Shockwave for Director Netscape plug-in, version 8.5.1
    *Java 1.3.1 Plug-in

    You can export the bookmarks to an HTML file: Bookmarks > Organize Bookmarks > File: Export
    See http://kb.mozillazine.org/Backing_up_and_restoring_bookmarks_-_Firefox
    See also [tiki-view_forum_thread.php?forumId=1&comments_parentId=252551 How do I print off my bookmarks]
    You should at least update to Firefox 2.0.0.20 if you are on Mac OS X 10.3.9 or lower and can't use more recent versions that require at least OS X 10.4
    See http://kb.mozillazine.org/Installing_Firefox
    The most recent Firefox version for OS X 10.3.9 is 2.0.0.20.
    Mac: http://download.mozilla.org/?product=firefox-2.0.0.20&os=osx&lang=en-US

  • Hi, I'm making hyperlinks. They work for the main page of the webpage, but when I'm trying to redirect the hyperlink to a "sub page" of the webpage it is still going to the main page. (allthough I'm pasting the complete url address)

    Hi, I'm making hyperlinks. They work for the main page of the webpage, but when I'm trying to redirect the hyperlink to a "sub page" of the webpage it is still going to the main page. (allthough I'm pasting the complete url address)

    Hi! first of all, thank you so much for your help.
    I don't know about that panel you are talking about.
    what I do is RIGHT CLICK, INTERACTIVE, NEW HYPERLINK, and a window pops up, where I paste the address (images).
    Where says URL I paste the complete address that the "sub page" gives me.
    Is that correct? (for the main page of the wabepage works correctly)
    thanks!!!

  • How to get the specified serarch term from the complete url? - Help

    Hello,
    I have a table in which some columns. One of the column is storing the complete url for the search given by the user.
    For Example:
    1.
    I give search like "oracle" on the Google, the column will store the complete url as
    "http://www.google.com/search?hl=en&q=oracle".
    I want the search word "oracle" to be returned from the column.
    2.
    I give search like "new + features + in + oracle + 10g", the column will store the url as
    "http://www.google.com/search?hl=en&lr=&q=new+%2B+features+%2B+in+%2B+oracle+%2B+10g"
    I want "new + features + in + oracle + 10g" search word to returned from the column.
    Can anyone tell me how to achieve this task? I have tried for a long time also I tried the sys.utl_url.unescape() function, but could not got the desired result.
    Please help, its really urgent!!!
    Thanks in advance.

    Hi,
    you can have a look into this code:SET ESCAPE ON
    DECLARE
            ref1 VARCHAR2(1000 CHAR) := 'http://www.google.com/search?hl=en\&q=oracle';
            ref2 VARCHAR2(1000 CHAR) := 'http://www.google.com/search?hl=en\&lr=\&q=new+%2B+features+%2B+in+%2B+oracle+%2B+10g';
            FUNCTION hextodec( h IN VARCHAR ) RETURN NUMBER
            AS
                    h2 VARCHAR2( 150 );
                    i NUMBER( 10 );
                    j NUMBER( 2 );
                    d NUMBER;
            BEGIN
                    h2 := LTRIM( h, '0' );
                    d := 0;
                    FOR i IN 1 .. LENGTH( h2 )
                    LOOP
                            SELECT DECODE( SUBSTR( h2, i, 1 )
                                    , '0', 0, '1', 1, '2', 2, '3', 3, '4', 4, '5', 5
                                    , '6', 6, '7', 7, '8', 8, '9', 9, 'A', 10
                                    , 'B', 11, 'C', 12, 'D', 13, 'E', 14, 'F', 15 )
                                    INTO j
                                    FROM DUAL;
                            d := 16 * d + j;
                    END LOOP;
                    RETURN d;
            END hextodec;
            FUNCTION strip(samplevalue IN VARCHAR2) RETURN VARCHAR2
            AS
                    finalvalue VARCHAR2(1000 CHAR) := samplevalue;
                    decimalvalue NUMBER(2);
                    pospct NUMBER;
                    extract VARCHAR2(2 CHAR);
            BEGIN
                    finalvalue := SUBSTR(finalvalue ,INSTR(finalvalue ,'\&q='));
                    finalvalue := SUBSTR(finalvalue ,4);
                    if (INSTR(finalvalue ,'\&')-1 > 0) then
                            finalvalue := SUBSTR(finalvalue ,1,INSTR(finalvalue ,'\&')-1);
                    end if;
                    finalvalue := REPLACE(finalvalue ,'+',' ');
                    LOOP
                            pospct := INSTR(finalvalue ,'%');
                            EXIT WHEN pospct = 0;
                            extract := SUBSTR(finalvalue ,pospct+1,2);
                            finalvalue  := SUBSTR(finalvalue ,1,pospct-1) || chr(hextodec(extract)) || SUBSTR(finalvalue ,pospct+3);
                    END LOOP;
                    RETURN finalvalue;
            END;
    BEGIN
            DBMS_OUTPUT.PUT_LINE( hextodec('2B'));
            DBMS_OUTPUT.PUT_LINE(strip(ref1));
            DBMS_OUTPUT.PUT_LINE(strip(ref2));
    END;
    /Regards,
    Yoann.

  • Why can't I just press ENTER to go to the page when I have the complete URL typed into the address bar?

    I dunno; maybe I'm just crazy, but I'd swear that before I downloaded FF4, I used to be able to (1) type in a complete URL, or (2) type a partial URL or keyword and choose what I wanted from a drop-down of recent URLs, then hit ENTER to be taken to the page I was looking for--all in the address bar, without having to use my mouse to click the little curly arrow at the right end of the address bar (next to the "favorite" star).

    BINGO! SOLVED IT!! It was that rotten AVG safe search. Bravo, and thank you, TonyE! (I often suspect I'm losing my marbles; glad to know that this time it was a false alarm;)

  • Navigation Target : Nav URL : Accessing an Iview directly

    Hi,
    I have a BI portal as producer fedearetd to NWP consumer.
    I want to provide a direct URL of an iview located on producer portal  to the customer accessing consumer portal.
    I can see there is this way, creating a nav URL...but not sure how can I do that?
    http://<xyz>/irj/portal?NavigationTarget=navurl://<f1bfd4df279ecf27d95ce39cd28d307c>
    can anyone please guide,
    How to access producer portal iview directly on consumer portal
    How to get the nav url ie. <f1bfd4df279ecf27d95ce39cd28d307c>...what is this keycode stands for?
    Awaiting reply!
    Thanks,
    Smita Thorat

    Hi Smita,
    As shown below, the PCD path of the portal object is the Navigation target.
    http:/myServer:50000/irj/portal?NavigationTarget=ROLES://portal_content/myFolder/myRole
    This can be hashed and shortened to form the Short URL as shown below
    http:/myServer:50000/irj/portal?NavigationTarget=navurl://b3d6d9ebac16a46574d62757803b05d4
    Short URL can be enabled and disabled depending upon the requirements.
    Check the links below for detail description to enable short URL:
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/43/014421d21d6fade10000000a11466f/frameset.htm
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/49/330b66fd695aa8e10000000a42189d/frameset.htm
    Hope it Helps.
    Regards,
    Khushboo

  • Complete URL of the page

    Hi All,
    Does any one know how can I get the complete URL of the page using inbuilt API's.
    For example, If I am on page:
    http://localhost:7501/sampleportal/application?namespace=security&origin=portal.jsp&pageId=page1
    Is there any way I can get this using API's.
    request.getRequestURI() doesn't solve the purpose.
    Any ideas?
    cheers
    Mark

    Mark,
    request.getRequestURI() gives you everything up to the query string. So
    append to this reqeust.getQueryString().
    russ
    "Mark" <[email protected]> wrote in message
    news:3ef3125e$[email protected]..
    >
    Hi All,
    Does any one know how can I get the complete URL of the page using inbuiltAPI's.
    >
    For example, If I am on page:
    http://localhost:7501/sampleportal/application?namespace=security&origin=portal.jsp&pageId=page1
    >
    >
    Is there any way I can get this using API's.
    request.getRequestURI() doesn't solve the purpose.
    Any ideas?
    cheers
    Mark

  • How to find the short url of an iview

    Hi,
    Please help me in <b>finding the short url of an iview</b>
    i went to system administration-navigation-short url but unable to find the short url of the iview which i created.
    please help me in solving this issue.
    thanks
    bala

    Hey Bala,
    The links below might help you.
    EFP: Short URLs
    http://help.sap.com/saphelp_nw70/helpdata/en/b3/7b8163404448e7aad7899c0b30313e/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/3c/125b07ce964b1eac2115b7b3c8bf9f/frameset.htm
    Thanks,
    Vamshi

  • Unabel to get complete URL in PDF with Acrobat 7.0

    Hi
    I am working with Indesign CS2, Now a days i am facing one comic problem. My PDF file with acrobat professional 7.0, Unable to handle complete URL which is having "period or under score" in between.
    For Example [email protected]
    In PDF file that will appear [email protected]

    Hi Bob
    Sorry for inconvenience.
    Acrobat automatically generate the hyperlink from URL but Acrobat 7.0 unable
    to generate complete link for URL, Incase inbetween of URL there is any
    "period or underscore" present. For EXP [email protected] this URL
    has an indesign file after created the PDF and open with Acrobat 7.0 this
    will be shown [email protected]
    Is there any way to overcome this problem with Acrobat 7.0.
    However Acrobat 8.0 has this compatibility.

  • Safari: Display complete URL in search/URL Bar

    OS/X 10.10.1
    Safari 8.0
    How do I make Safari always display the complete URL in the search bar and not just the abbreviated domain name?
    thanks,
    bill plunkett

    Safari > Preferences > Advanced > Smart Search Field:
    Checkmark the box beside "Show full website address".

Maybe you are looking for

  • Report from PL/SQL Table

    Thanks for answer to my first question. Now I have another problem. Is there any way to print a report based on virtual table, which is created during some Pl/SQL procedure and can't be easily decribed by Select statement

  • How fast can I read DI port in PCI 6071E?

    I have a while loop with no delay running full speed reading a TTL compatible square wave fed into Channel 0 of my DIO port. I then watch for any transition from hi to low, count these transitions and divide by 2 to get the count. This works very wel

  • Default Settings for Items - default company code

    Upon entry into Power Shop, how can I look up what the default Company Code is for the user?  Is there a BADI/FM combination that can be used?

  • Can not install Camera RAW update

    I have been unable to install v5.4 and now 5.5 on my desktop. It installs without a problem on my laptop. MAC os v.10.5.8 and the laptop is a clone on the desktop. Adobe support has told me to try manual install nothing works. the case #181056926. An

  • How to disable notifications for shared calendars?

    My girlfriend and I are sharing calendars. Every time she adds an activity, Calendar on OS X Mountain Lion notifies me via notification center AND from within the app. I disabled this when subscribing to her calendars on Lion and iOS 5, but it's enab