Package org.exoplatform.services.organization.impl

Examples of org.exoplatform.services.organization.impl.UserProfileData


      if (PROFILE_LDAP_CLASSES == null)
         PROFILE_LDAP_CLASSES = profileLDAPClasses.split(",");
      attrs.put(new ObjectClassAttribute(PROFILE_LDAP_CLASSES));

      attrs.put("sn", profile.getUserName());
      UserProfileData upd = new UserProfileData();
      upd.setUserProfile(profile);
      attrs.put(ldapDescriptionAttr, upd.getProfile());
      return attrs;
   }
View Full Code Here


    */
   public final UserProfileData attributesToProfile(Attributes attrs)
   {
      if (attrs == null || attrs.size() == 0)
         return null;
      UserProfileData upd = new UserProfileData();
      upd.setProfile(getAttributeValueAsString(attrs, ldapDescriptionAttr));
      return upd;
   }
View Full Code Here

                  if (broadcast)
                     postSave(profile, true);
                 
                  return;
               }
               UserProfileData upd = new UserProfileData();
               upd.setUserProfile(profile);

               if (broadcast)
                  preSave(profile, false);

               ModificationItem[] mods = new ModificationItem[1];
               mods[0] =
                  new ModificationItem(DirContext.REPLACE_ATTRIBUTE, new BasicAttribute(
                     ldapAttrMapping.ldapDescriptionAttr, upd.getProfile()));
               ctx.modifyAttributes(profileDN, mods);

               if (broadcast)
                  postSave(profile, false);
            }
View Full Code Here

    * {@inheritDoc}
    */
   public void saveUserProfile(UserProfile profile, boolean broadcast) throws Exception
   {
      Session session = service_.openSession();
      UserProfileData upd =
         (UserProfileData)service_.findOne(session, queryFindUserProfileByName, profile.getUserName());
      if (upd == null)
      {
         upd = new UserProfileData();
         upd.setUserProfile(profile);
         if (broadcast)
            preSave(profile, true);

         session.save(profile.getUserName(), upd);
         session.flush();
         cache_.put(profile.getUserName(), profile);

         if (broadcast)
            postSave(profile, true);
      }
      else
      {
         upd.setUserProfile(profile);
         if (broadcast)
            preSave(profile, false);

         session.update(upd);
         session.flush();
View Full Code Here

   public UserProfile removeUserProfile(String userName, boolean broadcast) throws Exception
   {
      Session session = service_.openSession();
      try
      {
         UserProfileData upd = (UserProfileData)service_.findExactOne(session, queryFindUserProfileByName, userName);
         UserProfile profile = upd.getUserProfile();
         if (broadcast)
            preDelete(profile);

         session.delete(upd);
         session.flush();
View Full Code Here

   /**
    * {@inheritDoc}
    */
   public UserProfile findUserProfileByName(String userName, Session session) throws Exception
   {
      UserProfileData upd = (UserProfileData)service_.findOne(session, queryFindUserProfileByName, userName);
      if (upd != null)
      {
         return upd.getUserProfile();
      }
      return null;
   }
View Full Code Here

      if (PROFILE_LDAP_CLASSES == null)
         PROFILE_LDAP_CLASSES = profileLDAPClasses.split(",");
      attrs.put(new ObjectClassAttribute(PROFILE_LDAP_CLASSES));

      attrs.put("sn", profile.getUserName());
      UserProfileData upd = new UserProfileData();
      upd.setUserProfile(profile);
      attrs.put(ldapDescriptionAttr, upd.getProfile());
      return attrs;
   }
View Full Code Here

    */
   public final UserProfileData attributesToProfile(Attributes attrs)
   {
      if (attrs == null || attrs.size() == 0)
         return null;
      UserProfileData upd = new UserProfileData();
      upd.setProfile(getAttributeValueAsString(attrs, ldapDescriptionAttr));
      return upd;
   }
View Full Code Here

               catch (NameNotFoundException e)
               {
                  ctx.createSubcontext(profileDN, ldapAttrMapping.profileToAttributes(profile));
                  return;
               }
               UserProfileData upd = new UserProfileData();
               upd.setUserProfile(profile);
               ModificationItem[] mods = new ModificationItem[1];
               mods[0] =
                  new ModificationItem(DirContext.REPLACE_ATTRIBUTE, new BasicAttribute(
                     ldapAttrMapping.ldapDescriptionAttr, upd.getProfile()));
               ctx.modifyAttributes(profileDN, mods);
            }
            catch (NamingException e)
            {
               ctx = reloadCtx(ctx, err, e);
View Full Code Here

    */
   public void saveUserProfile(UserProfile profile, boolean broadcast) throws Exception
   {
      String userName = profile.getUserName();
      Session session = service_.openSession();
      UserProfileData upd = (UserProfileData)service_.findOne(session, queryFindUserProfileByName, userName);

      User user = userDAO.findUserByName(userName);
      if (user == null)
      {
         throw new InvalidNameException("User " + userName + " not exists");
      }

      if (upd == null)
      {
         upd = new UserProfileData();
         upd.setUserProfile(profile);
         if (broadcast)
            preSave(profile, true);

         session.save(userName, upd);
         session.flush();
         cache_.put(userName, profile);

         if (broadcast)
            postSave(profile, true);
      }
      else
      {
         upd.setUserProfile(profile);
         if (broadcast)
            preSave(profile, false);

         session.update(upd);
         session.flush();
View Full Code Here

TOP

Related Classes of org.exoplatform.services.organization.impl.UserProfileData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.