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

Add a new entry in KM Favorites.

We have a portal app that provides a list of external URLs. We would like to be able to click a check box and invoke an "Add to Favorites" and a new external link is added to the repository: UserHome --> UserID --> Favorites folder. Has anyone done that??

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Feb 02, 2005 at 04:17 PM

    Hi Claude,

    I haven't done this, but here is the way:

    ResourceFactory resFac = ResourceFactory.getInstance();
    IURLGeneratorService urlGen = (IURLGeneratorService)resFac.getServiceFactory().getService("URLGeneratorService");
    RID favRid = urlGen.getUserFolderRID(currentUser, "favorites");
    ICollection favs = (ICollection)resFac.getResource(favRid, new ResourceContext(currentUser));
    favs.createLink([...]);

    More or less stolen from decompiled AddToFavoritesCommand.class.

    Hope it helps

    Detlev

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 16, 2005 at 09:57 PM

    Detlev,

    Could you tell me what version of the portal/km you ripped this from, and perhapts list the relevant imports? I am trying with our EP6 SP2 P5 system, and I am getting type mismatch and type errors on a couple of lines of the code. I am guessing this may be because you are using a newer version than we are.

    Thanks,

    Sean

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Sean,

      > I am trying with our EP6 SP2 P5 system

      [...]

      > because you are using a newer version than we are

      I am, but that's for sure not the reason. The code given is completely KM standard.

      It's from, as said, AddToFavoritesCommand, to be found under .../irj/root/WEB-INF/portal/portalapps/com.sap.km.cm.command/lib/km.shared.command_api.jar

      If specific problems persist, open a new thread with details.

      Hope it helps

      Detlev

      PS: CLAUDE - please consider rewarding points if it helps. If not, please be responsive and say where's the problem. This not only to be polite against me, but also for other users running into the same issue.

  • author's profile photo Former Member
    Former Member
    Posted on Feb 16, 2005 at 10:17 PM

    Detlev,

    Claude passed this issue on to me, so I will let you know if I can get it working or not.

    Sean

    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.