Skip to Content
avatar image
Former Member

Retriving user details from Portal database

Hi Friends

Do any one knows how to retrive user(portal login user) details from Portal database.

Thank you

maruti

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 13, 2006 at 09:14 AM

    hi maruti ....what the problem is with u guy's.....

    it is too much simple to get the user Details from portals database.....first of plz noted some points.

    1. u must use the IUser InterFace.

    2. also the Data abt a user is mapped thrgh the attribute-mapping xml file which mapped to the LDAP Server.

    Also the my following code Snippet may solves ur's problem....as i had worked on same and get successfully data of the logged user from Back-end...

    -


    String userID = "";

    String [] nameSpace, attrib = new String[100], nSpace;

    try{

    IWDClientUser wdUser = WDClientUser.getCurrentUser();

    IUser user = wdUser.getSAPUser();

    nSpace = user.getAttributeNamespaces();

    // for(int k =3 ; k < nSpace.length; k++)

    // {

    // wdComponentAPI.getMessageManager().reportSuccess("NameSpace: "+nSpace[k]);

    // nameSpace = user.getAttributeNames(nSpace[k]);

    nameSpace = user.getAttributeNames("com.sap.security.core.usermanagement");

    for(int i = 0 ; i < nameSpace.length; i++)

    {

    if(nameSpace<i>.equals("uniquename"))

    {

    attrib = user.getAttribute("com.sap.security.core.usermanagement",nameSpace<i>);

    //wdComponentAPI.getMessageManager().reportSuccess(":::::::: "nameSpace<i>" "+attrib.length);

    for(int j =0 ; j < attrib.length; j++)

    {

    //wdComponentAPI.getMessageManager().reportSuccess("Login ID::::::-->"+attrib[j]);

    wdContext.currentContextElement().setLoginid(attrib[j]);

    }

    userID = attrib[0];

    }

    //----


    if(nameSpace<i>.equals("firstname"))

    {

    attrib = user.getAttribute("com.sap.security.core.usermanagement",nameSpace<i>);

    //wdComponentAPI.getMessageManager().reportSuccess(":::::::: "nameSpace<i>" "+attrib.length);

    for(int j =0 ; j < attrib.length; j++)

    {

    // wdComponentAPI.getMessageManager().reportSuccess("FirstName::::::-->"+attrib[j]);

    wdContext.currentContextElement().setFirstname(attrib[j]);

    }

    userID = attrib[0];

    }

    //----


    //----


    if(nameSpace<i>.equals("lastname"))

    {

    attrib = user.getAttribute("com.sap.security.core.usermanagement",nameSpace<i>);

    //wdComponentAPI.getMessageManager().reportSuccess(":::::::: "nameSpace<i>" "+attrib.length);

    for(int j =0 ; j < attrib.length; j++)

    {

    // wdComponentAPI.getMessageManager().reportSuccess("lastname::::::-->"+attrib[j]);

    wdContext.currentContextElement().setLastname(attrib[j]);

    }

    userID = attrib[0];

    }

    //----


    //----


    -


    with Best Regard's

    Dheerendra k Shukla

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 11, 2006 at 03:20 PM

    Maruti,

    Why not to use advises given in your other thread retriving-user-details-from-user-rofile-in-portal ???

    You didn't even reply to authors, meanwhile there are correct answers...

    VS

    Add comment
    10|10000 characters needed characters exceeded