Skip to Content
avatar image
Former Member

Update Attributes in UME

Hi

Is it possible to update attributes e.g Language in UME via security.api ?.

Thanks

Damien

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Dec 10, 2008 at 05:23 PM

    Hi,

    Actually for setting the language i am not sure but we have a predefined attribute locale.

    For doing this .

    IUserFactory userfact = UMFactory.getUserFactory();
    String userid = "test";
    IUserMaint user = userfact.getMutableUser(userfact.getUserByLogonID(userid).getUniqueID());
    user.setCity("Hyderabad");
    user.setLocale("EN");
    user.setFirstNmae("lokesh");
    user.setFirstNmae("Kamana");
    user.commit();
    

    Thanks & Regards,

    Lokesh

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Damien,

      Lokesh has given good input but user.setLocale("EN"); may not work as such because method setLocale

      public boolean setLocale(java.util.Locale locale).

      does not accept String parameter.

      I tried it following way and it worked for me.

      IUserMaint user = UMFactory.getUserFactory().getMutableUser(UMFactory.getUserFactory().getUserByLogonID("userid").getUniqueID());
      Locale deLocale = new Locale("de", "DE");
      user.setLocale(deLocale);
      user.commit();
      

      Obviously, "userid" needs to be replaced with a real User ID.

      After this, refresh the browser and all navigation for user mapped to userid will be in German. You can get more information about Locale [here|http://java.sun.com/developer/technicalArticles/J2SE/locale/].

      Hope it helps,

      Vishwas.

  • Dec 11, 2008 at 08:55 AM

    Hi,

    Actually i have nt tried that but have an idea that theer is an attribute for locale.

    Anyway if ur issue is resolved.

    Plz close the thread.

    Thanks & regrads,

    Lokesh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 11, 2008 at 08:57 AM

    Thanks guys, points awarded ! ..

    Add comment
    10|10000 characters needed characters exceeded