cancel
Showing results for 
Search instead for 
Did you mean: 

WebDynPro and Knowledge Management (KM) API

Former Member
0 Kudos

Dear All,

I am designing some User Interfaces to access KM Content using WebDynPro. But I cannot get the user (from EP, you can get it like <b>request.getUser()</b>). But in WebDynPro the request object is not available and so I cannot get the <b>com.sapportals.wcm.repository.ResourceContext</b> object which is needed to access any content on KM.

It would be great if you share any ideas to solve this.

Kind regards,

Sreejesh.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sreejesh,

here is the ode to create the resource context:

/*Get an object of current Portal user */ IWDClientUser wdClientUser =

WDClientUser.getCurrentUser(); com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();

/*create an ep5 user from the retrieved user

IUser ep5User =WPUMFactory.getUserFactory().getEP5User(sapUser);

ResourceContext context = new ResourceContext(ep5User);

see also:

/people/rohit.radhakrishnan/blog/2005/05/27/uploading-files-to-km-repository-using-webdynpro-apis

regards,

Martin

Former Member
0 Kudos

Thanks alot, Martin. It solved my prob!

Fully rewarded!

cheers,

Sreejesh

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sreejesh Raj,

I'm not sure that I understood the question.

if all you need the users ID you can use:

IWDClientUse wdClientUser = WDClientUser.getCurrentUser();

com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();

String userID = sapUser.getName();

Hope it helps, Adi