Package com.agiletec.plugins.jpsurvey.aps.system.services.collect

Examples of com.agiletec.plugins.jpsurvey.aps.system.services.collect.IVoterManager


    return false;
  }

  private static boolean isVotedByIpAddressAndUser(SurveyRecord surveyInfo, HttpServletRequest request) throws ApsSystemException {
    String remoteAddress = request.getRemoteAddr();
    IVoterManager voterManager = (IVoterManager) ApsWebApplicationUtils.getBean(SurveySystemConstants.SURVEY_VOTER_MANAGER, request);
    UserDetails currentUser = (UserDetails) request.getSession().getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER);
    Voter voter = voterManager.getVoter(currentUser.getUsername(), remoteAddress, surveyInfo.getId());
    return (voter != null);
  }
View Full Code Here


    Voter voter = voterManager.getVoter(currentUser.getUsername(), remoteAddress, surveyInfo.getId());
    return (voter != null);
  }
  private static boolean isVotedByUser(SurveyRecord surveyInfo, HttpServletRequest request) throws ApsSystemException {
    //String remoteAddress = request.getRemoteAddr();
    IVoterManager voterManager = (IVoterManager) ApsWebApplicationUtils.getBean(SurveySystemConstants.SURVEY_VOTER_MANAGER, request);
    UserDetails currentUser = (UserDetails) request.getSession().getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER);

    FieldSearchFilter usernameFilter = new FieldSearchFilter((IVoterManager.FIELD_USERNAME), currentUser.getUsername(), false);
    FieldSearchFilter surveyIdFilter = new FieldSearchFilter((IVoterManager.FIELD_SURVEY_ID), new Integer(surveyInfo.getId()), false);
    FieldSearchFilter[] filters = new FieldSearchFilter[]{usernameFilter, surveyIdFilter};

    List<Integer> voters = voterManager.searchVoters(filters);
    return (null != voters && !voters.isEmpty());
  }
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jpsurvey.aps.system.services.collect.IVoterManager

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.