on 07-17-2006 12:32 PM
Hi,
I have a Web Dynpro logon application. I have 1 portal with two different URLs. Depending on the URL, I want to give users a different role (with different content).
Is it possible to get the current URL from your browser in Web Dynpro?
Kind Regards,
David
Hi,
I do not want to get the URL of the application, but the url of the portal: e.g.: http://xxxxx:50000/irj/portal
Is this possible?
Best Regards,
David De Kerpel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
You can use this code although it uses a deprecated API:
WDDeployableObjectPart d = wdComponentAPI.getDeployableObjectPart();
try{String url = wdComponentAPI.getURLService().getGeneralService().getAbsoluteWebResourceURL(d);
}catch(WDURLException e){}
The url will be of the form http://<servername>:<serverport>/.
You can then do a bit of string indexing to find out the portal URL.
Regards,
Satyajit.
Hi,
I think it is also possible to get it with WDSystemLandscape.getSLDHost() and WDSystemLandscape.getSLDPort()
or
with the ISystem class, something like
ISystems sys = (ISystems)WDPortalUtils.getServiceReference(ISystems.KEY);
By the way Satyajit I cannot get the method getURLService from wdComponetAPI. I am using SP15
Greetings,
Sandhya
Hi,
If you don't find the API that I have mentioned, then you can also use this:
WDURLGenerator.getAbsoluteWebResourceURL(wdComponentAPI.getApplication().getDeployableObjectPart());
The method <i>WDSystemLandscape.getSLDHost()</i> returns the SLD host name, not your portal server name and likewise for the method <i>WDSystemLandscape.getSLDPort()</i>, it returns the SLD port number.
Regards,
Satyajit.
I can get the URL with one of the above methods, but I don`t need it anymore. thx for the help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This method:
WDURLGenerator.getAbsoluteWebResourceURL(wdComponentAPI.getApplication().getDeployableObjectPart());
is depricated. Is there an other method I can use?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David.
I use the following code to obtain the app URL:
String deployableObjectName = wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();
try {
WDDeployableObjectPart deployableObjectPart =
WDDeployableObject.getDeployableObjectPart( deployableObjectName, "PCT",
WDDeployableObjectPartType.APPLICATION);
String urlToTargetApp = WDURLGenerator.getApplicationURL(deployableObjectPart, new HashMap());
} catch (WDURLException e) {
manager.reportException(e.getLocalizedMessage(), false);
} catch (WDDeploymentException ex) {
manager.reportException(ex.getLocalizedMessage(), false);
}
I hope it helps u.
Best Regards.
Gregory.
Hi,
This will give u the current application url
try {
WDDeployableObjectPart part = wdThis.wdGetAPI().getComponent().getApplication().getDeployableObjectPart();
String appPath =WDURLGenerator.getApplicationURL(part);
wdComponentAPI.getMessageManager().reportSuccess("AppPath"+appPath);
} catch (WDURLException e1) {
wdComponentAPI.getMessageManager().reportException("Exception:"+e1,true);
}
In your case when u need the URL of another application
String depObjectName =
wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();
WDDeployableObjectPart depObjectpart =
WDDeployableObject.getDeployableObjectPart(
depObjectName,
"<application name u want to navigate to>",
WDDeployableObjectPartType.APPLICATION);
String a = WDURLGenerator.getApplicationURL(depObjectPart) ;
Fire exit plug with this String a as the argument.
Regards,
Vijayakhanna Raman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.