on 04-05-2006 2:07 PM
Dear Experts,
I have the following question
I deploy par-file to portal with two components inside. I need to call one component from another via URL. How can I get URL of the component?
The simplest way to solve my problem is:
response.write("<a href="https://answers.sap.com/irj/servlet/prt/portal/prtroot/<componentName>">link</a><br>n");
But I think it is not the best solution for such problem because "/irj/servlet/prt/portal/prtroot/" constant which may be changed in future.
Do you have any suggestion how to get relative (or absolute) URL of the current component?
Thanks many times,
Egor.
Hi Egor,
first, welcome on SDN
About your question:
Use the IPortalUrlGenerator, see http://www.ajvic.net/irj/portalapps/com.sap.portal.pdk.srv.urlgenerator/docs/urlgeneratorcomponent.h... and/or (Apr 29, 2004 10:12 AM).
Hope it helps
Detlev
PS: Please consider rewarding points for helpful answers on SDN. Thanks in advance!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello!
First of all, guys, thanks a lot for your answers! It was really useful!
I regret that there is no possibility to award each of you by 10 points. Therefore I awarded 10 points to Detlev and 6 to Pooja just because of Detlev was first.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Detlev,
The code that i have posted..i think it gives a direct explanation to the query that Egor has asked. I thought it'll be of some help in addition to the links that you have sent.
Regards,
Pooja.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Egor,
Suppose u have to call one iview from another...See this code:
Every iView is based on the par file..
So u will be having the 2 par files 2 iViews.
First write the on method in your controller in JSPDynPage or abstract portal componet which is a controller to ur iView when u want to call another view.
In that controller you have to import a classes called
import com.sapportals.portal.prt.service.urlgenerator.IUrlGeneratorService;
import com.sapportals.portal.prt.service.urlgenerator.specialized.IPortalUrlGenerator;
import com.sapportals.portal.prt.service.urlgenerator.specialized.ISpecializedUrlGenerator;
And in the specific method where u want to call the another iview you have to have the following code:
//Get the request, context and profile from portal platform
compRequest = (IPortalComponentRequest)this.getRequest();
IUrlGeneratorService urlGen = (IUrlGeneratorService)compRequest.getService(IUrlGeneratorService.KEY);
// get Specialized Portal Url Generator
IPortalUrlGenerator portalGen = null;
ISpecializedUrlGenerator specUrlGen = urlGen.getSpecializedUrlGenerator(IPortalUrlGenerator.KEY);
if(specUrlGen != null && specUrlGen instanceof IPortalUrlGenerator){
String strNewiViewComp = "";
portalGen = (IPortalUrlGenerator)specUrlGen;
strNewiViewComp = compProfile.getProperty("secondivewparfilename");
url = portalGen.generatePortalComponentUrl(compRequest, strNewiViewComp);
In the above code strNewiViewComp = compProfile.getProperty("ClaimDetailsComponent");
is used to get the another iViews par file which is configured in default.properties file
your default.properties file should contain "secondivewparfilename" value assigned .
This will take you to the new iView.
Regards,
Pooja.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.