cancel
Showing results for 
Search instead for 
Did you mean: 

Instance of IPortalComponentRequest object in Portal Service

Former Member
0 Kudos
44

Hello All,

How can i access IPortalComponentRequest object in Portal Service.

I have a piece of code that works for Portal Component, now i want to convert it to Portal Service.

Now i am not able to get instance of IPortalComponentRequest in Portal Service.

regards

Santosh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Santosh,

actually, i couldnt get ur question well, but....

By extending the IService build a interface and then by implementing that particular interface write the implementation code .

Please explain ur problem a bit more...

regards,

Joshua Kiran

Former Member
0 Kudos

Hi Joshua,

Sorry if my query was not clear.

My Question is:

1. Can i have <b>access to Object of IPortalComponentRequest</b> inside Portal Service.

If Yes how?,

2. If not is there any way to do this in Portal Service.

request.getUser()

request.getLocale()

where <b>request</b> is an object of <b>IPortalComponentRequest in Portal Component</b>

I think now it shud b clear.

regards

Santosh

Former Member
0 Kudos

Portal Service doesn't have acess to IPortalComponentRequest object. However, you can pass the IPortalComponentRequest object from JSPDynpage or Dynpage component when the it is calling the portal service.

Former Member
0 Kudos

Hi Santosh,

I'm not SAP expert, others surely correct my anwer.

As Prakash Singh mentioned service can't access IPortalComponentRequest becouse of its nature.

Folowing is my personal wiew of how services works.

When service is called, it's called not by portal end user, but so-called service user (maybe cms_service), so from service cannot be accessed request of portal end user (do anybody why? I think it's becouse there is some other way to run service from enviroment where are no portal end users or cannot be accessed).

Next, becouse of impossibility of getting request, you cannot access authenticated (logged) portal end user.

What concretly do you need from user object (class IUser)?

There is way of getting IUser object of all portal end users, but these objects represent of course unauthenticated users. I can provide you code snipplet or you can search SDN for this.

Regarding locale, you can get this from IUser object. I'm sure there is way to get portal locale, but I don't know how at this time. There is even strategy to get locale, but I think it is used only when getting locale from request object (http://help.sap.com/saphelp_nw04/helpdata/en/ce/b31e40777cdd5fe10000000a155106/content.htm)

Best regards,

Josef Motl

Former Member
0 Kudos

Hi Santosh,

Since you need a locale and a user, I guess you need it for JCA.

If I guessed right - see:

For a more general solution, Prakash gave the answer.

A Portal Service exposes methods to be used by consumers.

Have these methods take a IPortalComponentRequest parameter and send it in the consumer Dynpage.

Hope that helps,

Yoav.

Former Member
0 Kudos

Thanks Prakash, Yoav for ur helpful thought.

I got the idea,

regards

Santosh

Former Member
0 Kudos

Thanks Josef,

I have rewarded points to u all.

regards

Santosh

Former Member
0 Kudos

Hi!

The answer of Pakrash is working, if your portal service does nothing without being called by a portal component.

I have a portal service running as daemon, periodly checking a database table and adapting KM folders according to it. This service isn't called by a component at all, but running all by himself.

Thus I need to use JCA JDBC without having IPortalComponentRequest to get locale and user. Not sure if JCA even needs an authenticated user or if any user will do. Any hints?

Cheers,

Juergen

Former Member
0 Kudos

Hi Juergen,

For JCA, see my answer above.

Hope that helps,

Yoav.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Santosh,

What do you need the request for?

Yoav.

Former Member
0 Kudos

Hi Yoav,

i have PortalComponent in which i am making call something like this.

request.getLocale()

and

request.getUser()

where request is instance of IPortalComponentRequest.

Now while writing Portal Service for same functionality i need these values, how do i get it.

Thanks and regards

Santosh