Skip to Content
avatar image
Former Member

User Search Application to fetch data from UME

Dear All,

I have a requirement of creating a User Search Application that fetches data from UME. I went through the below link but I am confused in what project should I creat in NWDS.

http://wiki.sdn.sap.com/wiki/display/EP/Portal+Components+for+searching+Users+in+UME+(HTMLB,+Internationalization,+Personalization)

Any inputs will be of great help.

Thank you,

Regards,

Disha.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jun 07, 2012 at 01:56 AM

    Hi Disha,

    You can create Webdynpro or Portal Application (other java also possible).

    Sample code(webdynpro) will look like this:

    IUserFactory usrFact = UMFactory.getUserFactory();

    IUserSearchFilter usrFilt = usrFact.getUserSearchFilter();

    String usrPrefix = wdContext.currentContextElement().getSearchTerm();

    usrFilt.setUniqueName(usrPrefix,ISearchAttribute.LIKE_OPERATOR,false);

    IPublicUME_Comp.IAllUSersElement usrElement = null;

    wdContext.nodeAllUSers().invalidate();

    String usrName = null;

    ISearchResult result = usrFact.searchUsers(usrFilt);

    if (result.getState() == ISearchResult.SEARCH_RESULT_OK) {

         if(result.size()>0);

         while (result.hasNext()) {

         usrElement = wdContext.nodeAllUSers().createAllUSersElement();

         usrName = (String) result.next();

         usrName = usrName.substring(usrName.lastIndexOf(":") + 1,usrName.length());

         usrElement.setUsers(usrName);

         wdContext.nodeAllUSers().addElement(usrElement);

         }

    }

    You can modify the above an can use in Portal application also.

    Regards,

    Ram

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Disha,

      If you have userid, you can get any information from userFactory.

      Just make one instance of user factory and there you will get all other attributes like

      firast name, last name etc..... using  <userfactory>.get<property>;

      eg: IUser user = userFact.getUser(userID);

                    user.getFirstName();

      also one more thing about below one:

      >IPublicUserSearchAppComp.IAllUsersElement usrElement = null;

      >IPrivateUserSearchAppCompView.IAllUsersElement usrElement = null; (This works)

      the first one is component controller and second one is view.

      I think you have written the method in view. thats why second one works.

      If you write it in controller, the first one will work.

      Regards,

      Ram

  • Jun 07, 2012 at 01:03 PM

    hi Disha,

    You may like to refer to the following document. 

    http://scn.sap.com/docs/DOC-19552

    This explains how to create a Portal user in the UME. The procedure and jar mentioned are relevant to your requirement.

    Regards,

    -Amol

    Add comment
    10|10000 characters needed characters exceeded