Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteContent.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1140cc53ea50d189a37a13449ea73d5a79a6afa9 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteContent.java (.../VoteContent.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteContent.java (.../VoteContent.java) (revision 1140cc53ea50d189a37a13449ea73d5a79a6afa9) @@ -60,6 +60,8 @@ /** nullable persistent field */ private String instructions; + + private String posting; /** nullable persistent field */ private boolean defineLater; @@ -119,7 +121,7 @@ private Set voteAttachments; /** full constructor */ - public VoteContent(Long voteContentId, String content, String title, String instructions, boolean defineLater, boolean runOffline, + public VoteContent(Long voteContentId, String content, String title, String instructions, String posting, boolean defineLater, boolean runOffline, Date creationDate, Date updateDate, boolean questionsSequenced, boolean usernameVisible, String reportTitle, String monitoringReportTitle, long createdBy, boolean lockOnFinish, boolean contentInUse, String offlineInstructions, String onlineInstructions, String endLearningMessage, boolean showReport, boolean retries, Set voteQueContents, Set voteSessions, @@ -128,6 +130,7 @@ this.content=content; this.title = title; this.instructions = instructions; + this.posting = posting; this.defineLater = defineLater; this.runOffline = runOffline; this.creationDate = creationDate; @@ -171,37 +174,38 @@ * @param newContentId the new mc content id. * @return the new mc content object. */ - public static VoteContent newInstance(IToolContentHandler toolContentHandler, VoteContent mc, + public static VoteContent newInstance(IToolContentHandler toolContentHandler, VoteContent vote, Long newContentId) throws ItemNotFoundException, RepositoryCheckedException { VoteContent newContent = new VoteContent( newContentId, - mc.getContent(), - mc.getTitle(), - mc.getInstructions(), - mc.isDefineLater(), - mc.isRunOffline(), - mc.getCreationDate(), - mc.getUpdateDate(), - mc.isQuestionsSequenced(), - mc.isUsernameVisible(), - mc.getReportTitle(), - mc.getMonitoringReportTitle(), - mc.getCreatedBy(), - mc.isLockOnFinish(), - mc.isContentInUse(), - mc.getOfflineInstructions(), - mc.getOnlineInstructions(), - mc.getEndLearningMessage(), - mc.isShowReport(), - mc.isRetries(), + vote.getContent(), + vote.getTitle(), + vote.getInstructions(), + vote.getPosting(), + vote.isDefineLater(), + vote.isRunOffline(), + vote.getCreationDate(), + vote.getUpdateDate(), + vote.isQuestionsSequenced(), + vote.isUsernameVisible(), + vote.getReportTitle(), + vote.getMonitoringReportTitle(), + vote.getCreatedBy(), + vote.isLockOnFinish(), + vote.isContentInUse(), + vote.getOfflineInstructions(), + vote.getOnlineInstructions(), + vote.getEndLearningMessage(), + vote.isShowReport(), + vote.isRetries(), new TreeSet(), new TreeSet(), new TreeSet() ); - newContent.setVoteQueContents(mc.deepCopyMcQueContent(newContent)); - newContent.setVoteAttachments(mc.deepCopyMcAttachments(toolContentHandler, newContent)); + newContent.setVoteQueContents(vote.deepCopyMcQueContent(newContent)); + newContent.setVoteAttachments(vote.deepCopyMcAttachments(toolContentHandler, newContent)); return newContent; } @@ -221,7 +225,8 @@ VoteQueContent queContent = (VoteQueContent) i.next(); if (queContent.getMcContent() != null) { - VoteQueContent mcQueContent=VoteQueContent.newInstance(queContent, + int displayOrder=queContent.getDisplayOrder(); + VoteQueContent mcQueContent=VoteQueContent.newInstance(queContent,displayOrder, newMcContent); newMcQueContent.add(mcQueContent); } @@ -504,4 +509,16 @@ public void setVoteContentId(Long voteContentId) { this.voteContentId = voteContentId; } + /** + * @return Returns the posting. + */ + public String getPosting() { + return posting; + } + /** + * @param posting The posting to set. + */ + public void setPosting(String posting) { + this.posting = posting; + } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueContent.java =================================================================== diff -u -r402985c35e80fbce6960c7d7598b0262292398eb -r1140cc53ea50d189a37a13449ea73d5a79a6afa9 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueContent.java (.../VoteQueContent.java) (revision 402985c35e80fbce6960c7d7598b0262292398eb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueContent.java (.../VoteQueContent.java) (revision 1140cc53ea50d189a37a13449ea73d5a79a6afa9) @@ -24,7 +24,6 @@ import java.io.Serializable; import java.util.HashSet; -import java.util.Iterator; import java.util.Set; import java.util.TreeSet; @@ -51,6 +50,8 @@ /** nullable persistent field */ private String question; + + private int displayOrder; /** non persistent field */ @@ -80,6 +81,15 @@ this.voteUsrAttempts = voteUsrAttempts; this.voteOptionsContents = voteOptionsContents; } + + public VoteQueContent(String question, int displayOrder, VoteContent voteContent, Set voteUsrAttempts, Set voteOptionsContents) { + this.question = question; + this.displayOrder=displayOrder; + this.voteContent=voteContent; + this.voteUsrAttempts = voteUsrAttempts; + this.voteOptionsContents = voteOptionsContents; + } + public VoteQueContent(Long voteQueContentId, String question, Set voteUsrAttempts, Set voteOptionsContents) { this.voteQueContentId = voteQueContentId; @@ -116,37 +126,20 @@ * @param queContent the original qa question content * @return the new qa question content object */ - public static VoteQueContent newInstance(VoteQueContent queContent, + public static VoteQueContent newInstance(VoteQueContent queContent, int displayOrder, VoteContent newMcContent) { VoteQueContent newQueContent = new VoteQueContent(queContent.getQuestion(), + displayOrder, newMcContent, new TreeSet(), new TreeSet()); - newQueContent.setVoteOptionsContents(queContent.deepCopyMcOptionsContent(newQueContent)); return newQueContent; } - public Set deepCopyMcOptionsContent(VoteQueContent newQueContent) - { - Set newMcOptionsContent = new TreeSet(); - for (Iterator i = this.getVoteOptionsContents().iterator(); i.hasNext();) - { - VoteOptsContent mcOptsContent = (VoteOptsContent) i.next(); - VoteOptsContent mcNewOptsContent= VoteOptsContent.newInstance(mcOptsContent,newQueContent); - - if (mcNewOptsContent.getVoteQueContent() != null) - { - newMcOptionsContent.add(mcNewOptsContent); - } - } - return newMcOptionsContent; - } - - public Long getUid() { return this.uid; } @@ -270,4 +263,16 @@ public void setVoteOptionsContents(Set voteOptionsContents) { this.voteOptionsContents = voteOptionsContents; } + /** + * @return Returns the displayOrder. + */ + public int getDisplayOrder() { + return displayOrder; + } + /** + * @param displayOrder The displayOrder to set. + */ + public void setDisplayOrder(int displayOrder) { + this.displayOrder = displayOrder; + } }