Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteQueContentDAO.java =================================================================== diff -u -r5773f84ed608838de3521ecde87c52f3c72d478c -rc4fa6919ecdb07f3bc9b99d00c91af3819aa8814 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteQueContentDAO.java (.../VoteQueContentDAO.java) (revision 5773f84ed608838de3521ecde87c52f3c72d478c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteQueContentDAO.java (.../VoteQueContentDAO.java) (revision c4fa6919ecdb07f3bc9b99d00c91af3819aa8814) @@ -38,7 +38,7 @@ @Repository public class VoteQueContentDAO extends LAMSBaseDAO implements IVoteQueContentDAO { - private static final String CLEAN_QUESTION_CONTENT_BY_CONTENT_ID_SIMPLE = "from voteQueContent in class VoteQueContent where voteQueContent.voteContentId=:voteContentId"; + // private static final String CLEAN_QUESTION_CONTENT_BY_CONTENT_ID_SIMPLE = "from voteQueContent in class VoteQueContent where voteQueContent.voteContentId=:voteContentId"; private static final String LOAD_QUESTION_CONTENT_BY_CONTENT_ID = "from voteQueContent in class VoteQueContent where voteQueContent.voteContentId=:voteContentId"; @@ -51,10 +51,11 @@ return (VoteQueContent) this.getSession().get(VoteQueContent.class, uid); } + @SuppressWarnings("unchecked") @Override public VoteQueContent getDefaultVoteContentFirstQuestion() { final long voteContentId = 1; - List list = getSessionFactory().getCurrentSession().createQuery(LOAD_QUESTION_CONTENT_BY_CONTENT_ID) + List list = getSessionFactory().getCurrentSession().createQuery(LOAD_QUESTION_CONTENT_BY_CONTENT_ID) .setLong("voteContentId", voteContentId).list(); if (list != null && list.size() > 0) { @@ -64,9 +65,10 @@ return null; } + @SuppressWarnings("unchecked") @Override public VoteQueContent getQuestionByDisplayOrder(final Long displayOrder, final Long voteContentUid) { - List list = getSessionFactory().getCurrentSession().createQuery(LOAD_QUESTION_CONTENT_BY_DISPLAY_ORDER) + List list = getSessionFactory().getCurrentSession().createQuery(LOAD_QUESTION_CONTENT_BY_DISPLAY_ORDER) .setLong("displayOrder", displayOrder.longValue()).setLong("voteContentUid", voteContentUid.longValue()) .list(); @@ -77,9 +79,10 @@ return null; } + @SuppressWarnings("unchecked") @Override - public List getAllQuestionsSorted(final long voteContentId) { - List list = getSessionFactory().getCurrentSession().createQuery(SORT_QUESTION_CONTENT_BY_DISPLAY_ORDER) + public List getAllQuestionsSorted(final long voteContentId) { + List list = getSessionFactory().getCurrentSession().createQuery(SORT_QUESTION_CONTENT_BY_DISPLAY_ORDER) .setLong("voteContentId", voteContentId).list(); return list; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteSessionDAO.java =================================================================== diff -u -r5773f84ed608838de3521ecde87c52f3c72d478c -rc4fa6919ecdb07f3bc9b99d00c91af3819aa8814 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteSessionDAO.java (.../VoteSessionDAO.java) (revision 5773f84ed608838de3521ecde87c52f3c72d478c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteSessionDAO.java (.../VoteSessionDAO.java) (revision c4fa6919ecdb07f3bc9b99d00c91af3819aa8814) @@ -56,11 +56,12 @@ return (VoteSession) this.getSession().get(VoteSession.class, sessionUid); } + @SuppressWarnings("unchecked") @Override public VoteSession getSessionBySessionId(Long voteSessionId) { String query = "from VoteSession votes where votes.voteSessionId=?"; - List list = getSessionFactory().getCurrentSession().createQuery(query).setLong(0, voteSessionId.longValue()) + List list = getSessionFactory().getCurrentSession().createQuery(query).setLong(0, voteSessionId.longValue()) .list(); if (list != null && list.size() > 0) { @@ -70,9 +71,10 @@ return null; } + @SuppressWarnings("unchecked") @Override public int countSessionComplete() { - List list = getSessionFactory().getCurrentSession().createQuery(COUNT_SESSION_COMPLETE).list(); + List list = getSessionFactory().getCurrentSession().createQuery(COUNT_SESSION_COMPLETE).list(); if (list != null && list.size() > 0) { return list.size(); @@ -98,11 +100,11 @@ this.getSession().delete(votes); } + @SuppressWarnings("unchecked") @Override public void removeVoteSessionById(Long voteSessionId) { - if (voteSessionId != null) { - List list = getSessionFactory().getCurrentSession().createQuery(FIND_VOTE_SESSION_CONTENT) + List list = getSessionFactory().getCurrentSession().createQuery(FIND_VOTE_SESSION_CONTENT) .setLong(0, voteSessionId.longValue()).list(); if (list != null && list.size() > 0) { Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUserDAO.java =================================================================== diff -u -r5773f84ed608838de3521ecde87c52f3c72d478c -rc4fa6919ecdb07f3bc9b99d00c91af3819aa8814 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUserDAO.java (.../VoteUserDAO.java) (revision 5773f84ed608838de3521ecde87c52f3c72d478c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUserDAO.java (.../VoteUserDAO.java) (revision c4fa6919ecdb07f3bc9b99d00c91af3819aa8814) @@ -44,11 +44,12 @@ private static final String LOAD_USER_FOR_SESSION = "from voteQueUsr in class VoteQueUsr where voteQueUsr.voteSessionId= :voteSessionId"; + @SuppressWarnings("unchecked") @Override public VoteQueUsr getUserByUserId(Long userId) { String query = "from VoteQueUsr user where user.queUsrId=?"; - List list = getSessionFactory().getCurrentSession().createQuery(query).setLong(0, userId.longValue()).list(); + List list = getSessionFactory().getCurrentSession().createQuery(query).setLong(0, userId.longValue()).list(); if (list != null && list.size() > 0) { VoteQueUsr voteu = (VoteQueUsr) list.get(0); @@ -57,14 +58,15 @@ return null; } + @SuppressWarnings("unchecked") @Override public int getCompletedVoteUserBySessionUid(final Long voteSessionUid) { - List list = getSessionFactory().getCurrentSession().createQuery(LOAD_USER_FOR_SESSION) + List list = getSessionFactory().getCurrentSession().createQuery(LOAD_USER_FOR_SESSION) .setLong("voteSessionId", voteSessionUid.longValue()).list(); int completedSessionUserCount = 0; if (list != null && list.size() > 0) { - Iterator listIterator = list.iterator(); + Iterator listIterator = list.iterator(); while (listIterator.hasNext()) { VoteQueUsr user = (VoteQueUsr) listIterator.next(); if (user.getVoteSession().getSessionStatus().equals("COMPLETED")) { @@ -76,11 +78,12 @@ return completedSessionUserCount; } + @SuppressWarnings("unchecked") @Override public VoteQueUsr getVoteUserBySession(final Long queUsrId, final Long voteSessionId) { String strGetUser = "from voteQueUsr in class VoteQueUsr where voteQueUsr.queUsrId=:queUsrId and voteQueUsr.voteSessionId=:voteSessionId"; - List list = getSessionFactory().getCurrentSession().createQuery(strGetUser) + List list = getSessionFactory().getCurrentSession().createQuery(strGetUser) .setLong("queUsrId", queUsrId.longValue()).setLong("voteSessionId", voteSessionId.longValue()).list(); if (list != null && list.size() > 0) { @@ -90,11 +93,12 @@ return null; } + @SuppressWarnings("unchecked") @Override public VoteQueUsr getVoteQueUsrById(long voteQueUsrId) { String query = "from VoteQueUsr user where user.queUsrId=?"; - List list = getSessionFactory().getCurrentSession().createQuery(query).setLong(0, voteQueUsrId).list(); + List list = getSessionFactory().getCurrentSession().createQuery(query).setLong(0, voteQueUsrId).list(); if (list != null && list.size() > 0) { VoteQueUsr qu = (VoteQueUsr) list.get(0); @@ -113,6 +117,7 @@ this.getSession().update(voteUser); } + @SuppressWarnings("unchecked") @Override public List getUserBySessionOnly(final VoteSession voteSession) { List list = getSessionFactory().getCurrentSession().createQuery(LOAD_USER_FOR_SESSION) Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java =================================================================== diff -u -r5773f84ed608838de3521ecde87c52f3c72d478c -rc4fa6919ecdb07f3bc9b99d00c91af3819aa8814 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java (.../VoteUsrAttemptDAO.java) (revision 5773f84ed608838de3521ecde87c52f3c72d478c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java (.../VoteUsrAttemptDAO.java) (revision c4fa6919ecdb07f3bc9b99d00c91af3819aa8814) @@ -77,6 +77,7 @@ private static final String COUNT_ENTRIES_BY_SESSION_ID = "select count(*) from VoteUsrAttempt att, VoteQueUsr user, VoteSession ses where " + "att.voteQueUsr=user and user.voteSession=ses and ses.uid=:voteSessionUid"; + @SuppressWarnings("unchecked") @Override public VoteUsrAttempt getAttemptByUID(Long uid) { String query = "from VoteUsrAttempt attempt where attempt.uid=?"; @@ -96,13 +97,15 @@ this.getSession().save(voteUsrAttempt); } + @SuppressWarnings("unchecked") @Override public List getAttemptsForUser(final Long queUsrId) { - List list = getSessionFactory().getCurrentSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_USER) + List list = getSessionFactory().getCurrentSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_USER) .setLong("queUsrId", queUsrId.longValue()).list(); return list; } + @SuppressWarnings("unchecked") @Override public Set getUserEntries(final Long voteContentUid) { List list = getSessionFactory().getCurrentSession().createQuery(VoteUsrAttemptDAO.LOAD_USER_ENTRIES) @@ -121,6 +124,7 @@ return userEntries; } + @SuppressWarnings("unchecked") @Override public List getUserAttempts(final Long voteContentUid, final String userEntry) { List list = getSessionFactory().getCurrentSession() @@ -129,12 +133,14 @@ return list; } + @SuppressWarnings("unchecked") @Override public List getSessionOpenTextUserEntries(final Long voteSessionUid) { return getSession().createQuery(VoteUsrAttemptDAO.LOAD_OPEN_TEXT_ENTRIES_BY_SESSION_UID) .setLong("voteSessionUid", voteSessionUid).list(); } + @SuppressWarnings("unchecked") @Override public void removeAttemptsForUserandSession(final Long queUsrId, final Long sessionUid) { String strGetUser = "from voteUsrAttempt in class VoteUsrAttempt where voteUsrAttempt.queUsrId=:queUsrId and voteUsrAttempt.voteQueUsr.voteSession.uid=:sessionUid"; @@ -152,6 +158,7 @@ } } + @SuppressWarnings("unchecked") @Override public int getStandardAttemptsForQuestionContentAndSessionUid(final Long questionUid, final Long sessionUid) { List list = getSession().createQuery(VoteUsrAttemptDAO.COUNT_ATTEMPT_FOR_QUESTION_CONTENT_AND_SESSION) @@ -165,6 +172,7 @@ } + @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public List getAttemptsForQuestionContentAndSessionUid(final Long questionUid, final Long sessionUid) { @@ -181,6 +189,7 @@ } + @SuppressWarnings("unchecked") @Override public List getAttemptsForUserAndQuestionContent(final Long queUsrId, final Long questionUid) { List list = getSessionFactory().getCurrentSession() @@ -190,6 +199,7 @@ return list; } + @SuppressWarnings("unchecked") @Override public VoteUsrAttempt getAttemptForUserAndQuestionContentAndSession(final Long queUsrId, final Long questionUid, final Long sessionUid) { @@ -204,6 +214,7 @@ return list.get(0); } + @SuppressWarnings("unchecked") @Override public Set getAttemptsForUserAndSession(final Long queUsrId, final Long sessionUid) { @@ -226,6 +237,7 @@ return userEntries; } + @SuppressWarnings("unchecked") @Override public List getAttemptsForUserAndSessionUseOpenAnswer(final Long queUsrId, final Long sessionUid) { @@ -234,9 +246,10 @@ } + @SuppressWarnings("unchecked") @Override public int getSessionEntriesCount(final Long voteSessionUid) { - List result = getSessionFactory().getCurrentSession().createQuery(VoteUsrAttemptDAO.COUNT_ENTRIES_BY_SESSION_ID) + List result = getSessionFactory().getCurrentSession().createQuery(VoteUsrAttemptDAO.COUNT_ENTRIES_BY_SESSION_ID) .setLong("voteSessionUid", voteSessionUid).list(); Long resultLong = result.get(0) != null ? (Long) result.get(0) : new Long(0); return resultLong.intValue(); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/ReflectionDTO.java =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -rc4fa6919ecdb07f3bc9b99d00c91af3819aa8814 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/ReflectionDTO.java (.../ReflectionDTO.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/ReflectionDTO.java (.../ReflectionDTO.java) (revision c4fa6919ecdb07f3bc9b99d00c91af3819aa8814) @@ -31,7 +31,7 @@ * * @author Ozgur Demirtas */ -public class ReflectionDTO implements Comparable { +public class ReflectionDTO implements Comparable { protected String userName; protected String userId; @@ -43,8 +43,7 @@ protected String entry; @Override - public int compareTo(Object o) { - ReflectionDTO reflectionDTO = (ReflectionDTO) o; + public int compareTo(ReflectionDTO reflectionDTO) { if (reflectionDTO == null) { return 1; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/SessionDTO.java =================================================================== diff -u -r5773f84ed608838de3521ecde87c52f3c72d478c -rc4fa6919ecdb07f3bc9b99d00c91af3819aa8814 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/SessionDTO.java (.../SessionDTO.java) (revision 5773f84ed608838de3521ecde87c52f3c72d478c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/SessionDTO.java (.../SessionDTO.java) (revision c4fa6919ecdb07f3bc9b99d00c91af3819aa8814) @@ -34,47 +34,47 @@ * * @author Ozgur Demirtas */ -public class SessionDTO implements Comparable { +public class SessionDTO implements Comparable { private int sessionUserCount; private int completedSessionUserCount; private String sessionId; private String sessionName; - private Map mapStandardNominationsHTMLedContent; - private Map mapStandardQuestionUid; - private Map mapStandardToolSessionUid; + private Map mapStandardNominationsHTMLedContent; + private Map mapStandardQuestionUid; + private Map mapStandardToolSessionUid; private boolean existsOpenVote; private Map mapStandardUserCount; - private Map mapStandardRatesContent; + private Map mapStandardRatesContent; private List openVotes; private List answers; /** * @return Returns the mapStandardQuestionUid. */ - public Map getMapStandardQuestionUid() { + public Map getMapStandardQuestionUid() { return mapStandardQuestionUid; } /** * @param mapStandardQuestionUid * The mapStandardQuestionUid to set. */ - public void setMapStandardQuestionUid(Map mapStandardQuestionUid) { + public void setMapStandardQuestionUid(Map mapStandardQuestionUid) { this.mapStandardQuestionUid = mapStandardQuestionUid; } /** * @return Returns the mapStandardToolSessionUid. */ - public Map getMapStandardToolSessionUid() { + public Map getMapStandardToolSessionUid() { return mapStandardToolSessionUid; } /** * @param mapStandardToolSessionUid * The mapStandardToolSessionUid to set. */ - public void setMapStandardToolSessionUid(Map mapStandardToolSessionUid) { + public void setMapStandardToolSessionUid(Map mapStandardToolSessionUid) { this.mapStandardToolSessionUid = mapStandardToolSessionUid; } @@ -111,15 +111,15 @@ /** * @return Returns the mapStandardRatesContent. */ - public Map getMapStandardRatesContent() { + public Map getMapStandardRatesContent() { return mapStandardRatesContent; } /** * @param mapStandardRatesContent * The mapStandardRatesContent to set. */ - public void setMapStandardRatesContent(Map mapStandardRatesContent) { + public void setMapStandardRatesContent(Map mapStandardRatesContent) { this.mapStandardRatesContent = mapStandardRatesContent; } @@ -202,15 +202,15 @@ /** * @return Returns the mapStandardNominationsHTMLedContent. */ - public Map getMapStandardNominationsHTMLedContent() { + public Map getMapStandardNominationsHTMLedContent() { return mapStandardNominationsHTMLedContent; } /** * @param mapStandardNominationsHTMLedContent * The mapStandardNominationsHTMLedContent to set. */ - public void setMapStandardNominationsHTMLedContent(Map mapStandardNominationsHTMLedContent) { + public void setMapStandardNominationsHTMLedContent(Map mapStandardNominationsHTMLedContent) { this.mapStandardNominationsHTMLedContent = mapStandardNominationsHTMLedContent; } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/SessionNominationDTO.java =================================================================== diff -u -r5773f84ed608838de3521ecde87c52f3c72d478c -rc4fa6919ecdb07f3bc9b99d00c91af3819aa8814 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/SessionNominationDTO.java (.../SessionNominationDTO.java) (revision 5773f84ed608838de3521ecde87c52f3c72d478c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/SessionNominationDTO.java (.../SessionNominationDTO.java) (revision c4fa6919ecdb07f3bc9b99d00c91af3819aa8814) @@ -25,7 +25,7 @@ /** * DTO that holds summary data for a nomination, not the answers themselves */ -public class SessionNominationDTO implements Comparable { +public class SessionNominationDTO implements Comparable { Long questionUid; Integer numberOfVotes; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/SummarySessionDTO.java =================================================================== diff -u -r5773f84ed608838de3521ecde87c52f3c72d478c -rc4fa6919ecdb07f3bc9b99d00c91af3819aa8814 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/SummarySessionDTO.java (.../SummarySessionDTO.java) (revision 5773f84ed608838de3521ecde87c52f3c72d478c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/SummarySessionDTO.java (.../SummarySessionDTO.java) (revision c4fa6919ecdb07f3bc9b99d00c91af3819aa8814) @@ -29,7 +29,7 @@ /** * DTO that holds summary data for all the sessions - down to the %s, number of votes etc but not the actual answers. */ -public class SummarySessionDTO implements Comparable { +public class SummarySessionDTO implements Comparable { private Long sessionUid; private Long toolSessionId; private String sessionName; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/VoteGeneralAuthoringDTO.java =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -rc4fa6919ecdb07f3bc9b99d00c91af3819aa8814 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/VoteGeneralAuthoringDTO.java (.../VoteGeneralAuthoringDTO.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dto/VoteGeneralAuthoringDTO.java (.../VoteGeneralAuthoringDTO.java) (revision c4fa6919ecdb07f3bc9b99d00c91af3819aa8814) @@ -29,7 +29,7 @@ * * @author Ozgur Demirtas */ -public class VoteGeneralAuthoringDTO implements Comparable { +public class VoteGeneralAuthoringDTO implements Comparable { protected String exceptionMaxNominationInvalid; protected String toolContentID; protected String activityTitle; @@ -52,8 +52,8 @@ protected String contentFolderID; protected String editableQuestionText; - protected List attachmentList; - protected List deletedAttachmentList; + // protected List attachmentList; + // protected List deletedAttachmentList; protected String reflect; protected String reflectionSubject; @@ -336,37 +336,37 @@ this.editableQuestionText = editableQuestionText; } - /** - * @return Returns the attachmentList. - */ - public List getAttachmentList() { - return attachmentList; - } +// /** +// * @return Returns the attachmentList. +// */ +// public List getAttachmentList() { +// return attachmentList; +// } +// +// /** +// * @param attachmentList +// * The attachmentList to set. +// */ +// public void setAttachmentList(List attachmentList) { +// this.attachmentList = attachmentList; +// } - /** - * @param attachmentList - * The attachmentList to set. - */ - public void setAttachmentList(List attachmentList) { - this.attachmentList = attachmentList; - } +// /** +// * @return Returns the deletedAttachmentList. +// */ +// public List getDeletedAttachmentList() { +// return deletedAttachmentList; +// } +// +// /** +// * @param deletedAttachmentList +// * The deletedAttachmentList to set. +// */ +// public void setDeletedAttachmentList(List deletedAttachmentList) { +// this.deletedAttachmentList = deletedAttachmentList; +// } /** - * @return Returns the deletedAttachmentList. - */ - public List getDeletedAttachmentList() { - return deletedAttachmentList; - } - - /** - * @param deletedAttachmentList - * The deletedAttachmentList to set. - */ - public void setDeletedAttachmentList(List deletedAttachmentList) { - this.deletedAttachmentList = deletedAttachmentList; - } - - /** * @return Returns the reflect. */ public String getReflect() {