Skip to Content
avatar image
Former Member

How to get the current webdynpro application url

Hi,

I have a requirement to get current webdynpro application url, as I need to pass that as POST method to external website.

Please suggest.

Thanks,

Vinit

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jun 04, 2010 at 02:25 PM
    
    try {
    	// Get name of deployable object this component belongs to
    	String deployableObjectName = "xyz.com/sol~portal~lib";
    	deployableObjectName = wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();
    
    	//Map urlParameters = new HashMap();
    	// get URL parameter value entered by user, stored in context attribute
    	// ?UrlParamValue?. Put parameter ?hugo? in the sneak preview version.
    	//urlParameters.put("", "");
    
    	// Get deployable object part of target application.
    	// Precondition: assume, that other application belongs to the same
    	// Web Dynpro Project (Deployable Object)
    	WDDeployableObjectPart deployableObjectPart = WDDeployableObject.getDeployableObjectPart(deployableObjectName, wdContext.currentVnAppPropertiesElement().getVaAppName(), WDDeployableObjectPartType.APPLICATION);
            
            wdContext.currentVnAppPropertiesElement().setVaAppUrl_Relative(WDURLGenerator.getApplicationURL(deployableObjectPart));
    
    	String clientHostAddress = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getClientHostAddress().trim();
    
    	String clientHostName = WDProtocolAdapter.getProtocolAdapter().getRequestObject().getClientHostName().trim();
    
    	String serverHostName = TaskBinder.getCurrentTask().getProtocolAdapter().getServerName().trim();
    
    	if (serverHostName.indexOf(".") != -1)
    		serverHostName = serverHostName.substring(0, serverHostName.indexOf("."));
    
    	wdContext.currentVnAppPropertiesElement().setVaAppServerHostName(serverHostName);
    
    	int serverPort = TaskBinder.getCurrentTask().getProtocolAdapter().getServerPort();
    
    	wdContext.currentVnAppPropertiesElement().setVaAppServerPort(serverPort);
    
    	// Get target URL based on deployable object part and URL parameters
    	String urlToTargetApp = "http://" + serverHostName + ".xyz.com:" + serverPort + WDURLGenerator.getStaticApplicationURL() + "/" + WDURLGenerator.getDynamicApplicationURL(deployableObjectPart);
    
    	wdContext.currentVnAppPropertiesElement().setVaAppUrl_Absolute(urlToTargetApp);
    
    } catch (WDURLException e) {
    	this.messManagerShowMessage(e.getLocalizedMessage(), PBMessagesTypes.TP_StackTrace, e, myLogger);
    } catch (WDDeploymentException ex) {
    	this.messManagerShowMessage(ex.getLocalizedMessage(), PBMessagesTypes.TP_StackTrace, ex, myLogger);
    }
    

    regards,

    Angelo

    Edited by: Angelo Antonello Borges on Jun 4, 2010 11:27 AM

    Edited by: Angelo Antonello Borges on Jun 4, 2010 11:28 AM

    Add comment
    10|10000 characters needed characters exceeded

    • >

      > Your question is in the wrong forum then! Should have been posted in the forum for Portal!

      > In any case ... you need to create an alias for your iview in Portal:

      >

      > http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/808fb397-1fcf-2910-7884-8f075c939666

      > http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/4a3addc4-0501-0010-bfbb-9cdd29581adf

      > http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/70a24307-33f4-2a10-f8aa-c9f9b7c9b94f

      >

      > Would recommend that you apply SSO with Active Directory so that your portal does not request login.

      >

      > /people/holger.bruchelt/blog/2008/10/06/single-sign-on-to-bsp-pages-from-duets-action-pane

      > http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f05ae0f0-bf93-2b10-ed9e-a7320c012841

      >

      > regards,

      > Angelo

      You need to create a short URL for your application in the Portal iView ... and instead of using the url of the application webdynpro, use this short url created.

  • avatar image
    Former Member
    Jun 16, 2010 at 08:59 PM

    resolved

    Add comment
    10|10000 characters needed characters exceeded