Examples of UserPreference


Examples of in.partake.model.dto.UserPreference

        List<UserTicket> participations = daos.getEnrollmentAccess().findByEventId(con, eventId, 0, Integer.MAX_VALUE);
        for (UserTicket participation : participations) {
            if (!participation.getStatus().isEnrolled())
                continue;

            UserPreference pref = daos.getUserPreferenceAccess().find(con, participation.getUserId());
            if (pref == null)
                pref = UserPreference.getDefaultPreference(participation.getUserId());

            MessageDelivery delivery = pref.isReceivingTwitterMessage() ? MessageDelivery.INQUEUE : MessageDelivery.NOT_DELIVERED;

            UUID userMessageId = daos.getUserReceivedMessageAccess().getFreshId(con);
            UserReceivedMessage userMessage = new UserReceivedMessage(userMessageId, sender.getId(), participation.getUserId(), eventId, messageId.toString(),
                    false, delivery, null, null, TimeUtil.getCurrentDateTime(), null);
            daos.getUserReceivedMessageAccess().put(con, userMessage);
View Full Code Here

Examples of in.partake.model.dto.UserPreference

import in.partake.model.dao.postgres9.Postgres9EntityDataMapper;
import in.partake.model.dto.UserPreference;

class EntityUserPreferenceMapper extends Postgres9EntityDataMapper<UserPreference> {
    public UserPreference map(ObjectNode obj) {
        return new UserPreference(obj).freeze();
    }
View Full Code Here

Examples of in.partake.model.dto.UserPreference

    /**
     * Updates UserPreference. Null arguments won't be updated.
     */
    public Void doExecute(PartakeConnection con, IPartakeDAOs daos) throws DAOException, PartakeException {
        final UserPreference pref = daos.getUserPreferenceAccess().find(con, user.getId());
        UserPreference newPref = new UserPreference(pref != null ? pref : UserPreference.getDefaultPreference(user.getId()));

        if (profilePublic != null)
            newPref.setProfilePublic(profilePublic);
        if (receivingTwitterMessage != null)
            newPref.setReceivingTwitterMessage(receivingTwitterMessage);
        if (tweetingAttendanceAutomatically != null)
            newPref.setTweetingAttendanceAutomatically(tweetingAttendanceAutomatically);

        daos.getUserPreferenceAccess().put(con, newPref);
        return null;
    }
View Full Code Here

Examples of net.baguajie.domains.UserPreference

  public boolean preHandle(HttpServletRequest request,
      HttpServletResponse response, Object handler) throws Exception {
    HttpSession session = request.getSession(true);
    User signInUser = sessionUtil.getSignInUser(session);
    UserPreference up = sessionUtil.getSignInUserPrefer(session);
    if (signInUser != null && signInUser.getStatus() == UserStatus.INVALID) {
      session.removeAttribute(ApplicationConstants.SESSION_SIGNIN_USER);
    } else {
      if (signInUser != null && up == null) {
        up = userPreferenceRepository.getByUser(signInUser);
View Full Code Here

Examples of net.baguajie.domains.UserPreference

          .from(result));
    }else{
      if (existed != null) {
        session.setAttribute(ApplicationConstants.SESSION_SIGNIN_USER,
            existed);
        UserPreference up = userPreferenceRepository.getByUser(existed);
        if (up != null) {
          sessionUtil.setSignInUserPrefer(up, session);
        }
      }
      return new ValidationEngineError[]{};
View Full Code Here

Examples of net.baguajie.domains.UserPreference

    }

    if (existed != null) {
      session.setAttribute(ApplicationConstants.SESSION_SIGNIN_USER,
          existed);
      UserPreference up = userPreferenceRepository.getByUser(existed);
      if (up != null) {
        sessionUtil.setSignInUserPrefer(up, session);
      }
    }
View Full Code Here

Examples of net.baguajie.domains.UserPreference

        Arrays.asList(ApplicationConfig.defaultCategories));
    }
  }
 
  public UserPreference getDefaultPrefer(){
    UserPreference up = new UserPreference();
    up.setId(ApplicationConfig.defaultPreferenceId);
    List<String> categories = new ArrayList<String>();
    Collections.addAll(categories, ApplicationConfig.defaultCategories);
    up.setCategories(categories);
    return up;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.