Skip to Content
author's profile photo Former Member
Former Member

KM repository framework issue

I am trying to implement a simple KM repository framework program.

I was informed to use this:

IUser serviceUser = WPUMFactory.getServiceUserFactory().getServiceUser("cmadmin_service");
ResourceContext c = new ResourceContext(serviceUser);

Since I am on EP 7 2004S I have to use this:

com.sap.security.api.IUser user=(com.sap.security.api.IUser)request.getUser();
IResourceContext resourceContext=new ResourceContext(user);

But now I get an error:

<b>Constructor ResourceContext(IUser) is undefined</b> in Eclipse.

And I get this whole list of errors <b>"Missing required library: C:Program Files/SAP/IDE/IDE70/eclipse/plugins/com.sap.km.rfwizard/lib/prtapi.jar"</b> when in my nwds i get all the jars in folder <b>com.sap.km.rfwizard_7.1.5</b>

Please do help me out.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2006 at 11:38 AM

    hi,

    In portalapp.xml:

    Mention

    com.sap.km.cm"/>

    also

    import com.sap.security.api.IUser;
    import com.sapportals.portal.security.usermanagement.IUser
    
    com.sapportals.portal.security.usermanagement.IUser user=(com.sapportals.portal.security.usermanagement.IUser)request.getUser().getUser();
    
    IResourceContext resourceContext=new ResourceContext(user);

    Regards,

    Ganesh N

    Message was edited by: Ganesh Natarajan

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      If you know, that the resource is HTML (or generally text/string) you read the content (<i>resource.getUnfilteredContent()</i>) get the inputstream (<i>resource.getUnfilteredContent().getInputStream()</i>) read it byte by byte and write it to string (<i>new String(bytes, "UTF-8")</i>). Then give this string to <i>response.write()</i> method.

      There is a lot of methods how to read InputStream in java, check the Google for some (surely better) examples 😉

      Romano

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2006 at 10:53 AM

    Dear All,

    Could I have some help on this please.

    I need it urgently.

    Thanks in advance.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.