cancel
Showing results for 
Search instead for 
Did you mean: 

Generate URL's for webDynpro applications and public web resources( MIMES)

Former Member
0 Kudos

Hi Colleagues

could anyone please let me know how to generate URL for Webdynpro applications?

i am trying it by using the fiollowing code

WDDeployableObjectPart appPart = WDDeployableObject.getPart(u201CTestu201D,u201CTestAppu201D,WDDeployableObjectPart.APPLICATION);

but here i dont know what exactly need to be passed in the arguments of getPart()...could anyone please explain

String resourcePath = WDURLGenerator.getAbsoluteWebResourceURL(wdComponentAPI.getComponent().getDeployableObjectPart(), resourceName);

and what is to be given here in the resourcename

Thanks a lot in advance

Thanks & Regards

Swetha

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

To get the application URL use


WDDeployableObjectPart deployableObjectPart =  wdComponentAPI.getComponent().getDeployableObjectPart();
	  String appURl = WDURLGenerator.getApplicationURL(deployableObjectPart);

Regards

Ayyapparaj

Former Member
0 Kudos

Hi Ayyapparaj,

Thanks for the reply...i have used the code given by you...and i got an error

"com.sap.tc.webdynpro.services.exceptions.WDIllegalArgumentException: Invalid deployable object part type: Component"

i have included this code in component controller in Modify View method

try{

WDDeployableObjectPart deployableObjectPart = wdThis.wdGetAPI().getComponent().getDeployableObjectPart();

String appURl = WDURLGenerator.getApplicationURL(deployableObjectPart);

wdComponentAPI.getMessageManager().reportSuccess(appURl);

}

catch(Exception ex)

{

throw new WDRuntimeException(ex);

}

Please let me know how to proceed further

Thaks & regards

Swetha

Edited by: Swetha Nellore on Feb 24, 2009 10:04 AM

Former Member
0 Kudos

Hi,

Following will help you to get the URL

Replace "TestComp" with that of yours.



	  String deployableObjectName =  wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();

	  try {
	  WDDeployableObjectPart deployableObjectPart =  WDDeployableObject.getDeployableObjectPart(
			  											deployableObjectName, "TestComp",  WDDeployableObjectPartType.APPLICATION);

	  String url = WDURLGenerator.getApplicationURL(deployableObjectPart);
	   String url1 = WDURLGenerator.getAbsoluteWebResourceURL(deployableObjectPart);
	  wdComponentAPI.getMessageManager().reportSuccess(url);
wdComponentAPI.getMessageManager().reportSuccess(url1);

	  }
	  catch(Exception e)
	  {
		  wdComponentAPI.getMessageManager().reportException(e);
	  }

Regards

Ayyapparaj

Answers (0)