on 06-08-2004 8:06 AM
Is there any way to access the Portal Session Object in a Web Dynpro App? What is the alternative method of storing some user specific data that is accessible across applications(other than storing that in a DB) in that same session?
Please let me know.
Thanks
Shakeel
Perhaps the following lines of code answer your question:
IPortalComponentProfile profile = portalRequest.getComponentContext().getProfile();
profile.putValue(....);
profile.store();
Please tell me if it works - I have never tried it.
regards
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Michael,
Unfortunately, this doesn't work in WebDynpro. The request/response/session objects are not exposed to the application.
Consider a scenario, where some data is generated in one application and I would like a few other apps to make use of this data across the same session.
Ideally, I would store the data in session scope so that other apps in the same session can always access the object and retrieve the data.
But given the limitations in WebDynpro, how do I achieve this without making backend visits and subscribing to events?
-Shakeel
Hi Shakeel,
ok, although i shouldn't do this, try the following lines, but even if it might help at the moment, <b>don't forget</b> you loose SAP support and your code will possibly fail in future releases:
if (WDPortalUtils.isRunningInPortal()) {
IWebContextAdapter adapterInternal = (IWebContextAdapter)
WDWebContextAdapter.getWebContextAdapter();
IPortalComponentRequest req = (IPortalComponentRequest)
adapterInternal.getOriginRequest();
IPortalComponentResponse resp = (IPortalComponentResponse)
adapterInternal.getOriginResponse();
IPortalComponentContext ctx = (IPortalComponentContext)
adapterInternal.getOriginContext();
}
Regards
Stefan
Hey Stefan,
This doesn't help either. How do I import the package containing the jar files of IPortalComponent* interfaces into my project?
I couldn't find any com.sapportals.* package on my computer.
Alternatively, I tried using the WDPortalNavigation.navigateAbsolute() method. The last parameter of this method supposedly shud contain the request object parameters in name value pairs. This one doesn't seem to be working either. I guess there is a problem in the way the URL of the target app is generated by this method. Coz, when I modify the URL of the target app to pass the parameters into the request object correctly, it works.
Any idea how this could be rectified?
Thanks
Shakeel
Hi Shakeel,
isn't the portal as the "launching" software component responsible for and able to store that data? AFAIK, the only thing WD runtime receives from the portal (in difference to running standalone) is an IPortalComponentRequest/Response instead of the corresponding "plain" HttpServletRequest/Response. But you won't reach the PortalReq/Resp since they are not exposed by the API.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.