Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteStringComparator.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteStringComparator.java (.../VoteStringComparator.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteStringComparator.java (.../VoteStringComparator.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -25,16 +25,13 @@ import java.io.Serializable; import java.util.Comparator; -import org.apache.log4j.Logger; - /** * @author Ozgur Demirtas * * A comparator implementation that can be used as a constructor to collections. * The TreeMap in the web layer makes use of it. * */ public class VoteStringComparator implements Comparator, Serializable { - static Logger logger = Logger.getLogger(VoteStringComparator.class.getName()); public int compare(Object o1, Object o2) { String s1 = (String)o1; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java =================================================================== diff -u -r618abc7cca98f08ef288878ab371a3693492d835 -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java (.../VoteUtils.java) (revision 618abc7cca98f08ef288878ab371a3693492d835) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java (.../VoteUtils.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -34,7 +34,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; -import org.apache.log4j.Logger; import org.lamsfoundation.lams.tool.vote.pojos.VoteContent; import org.lamsfoundation.lams.tool.vote.pojos.VoteSession; import org.lamsfoundation.lams.tool.vote.pojos.VoteUploadedFile; @@ -53,17 +52,13 @@ * @author Ozgur Demirtas */ public abstract class VoteUtils implements VoteAppConstants { - - static Logger logger = Logger.getLogger(VoteUtils.class.getName()); public static String replaceNewLines(String text) { - logger.debug("using text: " + text); String newText = ""; if (text != null) { newText = text.replaceAll("\n","
"); - logger.debug("newText: " + newText); } return newText; @@ -73,15 +68,13 @@ { String userID = ""; HttpSession ss = SessionManager.getSession(); - logger.debug("ss: " + ss); if (ss != null) { UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); if ((user != null) && (user.getUserID() != null)) { userID = user.getUserID().toString(); - logger.debug("retrieved userId: " + userID); } } return userID; @@ -100,7 +93,6 @@ public static Date getGMTDateTime() { Date date=new Date(System.currentTimeMillis()); - logger.debug("date: " + date); return date; } @@ -112,7 +104,6 @@ HttpSession ss = SessionManager.getSession(); /* get back login user DTO */ UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER); - logger.debug("retrieving toolUser: " + toolUser); return toolUser; } @@ -121,7 +112,6 @@ { UserDTO toolUser=getToolUser(); long userId=toolUser.getUserID().longValue(); - logger.debug("userId: " + userId); return new Long(userId); } @@ -130,36 +120,29 @@ /* double check if username and login is the same */ UserDTO toolUser=getToolUser(); String userName=toolUser.getLogin(); - logger.debug("userName: " + userName); return userName; } public static String getUserFullName() { UserDTO toolUser=getToolUser(); - String fullName=toolUser.getFirstName() + " " + toolUser.getLastName(); - logger.debug("fullName: " + fullName); + String fullName=toolUser.getFirstName() + " " + toolUser.getLastName(); return fullName; } public static String getFormattedDateString(Date date) { - logger.debug("getFormattedDateString: " + - DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(date)); return (DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG).format(date)); } public static void saveTimeZone(HttpServletRequest request) { TimeZone timeZone=TimeZone.getDefault(); - logger.debug("current timezone: " + timeZone.getDisplayName()); - logger.debug("current timezone id: " + timeZone.getID()); } public static String getCurrentTimeZone() { TimeZone timeZone=TimeZone.getDefault(); - logger.debug("current timezone: " + timeZone.getDisplayName()); return timeZone.getDisplayName(); } @@ -172,10 +155,8 @@ */ public static boolean existsContent(Long toolContentId, HttpServletRequest request, IVoteService voteService) { - logger.debug("voteService: " + voteService); VoteContent voteContent=voteService.retrieveVote(toolContentId); - logger.debug("retrieving voteContent: " + voteContent); if (voteContent == null) return false; @@ -191,10 +172,8 @@ */ public static boolean existsSession(Long toolSessionId, HttpServletRequest request, IVoteService voteService) { - logger.debug("voteService: " + voteService); VoteSession voteSession=voteService.retrieveVoteSession(toolSessionId); - logger.debug("voteSession:" + voteSession); if (voteSession == null) return false; @@ -206,7 +185,6 @@ public static void readContentValues(HttpServletRequest request, VoteContent defaultVoteContent, VoteAuthoringForm voteAuthoringForm, VoteGeneralAuthoringDTO voteGeneralAuthoringDTO) { - logger.debug("setting authoring screen properties"); /*should never be null anyway as default content MUST exist in the db*/ if(defaultVoteContent == null) throw new NullPointerException("Default VoteContent cannot be null"); @@ -235,14 +213,12 @@ String maxNomcount= defaultVoteContent.getMaxNominationCount(); - logger.debug("maxNomcount: " + maxNomcount); if (maxNomcount.equals("")) maxNomcount="0"; voteAuthoringForm.setMaxNominationCount(maxNomcount); voteGeneralAuthoringDTO.setMaxNominationCount(maxNomcount); String minNomcount= defaultVoteContent.getMinNominationCount(); - logger.debug("minNomcount: " + minNomcount); if ((minNomcount == null) || minNomcount.equals("")) minNomcount="0"; voteAuthoringForm.setMinNominationCount(minNomcount); @@ -263,10 +239,9 @@ } } - logger.debug("trimmed noHtmlNoNewLineStr: " + noHtmlNoNewLineStr.trim()); if (noHtmlNoNewLineStr.trim().length()==0) { - logger.debug("nomination text is just composed of html markup, try getting just a src entry for a picture otherwise give up."); + //nomination text is just composed of html markup, try getting just a src entry for a picture otherwise give up htmlText = htmlText.toLowerCase(); int index = htmlText.indexOf("src"); if ( index > -1 ) { @@ -302,20 +277,16 @@ public static void saveRichText(HttpServletRequest request, VoteGeneralAuthoringDTO voteGeneralAuthoringDTO, SessionMap sessionMap) { - logger.debug("doing saveRichText, sessionMap: " + sessionMap); String richTextTitle = request.getParameter(TITLE); String richTextInstructions = request.getParameter(INSTRUCTIONS); - logger.debug("richTextTitle: " + richTextTitle); - logger.debug("richTextInstructions: " + richTextInstructions); if (richTextTitle != null) { voteGeneralAuthoringDTO.setActivityTitle(richTextTitle); } String noHTMLTitle = stripHTML(richTextTitle); - logger.debug("noHTMLTitle: " + noHTMLTitle); if (richTextInstructions != null) @@ -324,7 +295,6 @@ } String richTextOfflineInstructions=request.getParameter(RICHTEXT_OFFLINEINSTRUCTIONS); - logger.debug("read parameter richTextOfflineInstructions: " + richTextOfflineInstructions); if ((richTextOfflineInstructions != null) && (richTextOfflineInstructions.length() > 0)) { @@ -333,7 +303,6 @@ } String richTextOnlineInstructions=request.getParameter(RICHTEXT_ONLINEINSTRUCTIONS); - logger.debug("read parameter richTextOnlineInstructions: " + richTextOnlineInstructions); if ((richTextOnlineInstructions != null) && (richTextOnlineInstructions.length() > 0)) { @@ -345,9 +314,7 @@ public static void configureContentRepository(HttpServletRequest request, IVoteService voteService) { - logger.debug("attempt configureContentRepository"); voteService.configureContentRepository(); - logger.debug("configureContentRepository ran successfully"); } @@ -360,7 +327,6 @@ { HttpSession ss = SessionManager.getSession(); UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); - logger.debug(logger + " " + "VoteUtils" + " Current user is: " + user + " with id: " + user.getUserID()); return user.getUserID().intValue(); } @@ -396,7 +362,6 @@ public static Map convertToMap(List sessionsList, String listType) { Map map= new TreeMap(new VoteComparator()); - logger.debug("listType: " + listType); Iterator listIterator=sessionsList.iterator(); Long mapIndex=new Long(1); @@ -430,7 +395,6 @@ public static Map convertToStringMap(List sessionsList, String listType) { Map map= new TreeMap(new VoteComparator()); - logger.debug("listType: " + listType); Iterator listIterator=sessionsList.iterator(); Long mapIndex=new Long(1); @@ -440,13 +404,11 @@ { if (listType.equals("String")) { - logger.debug("listType String"); String text=(String)listIterator.next(); map.put(mapIndex.toString(), text); } else if (listType.equals("Long")) { - logger.debug("listType Long"); Long LongValue=(Long)listIterator.next(); map.put(mapIndex.toString(), LongValue.toString()); } @@ -467,7 +429,6 @@ */ public static boolean isContentInUse(VoteContent voteContent) { - logger.debug("is content inuse: " + voteContent.isContentInUse()); return voteContent.isContentInUse(); } @@ -481,7 +442,6 @@ */ public static boolean isDefineLater(VoteContent voteContent) { - logger.debug("is define later: " + voteContent.isDefineLater()); return voteContent.isDefineLater(); } @@ -495,43 +455,38 @@ */ public static boolean isRunOffline(VoteContent voteContent) { - logger.debug("is run offline: " + voteContent.isRunOffline()); return voteContent.isRunOffline(); } public static String getDestination(String sourceVoteStarter) { - logger.debug("sourceVoteStarter: " + sourceVoteStarter); if ((sourceVoteStarter != null) && !sourceVoteStarter.equals("monitoring")) { - logger.debug("request is from authoring or define Later url. return to: " + LOAD_QUESTIONS); + //request is from authoring or define Later url. return to: LOAD_QUESTIONS return LOAD_QUESTIONS; } else if (sourceVoteStarter == null) { - logger.debug("request is from authoring url. return to: " + LOAD_QUESTIONS); + //request is from authoring url. return to: LOAD_QUESTIONS return LOAD_QUESTIONS; } else { - logger.debug("request is from monitoring url. return to: " + LOAD_MONITORING_CONTENT_EDITACTIVITY); + //request is from monitoring url. return to: LOAD_MONITORING_CONTENT_EDITACTIVITY return LOAD_MONITORING_CONTENT_EDITACTIVITY; } } public static void setDefineLater(HttpServletRequest request, boolean value, IVoteService voteService, String toolContentID) { - logger.debug("toolContentID:" + toolContentID); VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); - logger.debug("voteContent:" + voteContent); if (voteContent != null) { voteContent.setDefineLater(value); - logger.debug("defineLater has been set to value: " + value); voteService.updateVote(voteContent); } } @@ -545,7 +500,6 @@ public static void cleanUpSessionAbsolute(HttpServletRequest request) { cleanUpUserExceptions(request); - logger.debug("completely cleaned the session."); } /** @@ -597,11 +551,6 @@ VoteAuthoringForm voteAuthoringForm, VoteGeneralAuthoringDTO voteGeneralAuthoringDTO, String strToolContentID, String defaultContentIdStr, String activeModule, SessionMap sessionMap, String httpSessionID) { - logger.debug("setFormProperties: "); - logger.debug("using strToolContentID: " + strToolContentID); - logger.debug("using defaultContentIdStr: " + defaultContentIdStr); - logger.debug("using activeModule: " + activeModule); - logger.debug("using httpSessionID: " + httpSessionID); voteAuthoringForm.setHttpSessionID(httpSessionID); voteGeneralAuthoringDTO.setHttpSessionID(httpSessionID); @@ -615,12 +564,10 @@ voteGeneralAuthoringDTO.setActiveModule(activeModule); String lockOnFinish=request.getParameter("lockOnFinish"); - logger.debug("lockOnFinish: " + lockOnFinish); voteAuthoringForm.setLockOnFinish(lockOnFinish); voteGeneralAuthoringDTO.setLockOnFinish(lockOnFinish); String allowText=request.getParameter("allowText"); - logger.debug("allowText: " + allowText); voteAuthoringForm.setAllowText(allowText); voteGeneralAuthoringDTO.setAllowText(allowText); @@ -629,49 +576,36 @@ voteGeneralAuthoringDTO.setShowResults(showResults); String maxNominationCount=request.getParameter("maxNominationCount"); - logger.debug("maxNominationCount: " + maxNominationCount); voteAuthoringForm.setMaxNominationCount(maxNominationCount); voteGeneralAuthoringDTO.setMaxNominationCount(maxNominationCount); String reflect=request.getParameter("reflect"); - logger.debug("reflect: " + maxNominationCount); voteAuthoringForm.setReflect(reflect); voteGeneralAuthoringDTO.setReflect(reflect); String reflectionSubject=request.getParameter("reflectionSubject"); - logger.debug("reflectionSubject: " + reflectionSubject); voteAuthoringForm.setReflectionSubject(reflectionSubject); voteGeneralAuthoringDTO.setReflectionSubject(reflectionSubject); String offlineInstructions=request.getParameter(OFFLINE_INSTRUCTIONS); - logger.debug("offlineInstructions: " + offlineInstructions); voteAuthoringForm.setOfflineInstructions(offlineInstructions); voteGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); String onlineInstructions=request.getParameter(ONLINE_INSTRUCTIONS); - logger.debug("onlineInstructions: " + onlineInstructions); voteAuthoringForm.setOnlineInstructions(onlineInstructions); voteGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); - - logger.debug("ending setFormProperties with voteAuthoringForm: " + voteAuthoringForm); - logger.debug("ending setFormProperties with voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); } public static void setDefineLater(HttpServletRequest request, boolean value, String strToolContentID, IVoteService voteService) { - logger.debug("voteService: " + voteService); - logger.debug("value:" + value); - logger.debug("strToolContentID:" + strToolContentID); VoteContent voteContent=voteService.retrieveVote(new Long(strToolContentID)); - logger.debug("voteContent:" + voteContent); if (voteContent != null) { voteContent.setDefineLater(value); - logger.debug("defineLater has been set to:" + value); voteService.updateVote(voteContent); } } @@ -683,35 +617,25 @@ * then tries to match on that, otherwise uses filename and isOnline. */ public static List moveToDelete(String uuid, List attachmentsList, List deletedAttachmentsList ) { - logger.debug("doing moveToDelete: " + attachmentsList); - logger.debug("doing moveToDelete: " + deletedAttachmentsList); List deletedList = deletedAttachmentsList != null ? deletedAttachmentsList : new ArrayList(); - logger.debug("deletedList: " + deletedList); - if ( attachmentsList != null ) { - logger.debug("attachmentsList not null: " + attachmentsList); Iterator iter = attachmentsList.iterator(); VoteUploadedFile attachment = null; while ( iter.hasNext() && attachment == null ) { VoteUploadedFile value = (VoteUploadedFile) iter.next(); - logger.debug("value: " + value); if ( uuid.equals(value.getUuid()) ) { - logger.debug("value made attachment:"); attachment = value; } } - if ( attachment != null ) { - logger.debug("attachment not null"); + if ( attachment != null ) { deletedList.add(attachment); attachmentsList.remove(attachment); } } - logger.debug("final attachmentsList: " + attachmentsList); - logger.debug("final deletedAttachmentsList: " + deletedAttachmentsList); return deletedList; } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteContentDAO.java =================================================================== diff -u -r2ed86809be97c2553630665e20d6cc21b57c531c -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteContentDAO.java (.../VoteContentDAO.java) (revision 2ed86809be97c2553630665e20d6cc21b57c531c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteContentDAO.java (.../VoteContentDAO.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -25,7 +25,6 @@ import java.util.List; import java.util.Set; -import org.apache.log4j.Logger; import org.hibernate.FlushMode; import org.hibernate.HibernateException; import org.hibernate.Session; @@ -46,7 +45,6 @@ */ public class VoteContentDAO extends HibernateDaoSupport implements IVoteContentDAO { - static Logger logger = Logger.getLogger(VoteContentDAO.class.getName()); private static final String FIND_VOTE_CONTENT = "from " + VoteContent.class.getName() + " as vote where content_id=?"; @@ -60,7 +58,6 @@ public void saveOrUpdateVote(VoteContent vote) { this.getSession().setFlushMode(FlushMode.AUTO); - VoteContentDAO.logger.debug("before saveOrUpdateVote: " + vote); this.getHibernateTemplate().saveOrUpdate(vote); } @@ -88,9 +85,7 @@ public void saveVoteContent(VoteContent voteContent) { this.getSession().setFlushMode(FlushMode.AUTO); - VoteContentDAO.logger.debug("before saveOrUpdate"); this.getHibernateTemplate().saveOrUpdate(voteContent); - VoteContentDAO.logger.debug("after saveOrUpdate"); } public void updateVoteContent(VoteContent voteContent) { Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteQueContentDAO.java =================================================================== diff -u -r2ed86809be97c2553630665e20d6cc21b57c531c -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteQueContentDAO.java (.../VoteQueContentDAO.java) (revision 2ed86809be97c2553630665e20d6cc21b57c531c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteQueContentDAO.java (.../VoteQueContentDAO.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -24,7 +24,6 @@ import java.util.Iterator; import java.util.List; -import org.apache.log4j.Logger; import org.hibernate.FlushMode; import org.lamsfoundation.lams.tool.vote.dao.IVoteQueContentDAO; import org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent; @@ -40,7 +39,6 @@ *

*/ public class VoteQueContentDAO extends HibernateDaoSupport implements IVoteQueContentDAO { - static Logger logger = Logger.getLogger(VoteQueContentDAO.class.getName()); private static final String CLEAN_QUESTION_CONTENT_BY_CONTENT_ID_SIMPLE = "from voteQueContent in class VoteQueContent where voteQueContent.voteContentId=:voteContentId"; @@ -57,7 +55,6 @@ } public VoteQueContent getToolDefaultQuestionContent(final long voteContentId) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(LOAD_QUESTION_CONTENT_BY_CONTENT_ID).setLong("voteContentId", voteContentId).list(); @@ -74,15 +71,13 @@ } public List getAllQuestionEntries(final long voteContentId) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(LOAD_QUESTION_CONTENT_BY_CONTENT_ID).setLong("voteContentId", voteContentId).list(); return list; } public VoteQueContent getQuestionContentByQuestionText(final String question, final Long voteContentUid) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(LOAD_QUESTION_CONTENT_BY_QUESTION_TEXT).setString("question", question) .setLong("voteContentUid", voteContentUid.longValue()).list(); @@ -94,7 +89,6 @@ } public VoteQueContent getQuestionContentByDisplayOrder(final Long displayOrder, final Long voteContentUid) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(LOAD_QUESTION_CONTENT_BY_DISPLAY_ORDER).setLong("displayOrder", displayOrder.longValue()).setLong("voteContentUid", voteContentUid.longValue()).list(); @@ -169,7 +163,6 @@ } public List getAllQuestionEntriesSorted(final long voteContentId) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(SORT_QUESTION_CONTENT_BY_DISPLAY_ORDER).setLong("voteContentId", voteContentId).list(); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteSessionDAO.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteSessionDAO.java (.../VoteSessionDAO.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteSessionDAO.java (.../VoteSessionDAO.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -64,7 +64,6 @@ { String query = "from VoteSession votes where votes.voteSessionId=?"; - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(query) .setLong(0,voteSessionId.longValue()) .list(); @@ -78,7 +77,6 @@ public int countSessionComplete() { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(COUNT_SESSION_COMPLETE) .list(); @@ -90,7 +88,6 @@ public int countSessionIncomplete() { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(COUNT_SESSION_INCOMPLETE) .list(); @@ -122,7 +119,6 @@ public void removeVoteSessionById(Long voteSessionId) { - String query = "from VoteSession as votes where votes.voteSessionId ="; HibernateTemplate templ = this.getHibernateTemplate(); if ( voteSessionId != null) { Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUploadedFileDAO.java =================================================================== diff -u -r00759d7592ccc90e8769763524afb69546f641d4 -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUploadedFileDAO.java (.../VoteUploadedFileDAO.java) (revision 00759d7592ccc90e8769763524afb69546f641d4) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUploadedFileDAO.java (.../VoteUploadedFileDAO.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -25,7 +25,6 @@ import java.util.Iterator; import java.util.List; -import org.apache.log4j.Logger; import org.hibernate.FlushMode; import org.lamsfoundation.lams.tool.vote.dao.IVoteUploadedFileDAO; import org.lamsfoundation.lams.tool.vote.pojos.VoteContent; @@ -41,7 +40,6 @@ public class VoteUploadedFileDAO extends HibernateDaoSupport implements IVoteUploadedFileDAO { - static Logger logger = Logger.getLogger(VoteUploadedFileDAO.class.getName()); private static final String GET_UPLOADED_FILES = "from VoteUploadedFile voteUploadedFile where voteUploadedFile.voteContent.voteContentId = :contentId"; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUserDAO.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUserDAO.java (.../VoteUserDAO.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUserDAO.java (.../VoteUserDAO.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -42,16 +42,13 @@ private static final String COUNT_USERS_IN_SESSION = "select voteu.queUsrId from VoteQueUsr voteu where voteu.voteSession= :voteSession"; - private static final String COUNT_USERS = "select voteu.queUsrId from VoteQueUsr"; - private static final String LOAD_USER_FOR_SESSION = "from voteQueUsr in class VoteQueUsr where voteQueUsr.voteSessionId= :voteSessionId"; public VoteQueUsr getVoteUserByUID(Long uid) { String query = "from VoteQueUsr user where user.uid=?"; - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(query) .setLong(0,uid.longValue()) .list(); @@ -68,7 +65,6 @@ { String query = "from VoteQueUsr user where user.queUsrId=?"; - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(query) .setLong(0,userId.longValue()) .list(); @@ -83,7 +79,6 @@ public List getVoteUserBySessionOnly(final VoteSession voteSession) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(LOAD_USER_FOR_SESSION) .setLong("voteSessionId", voteSession.getUid().longValue()) .list(); @@ -92,7 +87,6 @@ public List getVoteUserBySessionUid(final Long voteSessionUid) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(LOAD_USER_FOR_SESSION) .setLong("voteSessionId", voteSessionUid.longValue()) .list(); @@ -101,7 +95,6 @@ public int getCompletedVoteUserBySessionUid(final Long voteSessionUid) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(LOAD_USER_FOR_SESSION) .setLong("voteSessionId", voteSessionUid.longValue()) .list(); @@ -128,7 +121,6 @@ { String strGetUser = "from voteQueUsr in class VoteQueUsr where voteQueUsr.queUsrId=:queUsrId and voteQueUsr.voteSessionId=:voteSessionId"; - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(strGetUser) .setLong("queUsrId", queUsrId.longValue()) .setLong("voteSessionId", voteSessionId.longValue()) @@ -146,7 +138,6 @@ { String query = "from VoteQueUsr user where user.queUsrId=?"; - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(query) .setLong(0,voteQueUsrId) .list(); @@ -192,7 +183,6 @@ public List getUserBySessionOnly(final VoteSession voteSession) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(LOAD_USER_FOR_SESSION) .setLong("voteSessionId", voteSession.getUid().longValue()) .list(); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java =================================================================== diff -u -racc8d2acf5b6b0002e0c8129947040a779ab4077 -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java (.../VoteUsrAttemptDAO.java) (revision acc8d2acf5b6b0002e0c8129947040a779ab4077) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/dao/hibernate/VoteUsrAttemptDAO.java (.../VoteUsrAttemptDAO.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -28,9 +28,7 @@ import java.util.List; import java.util.Set; -import org.apache.log4j.Logger; import org.hibernate.FlushMode; -import org.lamsfoundation.lams.tool.vote.dao.IVoteUserDAO; import org.lamsfoundation.lams.tool.vote.dao.IVoteUsrAttemptDAO; import org.lamsfoundation.lams.tool.vote.pojos.VoteQueUsr; import org.lamsfoundation.lams.tool.vote.pojos.VoteUsrAttempt; @@ -45,10 +43,7 @@ *

*/ public class VoteUsrAttemptDAO extends HibernateDaoSupport implements IVoteUsrAttemptDAO { - static Logger logger = Logger.getLogger(VoteUsrAttemptDAO.class.getName()); - private IVoteUserDAO voteUserDAO; - private static final String LOAD_ATTEMPT_FOR_QUE_CONTENT = "from voteUsrAttempt in class VoteUsrAttempt where voteUsrAttempt.queUsrId=:queUsrId and voteUsrAttempt.voteQueContentId=:voteQueContentId"; private static final String LOAD_ATTEMPT_FOR_USER = "from voteUsrAttempt in class VoteUsrAttempt where voteUsrAttempt.queUsrId=:queUsrId"; @@ -67,12 +62,6 @@ private static final String LOAD_DISTINCT_USER_ENTRY_RECORDS = "select distinct voteUsrAttempt.queUsrId from VoteUsrAttempt voteUsrAttempt where voteUsrAttempt.userEntry=:userEntry"; - // lfoxton about below: - // No! Very Bad programmer!!! Go to your room and think about what you did! - // private static final String LOAD_ALL_ENTRIES = "from voteUsrAttempt in class VoteUsrAttempt"; - - private static final String LOAD_DISTINCT_USER_ENTRIES = "select distinct voteUsrAttempt.queUsrId from VoteUsrAttempt voteUsrAttempt"; - private static final String COUNT_ATTEMPTS_BY_CONTENT_ID = "select count(*) from VoteUsrAttempt att, VoteQueUsr user, VoteSession ses where " + "att.voteQueUsr=user and user.voteSession=ses and " + "ses.voteContentId=:voteContentId"; @@ -89,7 +78,6 @@ public VoteUsrAttempt getAttemptByUID(Long uid) { String query = "from VoteUsrAttempt attempt where attempt.uid=?"; - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(query).setLong(0, uid.longValue()).list(); if (list != null && list.size() > 0) { @@ -104,7 +92,6 @@ } public List getAttemptsForUser(final Long queUsrId) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_USER).setLong("queUsrId", queUsrId.longValue()).list(); return list; @@ -118,7 +105,6 @@ } public Set getUserEntries() { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_USER_ENTRIES).list(); Set set = new HashSet(); @@ -128,7 +114,6 @@ Iterator listIterator = list.iterator(); while (listIterator.hasNext()) { String entry = (String) listIterator.next(); - VoteUsrAttemptDAO.logger.debug("entry: " + entry); if (entry != null && entry.length() > 0) { userEntries.add(entry); } @@ -153,7 +138,6 @@ } public int getUserRecordsEntryCount(final String userEntry) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_DISTINCT_USER_ENTRY_RECORDS).setString("userEntry", userEntry).list(); @@ -166,7 +150,6 @@ public int getSessionUserRecordsEntryCount(final String userEntry, final Long voteSessionUid, IVoteService voteService) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_DISTINCT_USER_ENTRY_RECORDS).setString("userEntry", userEntry).list(); @@ -176,10 +159,7 @@ Iterator listIterator = list.iterator(); while (listIterator.hasNext()) { Long userId = (Long) listIterator.next(); - VoteUsrAttemptDAO.logger.debug("userId: " + userId); - VoteUsrAttemptDAO.logger.debug("voteService: " + voteService); VoteQueUsr voteQueUsr = voteService.getVoteUserByUID(userId); - VoteUsrAttemptDAO.logger.debug("voteQueUsr: " + voteQueUsr); if (voteQueUsr.getVoteSession().getUid().toString().equals(voteSessionUid.toString())) { ++entryCount; @@ -225,7 +205,6 @@ } public int getAttemptsForQuestionContent(final Long voteQueContentId) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_QUESTION_CONTENT).setLong( "voteQueContentId", voteQueContentId.longValue()).list(); @@ -237,7 +216,6 @@ } public int getStandardAttemptsForQuestionContentAndSessionUid(final Long voteQueContentId, final Long voteSessionUid) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_QUESTION_CONTENT).setLong( "voteQueContentId", voteQueContentId.longValue()).list(); @@ -257,7 +235,6 @@ public List getStandardAttemptUsersForQuestionContentAndSessionUid(final Long voteQueContentId, final Long voteSessionUid) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_QUESTION_CONTENT).setLong( "voteQueContentId", voteQueContentId.longValue()).list(); @@ -276,7 +253,6 @@ } public boolean isVoteVisibleForSession(final String userEntry, final Long voteSessionUid) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_USER_ENTRY_RECORDS).setString("userEntry", userEntry).list(); @@ -285,10 +261,8 @@ Iterator listIterator = list.iterator(); while (listIterator.hasNext()) { VoteUsrAttempt attempt = (VoteUsrAttempt) listIterator.next(); - VoteUsrAttemptDAO.logger.debug("attempt: " + attempt); if (attempt.getVoteQueUsr().getVoteSession().getUid().toString().equals(voteSessionUid.toString())) { boolean isVoteVisible = attempt.isVisible(); - VoteUsrAttemptDAO.logger.debug("isVoteVisible: " + isVoteVisible); if (isVoteVisible == false) { return false; } @@ -300,7 +274,6 @@ } public int getStandardAttemptsForQuestionContentAndContentUid(final Long voteQueContentId, final Long voteContentUid) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_QUESTION_CONTENT).setLong( "voteQueContentId", voteQueContentId.longValue()).list(); @@ -321,7 +294,6 @@ } public List getAttemptsForUserAndQuestionContent(final Long queUsrId, final Long voteQueContentId) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_USER_AND_QUESTION_CONTENT).setLong( "queUsrId", queUsrId.longValue()).setLong("voteQueContentId", voteQueContentId.longValue()).list(); @@ -330,7 +302,6 @@ public VoteUsrAttempt getAttemptsForUserAndQuestionContentAndSession(final Long queUsrId, final Long voteQueContentId, final Long voteSessionId) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_USER_AND_QUESTION_CONTENT_AND_SESSION) .setLong("queUsrId", queUsrId.longValue()).setLong("voteQueContentId", voteQueContentId.longValue()) .list(); @@ -339,7 +310,6 @@ Iterator listIterator = list.iterator(); while (listIterator.hasNext()) { VoteUsrAttempt attempt = (VoteUsrAttempt) listIterator.next(); - VoteUsrAttemptDAO.logger.debug("attempt: " + attempt); if (attempt.getVoteQueUsr().getVoteSession().getUid().toString().equals(voteSessionId.toString())) { return attempt; } @@ -349,63 +319,46 @@ } public Set getAttemptsForUserAndSession(final Long queUsrId, final Long voteSessionId) { - VoteUsrAttemptDAO.logger.debug("starting getAttemptsForUserAndSession"); - VoteUsrAttemptDAO.logger.debug("queUsrId: " + queUsrId); - VoteUsrAttemptDAO.logger.debug("voteSessionId: " + voteSessionId); - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_USER_AND_SESSION).setLong("queUsrId", queUsrId.longValue()).list(); - VoteUsrAttemptDAO.logger.debug("list: " + list); Set userEntries = new HashSet(); if (list != null && list.size() > 0) { Iterator listIterator = list.iterator(); while (listIterator.hasNext()) { VoteUsrAttempt attempt = (VoteUsrAttempt) listIterator.next(); - VoteUsrAttemptDAO.logger.debug("attempt: " + attempt); if (attempt.getVoteQueUsr().getVoteSession().getUid().toString().equals(voteSessionId.toString())) { if (!attempt.getVoteQueContentId().toString().equals("1")) { - VoteUsrAttemptDAO.logger.debug("adding attempt question : " - + attempt.getVoteQueContent().getQuestion()); userEntries.add(attempt.getVoteQueContent().getQuestion()); } } } } - VoteUsrAttemptDAO.logger.debug("returning userEntries: " + userEntries); return userEntries; } public Set getAttemptsForUserAndSessionUseOpenAnswer(final Long queUsrId, final Long voteSessionId) { - VoteUsrAttemptDAO.logger.debug("starting getAttemptsForUserAndSession"); - VoteUsrAttemptDAO.logger.debug("queUsrId: " + queUsrId); - VoteUsrAttemptDAO.logger.debug("voteSessionId: " + voteSessionId); - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_USER_AND_SESSION).setLong("queUsrId", queUsrId.longValue()).list(); - VoteUsrAttemptDAO.logger.debug("list: " + list); String openAnswer = ""; Set userEntries = new HashSet(); if (list != null && list.size() > 0) { Iterator listIterator = list.iterator(); while (listIterator.hasNext()) { VoteUsrAttempt attempt = (VoteUsrAttempt) listIterator.next(); - VoteUsrAttemptDAO.logger.debug("attempt: " + attempt); if (attempt.getVoteQueUsr().getVoteSession().getUid().toString().equals(voteSessionId.toString())) { if (!attempt.getVoteQueContentId().toString().equals("1")) { - VoteUsrAttemptDAO.logger.debug("adding attempt question : " - + attempt.getVoteQueContent().getQuestion()); userEntries.add(attempt.getVoteQueContent().getQuestion()); } else { - VoteUsrAttemptDAO.logger.debug("this is a user entered vote: " + attempt.getUserEntry()); + //this is a user entered vote if (attempt.getUserEntry().length() > 0) { openAnswer = attempt.getUserEntry(); - VoteUsrAttemptDAO.logger.debug("adding openAnswer to userEntries: "); + //adding openAnswer to userEntries userEntries.add(openAnswer); } @@ -414,13 +367,10 @@ } } } - - VoteUsrAttemptDAO.logger.debug("final userEntries : " + userEntries); return userEntries; } public List getAttemptsListForUserAndQuestionContent(final Long queUsrId, final Long voteQueContentId) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_USER_AND_QUESTION_CONTENT).setLong( "queUsrId", queUsrId.longValue()).setLong("voteQueContentId", voteQueContentId.longValue()).list(); return list; @@ -431,21 +381,18 @@ } public List getAttemptForQueContent(final Long queUsrId, final Long voteQueContentId) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_ATTEMPT_FOR_QUE_CONTENT).setLong("queUsrId", queUsrId.longValue()).setLong("voteQueContentId", voteQueContentId.longValue()).list(); return list; } public List getUserRecords(final String userEntry) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_USER_ENTRY_RECORDS).setString("userEntry", userEntry).list(); return list; } public List getUserEnteredVotesForSession(final String userEntry, final Long voteSessionUid) { - HibernateTemplate templ = this.getHibernateTemplate(); List list = getSession().createQuery(VoteUsrAttemptDAO.LOAD_USER_ENTRY_RECORDS).setString("userEntry", userEntry).list(); @@ -454,7 +401,6 @@ Iterator listIterator = list.iterator(); while (listIterator.hasNext()) { VoteUsrAttempt attempt = (VoteUsrAttempt) listIterator.next(); - VoteUsrAttemptDAO.logger.debug("attempt: " + attempt); if (attempt.getVoteQueUsr().getVoteSession().getUid().toString().equals(voteSessionUid.toString())) { sessionUserEntries.add(attempt.getUserEntry()); } @@ -466,7 +412,6 @@ public int getSessionEntriesCount(final Long voteSessionUid) { List result = getSession().createQuery(VoteUsrAttemptDAO.COUNT_ENTRIES_BY_SESSION_ID).setLong("voteSessionUid", voteSessionUid).list(); - VoteUsrAttemptDAO.logger.debug("getSessionEntriesCount: " + result); Long resultLong = result.get(0) != null ? (Long) result.get(0) : new Long(0); return resultLong.intValue(); } @@ -476,10 +421,9 @@ int completedSessionCount = 0; for (VoteUsrAttempt att : list) { String sessionStatus = att.getVoteQueUsr().getVoteSession().getSessionStatus(); - VoteUsrAttemptDAO.logger.debug("this is a completed session: " + sessionStatus); + //this is a completed session ++completedSessionCount; } - VoteUsrAttemptDAO.logger.debug("getCompletedSessionEntriesCount" + completedSessionCount); return completedSessionCount; } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteContent.java =================================================================== diff -u -r524420e39b3fe8707f81c4bc602b205cff29f0f8 -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteContent.java (.../VoteContent.java) (revision 524420e39b3fe8707f81c4bc602b205cff29f0f8) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteContent.java (.../VoteContent.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -29,7 +29,6 @@ import java.util.TreeSet; import org.apache.commons.lang.builder.ToStringBuilder; -import org.apache.log4j.Logger; import org.lamsfoundation.lams.contentrepository.ItemNotFoundException; import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; @@ -43,7 +42,6 @@ * @author Ozgur Demirtas */ public class VoteContent implements Serializable { - static Logger logger = Logger.getLogger(VoteContent.class.getName()); /** identifier field */ private Long uid; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueContent.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueContent.java (.../VoteQueContent.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteQueContent.java (.../VoteQueContent.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -29,7 +29,6 @@ import java.util.TreeSet; import org.apache.commons.lang.builder.ToStringBuilder; -import org.apache.log4j.Logger; /** @@ -41,7 +40,6 @@ * @author Ozgur Demirtas */ public class VoteQueContent implements Serializable, Comparable { - static Logger logger = Logger.getLogger(VoteQueContent.class.getName()); /** identifier field */ private Long uid; @@ -208,18 +206,6 @@ this.voteContentId = voteContentId; } /** - * @return Returns the logger. - */ - public static Logger getLogger() { - return logger; - } - /** - * @param logger The logger to set. - */ - public static void setLogger(Logger logger) { - VoteQueContent.logger = logger; - } - /** * @return Returns the voteContent. */ public org.lamsfoundation.lams.tool.vote.pojos.VoteContent getVoteContent() { Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUploadedFile.java =================================================================== diff -u -r6469a3c8ad3e545e2f1929947d3c46b040896632 -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUploadedFile.java (.../VoteUploadedFile.java) (revision 6469a3c8ad3e545e2f1929947d3c46b040896632) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUploadedFile.java (.../VoteUploadedFile.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -28,9 +28,7 @@ import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.commons.lang.builder.ToStringBuilder; -import org.apache.log4j.Logger; import org.lamsfoundation.lams.contentrepository.ItemNotFoundException; -import org.lamsfoundation.lams.contentrepository.NodeKey; import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; @@ -44,7 +42,6 @@ */ public class VoteUploadedFile implements Serializable, Comparable { - static Logger logger = Logger.getLogger(VoteUploadedFile.class.getName()); /** identifier field */ private Long submissionId; @@ -99,7 +96,6 @@ String fileName, VoteContent voteContent) { - logger.debug("constructor gets called."); this.uuid = uuid; this.fileOnline = fileOnline; this.fileName = fileName; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java =================================================================== diff -u -re7c872d97ed5a450f72cfa57325f7d37280efcde -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java (.../VoteServicePOJO.java) (revision e7c872d97ed5a450f72cfa57325f7d37280efcde) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java (.../VoteServicePOJO.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -138,14 +138,10 @@ } public void configureContentRepository() throws VoteApplicationException { - VoteServicePOJO.logger.debug("retrieved repService: " + repositoryService); cred = new SimpleCredentials(repositoryUser, repositoryId); - VoteServicePOJO.logger.debug("retrieved cred: " + cred); try { repositoryService.createCredentials(cred); - VoteServicePOJO.logger.debug("created credentails."); repositoryService.addWorkspace(cred, VoteServicePOJO.repositoryWorkspaceName); - VoteServicePOJO.logger.debug("created workspace."); } catch (ItemExistsException ie) { VoteServicePOJO.logger.warn("Tried to configure repository but it " + " appears to be already configured. Exception thrown by repository being ignored. ", ie); @@ -159,7 +155,6 @@ public void createVote(VoteContent voteContent) throws VoteApplicationException { try { - VoteServicePOJO.logger.debug("using voteContent defineLater:" + voteContent.isDefineLater()); voteContentDAO.saveVoteContent(voteContent); } catch (DataAccessException e) { throw new VoteApplicationException("Exception occured when lams is creating vote content: " @@ -837,7 +832,6 @@ * logs hiding of a user entered vote */ public void hideOpenVote(VoteUsrAttempt voteUsrAttempt) throws VoteApplicationException { - VoteServicePOJO.logger.debug("hiding user entry: " + voteUsrAttempt.getUserEntry()); auditService.logHideEntry(VoteAppConstants.MY_SIGNATURE, voteUsrAttempt.getQueUsrId(), voteUsrAttempt .getVoteQueUsr().getUsername(), voteUsrAttempt.getUserEntry()); } @@ -846,7 +840,6 @@ * logs showing of a user entered vote */ public void showOpenVote(VoteUsrAttempt voteUsrAttempt) throws VoteApplicationException { - VoteServicePOJO.logger.debug("showing user entry: " + voteUsrAttempt.getUserEntry()); auditService.logShowEntry(VoteAppConstants.MY_SIGNATURE, voteUsrAttempt.getQueUsrId(), voteUsrAttempt .getVoteQueUsr().getUsername(), voteUsrAttempt.getUserEntry()); } @@ -889,7 +882,6 @@ public User getCurrentUserData(String username) throws VoteApplicationException { try { - VoteServicePOJO.logger.debug("getCurrentUserData: " + username); /** * this will return null if the username not found */ @@ -946,14 +938,12 @@ * @throws VoteApplicationException */ public boolean studentActivityOccurredGlobal(VoteContent voteContent) throws VoteApplicationException { - VoteServicePOJO.logger.debug("voteContent uid: " + voteContent.getUid()); Iterator questionIterator = voteContent.getVoteQueContents().iterator(); while (questionIterator.hasNext()) { VoteQueContent voteQueContent = (VoteQueContent) questionIterator.next(); Iterator attemptsIterator = voteQueContent.getVoteUsrAttempts().iterator(); while (attemptsIterator.hasNext()) { - VoteServicePOJO.logger.debug("there is at least one attempt for the standard nominamtions"); /** * proved the fact that there is at least one attempt for this content. */ @@ -964,18 +954,14 @@ } public boolean studentActivityOccurredStandardAndOpen(VoteContent voteContent) throws VoteApplicationException { - VoteServicePOJO.logger.debug("voteContent uid: " + voteContent.getUid()); boolean studentActivityOccurredGlobal = studentActivityOccurredGlobal(voteContent); - VoteServicePOJO.logger.debug("studentActivityOccurredGlobal: " + studentActivityOccurredGlobal); int userEnteredVotesCount = getUserEnteredVotesCountForContent(voteContent.getUid()); - VoteServicePOJO.logger.debug("userEnteredVotesCount: " + userEnteredVotesCount); - if (studentActivityOccurredGlobal == true || userEnteredVotesCount > 0) { return true; } - VoteServicePOJO.logger.debug("there is no votes/nominations for this content"); + //there is no votes/nominations for this content return false; } @@ -1015,12 +1001,9 @@ * */ public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException { - VoteServicePOJO.logger.debug("start of copyToolContent with ids: " + fromContentId + " and " + toContentId); if (fromContentId == null) { - VoteServicePOJO.logger.error("fromContentId is null."); - VoteServicePOJO.logger.debug("attempt retrieving tool's default content id with signatute : " - + VoteAppConstants.MY_SIGNATURE); + //attempt retrieving tool's default content id with signatute VoteAppConstants.MY_SIGNATURE long defaultContentId = 0; try { defaultContentId = getToolDefaultContentIdBySignature(VoteAppConstants.MY_SIGNATURE); @@ -1037,15 +1020,12 @@ VoteServicePOJO.logger.error("throwing ToolException: toContentId is null"); throw new ToolException("toContentId is missing"); } - VoteServicePOJO.logger.debug("final - copyToolContent using ids: " + fromContentId + " and " + toContentId); try { VoteContent fromContent = voteContentDAO.findVoteContentById(fromContentId); if (fromContent == null) { - VoteServicePOJO.logger.error("fromContent is null."); - VoteServicePOJO.logger.error("attempt retrieving tool's default content id with signatute : " - + VoteAppConstants.MY_SIGNATURE); + //attempt retrieving tool's default content id with signatute VoteAppConstants.MY_SIGNATURE long defaultContentId = 0; try { defaultContentId = getToolDefaultContentIdBySignature(VoteAppConstants.MY_SIGNATURE); @@ -1058,26 +1038,16 @@ } fromContent = voteContentDAO.findVoteContentById(fromContentId); - VoteServicePOJO.logger.debug("using fromContent: " + fromContent); } - VoteServicePOJO.logger.debug("final - retrieved fromContent: " + fromContent); - VoteServicePOJO.logger.debug("final - before new instance using " + fromContent + " and " + toContentId); - VoteServicePOJO.logger.debug("final - before new instance using voteToolContentHandler: " - + voteToolContentHandler); - try { VoteContent toContent = VoteContent.newInstance(voteToolContentHandler, fromContent, toContentId); if (toContent == null) { - VoteServicePOJO.logger.debug("throwing ToolException: WARNING!, retrieved toContent is null."); + VoteServicePOJO.logger.error("throwing ToolException: WARNING!, retrieved toContent is null."); throw new ToolException("WARNING! Fail to create toContent. Can't continue!"); } else { - VoteServicePOJO.logger.debug("retrieved toContent: " + toContent); voteContentDAO.saveVoteContent(toContent); - VoteServicePOJO.logger.debug("toContent has been saved successfully: " + toContent); } - VoteServicePOJO.logger.debug("end of copyToolContent with ids: " + fromContentId + " and " - + toContentId); } catch (ItemNotFoundException e) { VoteServicePOJO.logger.error("exception occurred: " + e); @@ -1093,7 +1063,6 @@ /** * implemented as part of the tool contract. Removes content and uploaded files from the content repository. - * removeToolContent(Long toolContentID, boolean removeSessionData) throws SessionDataExistsException, ToolException * * @param toContentId * @param removeSessionData @@ -1102,24 +1071,18 @@ */ public void removeToolContent(Long toolContentID, boolean removeSessionData) throws SessionDataExistsException, ToolException { - VoteServicePOJO.logger.debug("start of removeToolContent with toolContentID: " + toolContentID - + "removeSessionData: " + removeSessionData); if (toolContentID == null) { VoteServicePOJO.logger.error("toolContentID is null"); throw new ToolException("toolContentID is missing"); } VoteContent voteContent = voteContentDAO.findVoteContentById(toolContentID); - VoteServicePOJO.logger.debug("retrieving voteContent: " + voteContent); if (voteContent != null) { - VoteServicePOJO.logger - .error("start deleting any uploaded file for this content from the content repository"); Iterator filesIterator = voteContent.getVoteAttachments().iterator(); while (filesIterator.hasNext()) { VoteUploadedFile voteUploadedFile = (VoteUploadedFile) filesIterator.next(); - VoteServicePOJO.logger.debug("iterated voteUploadedFile : " + voteUploadedFile); String filesUuid = voteUploadedFile.getUuid(); if (filesUuid != null && filesUuid.length() > 0) { try { @@ -1130,36 +1093,29 @@ } } } - VoteServicePOJO.logger.debug("end deleting any uploaded files for this content."); Iterator sessionIterator = voteContent.getVoteSessions().iterator(); while (sessionIterator.hasNext()) { if (removeSessionData == false) { - VoteServicePOJO.logger.debug("removeSessionData is false, throwing SessionDataExistsException."); + VoteServicePOJO.logger.error("removeSessionData is false, throwing SessionDataExistsException."); throw new SessionDataExistsException(); } VoteSession voteSession = (VoteSession) sessionIterator.next(); - VoteServicePOJO.logger.debug("iterated voteSession : " + voteSession); Iterator sessionUsersIterator = voteSession.getVoteQueUsers().iterator(); while (sessionUsersIterator.hasNext()) { VoteQueUsr voteQueUsr = (VoteQueUsr) sessionUsersIterator.next(); - VoteServicePOJO.logger.debug("iterated voteQueUsr : " + voteQueUsr); Iterator sessionUsersAttemptsIterator = voteQueUsr.getVoteUsrAttempts().iterator(); while (sessionUsersAttemptsIterator.hasNext()) { VoteUsrAttempt voteUsrAttempt = (VoteUsrAttempt) sessionUsersAttemptsIterator.next(); - VoteServicePOJO.logger.debug("iterated voteUsrAttempt : " + voteUsrAttempt); removeAttempt(voteUsrAttempt); - VoteServicePOJO.logger.debug("removed voteUsrAttempt : " + voteUsrAttempt); } } } - VoteServicePOJO.logger.debug("removed all existing responses of toolContent with toolContentID:" - + toolContentID); + //removed all existing responses of toolContent with toolContentID voteContentDAO.removeVoteById(toolContentID); - VoteServicePOJO.logger.debug("removed voteContent:" + voteContent); } else { VoteServicePOJO.logger.error("Warning!!!, We should have not come here. voteContent is null."); throw new ToolException("toolContentID is missing"); @@ -1298,8 +1254,6 @@ if (voteSession == null) { VoteServicePOJO.logger.error("voteSession does not exist yet: " + toolSessionID); return false; - } else { - VoteServicePOJO.logger.debug("retrieving an existing voteSession: " + voteSession + " " + toolSessionID); } return true; } @@ -1319,8 +1273,6 @@ * */ public void createToolSession(Long toolSessionID, String toolSessionName, Long toolContentID) throws ToolException { - VoteServicePOJO.logger.debug("start of createToolSession with ids: " + toolSessionID + " and " + toolContentID); - VoteServicePOJO.logger.debug("toolSessionName: " + toolSessionName); if (toolSessionID == null) { VoteServicePOJO.logger.error("toolSessionID is null"); @@ -1329,35 +1281,25 @@ long defaultContentId = 0; if (toolContentID == null) { - VoteServicePOJO.logger.error("toolContentID is null."); - VoteServicePOJO.logger.error("attempt retrieving tool's default content id with signatute : " - + VoteAppConstants.MY_SIGNATURE); try { defaultContentId = getToolDefaultContentIdBySignature(VoteAppConstants.MY_SIGNATURE); toolContentID = new Long(defaultContentId); - VoteServicePOJO.logger.debug("updated toolContentID to: " + toolContentID); } catch (Exception e) { VoteServicePOJO.logger.error("default content id has not been setup for signature: " + VoteAppConstants.MY_SIGNATURE); throw new ToolException("WARNING! default content has not been setup for signature" + VoteAppConstants.MY_SIGNATURE + " Can't continue!"); } } - VoteServicePOJO.logger.debug("final toolSessionID and toolContentID: " + toolSessionID + " " + toolContentID); VoteContent voteContent = voteContentDAO.findVoteContentById(toolContentID); - VoteServicePOJO.logger.debug("retrieved voteContent: " + voteContent); if (voteContent == null) { - VoteServicePOJO.logger.error("voteContent is null."); - VoteServicePOJO.logger.error("attempt retrieving tool's default content id with signatute : " - + VoteAppConstants.MY_SIGNATURE); try { defaultContentId = getToolDefaultContentIdBySignature(VoteAppConstants.MY_SIGNATURE); toolContentID = new Long(defaultContentId); - VoteServicePOJO.logger.debug("updated toolContentID to: " + toolContentID); } catch (Exception e) { VoteServicePOJO.logger.error("default content id has not been setup for signature: " + VoteAppConstants.MY_SIGNATURE); @@ -1367,7 +1309,6 @@ voteContent = voteContentDAO.findVoteContentById(toolContentID); } - VoteServicePOJO.logger.debug("final - retrieved voteContent: " + voteContent); /* * create a new a new tool session if it does not already exist in the tool session table @@ -1377,9 +1318,7 @@ VoteSession voteSession = new VoteSession(toolSessionID, new Date(System.currentTimeMillis()), VoteSession.INCOMPLETE, toolSessionName, voteContent, new TreeSet()); - VoteServicePOJO.logger.debug("created voteSession: " + voteSession); voteSessionDAO.saveVoteSession(voteSession); - VoteServicePOJO.logger.debug("created voteSession in the db: " + voteSession); } catch (Exception e) { VoteServicePOJO.logger.error("Error creating new toolsession in the db"); @@ -1389,16 +1328,14 @@ } /** - * Implemented as part of the tool contract. removeToolSession(Long toolSessionID) throws DataMissingException, - * ToolException + * Implemented as part of the tool contract. * * @param toolSessionID * @param toolContentID * return * @throws ToolException */ public void removeToolSession(Long toolSessionID) throws DataMissingException, ToolException { - VoteServicePOJO.logger.debug("start of removeToolSession with id: " + toolSessionID); if (toolSessionID == null) { VoteServicePOJO.logger.error("toolSessionID is null"); throw new DataMissingException("toolSessionID is missing"); @@ -1407,7 +1344,6 @@ VoteSession voteSession = null; try { voteSession = retrieveVoteSession(toolSessionID); - VoteServicePOJO.logger.debug("retrieved voteSession: " + voteSession); } catch (VoteApplicationException e) { throw new DataMissingException("error retrieving voteSession: " + e); } catch (Exception e) { @@ -1421,15 +1357,13 @@ try { voteSessionDAO.removeVoteSession(voteSession); - VoteServicePOJO.logger.debug("voteSession " + voteSession + " has been deleted successfully."); } catch (VoteApplicationException e) { throw new ToolException("error deleting voteSession:" + e); } } /** - * Implemtented as part of the tool contract. leaveToolSession(Long toolSessionID,Long learnerId) throws - * DataMissingException, ToolException + * Implemtented as part of the tool contract. * * @param toolSessionID * @param learnerId @@ -1438,9 +1372,6 @@ * */ public String leaveToolSession(Long toolSessionID, Long learnerId) throws DataMissingException, ToolException { - VoteServicePOJO.logger.debug("start of leaveToolSession with toolSessionID:" + toolSessionID - + " and learnerId:" + learnerId); - VoteServicePOJO.logger.debug("make sure learnerService is available. Is it?" + learnerService); if (learnerService == null) { return "dummyNextUrl"; @@ -1459,18 +1390,15 @@ VoteSession voteSession = null; try { voteSession = retrieveVoteSession(toolSessionID); - VoteServicePOJO.logger.debug("retrieved voteSession: " + voteSession); } catch (VoteApplicationException e) { throw new DataMissingException("error retrieving voteSession: " + e); } catch (Exception e) { throw new ToolException("error retrieving voteSession: " + e); } voteSession.setSessionStatus(VoteAppConstants.COMPLETED); voteSessionDAO.updateVoteSession(voteSession); - VoteServicePOJO.logger.debug("updated voteSession to COMPLETED" + voteSession); String nextUrl = learnerService.completeToolSession(toolSessionID, learnerId); - VoteServicePOJO.logger.debug("nextUrl: " + nextUrl); if (nextUrl == null) { VoteServicePOJO.logger.error("nextUrl is null"); throw new ToolException("nextUrl is null"); @@ -1503,27 +1431,22 @@ } public IToolVO getToolBySignature(String toolSignature) throws VoteApplicationException { - VoteServicePOJO.logger.debug("attempt retrieving tool with signature : " + toolSignature); IToolVO tool = toolService.getToolBySignature(toolSignature); - VoteServicePOJO.logger.debug("retrieved tool: " + tool); return tool; } public long getToolDefaultContentIdBySignature(String toolSignature) throws VoteApplicationException { long contentId = 0; contentId = toolService.getToolDefaultContentIdBySignature(toolSignature); - VoteServicePOJO.logger.debug("tool default contentId : " + contentId); return contentId; } public VoteQueContent getToolDefaultQuestionContent(long contentId) throws VoteApplicationException { VoteQueContent voteQueContent = voteQueContentDAO.getToolDefaultQuestionContent(contentId); - VoteServicePOJO.logger.debug("retrieved voteQueContent : " + voteQueContent); return voteQueContent; } public List getToolSessionsForContent(VoteContent vote) { - VoteServicePOJO.logger.debug("attempt retrieving listToolSessionIds for : " + vote); List listToolSessionIds = voteSessionDAO.getSessionsFromContent(vote); return listToolSessionIds; } @@ -1563,7 +1486,6 @@ ICredentials credentials = new SimpleCredentials(repositoryUser, repositoryId); try { ITicket ticket = repositoryService.login(credentials, VoteServicePOJO.repositoryWorkspaceName); - VoteServicePOJO.logger.debug("retrieved ticket: " + ticket); return ticket; } catch (AccessDeniedException e) { throw new VoteApplicationException("Access Denied to repository." + e.getMessage()); @@ -1586,10 +1508,8 @@ */ public void deleteFromRepository(Long uuid, Long versionID) throws VoteApplicationException { ITicket ticket = getRepositoryLoginTicket(); - VoteServicePOJO.logger.debug("retrieved ticket: " + ticket); try { String files[] = repositoryService.deleteVersion(ticket, uuid, versionID); - VoteServicePOJO.logger.debug("retrieved files: " + files); } catch (Exception e) { throw new VoteApplicationException("Exception occured while deleting files from" + " the repository " + e.getMessage()); @@ -1611,13 +1531,10 @@ * @throws SubmitFilesException */ public NodeKey uploadFileToRepository(InputStream stream, String fileName) throws VoteApplicationException { - VoteServicePOJO.logger.debug("attempt getting the ticket"); ITicket ticket = getRepositoryLoginTicket(); - VoteServicePOJO.logger.debug("retrieved ticket: " + ticket); try { NodeKey nodeKey = repositoryService.addFileItem(ticket, stream, fileName, null, null); - VoteServicePOJO.logger.debug("retrieved nodeKey from repository service: " + nodeKey); return nodeKey; } catch (Exception e) { throw new VoteApplicationException("Exception occured while trying to" + " upload file into the repository" @@ -1629,7 +1546,6 @@ ITicket ticket = getRepositoryLoginTicket(); try { IVersionedNode node = repositoryService.getFileItem(ticket, uuid, null); - VoteServicePOJO.logger.debug("retrieved node: " + node); return node.getFile(); } catch (AccessDeniedException e) { throw new VoteApplicationException("AccessDeniedException occured while trying to download file " @@ -1648,22 +1564,16 @@ public void persistFile(String uuid, boolean isOnlineFile, String fileName, VoteContent voteContent) throws VoteApplicationException { - VoteServicePOJO.logger.debug("attempt persisting file to the db: " + uuid + " " + isOnlineFile + " " + fileName - + " " + voteContent); VoteUploadedFile voteUploadedFile = new VoteUploadedFile(uuid, isOnlineFile, fileName, voteContent); - VoteServicePOJO.logger.debug("created voteUploadedFile: " + voteUploadedFile); voteUploadedFileDAO.saveUploadFile(voteUploadedFile); - VoteServicePOJO.logger.debug("persisted voteUploadedFile: " + voteUploadedFile); } /** * * removes all the entries in the uploaded files table */ public void cleanUploadedFilesMetaData() throws VoteApplicationException { - VoteServicePOJO.logger.debug("attempt cleaning up uploaded file meta data table from the db"); voteUploadedFileDAO.cleanUploadedFilesMetaData(); - VoteServicePOJO.logger.debug("files meta data has been cleaned up"); } public boolean isGroupedActivity(long toolContentID) { @@ -1796,7 +1706,6 @@ } public Long createNotebookEntry(Long id, Integer idType, String signature, Integer userID, String entry) { - VoteServicePOJO.logger.debug("coreNotebookService: " + coreNotebookService); return coreNotebookService.createNotebookEntry(id, idType, signature, userID, "", entry); } @@ -1821,15 +1730,12 @@ public void removeFile(Long submissionId) throws VoteApplicationException { voteUploadedFileDAO.removeUploadFile(submissionId); - VoteServicePOJO.logger.debug("removed voteUploadedFile: " + submissionId); } public void persistFile(VoteContent content, VoteUploadedFile file) throws VoteApplicationException { - VoteServicePOJO.logger.debug("in persistFile: " + file); content.getVoteAttachments().add(file); file.setVoteContent(content); voteContentDAO.saveOrUpdateVote(content); - VoteServicePOJO.logger.debug("persisted voteUploadedFile: " + file); } @@ -1843,13 +1749,6 @@ } /** - * @return Returns the logger. - */ - public static Logger getLogger() { - return VoteServicePOJO.logger; - } - - /** * @return Returns the cred. */ public ICredentials getCred() { @@ -2126,14 +2025,6 @@ } /** - * @param logger - * The logger to set. - */ - public static void setLogger(Logger logger) { - VoteServicePOJO.logger = logger; - } - - /** * @return Returns the auditService. */ public IAuditService getAuditService() { Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java =================================================================== diff -u -r618abc7cca98f08ef288878ab371a3693492d835 -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 618abc7cca98f08ef288878ab371a3693492d835) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -64,8 +64,9 @@ * */ public class AuthoringUtil implements VoteAppConstants { - static Logger logger = Logger.getLogger(AuthoringUtil.class.getName()); + static private Logger logger = Logger.getLogger(AuthoringUtil.class.getName()); + /** * checks if there are any duplicate entries * @@ -79,7 +80,6 @@ int optionCount = 0; for (long i = 1; i <= VoteAppConstants.MAX_OPTION_COUNT; i++) { String currentOption = (String) originalMapOptionsContent.get(new Long(i).toString()); - AuthoringUtil.logger.debug("verified currentOption " + currentOption); optionCount = 0; for (long j = 1; j <= VoteAppConstants.MAX_OPTION_COUNT; j++) { @@ -88,7 +88,6 @@ if (currentOption != null && backedOption != null) { if (currentOption.equals(backedOption)) { optionCount++; - AuthoringUtil.logger.debug("optionCount for " + currentOption + " is: " + optionCount); } if (optionCount > 1) { @@ -110,7 +109,6 @@ Iterator itMap = map.entrySet().iterator(); while (itMap.hasNext()) { Map.Entry pairs = (Map.Entry) itMap.next(); - AuthoringUtil.logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue()); if (pairs.getValue() != null && pairs.getValue().toString().length() == 0) { return false; @@ -124,7 +122,6 @@ Iterator itMap = mapNominationsContent.entrySet().iterator(); while (itMap.hasNext()) { Map.Entry pairs = (Map.Entry) itMap.next(); - AuthoringUtil.logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue()); if (pairs.getValue() != null && pairs.getValue().toString().length() == 0) { return false; @@ -136,11 +133,9 @@ public static Map repopulateMap(HttpServletRequest request, String parameterType) { Map mapTempNominationsContent = new TreeMap(new VoteComparator()); - AuthoringUtil.logger.debug("parameterType: " + parameterType); long mapCounter = 0; String optionContent0 = request.getParameter("optionContent0"); - AuthoringUtil.logger.debug("optionContent0: " + optionContent0); mapCounter++; mapTempNominationsContent.put(new Long(mapCounter).toString(), optionContent0); @@ -151,43 +146,37 @@ mapTempNominationsContent.put(new Long(mapCounter).toString(), candidateEntry); } } - AuthoringUtil.logger.debug("return repopulated Map: " + mapTempNominationsContent); return mapTempNominationsContent; } public static Map shiftMap(Map mapOptionsContent, String optIndex, String movableOptionEntry, String direction) { - AuthoringUtil.logger.debug("movableOptionEntry: " + movableOptionEntry); Map mapTempOptionsContent = new TreeMap(new VoteComparator()); String shiftableEntry = null; int shiftableIndex = 0; if (direction.equals("down")) { - AuthoringUtil.logger.debug("moving map down"); + //moving map down"); shiftableIndex = new Integer(optIndex).intValue() + 1; } else { - AuthoringUtil.logger.debug("moving map up"); + //moving map up shiftableIndex = new Integer(optIndex).intValue() - 1; } - AuthoringUtil.logger.debug("shiftableIndex: " + shiftableIndex); shiftableEntry = (String) mapOptionsContent.get(new Integer(shiftableIndex).toString()); - AuthoringUtil.logger.debug("shiftable entry: " + shiftableEntry); if (shiftableEntry != null) { Iterator itNominationsMap = mapOptionsContent.entrySet().iterator(); long mapCounter = 0; while (itNominationsMap.hasNext()) { Map.Entry pairs = (Map.Entry) itNominationsMap.next(); - AuthoringUtil.logger.debug("comparing the pair: " + pairs.getKey() + " = " + pairs.getValue()); mapCounter++; - AuthoringUtil.logger.debug("mapCounter: " + mapCounter); if (!pairs.getKey().equals(optIndex) && !pairs.getKey().equals(new Integer(shiftableIndex).toString())) { - AuthoringUtil.logger.debug("normal copy " + optIndex); + //normal copy mapTempOptionsContent.put(new Long(mapCounter).toString(), pairs.getValue()); } else if (pairs.getKey().equals(optIndex)) { - AuthoringUtil.logger.debug("move type 1 " + optIndex); + //move type 1 mapTempOptionsContent.put(new Long(mapCounter).toString(), shiftableEntry); } else if (pairs.getKey().equals(new Integer(shiftableIndex).toString())) { mapTempOptionsContent.put(new Long(mapCounter).toString(), movableOptionEntry); @@ -212,8 +201,6 @@ public static VoteAttachmentDTO uploadFile(HttpServletRequest request, IVoteService voteService, VoteAuthoringForm voteAuthoringForm, boolean isOfflineFile, SessionMap sessionMap) throws RepositoryCheckedException { - AuthoringUtil.logger.debug("doing uploadFile...: " + sessionMap); - AuthoringUtil.logger.debug("isOfflineFile:" + isOfflineFile); InputStream stream = null; String fileName = null; @@ -222,44 +209,37 @@ if (isOfflineFile) { FormFile theOfflineFile = voteAuthoringForm.getTheOfflineFile(); - AuthoringUtil.logger.debug("retrieved theOfflineFile: " + theOfflineFile); try { stream = theOfflineFile.getInputStream(); fileName = theOfflineFile.getFileName(); if (fileName.length() == 0) { return null; } - AuthoringUtil.logger.debug("retrieved fileName: " + fileName); fileProperty = "OFFLINE"; } catch (FileNotFoundException e) { AuthoringUtil.logger - .debug("filenotfound exception occured in accessing the repository server for the offline file : " + .error("filenotfound exception occured in accessing the repository server for the offline file : " + e.getMessage()); } catch (IOException e) { AuthoringUtil.logger - .debug("io exception occured in accessing the repository server for the offline file : " + .error("io exception occured in accessing the repository server for the offline file : " + e.getMessage()); } if (fileName.length() > 0) { List listUploadedOfflineFileNames = (List) sessionMap .get(VoteAppConstants.LIST_UPLOADED_OFFLINE_FILENAMES_KEY); - AuthoringUtil.logger.debug("listUploadedOfflineFileNames:" + listUploadedOfflineFileNames); int index = findFileNameIndex(listUploadedOfflineFileNames, fileName); - AuthoringUtil.logger.debug("index:" + index); if (index == 0) { listUploadedOfflineFileNames.add(fileName); - AuthoringUtil.logger.debug("listUploadedOfflineFileNames after add :" - + listUploadedOfflineFileNames); sessionMap.put(VoteAppConstants.LIST_UPLOADED_OFFLINE_FILENAMES_KEY, listUploadedOfflineFileNames); } } } else { FormFile theOnlineFile = voteAuthoringForm.getTheOnlineFile(); - AuthoringUtil.logger.debug("retrieved theOnlineFile: " + theOnlineFile); try { stream = theOnlineFile.getInputStream(); @@ -269,46 +249,34 @@ return null; } - AuthoringUtil.logger.debug("retrieved fileName: " + fileName); fileProperty = "ONLINE"; } catch (FileNotFoundException e) { AuthoringUtil.logger - .debug("filenotfound exception occured in accessing the repository server for the online file : " + .error("filenotfound exception occured in accessing the repository server for the online file : " + e.getMessage()); } catch (IOException e) { AuthoringUtil.logger - .debug("io exception occured in accessing the repository server for the online file : " + .error("io exception occured in accessing the repository server for the online file : " + e.getMessage()); } if (fileName.length() > 0) { List listUploadedOnlineFileNames = (List) sessionMap .get(VoteAppConstants.LIST_UPLOADED_ONLINE_FILENAMES_KEY); - AuthoringUtil.logger.debug("listUploadedOnlineFileNames:" + listUploadedOnlineFileNames); int index = findFileNameIndex(listUploadedOnlineFileNames, fileName); - AuthoringUtil.logger.debug("index:" + index); if (index == 0) { listUploadedOnlineFileNames.add(fileName); - AuthoringUtil.logger.debug("listUploadedOnlineFileNames after add :" + listUploadedOnlineFileNames); sessionMap.put(VoteAppConstants.LIST_UPLOADED_ONLINE_FILENAMES_KEY, listUploadedOnlineFileNames); } } } - AuthoringUtil.logger.debug("calling uploadFile with:"); - AuthoringUtil.logger.debug("istream:" + stream); - AuthoringUtil.logger.debug("filename:" + fileName); - AuthoringUtil.logger.debug("mimeType:" + mimeType); - AuthoringUtil.logger.debug("fileProperty:" + fileProperty); - NodeKey nodeKey = null; try { nodeKey = voteService.uploadFile(stream, fileName, mimeType, fileProperty); - AuthoringUtil.logger.debug("nodeKey:" + nodeKey); - AuthoringUtil.logger.debug("nodeKey uuid:" + nodeKey.getUuid()); } catch (FileException e) { - AuthoringUtil.logger.debug("exception writing raw data:" + e); + AuthoringUtil.logger.error("exception writing raw data:" + e); /* return a null dto */ return null; } @@ -319,7 +287,6 @@ voteAttachmentDTO.setFilename(fileName); voteAttachmentDTO.setOfflineFile(isOfflineFile); - AuthoringUtil.logger.debug("uploadFile ends with sessionMap:" + sessionMap); return voteAttachmentDTO; } @@ -335,11 +302,6 @@ Iterator itList = listOfflineFilesMetaData.iterator(); while (itList.hasNext()) { VoteUploadedFile voteUploadedFile = (VoteUploadedFile) itList.next(); - AuthoringUtil.logger.debug("voteUploadedFile:" + voteUploadedFile); - AuthoringUtil.logger.debug("voteUploadedFile details, uid" + voteUploadedFile.getSubmissionId().toString()); - AuthoringUtil.logger.debug("voteUploadedFile details, uuid" + voteUploadedFile.getUuid()); - AuthoringUtil.logger.debug("voteUploadedFile details, filename" + voteUploadedFile.getFileName()); - AuthoringUtil.logger.debug("voteUploadedFile details, isOfflineFile" + !voteUploadedFile.isFileOnline()); VoteAttachmentDTO voteAttachmentDTO = new VoteAttachmentDTO(); voteAttachmentDTO.setUid(voteUploadedFile.getSubmissionId().toString()); @@ -348,9 +310,7 @@ voteAttachmentDTO.setOfflineFile(!voteUploadedFile.isFileOnline()); listAttachments.add(voteAttachmentDTO); - AuthoringUtil.logger.debug("listAttachments after add" + listAttachments); } - AuthoringUtil.logger.debug("final listAttachments after populating all: " + listAttachments); return listAttachments; } @@ -364,11 +324,8 @@ Iterator itList = listFilesMetaData.iterator(); while (itList.hasNext()) { VoteAttachmentDTO voteAttachmentDTO = (VoteAttachmentDTO) itList.next(); - AuthoringUtil.logger.debug("current filename" + voteAttachmentDTO.getFilename()); listFilenames.add(voteAttachmentDTO.getFilename()); - AuthoringUtil.logger.debug("listFilenames after add" + listFilenames); } - AuthoringUtil.logger.debug("final listFilenames after populating all: " + listFilenames); return listFilenames; } @@ -381,29 +338,19 @@ */ public static void removeFileItem(HttpServletRequest request, String filename, String offlineFile, SessionMap sessionMap) { - AuthoringUtil.logger.debug("starting removeFileItem, sessionMap:" + sessionMap); - AuthoringUtil.logger.debug("offlineFile:" + offlineFile); if (offlineFile.equals("1")) { - AuthoringUtil.logger.debug("will remove an offline file"); List listUploadedOfflineFileNames = (List) sessionMap .get(VoteAppConstants.LIST_UPLOADED_OFFLINE_FILENAMES_KEY); - AuthoringUtil.logger.debug("listUploadedOfflineFileNames:" + listUploadedOfflineFileNames); listUploadedOfflineFileNames.remove(filename); - AuthoringUtil.logger.debug("removed offline filename:" + filename); - AuthoringUtil.logger.debug("listUploadedOfflineFileNames after remove :" + listUploadedOfflineFileNames); sessionMap.put(VoteAppConstants.LIST_UPLOADED_OFFLINE_FILENAMES_KEY, listUploadedOfflineFileNames); } else { - AuthoringUtil.logger.debug("will remove an online file"); List listUploadedOnlineFileNames = (List) sessionMap .get(VoteAppConstants.LIST_UPLOADED_ONLINE_FILENAMES_KEY); - AuthoringUtil.logger.debug("listUploadedOnlineFileNames:" + listUploadedOnlineFileNames); listUploadedOnlineFileNames.remove(filename); - AuthoringUtil.logger.debug("removed online filename:" + filename); - AuthoringUtil.logger.debug("listUploadedOnlineFileNames after remove :" + listUploadedOnlineFileNames); sessionMap.put(VoteAppConstants.LIST_UPLOADED_ONLINE_FILENAMES_KEY, listUploadedOnlineFileNames); } } @@ -419,9 +366,7 @@ while (itListUploadedFileNames.hasNext()) { mainIndex++; String currentFilename = (String) itListUploadedFileNames.next(); - AuthoringUtil.logger.debug("currentFilename :" + currentFilename); if (currentFilename.equals(filename)) { - AuthoringUtil.logger.debug("currentFilename found in the list at mainIndex :" + mainIndex); return mainIndex; } } @@ -432,25 +377,16 @@ VoteAttachmentDTO deletableAttachmentDTO = null; Iterator itList = listFilesMetaData.iterator(); - int mainIndex = 0; while (itList.hasNext()) { - mainIndex++; VoteAttachmentDTO currentAttachmentDTO = (VoteAttachmentDTO) itList.next(); - AuthoringUtil.logger.debug("currentAttachmentDTO :" + currentAttachmentDTO); - AuthoringUtil.logger.debug("currentAttachmentDTO uuid :" + currentAttachmentDTO.getUuid()); if (currentAttachmentDTO.getUuid().equals(uuid)) { - AuthoringUtil.logger.debug("equal uuid found uuid :" + uuid); deletableAttachmentDTO = currentAttachmentDTO; break; } } - AuthoringUtil.logger.debug("equal uuid found at index :" + mainIndex); - AuthoringUtil.logger.debug("deletable attachment is:" + deletableAttachmentDTO); - listFilesMetaData.remove(deletableAttachmentDTO); - AuthoringUtil.logger.debug("listOfflineFilesMetaData after remove:" + listFilesMetaData); return listFilesMetaData; } @@ -462,77 +398,51 @@ while (itList.hasNext()) { VoteAttachmentDTO voteAttachmentDTO = (VoteAttachmentDTO) itList.next(); String filename = voteAttachmentDTO.getFilename(); - AuthoringUtil.logger.debug("extracted filename: " + filename); listFilenames.add(filename); } - AuthoringUtil.logger.debug("final extracted listFilenames: " + listFilenames); return listFilenames; } protected Map reconstructOptionContentMapForAdd(Map mapOptionsContent, HttpServletRequest request) { - AuthoringUtil.logger.debug("doing reconstructOptionContentMapForAdd."); - AuthoringUtil.logger.debug("pre-add Map content: " + mapOptionsContent); - AuthoringUtil.logger.debug("pre-add Map size: " + mapOptionsContent.size()); mapOptionsContent = repopulateMap(mapOptionsContent, request); - AuthoringUtil.logger.debug("mapOptionsContent: " + mapOptionsContent); mapOptionsContent.put(new Long(mapOptionsContent.size() + 1).toString(), ""); - AuthoringUtil.logger.debug("post-add Map is: " + mapOptionsContent); - AuthoringUtil.logger.debug("post-add count " + mapOptionsContent.size()); - return mapOptionsContent; } protected void reconstructOptionContentMapForRemove(Map mapOptionsContent, HttpServletRequest request, VoteAuthoringForm voteAuthoringForm) { - AuthoringUtil.logger.debug("doing reconstructOptionContentMapForRemove."); String optIndex = voteAuthoringForm.getOptIndex(); - AuthoringUtil.logger.debug("pre-delete map content: " + mapOptionsContent); - AuthoringUtil.logger.debug("optIndex: " + optIndex); String defLater = voteAuthoringForm.getActiveModule(); - AuthoringUtil.logger.debug("defLater: " + defLater); String removableOptIndex = null; if (defLater != null && defLater.equals(VoteAppConstants.MONITORING)) { removableOptIndex = (String) request.getSession().getAttribute(VoteAppConstants.REMOVABLE_QUESTION_INDEX); - AuthoringUtil.logger.debug("removableOptIndex: " + removableOptIndex); optIndex = removableOptIndex; } - AuthoringUtil.logger.debug("final removableOptIndex: " + optIndex); long longOptIndex = new Long(optIndex).longValue(); - AuthoringUtil.logger.debug("pre-delete count: " + mapOptionsContent.size()); repopulateMap(mapOptionsContent, request); - AuthoringUtil.logger.debug("post-repopulateMap optIndex: " + optIndex); mapOptionsContent.remove(new Long(longOptIndex).toString()); - AuthoringUtil.logger.debug("removed the question content with index: " + longOptIndex); - AuthoringUtil.logger.debug("post-delete count " + mapOptionsContent.size()); - AuthoringUtil.logger.debug("post-delete map content: " + mapOptionsContent); } protected Map repopulateMap(Map mapOptionsContent, HttpServletRequest request) { - AuthoringUtil.logger.debug("starting repopulateMap"); int intOptionIndex = mapOptionsContent.size(); - AuthoringUtil.logger.debug("intOptionIndex: " + intOptionIndex); /* if there is data in the Map remaining from previous session remove those */ mapOptionsContent.clear(); - AuthoringUtil.logger.debug("Map got initialized: " + mapOptionsContent); for (long i = 0; i < intOptionIndex; i++) { String candidateOptionEntry = request.getParameter("optionContent" + i); if (i == 0) { request.getSession().setAttribute("defaultOptionContent", candidateOptionEntry); - AuthoringUtil.logger.debug("defaultNominationContent set to: " + candidateOptionEntry); } if (candidateOptionEntry != null && candidateOptionEntry.length() > 0) { - AuthoringUtil.logger.debug("using key: " + i); mapOptionsContent.put(new Long(i + 1).toString(), candidateOptionEntry); - AuthoringUtil.logger.debug("added new entry."); } } return mapOptionsContent; @@ -544,8 +454,6 @@ * @param request */ protected Map reconstructOptionsContentMapForSubmit(Map mapOptionsContent, HttpServletRequest request) { - AuthoringUtil.logger.debug("pre-submit Map:" + mapOptionsContent); - AuthoringUtil.logger.debug("pre-submit Map size :" + mapOptionsContent.size()); repopulateMap(mapOptionsContent, request); Map mapFinalOptionsContent = new TreeMap(new VoteComparator()); @@ -555,75 +463,50 @@ Map.Entry pairs = (Map.Entry) itMap.next(); if (pairs.getValue() != null && !pairs.getValue().equals("")) { mapFinalOptionsContent.put(pairs.getKey(), pairs.getValue()); - AuthoringUtil.logger.debug("adding the pair: " + pairs.getKey() + " = " + pairs.getValue()); } } mapOptionsContent = mapFinalOptionsContent; - AuthoringUtil.logger.debug("final mapOptionsContent:" + mapOptionsContent); return mapOptionsContent; } public void removeRedundantOptions(Map mapOptionsContent, IVoteService voteService, VoteAuthoringForm voteAuthoringForm, HttpServletRequest request) { - AuthoringUtil.logger.debug("removing unused entries... "); - AuthoringUtil.logger.debug("mapOptionsContent: " + mapOptionsContent); String toolContentID = voteAuthoringForm.getToolContentID(); - AuthoringUtil.logger.debug("toolContentID: " + toolContentID); VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); - AuthoringUtil.logger.debug("voteContent: " + voteContent); if (voteContent != null) { - AuthoringUtil.logger.debug("voteContent uid: " + voteContent.getUid()); List allNominations = voteService.getAllQuestionEntries(voteContent.getUid()); - AuthoringUtil.logger.debug("allNominations: " + allNominations); Iterator listIterator = allNominations.iterator(); - Long mapIndex = new Long(1); boolean entryUsed = false; while (listIterator.hasNext()) { VoteQueContent queContent = (VoteQueContent) listIterator.next(); - AuthoringUtil.logger.debug("queContent data: " + queContent); entryUsed = false; Iterator itMap = mapOptionsContent.entrySet().iterator(); while (itMap.hasNext()) { entryUsed = false; Map.Entry pairs = (Map.Entry) itMap.next(); - AuthoringUtil.logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue()); if (pairs.getValue().toString().length() != 0) { - AuthoringUtil.logger.debug("text from map:" + pairs.getValue().toString()); - AuthoringUtil.logger.debug("text from db:" + queContent.getQuestion()); if (pairs.getValue().toString().equals(queContent.getQuestion())) { - AuthoringUtil.logger.debug("used entry in db:" + queContent.getQuestion()); entryUsed = true; break; } } } if (entryUsed == false) { - AuthoringUtil.logger.debug("removing unused entry in db:" + queContent.getQuestion()); VoteQueContent removeableVoteQueContent = voteService.getQuestionContentByQuestionText(queContent .getQuestion(), voteContent.getUid()); - AuthoringUtil.logger.debug("removeableVoteQueContent" + removeableVoteQueContent); if (removeableVoteQueContent != null) { - AuthoringUtil.logger.debug("doing association removal for nomination: " - + removeableVoteQueContent); - AuthoringUtil.logger.debug("doing association removal, for question: " - + removeableVoteQueContent.getQuestion()); - AuthoringUtil.logger.debug("doing association removal for nomination list: " - + voteContent.getVoteQueContents()); voteContent.getVoteQueContents().remove(removeableVoteQueContent); voteService.removeVoteQueContent(removeableVoteQueContent); - - AuthoringUtil.logger.debug("removed removeableVoteQueContent from the db: " - + removeableVoteQueContent); } } @@ -645,50 +528,31 @@ VoteAuthoringForm voteAuthoringForm, HttpServletRequest request, SessionMap sessionMap, DataFlowObject assignedDataFlowObject) { UserDTO toolUser = (UserDTO) SessionManager.getSession().getAttribute(AttributeNames.USER); - AuthoringUtil.logger.debug("toolUser: " + toolUser); String richTextTitle = request.getParameter(VoteAppConstants.TITLE); String richTextInstructions = request.getParameter(VoteAppConstants.INSTRUCTIONS); - AuthoringUtil.logger.debug("richTextTitle: " + richTextTitle); - AuthoringUtil.logger.debug("richTextInstructions: " + richTextInstructions); - String lockOnFinish = request.getParameter("lockOnFinish"); - AuthoringUtil.logger.debug("lockOnFinish: " + lockOnFinish); String allowTextEntry = request.getParameter("allowText"); - AuthoringUtil.logger.debug("allowTextEntry: " + allowTextEntry); String showResults = request.getParameter("showResults"); String maxInputs = request.getParameter("maxInputs"); String reflect = request.getParameter(VoteAppConstants.REFLECT); - AuthoringUtil.logger.debug("reflect: " + reflect); String reflectionSubject = voteAuthoringForm.getReflectionSubject(); - AuthoringUtil.logger.debug("reflectionSubject: " + reflectionSubject); String maxNomcount = voteAuthoringForm.getMaxNominationCount(); - AuthoringUtil.logger.debug("maxNomcount: " + maxNomcount); String minNomcount= voteAuthoringForm.getMinNominationCount(); - logger.debug("minNomcount: " + minNomcount); String richTextOfflineInstructions = (String) sessionMap.get(VoteAppConstants.OFFLINE_INSTRUCTIONS_KEY); - AuthoringUtil.logger.debug("richTextOfflineInstructions: " + richTextOfflineInstructions); String richTextOnlineInstructions = (String) sessionMap.get(VoteAppConstants.ONLINE_INSTRUCTIONS_KEY); - AuthoringUtil.logger.debug("richTextOnlineInstructions: " + richTextOnlineInstructions); - boolean setCommonContent = true; - if (lockOnFinish == null) { - setCommonContent = false; - } - AuthoringUtil.logger.debug("setCommonContent: " + setCommonContent); - String activeModule = voteAuthoringForm.getActiveModule(); - AuthoringUtil.logger.debug("activeModule: " + activeModule); boolean lockedOnFinishBoolean = false; boolean allowTextBoolean = false; @@ -721,45 +585,33 @@ userId = toolUser.getUserID().longValue(); } else { HttpSession ss = SessionManager.getSession(); - AuthoringUtil.logger.debug("ss: " + ss); UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); - AuthoringUtil.logger.debug("user" + user); if (user != null) { userId = user.getUserID().longValue(); } else { - AuthoringUtil.logger.debug("should not reach here"); userId = 0; } } - AuthoringUtil.logger.debug("userId: " + userId); String toolContentID = voteAuthoringForm.getToolContentID(); - AuthoringUtil.logger.debug("toolContentID: " + toolContentID); VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); - AuthoringUtil.logger.debug("voteContent: " + voteContent); boolean newContent = false; if (voteContent == null) { voteContent = new VoteContent(); newContent = true; } - AuthoringUtil.logger.debug("setting common content values..." + richTextTitle + " " + richTextInstructions); voteContent.setVoteContentId(new Long(toolContentID)); voteContent.setTitle(richTextTitle); voteContent.setInstructions(richTextInstructions); voteContent.setUpdateDate(new Date(System.currentTimeMillis())); /** keep updating this one */ - AuthoringUtil.logger.debug("userId: " + userId); voteContent.setCreatedBy(userId); /** make sure we are setting the userId from the User object above */ - AuthoringUtil.logger.debug("end of setting common content values..."); - AuthoringUtil.logger.debug("activeModule: " + activeModule); - if (activeModule.equals(VoteAppConstants.AUTHORING)) { - AuthoringUtil.logger.debug("setting other content values..."); voteContent.setLockOnFinish(lockedOnFinishBoolean); voteContent.setAllowText(allowTextBoolean); voteContent.setShowResults(showResultsBoolean); @@ -775,15 +627,12 @@ voteContent.setAssignedDataFlowObject(assignedDataFlowObject != null); if (newContent) { - AuthoringUtil.logger.debug("will create: " + voteContent); voteService.createVote(voteContent); } else { - AuthoringUtil.logger.debug("will update: " + voteContent); voteService.updateVote(voteContent); } voteContent = voteService.retrieveVote(new Long(toolContentID)); - AuthoringUtil.logger.debug("voteContent: " + voteContent); voteContent = createOptionsContent(mapOptionsContent, voteService, voteContent); @@ -801,43 +650,27 @@ * @return */ protected VoteContent createOptionsContent(Map mapOptionsContent, IVoteService voteService, VoteContent voteContent) { - AuthoringUtil.logger.debug("starting createOptiosContent: " + voteContent); - AuthoringUtil.logger.debug("content uid is: " + voteContent.getUid()); - List questions = voteService.retrieveVoteQueContentsByToolContentId(voteContent.getUid().longValue()); - AuthoringUtil.logger.debug("questions: " + questions); Iterator itMap = mapOptionsContent.entrySet().iterator(); int diplayOrder = 0; while (itMap.hasNext()) { Map.Entry pairs = (Map.Entry) itMap.next(); - AuthoringUtil.logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue()); if (pairs.getValue().toString().length() != 0) { - AuthoringUtil.logger.debug("starting createNominationContent: pairs.getValue().toString():" - + pairs.getValue().toString()); - AuthoringUtil.logger.debug("starting createNominationContent: voteContent: " + voteContent); - AuthoringUtil.logger.debug("starting createNominationContent: diplayOrder: " + diplayOrder); diplayOrder = new Integer(pairs.getKey().toString()).intValue(); - AuthoringUtil.logger.debug("int diplayOrder: " + diplayOrder); VoteQueContent queContent = new VoteQueContent(pairs.getValue().toString(), diplayOrder, voteContent, null); /* checks if the question is already recorded */ - AuthoringUtil.logger.debug("question text is: " + pairs.getValue().toString()); - AuthoringUtil.logger.debug("content uid is: " + voteContent.getUid()); - AuthoringUtil.logger.debug("question display order is: " + diplayOrder); VoteQueContent existingVoteQueContent = voteService.getQuestionContentByQuestionText(pairs.getValue() .toString(), voteContent.getUid()); - AuthoringUtil.logger.debug("existingVoteQueContent: " + existingVoteQueContent); if (existingVoteQueContent == null) { /* make sure a question with the same question text is not already saved */ VoteQueContent duplicateVoteQueContent = voteService.getQuestionContentByQuestionText(pairs .getValue().toString(), voteContent.getUid()); - AuthoringUtil.logger.debug("duplicateVoteQueContent: " + duplicateVoteQueContent); if (duplicateVoteQueContent == null) { - AuthoringUtil.logger.debug("adding a new question to content: " + queContent); voteContent.getVoteQueContents().add(queContent); queContent.setVoteContent(voteContent); @@ -846,7 +679,6 @@ } else { existingVoteQueContent.setQuestion(pairs.getValue().toString()); existingVoteQueContent.setDisplayOrder(diplayOrder); - AuthoringUtil.logger.debug("updating the existing question content: " + existingVoteQueContent); voteService.updateVoteQueContent(existingVoteQueContent); } } @@ -855,59 +687,39 @@ } protected static List swapNodes(List listNominationContentDTO, String questionIndex, String direction) { - AuthoringUtil.logger.debug("swapNodes:"); - AuthoringUtil.logger.debug("listNominationContentDTO:" + listNominationContentDTO); - AuthoringUtil.logger.debug("questionIndex:" + questionIndex); - AuthoringUtil.logger.debug("direction:" + direction); int intNominationIndex = new Integer(questionIndex).intValue(); int intOriginalNominationIndex = intNominationIndex; - AuthoringUtil.logger.debug("intNominationIndex:" + intNominationIndex); int replacedNodeIndex = 0; if (direction.equals("down")) { - AuthoringUtil.logger.debug("direction down:"); replacedNodeIndex = ++intNominationIndex; } else { - AuthoringUtil.logger.debug("direction up:"); replacedNodeIndex = --intNominationIndex; } - AuthoringUtil.logger.debug("replacedNodeIndex:" + replacedNodeIndex); - AuthoringUtil.logger.debug("replacing nodes:" + intOriginalNominationIndex + " and " + replacedNodeIndex); VoteNominationContentDTO mainNode = extractNodeAtDisplayOrder(listNominationContentDTO, intOriginalNominationIndex); - AuthoringUtil.logger.debug("mainNode:" + mainNode); VoteNominationContentDTO replacedNode = extractNodeAtDisplayOrder(listNominationContentDTO, replacedNodeIndex); - AuthoringUtil.logger.debug("replacedNode:" + replacedNode); List listFinalNominationContentDTO = new LinkedList(); listFinalNominationContentDTO = reorderSwappedListNominationContentDTO(listNominationContentDTO, intOriginalNominationIndex, replacedNodeIndex, mainNode, replacedNode); - AuthoringUtil.logger.debug("listFinalNominationContentDTO:" + listFinalNominationContentDTO); return listFinalNominationContentDTO; } protected static VoteNominationContentDTO extractNodeAtDisplayOrder(List listNominationContentDTO, int intOriginalNominationIndex) { - AuthoringUtil.logger.debug("listNominationContentDTO:" + listNominationContentDTO); - AuthoringUtil.logger.debug("intOriginalNominationIndex:" + intOriginalNominationIndex); - + Iterator listIterator = listNominationContentDTO.iterator(); while (listIterator.hasNext()) { VoteNominationContentDTO voteNominationContentDTO = (VoteNominationContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("voteNominationContentDTO:" + voteNominationContentDTO); - AuthoringUtil.logger.debug("voteNominationContentDTO question:" + voteNominationContentDTO.getNomination()); - AuthoringUtil.logger.debug("intOriginalNominationIndex versus displayOrder:" - + new Integer(intOriginalNominationIndex).toString() + " versus " - + voteNominationContentDTO.getDisplayOrder()); if (new Integer(intOriginalNominationIndex).toString().equals(voteNominationContentDTO.getDisplayOrder())) { - AuthoringUtil.logger.debug("node found:" + voteNominationContentDTO); return voteNominationContentDTO; } } @@ -917,37 +729,30 @@ protected static List reorderSwappedListNominationContentDTO(List listNominationContentDTO, int intOriginalNominationIndex, int replacedNodeIndex, VoteNominationContentDTO mainNode, VoteNominationContentDTO replacedNode) { - AuthoringUtil.logger.debug("reorderSwappedListNominationContentDTO: intOriginalNominationIndex:" - + intOriginalNominationIndex); - AuthoringUtil.logger.debug("reorderSwappedListNominationContentDTO: replacedNodeIndex:" + replacedNodeIndex); - AuthoringUtil.logger.debug("mainNode: " + mainNode); - AuthoringUtil.logger.debug("replacedNode: " + replacedNode); List listFinalNominationContentDTO = new LinkedList(); int queIndex = 0; Iterator listIterator = listNominationContentDTO.iterator(); while (listIterator.hasNext()) { VoteNominationContentDTO voteNominationContentDTO = (VoteNominationContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("voteNominationContentDTO:" + voteNominationContentDTO); - AuthoringUtil.logger.debug("voteNominationContentDTO question:" + voteNominationContentDTO.getNomination()); queIndex++; VoteNominationContentDTO tempNode = new VoteNominationContentDTO(); if (!voteNominationContentDTO.getDisplayOrder().equals(new Integer(intOriginalNominationIndex).toString()) && !voteNominationContentDTO.getDisplayOrder().equals(new Integer(replacedNodeIndex).toString())) { - AuthoringUtil.logger.debug("normal copy "); + //normal copy tempNode.setNomination(voteNominationContentDTO.getNomination()); tempNode.setDisplayOrder(voteNominationContentDTO.getDisplayOrder()); tempNode.setFeedback(voteNominationContentDTO.getFeedback()); } else if (voteNominationContentDTO.getDisplayOrder().equals( new Integer(intOriginalNominationIndex).toString())) { - AuthoringUtil.logger.debug("move type 1 "); + //move type 1 tempNode.setNomination(replacedNode.getNomination()); tempNode.setDisplayOrder(replacedNode.getDisplayOrder()); tempNode.setFeedback(replacedNode.getFeedback()); } else if (voteNominationContentDTO.getDisplayOrder().equals(new Integer(replacedNodeIndex).toString())) { - AuthoringUtil.logger.debug("move type 1 "); + //move type 1 tempNode.setNomination(mainNode.getNomination()); tempNode.setDisplayOrder(mainNode.getDisplayOrder()); tempNode.setFeedback(mainNode.getFeedback()); @@ -956,34 +761,25 @@ listFinalNominationContentDTO.add(tempNode); } - AuthoringUtil.logger.debug("final listFinalNominationContentDTO:" + listFinalNominationContentDTO); return listFinalNominationContentDTO; } protected static List reorderSimpleListNominationContentDTO(List listNominationContentDTO) { - AuthoringUtil.logger.debug("reorderListNominationContentDTO"); - AuthoringUtil.logger.debug("listNominationContentDTO:" + listNominationContentDTO); List listFinalNominationContentDTO = new LinkedList(); int queIndex = 0; Iterator listIterator = listNominationContentDTO.iterator(); while (listIterator.hasNext()) { VoteNominationContentDTO voteNominationContentDTO = (VoteNominationContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("voteNominationContentDTO:" + voteNominationContentDTO); - AuthoringUtil.logger.debug("voteNominationContentDTO question:" + voteNominationContentDTO.getNomination()); String question = voteNominationContentDTO.getNomination(); - AuthoringUtil.logger.debug("question:" + question); String displayOrder = voteNominationContentDTO.getDisplayOrder(); - AuthoringUtil.logger.debug("displayOrder:" + displayOrder); String feedback = voteNominationContentDTO.getFeedback(); - AuthoringUtil.logger.debug("feedback:" + feedback); if (question != null && !question.equals("")) { ++queIndex; - AuthoringUtil.logger.debug("using queIndex:" + queIndex); voteNominationContentDTO.setNomination(question); voteNominationContentDTO.setDisplayOrder(new Integer(queIndex).toString()); @@ -993,40 +789,27 @@ } } - AuthoringUtil.logger.debug("final listFinalNominationContentDTO:" + listFinalNominationContentDTO); return listFinalNominationContentDTO; } protected static List reorderListNominationContentDTO(List listNominationContentDTO, String excludeNominationIndex) { - AuthoringUtil.logger.debug("reorderListNominationContentDTO"); - AuthoringUtil.logger.debug("listNominationContentDTO:" + listNominationContentDTO); - AuthoringUtil.logger.debug("excludeNominationIndex:" + excludeNominationIndex); List listFinalNominationContentDTO = new LinkedList(); int queIndex = 0; Iterator listIterator = listNominationContentDTO.iterator(); while (listIterator.hasNext()) { VoteNominationContentDTO voteNominationContentDTO = (VoteNominationContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("voteNominationContentDTO:" + voteNominationContentDTO); - AuthoringUtil.logger.debug("voteNominationContentDTO question:" + voteNominationContentDTO.getNomination()); String question = voteNominationContentDTO.getNomination(); - AuthoringUtil.logger.debug("question:" + question); String displayOrder = voteNominationContentDTO.getDisplayOrder(); - AuthoringUtil.logger.debug("displayOrder:" + displayOrder); String feedback = voteNominationContentDTO.getFeedback(); - AuthoringUtil.logger.debug("feedback:" + feedback); - AuthoringUtil.logger.debug("displayOrder versus excludeNominationIndex :" + displayOrder + " versus " - + excludeNominationIndex); - if (question != null && !question.equals("")) { if (!displayOrder.equals(excludeNominationIndex)) { ++queIndex; - AuthoringUtil.logger.debug("using queIndex:" + queIndex); voteNominationContentDTO.setNomination(question); voteNominationContentDTO.setDisplayOrder(new Integer(queIndex).toString()); @@ -1037,25 +820,19 @@ } } - AuthoringUtil.logger.debug("final listFinalNominationContentDTO:" + listFinalNominationContentDTO); return listFinalNominationContentDTO; } public static boolean checkDuplicateNominations(List listNominationContentDTO, String newNomination) { - AuthoringUtil.logger.debug("checkDuplicateNominations: " + listNominationContentDTO); - AuthoringUtil.logger.debug("newNomination: " + newNomination); Map mapNominationContent = extractMapNominationContent(listNominationContentDTO); - AuthoringUtil.logger.debug("mapNominationContent: " + mapNominationContent); Iterator itMap = mapNominationContent.entrySet().iterator(); while (itMap.hasNext()) { Map.Entry pairs = (Map.Entry) itMap.next(); if (pairs.getValue() != null && !pairs.getValue().equals("")) { - AuthoringUtil.logger.debug("checking the pair: " + pairs.getKey() + " = " + pairs.getValue()); if (pairs.getValue().equals(newNomination)) { - AuthoringUtil.logger.debug("entry found: " + newNomination); return true; } } @@ -1064,61 +841,43 @@ } protected static Map extractMapNominationContent(List listNominationContentDTO) { - AuthoringUtil.logger.debug("listNominationContentDTO:" + listNominationContentDTO); Map mapNominationContent = new TreeMap(new VoteComparator()); Iterator listIterator = listNominationContentDTO.iterator(); int queIndex = 0; while (listIterator.hasNext()) { VoteNominationContentDTO voteNominationContentDTO = (VoteNominationContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("voteNominationContentDTO:" + voteNominationContentDTO); - AuthoringUtil.logger.debug("voteNominationContentDTO question:" + voteNominationContentDTO.getNomination()); queIndex++; - AuthoringUtil.logger.debug("queIndex:" + queIndex); mapNominationContent.put(new Integer(queIndex).toString(), voteNominationContentDTO.getNomination()); } - AuthoringUtil.logger.debug("mapNominationContent:" + mapNominationContent); return mapNominationContent; } protected static List reorderUpdateListNominationContentDTO(List listNominationContentDTO, VoteNominationContentDTO voteNominationContentDTONew, String editableNominationIndex) { - AuthoringUtil.logger.debug("reorderUpdateListNominationContentDTO"); - AuthoringUtil.logger.debug("listNominationContentDTO:" + listNominationContentDTO); - AuthoringUtil.logger.debug("voteNominationContentDTONew:" + voteNominationContentDTONew); - AuthoringUtil.logger.debug("editableNominationIndex:" + editableNominationIndex); List listFinalNominationContentDTO = new LinkedList(); int queIndex = 0; Iterator listIterator = listNominationContentDTO.iterator(); while (listIterator.hasNext()) { VoteNominationContentDTO voteNominationContentDTO = (VoteNominationContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("voteNominationContentDTO:" + voteNominationContentDTO); - AuthoringUtil.logger.debug("voteNominationContentDTO question:" + voteNominationContentDTO.getNomination()); ++queIndex; - AuthoringUtil.logger.debug("using queIndex:" + queIndex); String question = voteNominationContentDTO.getNomination(); - AuthoringUtil.logger.debug("question:" + question); String displayOrder = voteNominationContentDTO.getDisplayOrder(); - AuthoringUtil.logger.debug("displayOrder:" + displayOrder); String feedback = voteNominationContentDTO.getFeedback(); - AuthoringUtil.logger.debug("feedback:" + feedback); if (displayOrder.equals(editableNominationIndex)) { - AuthoringUtil.logger.debug("displayOrder equals editableNominationIndex:" + editableNominationIndex); voteNominationContentDTO.setNomination(voteNominationContentDTONew.getNomination()); voteNominationContentDTO.setDisplayOrder(voteNominationContentDTONew.getDisplayOrder()); voteNominationContentDTO.setFeedback(voteNominationContentDTONew.getFeedback()); listFinalNominationContentDTO.add(voteNominationContentDTO); } else { - AuthoringUtil.logger.debug("displayOrder does not equal editableNominationIndex:" - + editableNominationIndex); voteNominationContentDTO.setNomination(question); voteNominationContentDTO.setDisplayOrder(displayOrder); voteNominationContentDTO.setFeedback(feedback); @@ -1127,73 +886,50 @@ } } - AuthoringUtil.logger.debug("listFinalNominationContentDTO:" + listFinalNominationContentDTO); return listFinalNominationContentDTO; } protected static Map extractMapFeedback(List listNominationContentDTO) { - AuthoringUtil.logger.debug("listNominationContentDTO:" + listNominationContentDTO); Map mapFeedbackContent = new TreeMap(new VoteComparator()); Iterator listIterator = listNominationContentDTO.iterator(); int queIndex = 0; while (listIterator.hasNext()) { VoteNominationContentDTO voteNominationContentDTO = (VoteNominationContentDTO) listIterator.next(); - AuthoringUtil.logger.debug("voteNominationContentDTO:" + voteNominationContentDTO); - AuthoringUtil.logger.debug("voteNominationContentDTO feedback:" + voteNominationContentDTO.getFeedback()); queIndex++; - AuthoringUtil.logger.debug("queIndex:" + queIndex); mapFeedbackContent.put(new Integer(queIndex).toString(), voteNominationContentDTO.getFeedback()); } - AuthoringUtil.logger.debug("mapFeedbackContent:" + mapFeedbackContent); return mapFeedbackContent; } public void removeRedundantNominations(Map mapNominationContent, IVoteService voteService, VoteAuthoringForm voteAuthoringForm, HttpServletRequest request, String toolContentID) { - AuthoringUtil.logger.debug("removing unused entries... "); - AuthoringUtil.logger.debug("mapNominationContent: " + mapNominationContent); - AuthoringUtil.logger.debug("toolContentID: " + toolContentID); VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); - AuthoringUtil.logger.debug("voteContent: " + voteContent); if (voteContent != null) { - AuthoringUtil.logger.debug("voteContent uid: " + voteContent.getUid()); List allNominations = voteService.getAllQuestionEntries(voteContent.getUid()); - AuthoringUtil.logger.debug("allNominations: " + allNominations); Iterator listIterator = allNominations.iterator(); int mapIndex = 0; boolean entryUsed = false; while (listIterator.hasNext()) { ++mapIndex; - AuthoringUtil.logger.debug("current mapIndex: " + mapIndex); VoteQueContent queContent = (VoteQueContent) listIterator.next(); - AuthoringUtil.logger.debug("queContent data: " + queContent); - AuthoringUtil.logger.debug("queContent: " + queContent.getQuestion() + " " - + queContent.getDisplayOrder()); entryUsed = false; Iterator itMap = mapNominationContent.entrySet().iterator(); int displayOrder = 0; while (itMap.hasNext()) { ++displayOrder; - AuthoringUtil.logger.debug("current displayOrder: " + displayOrder); entryUsed = false; Map.Entry pairs = (Map.Entry) itMap.next(); - AuthoringUtil.logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue()); if (pairs.getValue().toString().length() != 0) { - AuthoringUtil.logger.debug("text from map:" + pairs.getValue().toString()); - AuthoringUtil.logger.debug("text from db:" + queContent.getQuestion()); - AuthoringUtil.logger.debug("mapIndex versus displayOrder:" + mapIndex + " versus " - + displayOrder); if (mapIndex == displayOrder) { - AuthoringUtil.logger.debug("used displayOrder position:" + displayOrder); entryUsed = true; break; } @@ -1202,15 +938,11 @@ } if (entryUsed == false) { - AuthoringUtil.logger.debug("removing unused entry in db:" + queContent.getQuestion()); VoteQueContent removeableVoteQueContent = voteService.getQuestionContentByQuestionText(queContent .getQuestion(), voteContent.getUid()); - AuthoringUtil.logger.debug("removeableVoteQueContent" + removeableVoteQueContent); if (removeableVoteQueContent != null) { voteService.removeVoteQueContent(removeableVoteQueContent); - AuthoringUtil.logger.debug("removed removeableVoteQueContent from the db: " - + removeableVoteQueContent); } } @@ -1231,36 +963,26 @@ String richTextTitle = request.getParameter(VoteAppConstants.TITLE); String richTextInstructions = request.getParameter(VoteAppConstants.INSTRUCTIONS); - AuthoringUtil.logger.debug("richTextTitle: " + richTextTitle); - AuthoringUtil.logger.debug("richTextInstructions: " + richTextInstructions); - String lockOnFinish = request.getParameter("lockOnFinish"); - AuthoringUtil.logger.debug("lockOnFinish: " + lockOnFinish); String allowTextEntry = request.getParameter("allowText"); - AuthoringUtil.logger.debug("allowTextEntry: " + allowTextEntry); String showResults = request.getParameter("showResults"); String maxInputs = request.getParameter("maxInputs"); String reflect = request.getParameter(VoteAppConstants.REFLECT); - AuthoringUtil.logger.debug("reflect: " + reflect); String reflectionSubject = voteAuthoringForm.getReflectionSubject(); - AuthoringUtil.logger.debug("reflectionSubject: " + reflectionSubject); String maxNomcount = voteAuthoringForm.getMaxNominationCount(); - AuthoringUtil.logger.debug("maxNomcount: " + maxNomcount); String minNomcount= voteAuthoringForm.getMinNominationCount(); - AuthoringUtil.logger.debug("minNomcount: " + minNomcount); String richTextOfflineInstructions = request.getParameter(VoteAppConstants.OFFLINE_INSTRUCTIONS); String richTextOnlineInstructions = request.getParameter(VoteAppConstants.ONLINE_INSTRUCTIONS); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - AuthoringUtil.logger.debug("activeModule: " + activeModule); boolean setCommonContent = true; if (lockOnFinish == null || allowTextEntry == null || showResults == null || reflect == null @@ -1269,7 +991,6 @@ { setCommonContent = false; } - AuthoringUtil.logger.debug("setCommonContent: " + setCommonContent); boolean lockOnFinishBoolean = false; boolean allowTextEntryBoolean = false; @@ -1297,48 +1018,34 @@ maxInputsShort = Short.parseShort(maxInputs); } - AuthoringUtil.logger.debug("lockOnFinishBoolean: " + lockOnFinishBoolean); - AuthoringUtil.logger.debug("allowTextEntryBoolean: " + allowTextEntryBoolean); - AuthoringUtil.logger.debug("reflectBoolean: " + reflectBoolean); - long userId = 0; if (toolUser != null) { userId = toolUser.getUserID().longValue(); } else { HttpSession ss = SessionManager.getSession(); - AuthoringUtil.logger.debug("ss: " + ss); UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); - AuthoringUtil.logger.debug("user" + user); if (user != null) { userId = user.getUserID().longValue(); } else { - AuthoringUtil.logger.debug("should not reach here"); userId = 0; } } - AuthoringUtil.logger.debug("userId: " + userId); - AuthoringUtil.logger.debug("voteContent: " + voteContent); boolean newContent = false; if (voteContent == null) { voteContent = new VoteContent(); newContent = true; } - AuthoringUtil.logger.debug("setting common content values..." + richTextTitle + " " + richTextInstructions); voteContent.setVoteContentId(new Long(strToolContentID)); voteContent.setTitle(richTextTitle); voteContent.setInstructions(richTextInstructions); voteContent.setUpdateDate(new Date(System.currentTimeMillis())); /** keep updating this one */ - AuthoringUtil.logger.debug("userId: " + userId); voteContent.setCreatedBy(userId); /** make sure we are setting the userId from the User object above */ - AuthoringUtil.logger.debug("end of setting common content values..."); - AuthoringUtil.logger.debug("activeModule:" + activeModule); if (activeModule.equals(VoteAppConstants.AUTHORING)) { - AuthoringUtil.logger.debug("setting other content values..."); voteContent.setLockOnFinish(lockOnFinishBoolean); voteContent.setAllowText(allowTextEntryBoolean); voteContent.setShowResults(showResultsBoolean); @@ -1355,17 +1062,13 @@ } if (newContent) { - AuthoringUtil.logger.debug("will create: " + voteContent); voteService.createVote(voteContent); } else { - AuthoringUtil.logger.debug("will update: " + voteContent); voteService.updateVote(voteContent); } voteContent = voteService.retrieveVote(new Long(strToolContentID)); - AuthoringUtil.logger.debug("voteContent: " + voteContent); - voteContent = createQuestionContent(mapQuestionContent, mapFeedback, voteService, voteContent); voteService.saveDataFlowObjectAssigment(assignedDataFlowObject); @@ -1375,66 +1078,40 @@ protected VoteContent createQuestionContent(Map mapQuestionContent, Map mapFeedback, IVoteService voteService, VoteContent voteContent) { - AuthoringUtil.logger.debug("createQuestionContent: "); - AuthoringUtil.logger.debug("content uid is: " + voteContent.getUid()); List questions = voteService.retrieveVoteQueContentsByToolContentId(voteContent.getUid().longValue()); - AuthoringUtil.logger.debug("questions: " + questions); - AuthoringUtil.logger.debug("mapQuestionContent: " + mapQuestionContent); - AuthoringUtil.logger.debug("mapFeedback: " + mapFeedback); - Iterator itMap = mapQuestionContent.entrySet().iterator(); int displayOrder = 0; while (itMap.hasNext()) { Map.Entry pairs = (Map.Entry) itMap.next(); - AuthoringUtil.logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue()); if (pairs.getValue().toString().length() != 0) { - AuthoringUtil.logger.debug("starting createQuestionContent: pairs.getValue().toString():" - + pairs.getValue().toString()); - AuthoringUtil.logger.debug("starting createQuestionContent: voteContent: " + voteContent); ++displayOrder; - AuthoringUtil.logger.debug("starting createQuestionContent: displayOrder: " + displayOrder); String currentFeedback = (String) mapFeedback.get(new Integer(displayOrder).toString()); - AuthoringUtil.logger.debug("currentFeedback: " + currentFeedback); VoteQueContent queContent = new VoteQueContent(pairs.getValue().toString(), displayOrder, voteContent, null); - AuthoringUtil.logger.debug("queContent: " + queContent); - /* checks if the question is already recorded */ - AuthoringUtil.logger.debug("question text is: " + pairs.getValue().toString()); - AuthoringUtil.logger.debug("content uid is: " + voteContent.getUid()); - AuthoringUtil.logger.debug("question display order is: " + displayOrder); VoteQueContent existingVoteQueContent = voteService.getQuestionContentByDisplayOrder(new Long( displayOrder), voteContent.getUid()); - AuthoringUtil.logger.debug("existingVoteQueContent: " + existingVoteQueContent); if (existingVoteQueContent == null) { /* make sure a question with the same question text is not already saved */ VoteQueContent duplicateVoteQueContent = voteService.getQuestionContentByQuestionText(pairs .getValue().toString(), voteContent.getUid()); - AuthoringUtil.logger.debug("duplicateVoteQueContent: " + duplicateVoteQueContent); - AuthoringUtil.logger.debug("adding a new question to content: " + queContent); voteContent.getVoteQueContents().add(queContent); queContent.setVoteContent(voteContent); voteService.createVoteQue(queContent); } else { String existingQuestion = existingVoteQueContent.getQuestion(); - AuthoringUtil.logger.debug("existingQuestion: " + existingQuestion); - AuthoringUtil.logger.debug("map question versus existingQuestion: " + pairs.getValue().toString() - + " versus db question value: " + existingQuestion); - existingVoteQueContent.setQuestion(pairs.getValue().toString()); // existingVoteQueContent.setFeedback(currentFeedback); existingVoteQueContent.setDisplayOrder(displayOrder); - - AuthoringUtil.logger.debug("updating the existing question content: " + existingVoteQueContent); voteService.updateVoteQueContent(existingVoteQueContent); } } @@ -1444,31 +1121,20 @@ public void reOrganizeDisplayOrder(Map mapQuestionContent, IVoteService voteService, VoteAuthoringForm voteAuthoringForm, VoteContent voteContent) { - AuthoringUtil.logger.debug("voteContent: " + voteContent); if (voteContent != null) { - AuthoringUtil.logger.debug("content uid: " + voteContent.getUid()); List sortedQuestions = voteService.getAllQuestionEntriesSorted(voteContent.getUid().longValue()); - AuthoringUtil.logger.debug("sortedQuestions: " + sortedQuestions); Iterator listIterator = sortedQuestions.iterator(); int displayOrder = 1; while (listIterator.hasNext()) { VoteQueContent queContent = (VoteQueContent) listIterator.next(); - AuthoringUtil.logger.debug("queContent data: " + queContent); - AuthoringUtil.logger.debug("queContent: " + queContent.getQuestion() + " " - + queContent.getDisplayOrder()); VoteQueContent existingVoteQueContent = voteService.getQuestionContentByQuestionText(queContent .getQuestion(), voteContent.getUid()); - AuthoringUtil.logger.debug("existingVoteQueContent: " + existingVoteQueContent); - existingVoteQueContent.setDisplayOrder(displayOrder); - AuthoringUtil.logger.debug("updating the existing question content for displayOrder: " - + existingVoteQueContent); voteService.updateVoteQueContent(existingVoteQueContent); displayOrder++; } } - AuthoringUtil.logger.debug("done with reOrganizeDisplayOrder..."); } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/LearningUtil.java =================================================================== diff -u -r25187e73d76504fc9d29a21440750230e35f00fb -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/LearningUtil.java (.../LearningUtil.java) (revision 25187e73d76504fc9d29a21440750230e35f00fb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/LearningUtil.java (.../LearningUtil.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -32,7 +32,6 @@ import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang.StringUtils; -import org.apache.log4j.Logger; import org.lamsfoundation.lams.learningdesign.DataFlowObject; import org.lamsfoundation.lams.tool.SimpleURL; import org.lamsfoundation.lams.tool.ToolOutput; @@ -56,7 +55,6 @@ * */ public class LearningUtil implements VoteAppConstants { - static Logger logger = Logger.getLogger(LearningUtil.class.getName()); /** * Build a map of the display ids -> nomination text. If checkedOptions != null then only include the display ids in @@ -123,15 +121,13 @@ * @return */ public static VoteQueUsr createUser(HttpServletRequest request, IVoteService voteService, Long toolSessionID) { - LearningUtil.logger.debug("createUser: " + toolSessionID); Long queUsrId = VoteUtils.getUserId(); String username = VoteUtils.getUserName(); String fullname = VoteUtils.getUserFullName(); VoteSession voteSession = voteService.retrieveVoteSession(toolSessionID); VoteQueUsr voteQueUsr = new VoteQueUsr(queUsrId, username, fullname, voteSession, new TreeSet()); voteService.createVoteQueUsr(voteQueUsr); - LearningUtil.logger.debug("created voteQueUsr in the db: " + voteQueUsr); return voteQueUsr; } @@ -154,38 +150,24 @@ public static void createAttempt(HttpServletRequest request, IVoteService voteService, VoteQueUsr voteQueUsr, Map mapGeneralCheckedOptionsContent, String userEntry, boolean singleUserEntry, VoteSession voteSession, Long toolContentUID) { - LearningUtil.logger.debug("doing voteSession: " + voteSession); - LearningUtil.logger.debug("doing createAttempt: " + mapGeneralCheckedOptionsContent); - LearningUtil.logger.debug("userEntry: " + userEntry); - LearningUtil.logger.debug("singleUserEntry: " + singleUserEntry); Date attempTime = VoteUtils.getGMTDateTime(); String timeZone = VoteUtils.getCurrentTimeZone(); - LearningUtil.logger.debug("timeZone: " + timeZone); - LearningUtil.logger.debug("toolContentUID: " + toolContentUID); - if (mapGeneralCheckedOptionsContent.size() == 0) { - LearningUtil.logger.debug("mapGeneralCheckedOptionsContent is empty"); VoteQueContent localVoteQueContent = voteService.getToolDefaultQuestionContent(1); - LearningUtil.logger.debug("localVoteQueContent: " + localVoteQueContent); createIndividualOptions(request, voteService, localVoteQueContent, voteQueUsr, attempTime, timeZone, userEntry, singleUserEntry, voteSession); } else { - LearningUtil.logger.debug("mapGeneralCheckedOptionsContent is not empty"); if (toolContentUID != null) { Iterator itCheckedMap = mapGeneralCheckedOptionsContent.entrySet().iterator(); - LearningUtil.logger.debug("iterating mapGeneralCheckedOptionsContent"); while (itCheckedMap.hasNext()) { Map.Entry checkedPairs = (Map.Entry) itCheckedMap.next(); Long questionDisplayOrder = new Long(checkedPairs.getKey().toString()); - LearningUtil.logger.debug("questionDisplayOrder: " + questionDisplayOrder); - VoteQueContent voteQueContent = voteService.getQuestionContentByDisplayOrder(questionDisplayOrder, toolContentUID); - LearningUtil.logger.debug("voteQueContent: " + voteQueContent); if (voteQueContent != null) { createIndividualOptions(request, voteService, voteQueContent, voteQueUsr, attempTime, timeZone, userEntry, false, voteSession); @@ -199,88 +181,59 @@ public static void createIndividualOptions(HttpServletRequest request, IVoteService voteService, VoteQueContent voteQueContent, VoteQueUsr voteQueUsr, Date attempTime, String timeZone, String userEntry, boolean singleUserEntry, VoteSession voteSession) { - LearningUtil.logger.debug("doing voteSession: " + voteSession); - LearningUtil.logger.debug("userEntry: " + userEntry); - LearningUtil.logger.debug("singleUserEntry: " + singleUserEntry); - LearningUtil.logger.debug("voteQueContent: " + voteQueContent); - LearningUtil.logger.debug("user " + voteQueUsr.getQueUsrId()); - LearningUtil.logger.debug("voteQueContent.getVoteContentId() " + voteQueContent.getVoteContentId()); - if (voteQueContent != null) { VoteUsrAttempt existingVoteUsrAttempt = voteService.getAttemptsForUserAndQuestionContentAndSession( voteQueUsr.getQueUsrId(), voteQueContent.getVoteContentId(), voteSession.getUid()); - LearningUtil.logger.debug("existingVoteUsrAttempt: " + existingVoteUsrAttempt); if (existingVoteUsrAttempt != null) { - LearningUtil.logger.debug("update existingVoteUsrAttempt: " + existingVoteUsrAttempt); existingVoteUsrAttempt.setUserEntry(userEntry); existingVoteUsrAttempt.setAttemptTime(attempTime); existingVoteUsrAttempt.setTimeZone(timeZone); voteService.updateVoteUsrAttempt(existingVoteUsrAttempt); - LearningUtil.logger.debug("done updating existingVoteUsrAttempt: " + existingVoteUsrAttempt); } else { - LearningUtil.logger.debug("create new attempt"); VoteUsrAttempt voteUsrAttempt = new VoteUsrAttempt(attempTime, timeZone, voteQueContent, voteQueUsr, userEntry, singleUserEntry, true); - LearningUtil.logger.debug("voteUsrAttempt: " + voteUsrAttempt); voteService.createVoteUsrAttempt(voteUsrAttempt); - LearningUtil.logger.debug("created voteUsrAttempt in the db :" + voteUsrAttempt); } } } public static void readParameters(HttpServletRequest request, VoteLearningForm voteLearningForm) { String optionCheckBoxSelected = request.getParameter("optionCheckBoxSelected"); - LearningUtil.logger.debug("parameter optionCheckBoxSelected: " + optionCheckBoxSelected); if (optionCheckBoxSelected != null && optionCheckBoxSelected.equals("1")) { - LearningUtil.logger.debug("parameter optionCheckBoxSelected is selected " + optionCheckBoxSelected); voteLearningForm.setOptionCheckBoxSelected("1"); } String questionIndex = request.getParameter("questionIndex"); - LearningUtil.logger.debug("parameter questionIndex: " + questionIndex); if (questionIndex != null) { - LearningUtil.logger.debug("parameter questionIndex is selected " + questionIndex); voteLearningForm.setQuestionIndex(questionIndex); } String optionIndex = request.getParameter("optionIndex"); - LearningUtil.logger.debug("parameter optionIndex: " + optionIndex); if (optionIndex != null) { - LearningUtil.logger.debug("parameter optionIndex is selected " + optionIndex); voteLearningForm.setOptionIndex(optionIndex); } String optionValue = request.getParameter("optionValue"); - LearningUtil.logger.debug("parameter optionValue: " + optionValue); if (optionValue != null) { voteLearningForm.setOptionValue(optionValue); } String checked = request.getParameter("checked"); - LearningUtil.logger.debug("parameter checked: " + checked); if (checked != null) { - LearningUtil.logger.debug("parameter checked is selected " + checked); voteLearningForm.setChecked(checked); } } public static Map selectOptionsCheckBox(HttpServletRequest request, VoteLearningForm voteLearningForm, String questionIndex, Map mapGeneralCheckedOptionsContent, Map mapQuestionContentLearner) { - LearningUtil.logger.debug("requested optionCheckBoxSelected..."); - LearningUtil.logger.debug("questionIndex: " + voteLearningForm.getQuestionIndex()); - LearningUtil.logger.debug("optionValue: " + voteLearningForm.getOptionValue()); - LearningUtil.logger.debug("checked: " + voteLearningForm.getChecked()); - LearningUtil.logger.debug("mapQuestionContentLearner: " + mapQuestionContentLearner); String selectedNomination = (String) mapQuestionContentLearner.get(voteLearningForm.getQuestionIndex()); - LearningUtil.logger.debug("selectedNomination: " + selectedNomination); Map mapFinal = new TreeMap(new VoteComparator()); if (mapGeneralCheckedOptionsContent.size() == 0) { - LearningUtil.logger.debug("mapGeneralCheckedOptionsContent size is 0"); Map mapLeanerCheckedOptionsContent = new TreeMap(new VoteComparator()); if (voteLearningForm.getChecked().equals("true")) { @@ -293,19 +246,16 @@ } else { Map mapCurrentOptions = mapGeneralCheckedOptionsContent; - LearningUtil.logger.debug("mapCurrentOptions: " + mapCurrentOptions); if (mapCurrentOptions != null) { if (voteLearningForm.getChecked().equals("true")) { mapCurrentOptions.put(voteLearningForm.getQuestionIndex(), selectedNomination); } else { mapCurrentOptions.remove(voteLearningForm.getQuestionIndex()); } - LearningUtil.logger.debug("updated mapCurrentOptions: " + mapCurrentOptions); - mapFinal = mapCurrentOptions; } else { - LearningUtil.logger.debug("no options for this questions has been selected yet"); + //no options for this questions has been selected yet Map mapLeanerCheckedOptionsContent = new TreeMap(new VoteComparator()); if (voteLearningForm.getChecked().equals("true")) { @@ -318,7 +268,6 @@ } } - LearningUtil.logger.debug("mapFinal: " + mapFinal); return mapFinal; } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java =================================================================== diff -u -rded6335c9a04246994586bba62b43b577d2e6fb2 -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision ded6335c9a04246994586bba62b43b577d2e6fb2) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -35,10 +35,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; -import org.apache.log4j.Logger; import org.lamsfoundation.lams.notebook.model.NotebookEntry; import org.lamsfoundation.lams.notebook.service.CoreNotebookConstants; -import org.lamsfoundation.lams.tool.vote.ExportPortfolioDTO; import org.lamsfoundation.lams.tool.vote.VoteAllGroupsDTO; import org.lamsfoundation.lams.tool.vote.VoteAllSessionsDTO; import org.lamsfoundation.lams.tool.vote.VoteAppConstants; @@ -72,25 +70,18 @@ * */ public class MonitoringUtil implements VoteAppConstants { - static Logger logger = Logger.getLogger(MonitoringUtil.class.getName()); public static Map populateToolSessions(HttpServletRequest request, VoteContent voteContent, IVoteService voteService) { List sessionsList = voteService.getSessionNamesFromContent(voteContent); - logger.debug("sessionsList size is:..." + sessionsList.size()); Map sessionsMap = VoteUtils.convertToStringMap(sessionsList, "String"); - logger.debug("generated sessionsMap:..." + sessionsMap); - logger.debug("sessionsMap size:..." + sessionsMap.size()); if (sessionsMap.isEmpty()) { - logger.debug("sessionsMap size is 0:"); sessionsMap.put(new Long(1).toString(), "None"); } else { - logger.debug("sessionsMap has some entries: " + sessionsMap.size()); sessionsMap.put(new Long(sessionsMap.size() + 1).toString(), "All"); } - logger.debug("final sessionsMap:" + sessionsMap); return sessionsMap; } @@ -110,39 +101,27 @@ public static List buildGroupsQuestionData(HttpServletRequest request, VoteContent voteContent, boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId, IVoteService voteService) { - logger.debug("isUserNamesVisible: " + isUserNamesVisible); - logger.debug("isLearnerRequest: " + isLearnerRequest); - logger.debug("userId: " + userId); - - logger.debug("voteService: " + voteService); - - logger.debug("will be building groups question data for content:..." + voteContent); List listQuestions = voteService.getAllQuestionEntries(voteContent.getUid()); - logger.debug("listQuestions:..." + listQuestions); List listMonitoredAnswersContainerDTO = new LinkedList(); Iterator itListQuestions = listQuestions.iterator(); while (itListQuestions.hasNext()) { VoteQueContent voteQueContent = (VoteQueContent) itListQuestions.next(); - logger.debug("voteQueContent:..." + voteQueContent); if (voteQueContent != null) { VoteMonitoredAnswersDTO voteMonitoredAnswersDTO = new VoteMonitoredAnswersDTO(); voteMonitoredAnswersDTO.setQuestionUid(voteQueContent.getUid().toString()); voteMonitoredAnswersDTO.setQuestion(voteQueContent.getQuestion()); - logger.debug("using allUsersData to retrieve users data: " + isUserNamesVisible); Map questionAttemptData = buildGroupsAttemptData(request, voteContent, voteQueContent, voteQueContent .getUid().toString(), isUserNamesVisible, isLearnerRequest, currentSessionId, userId, voteService); - logger.debug("questionAttemptData:..." + questionAttemptData); voteMonitoredAnswersDTO.setQuestionAttempts(questionAttemptData); listMonitoredAnswersContainerDTO.add(voteMonitoredAnswersDTO); } } - logger.debug("final listMonitoredAnswersContainerDTO:..." + listMonitoredAnswersContainerDTO); return listMonitoredAnswersContainerDTO; } @@ -163,37 +142,23 @@ public static Map buildGroupsAttemptData(HttpServletRequest request, VoteContent voteContent, VoteQueContent voteQueContent, String questionUid, boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId, IVoteService voteService) { - logger.debug("isUserNamesVisible: " + isUserNamesVisible); - logger.debug("isLearnerRequest: " + isLearnerRequest); - logger.debug("currentSessionId: " + currentSessionId); - logger.debug("userId: " + userId); - logger.debug("doing buildGroupsAttemptData..."); - logger.debug("voteService: " + voteService); - Map mapMonitoredAttemptsContainerDTO = new TreeMap(new VoteComparator()); List listMonitoredAttemptsContainerDTO = new LinkedList(); Map summaryToolSessions = populateToolSessionsId(request, voteContent, voteService); - logger.debug("summaryToolSessions: " + summaryToolSessions); Iterator itMap = summaryToolSessions.entrySet().iterator(); /*request is for monitoring summary */ if (!isLearnerRequest) { while (itMap.hasNext()) { Map.Entry pairs = (Map.Entry) itMap.next(); - logger.debug("using the summary tool sessions pair: " + pairs.getKey() + " = " + pairs.getValue()); if (!(pairs.getValue().toString().equals("None")) && !(pairs.getValue().toString().equals("All"))) { - logger.debug("using the numerical summary tool sessions pair: " + " = " + pairs.getValue()); VoteSession voteSession = voteService.retrieveVoteSession(new Long(pairs.getValue().toString())); - logger.debug("voteSession: " + " = " + voteSession); if (voteSession != null) { List listUsers = voteService.getUserBySessionOnly(voteSession); - logger - .debug("listMcUsers for session id:" + voteSession.getVoteSessionId() + " = " - + listUsers); Map sessionUsersAttempts = populateSessionUsersAttempts(request, voteContent, voteSession .getVoteSessionId(), listUsers, questionUid, isUserNamesVisible, isLearnerRequest, userId, voteService); @@ -203,25 +168,16 @@ } } else { /*request is for learner report, use only the passed tool session in the report*/ - logger.debug("using currentSessionId for the learner report:" + currentSessionId); while (itMap.hasNext()) { Map.Entry pairs = (Map.Entry) itMap.next(); - logger.debug("using the summary tool sessions pair: " + pairs.getKey() + " = " + pairs.getValue()); if (!(pairs.getValue().toString().equals("None")) && !(pairs.getValue().toString().equals("All"))) { - logger.debug("using the numerical summary tool sessions pair: " + " = " + pairs.getValue()); if (currentSessionId.equals(pairs.getValue())) { - logger - .debug("only using this tool session for the learner report: " + " = " - + pairs.getValue()); VoteSession voteSession = voteService .retrieveVoteSession(new Long(pairs.getValue().toString())); - logger.debug("voteSession: " + " = " + voteSession); if (voteSession != null) { List listUsers = voteService.getUserBySessionOnly(voteSession); - logger.debug("listMcUsers for session id:" + voteSession.getVoteSessionId() + " = " - + listUsers); Map sessionUsersAttempts = populateSessionUsersAttempts(request, voteContent, voteSession .getVoteSessionId(), listUsers, questionUid, isUserNamesVisible, isLearnerRequest, userId, voteService); @@ -232,49 +188,30 @@ } } - logger.debug("final listMonitoredAttemptsContainerDTO:..." + listMonitoredAttemptsContainerDTO); mapMonitoredAttemptsContainerDTO = convertToMap(listMonitoredAttemptsContainerDTO); - logger.debug("final mapMonitoredAttemptsContainerDTO:..." + mapMonitoredAttemptsContainerDTO); return mapMonitoredAttemptsContainerDTO; } public static Map populateSessionUsersAttempts(HttpServletRequest request, VoteContent voteContent, Long sessionId, List listUsers, String questionUid, boolean isUserNamesVisible, boolean isLearnerRequest, String userId, IVoteService voteService) { - logger.debug("doing populateSessionUsersAttempts for: " + questionUid); - logger.debug("isUserNamesVisible: " + isUserNamesVisible); - logger.debug("isLearnerRequest: " + isLearnerRequest); - logger.debug("voteContent: " + voteContent); - logger.debug("userId: " + userId); - logger.debug("doing populateSessionUsersAttempts..."); - logger.debug("voteService: " + voteService); - Map mapMonitoredUserContainerDTO = new TreeMap(new VoteStringComparator()); List listMonitoredUserContainerDTO = new LinkedList(); Iterator itUsers = listUsers.iterator(); if (userId == null) { - logger.debug("request is not for learner progress report"); if ((isUserNamesVisible) && (!isLearnerRequest)) { - logger.debug("summary reporting case 1"); - logger.debug("isUserNamesVisible true, isLearnerRequest false"); - logger.debug("getting alll the user' data"); while (itUsers.hasNext()) { VoteQueUsr voteQueUsr = (VoteQueUsr) itUsers.next(); - logger.debug("voteQueUsr: " + voteQueUsr); if (voteQueUsr != null) { - logger.debug("getting listUserAttempts for user id: " + voteQueUsr.getUid() - + " and que content id: " + questionUid); List listUserAttempts = voteService.getAttemptsListForUserAndQuestionContent(voteQueUsr .getUid(), new Long(questionUid)); - logger.debug("listUserAttempts: " + listUserAttempts); Iterator itAttempts = listUserAttempts.iterator(); while (itAttempts.hasNext()) { VoteUsrAttempt voteUsrResp = (VoteUsrAttempt) itAttempts.next(); - logger.debug("voteUsrResp: " + voteUsrResp); if (voteUsrResp != null) { VoteMonitoredUserDTO voteMonitoredUserDTO = new VoteMonitoredUserDTO(); @@ -285,34 +222,20 @@ voteMonitoredUserDTO.setSessionId(sessionId.toString()); voteMonitoredUserDTO.setUserEntry(voteUsrResp.getUserEntry()); - logger.debug("attempt: " + voteUsrResp); voteMonitoredUserDTO.setQuestionUid(questionUid); VoteQueContent voteQueContent = voteUsrResp.getVoteQueContent(); - logger.debug("voteQueContent: " + voteQueContent); String entry = voteQueContent.getQuestion(); - logger.debug("entry: " + entry); String voteQueContentId = voteUsrResp.getVoteQueContentId().toString(); - logger.debug("voteQueContentId: " + voteQueContentId); VoteSession localUserSession = voteUsrResp.getVoteQueUsr().getVoteSession(); - logger.debug("localUserSession: " + localUserSession); - logger.debug("localUserSession's content id: " + localUserSession.getVoteContentId()); - logger.debug("incoming content id versus localUserSession's content id: " - + voteContent.getVoteContentId() + " versus " - + localUserSession.getVoteContentId()); - logger.debug("summary reporting case 1"); if (voteContent.getVoteContentId().toString().equals( localUserSession.getVoteContentId().toString())) { if (entry != null) { if (entry.equals("sample nomination") && (voteQueContentId.equals("1"))) { - logger.debug("this nomination entry points to a user entered nomination: " - + voteUsrResp.getUserEntry()); voteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); } else { - logger.debug("this nomination entry points to a standard nomination: " - + voteQueContent.getQuestion()); voteMonitoredUserDTO.setResponse(voteQueContent.getQuestion()); } } @@ -324,32 +247,21 @@ } } } else if ((isUserNamesVisible) && (isLearnerRequest)) { - logger.debug("summary reporting case 2"); - logger - .debug("just populating data normally just like monitoring summary, except that the data is ony for a specific session"); - logger.debug("isUserNamesVisible true, isLearnerRequest true"); + //summary reporting case 2 + //just populating data normally just like monitoring summary, except that the data is ony for a specific session String userID = (String) request.getSession().getAttribute(USER_ID); - logger.debug("userID: " + userID); VoteQueUsr voteQueUsr = voteService.getVoteQueUsrById(new Long(userID).longValue()); - logger - .debug("the current user voteQueUsr " + voteQueUsr + " and username: " - + voteQueUsr.getUsername()); while (itUsers.hasNext()) { voteQueUsr = (VoteQueUsr) itUsers.next(); - logger.debug("voteQueUsr: " + voteQueUsr); if (voteQueUsr != null) { - logger.debug("getting listUserAttempts for user id: " + voteQueUsr.getUid() - + " and que content id: " + questionUid); List listUserAttempts = voteService.getAttemptsListForUserAndQuestionContent(voteQueUsr .getUid(), new Long(questionUid)); - logger.debug("listUserAttempts: " + listUserAttempts); Iterator itAttempts = listUserAttempts.iterator(); while (itAttempts.hasNext()) { VoteUsrAttempt voteUsrResp = (VoteUsrAttempt) itAttempts.next(); - logger.debug("voteUsrResp: " + voteUsrResp); if (voteUsrResp != null) { VoteMonitoredUserDTO voteMonitoredUserDTO = new VoteMonitoredUserDTO(); @@ -360,33 +272,19 @@ voteMonitoredUserDTO.setQueUsrId(voteQueUsr.getUid().toString()); voteMonitoredUserDTO.setSessionId(sessionId.toString()); voteMonitoredUserDTO.setUserEntry(voteUsrResp.getUserEntry()); - logger.debug("attempt: " + voteUsrResp); voteMonitoredUserDTO.setQuestionUid(questionUid); VoteQueContent voteQueContent = voteUsrResp.getVoteQueContent(); - logger.debug("voteQueContent: " + voteQueContent); String entry = voteQueContent.getQuestion(); - logger.debug("entry: " + entry); String voteQueContentId = voteUsrResp.getVoteQueContentId().toString(); - logger.debug("voteQueContentId: " + voteQueContentId); VoteSession localUserSession = voteUsrResp.getVoteQueUsr().getVoteSession(); - logger.debug("localUserSession: " + localUserSession); - logger.debug("localUserSession's content id: " + localUserSession.getVoteContentId()); - logger.debug("incoming content id versus localUserSession's content id: " - + voteContent.getVoteContentId() + " versus " - + localUserSession.getVoteContentId()); - logger.debug("summary reporting case 2"); if (voteContent.getVoteContentId().toString().equals( localUserSession.getVoteContentId().toString())) { if (entry != null) { if (entry.equals("sample nomination") && (voteQueContentId.equals("1"))) { - logger.debug("this nomination entry points to a user entered nomination: " - + voteUsrResp.getUserEntry()); voteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); } else { - logger.debug("this nomination entry points to a standard nomination: " - + voteQueContent.getQuestion()); voteMonitoredUserDTO.setResponse(voteQueContent.getQuestion()); } } @@ -398,77 +296,51 @@ } } } else if ((!isUserNamesVisible) && (isLearnerRequest)) { - logger.debug("summary reporting case 3"); - logger - .debug("populating data normally exception are for a specific session and other user names are not visible."); - logger.debug("isUserNamesVisible false, isLearnerRequest true"); - logger.debug("getting only current user's data"); + //summary reporting case 3 + //populating data normally exception are for a specific session and other user names are not visible String userID = (String) request.getSession().getAttribute(USER_ID); - logger.debug("userID: " + userID); while (itUsers.hasNext()) { VoteQueUsr voteQueUsr = (VoteQueUsr) itUsers.next(); - logger.debug("voteQueUsr: " + voteQueUsr); if (voteQueUsr != null) { - logger.debug("getting listUserAttempts for user id: " + voteQueUsr.getUid() - + " and que content id: " + questionUid); List listUserAttempts = voteService.getAttemptsListForUserAndQuestionContent(voteQueUsr .getUid(), new Long(questionUid)); - logger.debug("listUserAttempts: " + listUserAttempts); Iterator itAttempts = listUserAttempts.iterator(); while (itAttempts.hasNext()) { VoteUsrAttempt voteUsrResp = (VoteUsrAttempt) itAttempts.next(); - logger.debug("voteUsrResp: " + voteUsrResp); if (voteUsrResp != null) { VoteMonitoredUserDTO voteMonitoredUserDTO = new VoteMonitoredUserDTO(); voteMonitoredUserDTO.setAttemptTime(voteUsrResp.getAttemptTime()); voteMonitoredUserDTO.setTimeZone(voteUsrResp.getTimeZone()); voteMonitoredUserDTO.setUid(voteUsrResp.getUid().toString()); - logger.debug("userID versus queUsrId: " + userID + "-" + voteQueUsr.getQueUsrId()); if (userID.equals(voteQueUsr.getQueUsrId().toString())) { - logger.debug("this is current user, put his name normally."); voteMonitoredUserDTO.setUserName(voteQueUsr.getFullname()); } else { - logger.debug("this is not current user, put his name as blank."); voteMonitoredUserDTO.setUserName("[ ]"); } voteMonitoredUserDTO.setQueUsrId(voteQueUsr.getUid().toString()); voteMonitoredUserDTO.setSessionId(sessionId.toString()); - logger.debug("attempt: " + voteUsrResp); voteMonitoredUserDTO.setQuestionUid(questionUid); voteMonitoredUserDTO.setUserEntry(voteUsrResp.getUserEntry()); VoteQueContent voteQueContent = voteUsrResp.getVoteQueContent(); - logger.debug("voteQueContent: " + voteQueContent); String entry = voteQueContent.getQuestion(); - logger.debug("entry: " + entry); String voteQueContentId = voteUsrResp.getVoteQueContentId().toString(); - logger.debug("voteQueContentId: " + voteQueContentId); VoteSession localUserSession = voteUsrResp.getVoteQueUsr().getVoteSession(); - logger.debug("localUserSession: " + localUserSession); - logger.debug("localUserSession's content id: " + localUserSession.getVoteContentId()); - logger.debug("incoming content id versus localUserSession's content id: " - + voteContent.getVoteContentId() + " versus " - + localUserSession.getVoteContentId()); - logger.debug("summary reporting case 3"); if (voteContent.getVoteContentId().toString().equals( localUserSession.getVoteContentId().toString())) { if (entry != null) { if (entry.equals("sample nomination") && (voteQueContentId.equals("1"))) { - logger.debug("this nomination entry points to a user entered nomination: " - + voteUsrResp.getUserEntry()); voteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); } else { - logger.debug("this nomination entry points to a standard nomination: " - + voteQueContent.getQuestion()); voteMonitoredUserDTO.setResponse(voteQueContent.getQuestion()); } } @@ -482,28 +354,22 @@ } } } else { - logger.debug("summary reporting case 4"); - logger.debug("request is for learner progress report: " + userId); + //summary reporting case 4 + //request is for learner progress report userId while (itUsers.hasNext()) { VoteQueUsr voteQueUsr = (VoteQueUsr) itUsers.next(); - logger.debug("voteQueUsr: " + voteQueUsr); if (voteQueUsr != null) { - logger.debug("getting listUserAttempts for user id: " + voteQueUsr.getUid() - + " and que content id: " + questionUid); List listUserAttempts = voteService.getAttemptsListForUserAndQuestionContent(voteQueUsr.getUid(), new Long(questionUid)); - logger.debug("listUserAttempts: " + listUserAttempts); Iterator itAttempts = listUserAttempts.iterator(); while (itAttempts.hasNext()) { VoteUsrAttempt voteUsrResp = (VoteUsrAttempt) itAttempts.next(); - logger.debug("voteUsrResp: " + voteUsrResp); if (voteUsrResp != null) { - logger.debug("userID versus queUsrId: " + userId + "-" + voteQueUsr.getQueUsrId()); if (userId.equals(voteQueUsr.getQueUsrId().toString())) { - logger.debug("this is the user requested , include his name for learner progress."); + //this is the user requested , include his name for learner progress VoteMonitoredUserDTO voteMonitoredUserDTO = new VoteMonitoredUserDTO(); voteMonitoredUserDTO.setAttemptTime(voteUsrResp.getAttemptTime()); voteMonitoredUserDTO.setTimeZone(voteUsrResp.getTimeZone()); @@ -512,34 +378,20 @@ voteMonitoredUserDTO.setQueUsrId(voteQueUsr.getUid().toString()); voteMonitoredUserDTO.setSessionId(sessionId.toString()); voteMonitoredUserDTO.setUserEntry(voteUsrResp.getUserEntry()); - logger.debug("attempt: " + voteUsrResp); voteMonitoredUserDTO.setQuestionUid(questionUid); VoteQueContent voteQueContent = voteUsrResp.getVoteQueContent(); - logger.debug("voteQueContent: " + voteQueContent); String entry = voteQueContent.getQuestion(); - logger.debug("entry: " + entry); String voteQueContentId = voteUsrResp.getVoteQueContentId().toString(); - logger.debug("voteQueContentId: " + voteQueContentId); VoteSession localUserSession = voteUsrResp.getVoteQueUsr().getVoteSession(); - logger.debug("localUserSession: " + localUserSession); - logger.debug("localUserSession's content id: " + localUserSession.getVoteContentId()); - logger.debug("incoming content id versus localUserSession's content id: " - + voteContent.getVoteContentId() + " versus " - + localUserSession.getVoteContentId()); - logger.debug("summary reporting case 4"); if (voteContent.getVoteContentId().toString().equals( localUserSession.getVoteContentId().toString())) { if (entry != null) { if (entry.equals("sample nomination") && (voteQueContentId.equals("1"))) { - logger.debug("this nomination entry points to a user entered nomination: " - + voteUsrResp.getUserEntry()); voteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); } else { - logger.debug("this nomination entry points to a standard nomination: " - + voteQueContent.getQuestion()); voteMonitoredUserDTO.setResponse(voteQueContent.getQuestion()); } } @@ -554,47 +406,33 @@ } - logger.debug("final listMonitoredUserContainerDTO: " + listMonitoredUserContainerDTO); mapMonitoredUserContainerDTO = convertToVoteMonitoredUserDTOMap(listMonitoredUserContainerDTO); - logger.debug("final mapMonitoredUserContainerDTO:..." + mapMonitoredUserContainerDTO); return mapMonitoredUserContainerDTO; } public static Map populateToolSessionsId(HttpServletRequest request, VoteContent voteContent, IVoteService voteService) { - logger.debug("attempt populateToolSessionsId for: " + voteContent); List sessionsList = voteService.getSessionsFromContent(voteContent); - logger.debug("sessionsList size is:..." + sessionsList.size()); Map sessionsMap = VoteUtils.convertToStringMap(sessionsList, "Long"); - logger.debug("generated sessionsMap:..." + sessionsMap); - logger.debug("sessionsMap size:..." + sessionsMap.size()); if (sessionsMap.isEmpty()) { - logger.debug("sessionsMap size is 0:"); sessionsMap.put(new Long(1).toString(), "None"); } else { - logger.debug("sessionsMap has some entries: " + sessionsMap.size()); sessionsMap.put(new Long(sessionsMap.size() + 1).toString(), "All"); } - logger.debug("final sessionsMap:" + sessionsMap); return sessionsMap; } public static Map convertToVoteMonitoredUserDTOMap(List list) { - logger.debug("using convertToVoteMonitoredUserDTOMap: " + list); Map map = new TreeMap(new VoteComparator()); Iterator listIterator = list.iterator(); Long mapIndex = new Long(1); while (listIterator.hasNext()) { VoteMonitoredUserDTO data = (VoteMonitoredUserDTO) listIterator.next(); - logger.debug("using data: " + data); - logger.debug("using data: " + data.getResponse()); - logger.debug("using session id: " + data.getSessionId()); - logger.debug("using question uid: " + data.getQuestionUid()); map.put(mapIndex.toString(), data); mapIndex = new Long(mapIndex.longValue() + 1); @@ -603,23 +441,19 @@ } public static double calculateTotal(Map mapVoteRatesContent) { - logger.debug("calculating total for: " + mapVoteRatesContent); double total = 0d; Iterator itMap = mapVoteRatesContent.entrySet().iterator(); while (itMap.hasNext()) { Map.Entry pairs = (Map.Entry) itMap.next(); - logger.debug("using the pair: " + pairs.getKey() + " = " + pairs.getValue()); if (pairs.getValue() != null) { total = total + new Double(pairs.getValue().toString()).doubleValue(); } - logger.debug("total: " + total); } return total; } public static Map convertToMap(List list) { - logger.debug("using convertToMap: " + list); Map map = new TreeMap(new VoteComparator()); Iterator listIterator = list.iterator(); @@ -644,48 +478,33 @@ */ public static List prepareChartDTO(HttpServletRequest request, IVoteService voteService, VoteMonitoringForm voteMonitoringForm, Long toolContentID, MessageService messageService) { - logger.debug("start preparing ChartDTO with voteMonitoringForm: " + voteMonitoringForm); - logger.debug("start preparing ChartDTO with toolContentID: " + toolContentID); List listVoteAllSessionsDTO = new LinkedList(); VoteContent voteContent = voteService.retrieveVote(toolContentID); - logger.debug("existing voteContent:" + voteContent); - logger.debug("will be building groups question data for content:..." + voteContent); Iterator itListSessions = voteContent.getVoteSessions().iterator(); while (itListSessions.hasNext()) { VoteSession voteSession = (VoteSession) itListSessions.next(); - logger.debug("voteSession:..." + voteSession); - logger.debug("current voteSession id :..." + voteSession.getVoteSessionId()); - logger.debug("current toolSessionUid :..." + voteSession.getUid()); Map mapOptionsContent = new TreeMap(new VoteComparator()); - logger.debug("mapOptionsContent: " + mapOptionsContent); - Map mapVoteRatesContent = new TreeMap(new VoteComparator()); - logger.debug("mapVoteRatesContent: " + mapVoteRatesContent); VoteAllSessionsDTO voteAllSessionsDTO = new VoteAllSessionsDTO(); voteAllSessionsDTO.setSessionId(voteSession.getVoteSessionId().toString()); voteAllSessionsDTO.setSessionName(voteSession.getSession_name()); int entriesCount = voteService.getSessionEntriesCount(voteSession.getUid()); - logger.debug("entriesCount: " + entriesCount); Set userEntries = voteService.getSessionUserEntriesSet(voteSession.getUid()); - logger.debug("sessionUserCount: " + userEntries.size()); int potentialUserCount = voteService.getVoteSessionPotentialLearnersCount(voteSession.getUid()); - logger.debug("potentialUserCount: " + potentialUserCount); voteAllSessionsDTO.setSessionUserCount(Integer.toString(potentialUserCount)); int completedSessionUserCount = voteService.getCompletedVoteUserBySessionUid(voteSession.getUid()); - logger.debug("completedSessionUserCount: " + completedSessionUserCount); voteAllSessionsDTO.setCompletedSessionUserCount(new Integer(completedSessionUserCount).toString()); if (potentialUserCount != 0) { double completedPercent = (completedSessionUserCount * 100) / potentialUserCount; - logger.debug("completed percent: " + completedPercent); if (completedPercent > 100) completedPercent = 100; @@ -695,103 +514,69 @@ voteAllSessionsDTO.setCompletedSessionUserPercent("Not Available"); } - logger.debug("entriesCount: " + entriesCount); - logger.debug("userEntries: " + userEntries); - Map mapStandardUserCount = new TreeMap(new VoteComparator()); - logger.debug("setting existing content data from the db"); mapOptionsContent.clear(); Iterator queIterator = voteContent.getVoteQueContents().iterator(); Long mapIndex = new Long(1); - logger.debug("mapOptionsContent: " + mapOptionsContent); int totalStandardVotesCount = 0; - logger.debug("using entriesCount: " + entriesCount); Map mapStandardNominationsHTMLedContent = new TreeMap(new VoteComparator()); Map mapStandardQuestionUid = new TreeMap(new VoteComparator()); Map mapStandardToolSessionUid = new TreeMap(new VoteComparator()); while (queIterator.hasNext()) { VoteQueContent voteQueContent = (VoteQueContent) queIterator.next(); if (voteQueContent != null) { - logger.debug("question: " + voteQueContent.getQuestion()); mapStandardNominationsHTMLedContent.put(mapIndex.toString(), voteQueContent.getQuestion()); String noHTMLNomination = VoteUtils.stripHTML(voteQueContent.getQuestion()); - logger.debug("noHTMLNomination: " + noHTMLNomination); mapOptionsContent.put(mapIndex.toString(), noHTMLNomination); int votesCount = 0; - logger.debug("getting votesCount based on session: " + voteSession.getUid()); votesCount = voteService.getStandardAttemptsForQuestionContentAndSessionUid( voteQueContent.getUid(), voteSession.getUid()); mapStandardQuestionUid.put(mapIndex.toString(), voteQueContent.getUid().toString()); mapStandardToolSessionUid.put(mapIndex.toString(), voteSession.getUid()); - logger - .debug("votesCount for questionContent uid: " + votesCount + " for" - + voteQueContent.getUid()); mapStandardUserCount.put(mapIndex.toString(), new Integer(votesCount).toString()); totalStandardVotesCount = totalStandardVotesCount + votesCount; double voteRate = 0d; double doubleVotesCount = votesCount * 1d; - logger.debug("doubleVotesCount: " + doubleVotesCount); double doubleEntriesCount = entriesCount * 1d; - logger.debug("doubleEntriesCount: " + doubleEntriesCount); if (entriesCount != 0) { voteRate = ((doubleVotesCount * 100) / doubleEntriesCount); } - - logger.debug("voteRate" + voteRate); - String stringVoteRate = new Double(voteRate).toString(); int lengthVoteRate = stringVoteRate.length(); - logger.debug("lengthVoteRate" + lengthVoteRate); if (lengthVoteRate > 5) stringVoteRate = stringVoteRate.substring(0, 6); mapVoteRatesContent.put(mapIndex.toString(), stringVoteRate); mapIndex = new Long(mapIndex.longValue() + 1); } } - logger.debug("test1: Map initialized with existing contentid to: " + mapOptionsContent); Map mapStandardNominationsContent = new TreeMap(new VoteComparator()); mapStandardNominationsContent = mapOptionsContent; - logger.debug("mapStandardNominationsContent: " + mapStandardNominationsContent); - logger.debug("mapStandardNominationsHTMLedContent: " + mapStandardNominationsHTMLedContent); Map mapStandardRatesContent = new TreeMap(new VoteComparator()); mapStandardRatesContent = mapVoteRatesContent; - logger.debug("test1: mapStandardRatesContent: " + mapStandardRatesContent); - logger.debug("test1: mapStandardUserCount: " + mapStandardUserCount); Iterator itListQuestions = userEntries.iterator(); int mapVoteRatesSize = mapVoteRatesContent.size(); - logger.debug("mapVoteRatesSize: " + mapVoteRatesSize); mapIndex = new Long(mapVoteRatesSize + 1); - logger.debug("updated mapIndex: " + mapIndex); double total = MonitoringUtil.calculateTotal(mapVoteRatesContent); - logger.debug("updated mapIndex: " + mapIndex); double share = 100d - total; - logger.debug("share: " + share); - - logger.debug("totalStandardVotesCount: " + totalStandardVotesCount); int userEnteredVotesCount = entriesCount - totalStandardVotesCount; - logger.debug("userEnteredVotesCount for this session: " + userEnteredVotesCount); if (userEnteredVotesCount != 0) { share = ((userEnteredVotesCount * 100) / entriesCount); - logger.debug("calculated share normally, userEnteredVotesCount: " + userEnteredVotesCount); - logger.debug("calculated share normally, entriesCount: " + entriesCount); } else { share = 0; - logger.debug("reset share"); } - logger.debug("final share: " + share); if (voteContent.isAllowText()) { mapStandardNominationsContent.put(mapIndex.toString(), messageService.getMessage("label.open.vote")); @@ -804,13 +589,6 @@ mapStandardQuestionUid.put(mapIndex.toString(), "1"); mapStandardToolSessionUid.put(mapIndex.toString(), "1"); - logger.debug("processed for prepareChartDTO: mapStandardNominationsContent: " - + mapStandardNominationsContent); - logger.debug("processed for prepareChartDTO: mapStandardNominationsHTMLedContent: " - + mapStandardNominationsHTMLedContent); - logger.debug("processed for prepareChartDTO: mapStandardUserCount: " + mapStandardUserCount); - logger.debug("processed for prepareChartDTO: mapStandardRatesContent: " + mapStandardRatesContent); - voteAllSessionsDTO.setMapStandardNominationsContent(mapStandardNominationsContent); voteAllSessionsDTO.setMapStandardNominationsHTMLedContent(mapStandardNominationsHTMLedContent); voteAllSessionsDTO.setMapStandardUserCount(mapStandardUserCount); @@ -821,7 +599,6 @@ VoteMonitoringAction voteMonitoringAction = new VoteMonitoringAction(); List listUserEntries = voteMonitoringAction.processUserEnteredNominations(voteService, voteContent, voteSession.getVoteSessionId().toString(), true, null, false); - logger.debug("listUserEntries: " + listUserEntries); voteAllSessionsDTO.setListUserEntries(listUserEntries); if (listUserEntries.size() > 0) @@ -831,7 +608,6 @@ listVoteAllSessionsDTO.add(voteAllSessionsDTO); } - logger.debug("listVoteAllSessionsDTO: " + listVoteAllSessionsDTO); return listVoteAllSessionsDTO; } @@ -850,41 +626,24 @@ VoteMonitoringForm voteMonitoringForm, String toolContentID, String toolSessionUid, VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO, VoteGeneralMonitoringDTO voteGeneralMonitoringDTO, MessageService messageService) { - logger.debug("starting prepareChartData, voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); - logger.debug("starting prepareChartData, toolContentID: " + toolContentID); - logger.debug("starting prepareChartData, toolSessionUid: " + toolSessionUid); VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); - logger.debug("starting prepareChartData, voteContent uid: " + voteContent.getUid()); - - logger.debug("starting prepareChartData, voteMonitoringForm: " + voteMonitoringForm); - - logger.debug("existing voteContent:" + voteContent); Map mapOptionsContent = new TreeMap(new VoteComparator()); - logger.debug("mapOptionsContent: " + mapOptionsContent); - Map mapVoteRatesContent = new TreeMap(new VoteComparator()); - logger.debug("mapVoteRatesContent: " + mapVoteRatesContent); List distinctSessionUsers = new ArrayList(); boolean sessionLevelCharting = true; int entriesCount = 0; Set userEntries = null; if (toolSessionUid != null) { - logger.debug("process for session: " + toolSessionUid); entriesCount = voteService.getSessionEntriesCount(new Long(toolSessionUid)); - logger.debug("entriesCount: " + entriesCount); userEntries = voteService.getSessionUserEntriesSet(new Long(toolSessionUid)); - logger.debug("sessionUserCount: " + userEntries.size()); int completedSessionUserCount = voteService.getCompletedVoteUserBySessionUid(new Long(toolSessionUid)); - logger.debug("completedSessionUserCount: " + completedSessionUserCount); int completedEntriesCount = voteService.getCompletedSessionEntriesCount(new Long(toolSessionUid)); - logger.debug("completedEntriesCount: " + completedEntriesCount); if (voteMonitoringForm != null) { int potentialUserCount = voteService.getVoteSessionPotentialLearnersCount(new Long(toolSessionUid)); - logger.debug("potentialUserCount: " + potentialUserCount); voteMonitoringForm.setSessionUserCount(Integer.toString(potentialUserCount)); voteMonitoringForm.setCompletedSessionUserCount(new Integer(completedSessionUserCount).toString()); @@ -896,8 +655,6 @@ if (potentialUserCount != 0) { double completedPercent = (completedSessionUserCount * 100) / potentialUserCount; - logger.debug("completed percent: " + completedPercent); - if (completedPercent > 100) completedPercent = 100; @@ -915,69 +672,45 @@ } } - logger.debug("entriesCount: " + entriesCount); - logger.debug("userEntries: " + userEntries); - logger.debug("sessionLevelCharting: " + sessionLevelCharting); - Map mapStandardUserCount = new TreeMap(new VoteComparator()); - logger.debug("setting existing content data from the db"); mapOptionsContent.clear(); Iterator queIterator = voteContent.getVoteQueContents().iterator(); Long mapIndex = new Long(1); - logger.debug("mapOptionsContent: " + mapOptionsContent); int totalStandardVotesCount = 0; - logger.debug("using entriesCount: " + entriesCount); - Map mapStandardNominationsHTMLedContent = new TreeMap(new VoteComparator()); Map mapStandardQuestionUid = new TreeMap(new VoteComparator()); Map mapStandardToolSessionUid = new TreeMap(new VoteComparator()); while (queIterator.hasNext()) { VoteQueContent voteQueContent = (VoteQueContent) queIterator.next(); if (voteQueContent != null) { - logger.debug("question: " + voteQueContent.getQuestion()); mapStandardNominationsHTMLedContent.put(mapIndex.toString(), voteQueContent.getQuestion()); String noHTMLNomination = VoteUtils.stripHTML(voteQueContent.getQuestion()); - logger.debug("noHTMLNomination: " + noHTMLNomination); mapOptionsContent.put(mapIndex.toString(), noHTMLNomination); int votesCount = 0; if (sessionLevelCharting == true) { - logger.debug("getting votesCount based on session: " + toolSessionUid); votesCount = voteService.getStandardAttemptsForQuestionContentAndSessionUid( voteQueContent.getUid(), new Long(toolSessionUid)); mapStandardQuestionUid.put(mapIndex.toString(), voteQueContent.getUid().toString()); mapStandardToolSessionUid.put(mapIndex.toString(), toolSessionUid.toString()); - - logger - .debug("votesCount for questionContent uid: " + votesCount + " for" - + voteQueContent.getUid()); mapStandardUserCount.put(mapIndex.toString(), new Integer(votesCount).toString()); totalStandardVotesCount = totalStandardVotesCount + votesCount; } else { - logger.debug("getting votesCount based on content: " + voteQueContent.getUid()); votesCount = voteService.getAttemptsForQuestionContent(voteQueContent.getUid()); - logger - .debug("votesCount for questionContent uid: " + votesCount + " for" - + voteQueContent.getUid()); } double voteRate = 0d; double doubleVotesCount = votesCount * 1d; - logger.debug("doubleVotesCount: " + doubleVotesCount); double doubleEntriesCount = entriesCount * 1d; - logger.debug("doubleEntriesCount: " + doubleEntriesCount); if (entriesCount != 0) { voteRate = ((doubleVotesCount * 100) / doubleEntriesCount); } - logger.debug("voteRate" + voteRate); - String stringVoteRate = new Double(voteRate).toString(); int lengthVoteRate = stringVoteRate.length(); - logger.debug("lengthVoteRate" + lengthVoteRate); if (lengthVoteRate > 5) stringVoteRate = stringVoteRate.substring(0, 6); @@ -986,40 +719,25 @@ } } - logger.debug("test1: Map initialized with existing contentid to: " + mapOptionsContent); Map mapStandardNominationsContent = new TreeMap(new VoteComparator()); mapStandardNominationsContent = mapOptionsContent; - logger.debug("mapStandardNominationsContent: " + mapStandardNominationsContent); - logger.debug("mapStandardNominationsHTMLedContent: " + mapStandardNominationsHTMLedContent); Map mapStandardRatesContent = new TreeMap(new VoteComparator()); mapStandardRatesContent = mapVoteRatesContent; - logger.debug("test1: mapStandardRatesContent: " + mapStandardRatesContent); - logger.debug("test1: mapStandardUserCount: " + mapStandardUserCount); int mapVoteRatesSize = mapVoteRatesContent.size(); - logger.debug("mapVoteRatesSize: " + mapVoteRatesSize); mapIndex = new Long(mapVoteRatesSize + 1); - logger.debug("updated mapIndex: " + mapIndex); double total = MonitoringUtil.calculateTotal(mapVoteRatesContent); - logger.debug("updated mapIndex: " + mapIndex); double share = 100 - total; - logger.debug("share: " + share); - logger.debug("totalStandardVotesCount: " + totalStandardVotesCount); int userEnteredVotesCount = entriesCount - totalStandardVotesCount; - logger.debug("userEnteredVotesCount for this session: " + userEnteredVotesCount); if (userEnteredVotesCount != 0) { share = ((userEnteredVotesCount * 100) / entriesCount); - logger.debug("calculated share normally, userEnteredVotesCount: " + userEnteredVotesCount); - logger.debug("calculated share normally, entriesCount: " + entriesCount); } else { share = 0; - logger.debug("reset share"); } - logger.debug("final share: " + share); if (voteContent.isAllowText()) { mapStandardNominationsContent.put(mapIndex.toString(), messageService.getMessage("label.open.vote")); @@ -1034,18 +752,12 @@ mapStandardToolSessionUid.put(mapIndex.toString(), "1"); request.setAttribute(LIST_USER_ENTRIES_CONTENT, userEntries); - logger.debug("test2: mapUserEntriesContent: " + request.getSession().getAttribute(LIST_USER_ENTRIES_CONTENT)); request.getSession().setAttribute(MAP_STANDARD_NOMINATIONS_CONTENT, mapStandardNominationsContent); - logger.debug("test2: MAP_STANDARD_NOMINATIONS_CONTENT: " - + request.getSession().getAttribute(MAP_STANDARD_NOMINATIONS_CONTENT)); request.getSession().setAttribute(MAP_STANDARD_RATES_CONTENT, mapStandardRatesContent); - logger.debug("test2: MAP_STANDARD_RATES_CONTENT: " - + request.getSession().getAttribute(MAP_STANDARD_RATES_CONTENT)); if (voteGeneralLearnerFlowDTO != null) { - logger.debug("placing maps within voteGeneralLearnerFlowDTO"); voteGeneralLearnerFlowDTO.setMapStandardNominationsContent(mapStandardNominationsContent); voteGeneralLearnerFlowDTO.setMapStandardNominationsHTMLedContent(mapStandardNominationsHTMLedContent); voteGeneralLearnerFlowDTO.setMapStandardRatesContent(mapStandardRatesContent); @@ -1063,39 +775,27 @@ voteGeneralMonitoringDTO.setMapStandardQuestionUid(mapStandardQuestionUid); } - logger.debug("end of prepareChartData, voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); request.setAttribute(VOTE_GENERAL_LEARNER_FLOW_DTO, voteGeneralLearnerFlowDTO); - - logger.debug("end of prepareChartData, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); } public static boolean notebookEntriesExist(IVoteService voteService, VoteContent voteContent) { - logger.debug("finding out about content level notebook entries: " + voteContent); Iterator iteratorSession = voteContent.getVoteSessions().iterator(); while (iteratorSession.hasNext()) { VoteSession voteSession = (VoteSession) iteratorSession.next(); - logger.debug("voteSession: " + voteSession); if (voteSession != null) { - logger.debug("voteSession id: " + voteSession.getVoteSessionId()); Iterator iteratorUser = voteSession.getVoteQueUsers().iterator(); while (iteratorUser.hasNext()) { VoteQueUsr voteQueUsr = (VoteQueUsr) iteratorUser.next(); - logger.debug("voteQueUsr: " + voteQueUsr); if (voteQueUsr != null) { - logger.debug("voteQueUsr id: " + voteQueUsr.getQueUsrId()); - - logger.debug("attempt getting notebookEntry: "); NotebookEntry notebookEntry = voteService.getEntry(voteSession.getVoteSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, MY_SIGNATURE, new Integer(voteQueUsr.getQueUsrId() .intValue())); - logger.debug("notebookEntry: " + notebookEntry); if (notebookEntry != null) { - logger.debug("found at least one notebookEntry: " + notebookEntry.getEntry()); return true; } @@ -1157,32 +857,21 @@ public static void generateGroupsSessionData(HttpServletRequest request, IVoteService voteService, VoteContent voteContent) { - logger.debug("generateGroupsSessionData: " + voteContent); - List listAllGroupsDTO = buildGroupBasedSessionData(request, voteContent, voteService); - logger.debug("listAllGroupsDTO: " + listAllGroupsDTO); - request.setAttribute(LIST_ALL_GROUPS_DTO, listAllGroupsDTO); } public static List buildGroupBasedSessionData(HttpServletRequest request, VoteContent voteContent, IVoteService voteService) { - logger.debug("buildGroupBasedSessionData" + voteContent); - logger.debug("will be building groups question data for content:..." + voteContent); List listQuestions = voteService.getAllQuestionEntries(voteContent.getUid()); - logger.debug("listQuestions:..." + listQuestions); - List listAllGroupsContainerDTO = new LinkedList(); Iterator iteratorSession = voteContent.getVoteSessions().iterator(); while (iteratorSession.hasNext()) { VoteSession voteSession = (VoteSession) iteratorSession.next(); - logger.debug("iteration for group based session data: " + voteSession); String currentSessionId = voteSession.getVoteSessionId().toString(); - logger.debug("currentSessionId: " + currentSessionId); String currentSessionName = voteSession.getSession_name(); - logger.debug("currentSessionName: " + currentSessionName); VoteAllGroupsDTO voteAllGroupsDTO = new VoteAllGroupsDTO(); List listMonitoredAnswersContainerDTO = new LinkedList(); @@ -1191,10 +880,8 @@ Iterator itListQuestions = listQuestions.iterator(); while (itListQuestions.hasNext()) { VoteQueContent voteQueContent = (VoteQueContent) itListQuestions.next(); - logger.debug("voteQueContent:..." + voteQueContent); if (voteQueContent != null) { - logger.debug("populating VoteMonitoredAnswersDTO for : " + voteQueContent); VoteMonitoredAnswersDTO voteMonitoredAnswersDTO = new VoteMonitoredAnswersDTO(); voteMonitoredAnswersDTO.setQuestionUid(voteQueContent.getUid().toString()); voteMonitoredAnswersDTO.setQuestion(voteQueContent.getQuestion()); @@ -1203,48 +890,31 @@ Map questionAttemptData = buildGroupsAttemptData(request, voteContent, voteService, voteQueContent, voteQueContent.getUid().toString(), true, false, currentSessionId, null); - logger.debug("generated questionAttemptData: " + questionAttemptData); voteMonitoredAnswersDTO.setQuestionAttempts(questionAttemptData); - logger.debug("adding voteMonitoredAnswersDTO to the listMonitoredAnswersContainerDTO: " - + voteMonitoredAnswersDTO); listMonitoredAnswersContainerDTO.add(voteMonitoredAnswersDTO); } } } - logger.debug("listMonitoredAnswersContainerDTO:" + listMonitoredAnswersContainerDTO); - - logger.debug("adding listMonitoredAnswersContainerDTO to the voteAllGroupsDTO:" - + listMonitoredAnswersContainerDTO); voteAllGroupsDTO.setGroupData(listMonitoredAnswersContainerDTO); voteAllGroupsDTO.setSessionName(currentSessionName); voteAllGroupsDTO.setSessionId(currentSessionId); - logger.debug("built voteAllGroupsDTO:" + voteAllGroupsDTO); listAllGroupsContainerDTO.add(voteAllGroupsDTO); } - logger.debug("final listAllGroupsContainerDTO:..." + listAllGroupsContainerDTO); return listAllGroupsContainerDTO; } public static Map buildGroupsAttemptData(HttpServletRequest request, VoteContent voteContent, IVoteService voteService, VoteQueContent voteQueContent, String questionUid, boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId) { - logger.debug("doing buildGroupsAttemptData..."); - logger.debug("isUserNamesVisible: " + isUserNamesVisible); - logger.debug("isLearnerRequest: " + isLearnerRequest); - logger.debug("currentSessionId: " + currentSessionId); - logger.debug("userId: " + userId); - logger.debug("voteService: " + voteService); - Map mapMonitoredAttemptsContainerDTO = new TreeMap(new VoteStringComparator()); List listMonitoredAttemptsContainerDTO = new LinkedList(); Map summaryToolSessions = populateToolSessionsId(request, voteContent, voteService); - logger.debug("summaryToolSessions: " + summaryToolSessions); Iterator itMap = summaryToolSessions.entrySet().iterator(); @@ -1253,24 +923,15 @@ if (currentSessionId != null) { if (currentSessionId.equals("All")) { - logger.debug("**summary request is for All**:"); + //**summary request is for All** while (itMap.hasNext()) { Map.Entry pairs = (Map.Entry) itMap.next(); - logger.debug("using the summary tool sessions pair: " + pairs.getKey() + " = " - + pairs.getValue()); - if (!(pairs.getValue().toString().equals("None")) && !(pairs.getValue().toString().equals("All"))) { - logger - .debug("using the numerical summary tool sessions pair: " + " = " - + pairs.getValue()); VoteSession voteSession = voteService.retrieveVoteSession(new Long(pairs.getValue() .toString())); - logger.debug("voteSession: " + " = " + voteSession); if (voteSession != null) { List listUsers = voteService.getUserBySessionOnly(voteSession); - logger.debug("listMcUsers for session id:" + voteSession.getVoteSessionId() + " = " - + listUsers); Map sessionUsersAttempts = populateSessionUsersAttempts(request, voteService, voteSession.getVoteSessionId(), listUsers, questionUid, isUserNamesVisible, isLearnerRequest, userId); @@ -1279,12 +940,10 @@ } } } else if (!currentSessionId.equals("All")) { - logger.debug("**summary request is for currentSessionId**:" + currentSessionId); + //**summary request is for currentSessionId** currentSessionId VoteSession voteSession = voteService.retrieveVoteSession(new Long(currentSessionId.toString())); - logger.debug("voteSession: " + " = " + voteSession); List listUsers = voteService.getUserBySessionOnly(voteSession); - logger.debug("listUsers: " + " = " + listUsers); Map sessionUsersAttempts = populateSessionUsersAttempts(request, voteService, new Long( currentSessionId), listUsers, questionUid, isUserNamesVisible, isLearnerRequest, userId); @@ -1293,25 +952,16 @@ } } else { /*request is for learner report, use only the passed tool session in the report*/ - logger.debug("using currentSessionId for the learner report:" + currentSessionId); while (itMap.hasNext()) { Map.Entry pairs = (Map.Entry) itMap.next(); - logger.debug("using the summary tool sessions pair: " + pairs.getKey() + " = " + pairs.getValue()); if (!(pairs.getValue().toString().equals("None")) && !(pairs.getValue().toString().equals("All"))) { - logger.debug("using the numerical summary tool sessions pair: " + " = " + pairs.getValue()); if (currentSessionId.equals(pairs.getValue())) { - logger - .debug("only using this tool session for the learner report: " + " = " - + pairs.getValue()); VoteSession voteSession = voteService .retrieveVoteSession(new Long(pairs.getValue().toString())); - logger.debug("voteSession: " + " = " + voteSession); if (voteSession != null) { List listUsers = voteService.getUserBySessionOnly(voteSession); - logger.debug("listVoteUsers for session id:" + voteSession.getVoteSessionId() + " = " - + listUsers); Map sessionUsersAttempts = populateSessionUsersAttempts(request, voteService, voteSession .getVoteSessionId(), listUsers, questionUid, isUserNamesVisible, isLearnerRequest, userId); @@ -1322,46 +972,30 @@ } } - logger.debug("final listMonitoredAttemptsContainerDTO:..." + listMonitoredAttemptsContainerDTO); mapMonitoredAttemptsContainerDTO = convertToMap(listMonitoredAttemptsContainerDTO); - logger.debug("final mapMonitoredAttemptsContainerDTO:..." + mapMonitoredAttemptsContainerDTO); return mapMonitoredAttemptsContainerDTO; } public static Map populateSessionUsersAttempts(HttpServletRequest request, IVoteService voteService, Long sessionId, List listUsers, String questionUid, boolean isUserNamesVisible, boolean isLearnerRequest, String userId) { - logger.debug("isUserNamesVisible: " + isUserNamesVisible); - logger.debug("isLearnerRequest: " + isLearnerRequest); - logger.debug("userId: " + userId); - logger.debug("doing populateSessionUsersAttempts..."); - logger.debug("voteService: " + voteService); - Map mapMonitoredUserContainerDTO = new TreeMap(new VoteStringComparator()); List listMonitoredUserContainerDTO = new LinkedList(); Iterator itUsers = listUsers.iterator(); if (userId == null) { - logger.debug("request is not for learner progress report"); if ((isUserNamesVisible) && (!isLearnerRequest)) { - logger.debug("isUserNamesVisible true, isLearnerRequest false"); - logger.debug("getting alll the user' data"); while (itUsers.hasNext()) { VoteQueUsr voteQueUsr = (VoteQueUsr) itUsers.next(); - logger.debug("voteQueUsr: " + voteQueUsr); if (voteQueUsr != null) { - logger.debug("getting listUserAttempts for user id: " + voteQueUsr.getUid() - + " and que content id: " + questionUid); List listUserAttempts = voteService.getAttemptsForUserAndQuestionContent(voteQueUsr.getUid(), new Long(questionUid)); - logger.debug("listUserAttempts: " + listUserAttempts); Iterator itAttempts = listUserAttempts.iterator(); while (itAttempts.hasNext()) { VoteUsrAttempt voteUsrResp = (VoteUsrAttempt) itAttempts.next(); - logger.debug("voteUsrResp: " + voteUsrResp); if (voteUsrResp != null) { VoteMonitoredUserDTO voteMonitoredUserDTO = new VoteMonitoredUserDTO(); @@ -1374,7 +1008,6 @@ voteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); String responsePresentable = VoteUtils.replaceNewLines(voteUsrResp.getUserEntry()); - logger.debug("responsePresentable: " + responsePresentable); voteMonitoredUserDTO.setResponsePresentable(responsePresentable); voteMonitoredUserDTO.setQuestionUid(questionUid); @@ -1385,32 +1018,21 @@ } } } else if ((isUserNamesVisible) && (isLearnerRequest)) { - logger - .debug("just populating data normally just like monitoring summary, except that the data is ony for a specific session"); - logger.debug("isUserNamesVisible true, isLearnerRequest true"); + //just populating data normally just like monitoring summary, except that the data is ony for a specific session String userID = VoteUtils.getCurrentLearnerID(); - logger.debug("userID: " + userID); VoteQueUsr voteQueUsr = voteService.getVoteQueUsrById(new Long(userID).longValue()); - logger - .debug("the current user voteQueUsr " + voteQueUsr + " and username: " - + voteQueUsr.getUsername()); while (itUsers.hasNext()) { voteQueUsr = (VoteQueUsr) itUsers.next(); - logger.debug("voteQueUsr: " + voteQueUsr); if (voteQueUsr != null) { - logger.debug("getting listUserAttempts for user id: " + voteQueUsr.getUid() - + " and que content id: " + questionUid); List listUserAttempts = voteService.getAttemptsForUserAndQuestionContent(voteQueUsr.getUid(), new Long(questionUid)); - logger.debug("listUserAttempts: " + listUserAttempts); Iterator itAttempts = listUserAttempts.iterator(); while (itAttempts.hasNext()) { VoteUsrAttempt voteUsrResp = (VoteUsrAttempt) itAttempts.next(); - logger.debug("voteUsrResp: " + voteUsrResp); if (voteUsrResp != null) { VoteMonitoredUserDTO voteMonitoredUserDTO = new VoteMonitoredUserDTO(); @@ -1423,7 +1045,6 @@ voteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); String responsePresentable = VoteUtils.replaceNewLines(voteUsrResp.getUserEntry()); - logger.debug("responsePresentable: " + responsePresentable); voteMonitoredUserDTO.setResponsePresentable(responsePresentable); voteMonitoredUserDTO.setQuestionUid(questionUid); @@ -1434,42 +1055,30 @@ } } } else if ((!isUserNamesVisible) && (isLearnerRequest)) { - logger - .debug("populating data normally exception are for a specific session and other user names are not visible."); - logger.debug("isUserNamesVisible false, isLearnerRequest true"); - logger.debug("getting only current user's data"); + //populating data normally exception are for a specific session and other user names are not visible + //getting only current user's data String userID = VoteUtils.getCurrentLearnerID(); - logger.debug("userID: " + userID); - while (itUsers.hasNext()) { VoteQueUsr voteQueUsr = (VoteQueUsr) itUsers.next(); - logger.debug("voteQueUsr: " + voteQueUsr); if (voteQueUsr != null) { - logger.debug("getting listUserAttempts for user id: " + voteQueUsr.getUid() - + " and que content id: " + questionUid); List listUserAttempts = voteService.getAttemptsForUserAndQuestionContent(voteQueUsr.getUid(), new Long(questionUid)); - logger.debug("listUserAttempts: " + listUserAttempts); Iterator itAttempts = listUserAttempts.iterator(); while (itAttempts.hasNext()) { VoteUsrAttempt voteUsrResp = (VoteUsrAttempt) itAttempts.next(); - logger.debug("voteUsrResp: " + voteUsrResp); if (voteUsrResp != null) { VoteMonitoredUserDTO voteMonitoredUserDTO = new VoteMonitoredUserDTO(); voteMonitoredUserDTO.setAttemptTime(voteUsrResp.getAttemptTime()); //voteMonitoredUserDTO.setTimeZone(voteUsrResp.getTimezone()); voteMonitoredUserDTO.setUid(voteUsrResp.getUid().toString()); - logger.debug("userID versus queUsrId: " + userID + "-" + voteQueUsr.getQueUsrId()); if (userID.equals(voteQueUsr.getQueUsrId().toString())) { - logger.debug("this is current user, put his name normally."); voteMonitoredUserDTO.setUserName(voteQueUsr.getFullname()); } else { - logger.debug("this is not current user, put his name as blank."); voteMonitoredUserDTO.setUserName(" "); } @@ -1478,7 +1087,6 @@ voteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); String responsePresentable = VoteUtils.replaceNewLines(voteUsrResp.getUserEntry()); - logger.debug("responsePresentable: " + responsePresentable); voteMonitoredUserDTO.setResponsePresentable(responsePresentable); voteMonitoredUserDTO.setQuestionUid(questionUid); @@ -1490,27 +1098,20 @@ } } } else { - logger.debug("request is for learner progress report: " + userId); + //request is for learner progress report while (itUsers.hasNext()) { VoteQueUsr voteQueUsr = (VoteQueUsr) itUsers.next(); - logger.debug("voteQueUsr: " + voteQueUsr); if (voteQueUsr != null) { - logger.debug("getting listUserAttempts for user id: " + voteQueUsr.getUid() - + " and que content id: " + questionUid); List listUserAttempts = voteService.getAttemptsForUserAndQuestionContent(voteQueUsr.getUid(), new Long(questionUid)); - logger.debug("listUserAttempts: " + listUserAttempts); Iterator itAttempts = listUserAttempts.iterator(); while (itAttempts.hasNext()) { VoteUsrAttempt voteUsrResp = (VoteUsrAttempt) itAttempts.next(); - logger.debug("voteUsrResp: " + voteUsrResp); if (voteUsrResp != null) { - logger.debug("userID versus queUsrId: " + userId + "-" + voteQueUsr.getQueUsrId()); if (userId.equals(voteQueUsr.getQueUsrId().toString())) { - logger.debug("this is the user requested , include his name for learner progress."); VoteMonitoredUserDTO voteMonitoredUserDTO = new VoteMonitoredUserDTO(); voteMonitoredUserDTO.setAttemptTime(voteUsrResp.getAttemptTime()); //voteMonitoredUserDTO.setTimeZone(voteUsrResp.getTimezone()); @@ -1521,7 +1122,6 @@ voteMonitoredUserDTO.setResponse(voteUsrResp.getUserEntry()); String responsePresentable = VoteUtils.replaceNewLines(voteUsrResp.getUserEntry()); - logger.debug("responsePresentable: " + responsePresentable); voteMonitoredUserDTO.setResponsePresentable(responsePresentable); voteMonitoredUserDTO.setQuestionUid(questionUid); @@ -1535,14 +1135,11 @@ } - logger.debug("final listMonitoredUserContainerDTO: " + listMonitoredUserContainerDTO); mapMonitoredUserContainerDTO = convertToMcMonitoredUserDTOMap(listMonitoredUserContainerDTO); - logger.debug("final mapMonitoredUserContainerDTO:..." + mapMonitoredUserContainerDTO); return mapMonitoredUserContainerDTO; } public static Map convertToMcMonitoredUserDTOMap(List list) { - logger.debug("using convertToVoteMonitoredUserDTOMap: " + list); Map map = new TreeMap(new VoteStringComparator()); Iterator listIterator = list.iterator(); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java =================================================================== diff -u -r618abc7cca98f08ef288878ab371a3693492d835 -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java (.../VoteAction.java) (revision 618abc7cca98f08ef288878ab371a3693492d835) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java (.../VoteAction.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -49,7 +49,6 @@ import org.lamsfoundation.lams.learningdesign.DataFlowObject; import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.tool.vote.VoteAppConstants; -import org.lamsfoundation.lams.tool.vote.VoteApplicationException; import org.lamsfoundation.lams.tool.vote.VoteAttachmentDTO; import org.lamsfoundation.lams.tool.vote.VoteGeneralAuthoringDTO; import org.lamsfoundation.lams.tool.vote.VoteNominationContentDTO; @@ -69,113 +68,15 @@ import org.springframework.web.context.support.WebApplicationContextUtils; /** - * * - * * @author Ozgur Demirtas - * - *

- * Action class that controls the logic of tool behavior. - *

- * - *

- * Note that Struts action class only has the responsibility to navigate page flow. All database operation should go to - * service layer and data transformation from domain model to struts form bean should go to form bean class. This ensure - * clean and maintainable code. - *

- * - * SystemException is thrown whenever an known error condition is identified. No system exception error - * handling code should appear in the Struts action class as all of them are handled in - * CustomStrutsExceptionHandler. - * - * - - - - - - - - - - - - - - - - - - - * */ public class VoteAction extends LamsDispatchAction implements VoteAppConstants { static Logger logger = Logger.getLogger(VoteAction.class.getName()); private VoteToolContentHandler toolContentHandler; /** - *

- * Default struts dispatch method. - *

* - *

- * It is assuming that progress engine should pass in the tool access mode and the tool session id as http - * parameters. - *

- * - * @param mapping - * An ActionMapping class that will be used by the Action class to tell the ActionServlet where to - * send the end-user. - * - * @param form - * The ActionForm class that will contain any data submitted by the end-user via a form. - * @param request - * A standard Servlet HttpServletRequest class. - * @param response - * A standard Servlet HttpServletResponse class. - * @return An ActionForward class that will be returned to the ActionServlet indicating where the user is to go - * next. - * @throws IOException - * @throws ServletException - * @throws VoteApplicationException - * the known runtime exception - * - * unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - * throws IOException, ServletException - * * main content/question content management and workflow logic * * if the passed toolContentID exists in the db, we need to get the relevant data into the Map if not, create the @@ -209,71 +110,51 @@ public ActionForward submitOfflineFiles(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, RepositoryCheckedException { VoteUtils.cleanUpUserExceptions(request); - VoteAction.logger.debug("dispatching submitOfflineFile..."); IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteAction.logger.debug("voteService: " + voteService); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; - VoteAction.logger.debug("voteAuthoringForm :" + voteAuthoringForm); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteAction.logger.debug("sessionMap: " + sessionMap); Map mapOptionsContent = (Map) sessionMap.get(VoteAppConstants.MAP_OPTIONS_CONTENT_KEY); - VoteAction.logger.debug("mapOptionsContent: " + mapOptionsContent); voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); int maxIndex = mapOptionsContent.size(); - VoteAction.logger.debug("maxIndex: " + maxIndex); voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); String firstEntry = (String) mapOptionsContent.get("1"); - VoteAction.logger.debug("firstEntry: " + firstEntry); voteGeneralAuthoringDTO.setDefaultOptionContent(firstEntry); voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(false).toString()); /* determine whether the request is from Monitoring url Edit Activity */ String sourceVoteStarter = (String) request.getAttribute(VoteAppConstants.SOURCE_VOTE_STARTER); - VoteAction.logger.debug("sourceVoteStarter: " + sourceVoteStarter); String destination = VoteUtils.getDestination(sourceVoteStarter); - VoteAction.logger.debug("destination: " + destination); VoteUtils.saveRichText(request, voteGeneralAuthoringDTO, sessionMap); - VoteAction.logger.debug("will uploadFile for offline file:"); VoteAttachmentDTO voteAttachmentDTO = AuthoringUtil.uploadFile(request, voteService, voteAuthoringForm, true, sessionMap); - VoteAction.logger.debug("returned voteAttachmentDTO:" + voteAttachmentDTO); - VoteAction.logger.debug("returned sessionMap:" + sessionMap); - List listOfflineFilesMetaData = (List) sessionMap.get(VoteAppConstants.LIST_OFFLINEFILES_METADATA_KEY); - VoteAction.logger.debug("listOfflineFilesMetaData:" + listOfflineFilesMetaData); if (voteAttachmentDTO != null) { listOfflineFilesMetaData.add(voteAttachmentDTO); } - VoteAction.logger.debug("listOfflineFilesMetaData after add:" + listOfflineFilesMetaData); sessionMap.put(VoteAppConstants.LIST_OFFLINEFILES_METADATA_KEY, listOfflineFilesMetaData); voteGeneralAuthoringDTO.setListOfflineFilesMetadata(listOfflineFilesMetaData); - VoteAction.logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); - List listOnlineFilesMetaData = (List) sessionMap.get(VoteAppConstants.LIST_ONLINEFILES_METADATA_KEY); - VoteAction.logger.debug("listOnlineFilesMetaData:" + listOnlineFilesMetaData); voteGeneralAuthoringDTO.setListOnlineFilesMetadata(listOnlineFilesMetaData); if (voteAttachmentDTO == null) { @@ -285,16 +166,11 @@ voteAuthoringForm.resetUserAction(); persistInRequestError(request, "error.fileName.empty"); - VoteAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); - return mapping.findForward(destination); } - VoteAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); - - VoteAction.logger.debug("persisting sessionMap into session: " + sessionMap); request.getSession().setAttribute(httpSessionID, sessionMap); voteAuthoringForm.resetUserAction(); @@ -316,71 +192,49 @@ public ActionForward submitOnlineFiles(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, RepositoryCheckedException { VoteUtils.cleanUpUserExceptions(request); - VoteAction.logger.debug("dispatching submitOnlineFiles..."); IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteAction.logger.debug("voteService: " + voteService); - VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; - VoteAction.logger.debug("voteAuthoringForm :" + voteAuthoringForm); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteAction.logger.debug("httpSessionID: " + httpSessionID); - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteAction.logger.debug("sessionMap: " + sessionMap); Map mapOptionsContent = (Map) sessionMap.get(VoteAppConstants.MAP_OPTIONS_CONTENT_KEY); - VoteAction.logger.debug("mapOptionsContent: " + mapOptionsContent); voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); int maxIndex = mapOptionsContent.size(); - VoteAction.logger.debug("maxIndex: " + maxIndex); voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); String firstEntry = (String) mapOptionsContent.get("1"); - VoteAction.logger.debug("firstEntry: " + firstEntry); voteGeneralAuthoringDTO.setDefaultOptionContent(firstEntry); voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(false).toString()); /* determine whether the request is from Monitoring url Edit Activity */ String sourceVoteStarter = (String) request.getAttribute(VoteAppConstants.SOURCE_VOTE_STARTER); - VoteAction.logger.debug("sourceVoteStarter: " + sourceVoteStarter); String destination = VoteUtils.getDestination(sourceVoteStarter); - VoteAction.logger.debug("destination: " + destination); VoteUtils.saveRichText(request, voteGeneralAuthoringDTO, sessionMap); - VoteAction.logger.debug("will uploadFile for online file:"); VoteAttachmentDTO voteAttachmentDTO = AuthoringUtil.uploadFile(request, voteService, voteAuthoringForm, false, sessionMap); - VoteAction.logger.debug("returned voteAttachmentDTO:" + voteAttachmentDTO); - VoteAction.logger.debug("returned sessionMap:" + sessionMap); - List listOnlineFilesMetaData = (List) sessionMap.get(VoteAppConstants.LIST_ONLINEFILES_METADATA_KEY); - VoteAction.logger.debug("listOnlineFilesMetaData:" + listOnlineFilesMetaData); if (voteAttachmentDTO != null) { listOnlineFilesMetaData.add(voteAttachmentDTO); } - VoteAction.logger.debug("listOnlineFilesMetaData after add:" + listOnlineFilesMetaData); sessionMap.put(VoteAppConstants.LIST_ONLINEFILES_METADATA_KEY, listOnlineFilesMetaData); voteGeneralAuthoringDTO.setListOnlineFilesMetadata(listOnlineFilesMetaData); - VoteAction.logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); - List listOfflineFilesMetaData = (List) sessionMap.get(VoteAppConstants.LIST_OFFLINEFILES_METADATA_KEY); - VoteAction.logger.debug("listOfflineFilesMetaData:" + listOfflineFilesMetaData); voteGeneralAuthoringDTO.setListOfflineFilesMetadata(listOfflineFilesMetaData); if (voteAttachmentDTO == null) { @@ -392,16 +246,12 @@ voteAuthoringForm.resetUserAction(); persistInRequestError(request, "error.fileName.empty"); - VoteAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); return mapping.findForward(destination); } - VoteAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); - - VoteAction.logger.debug("persisting sessionMap into session: " + sessionMap); request.getSession().setAttribute(httpSessionID, sessionMap); voteAuthoringForm.resetUserAction(); @@ -424,71 +274,52 @@ { VoteUtils.cleanUpUserExceptions(request); - VoteAction.logger.debug("dispatching deleteOfflineFile..."); IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteAction.logger.debug("voteService: " + voteService); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; - VoteAction.logger.debug("voteAuthoringForm :" + voteAuthoringForm); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteAction.logger.debug("sessionMap: " + sessionMap); Map mapOptionsContent = (Map) sessionMap.get(VoteAppConstants.MAP_OPTIONS_CONTENT_KEY); - VoteAction.logger.debug("mapOptionsContent: " + mapOptionsContent); voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); int maxIndex = mapOptionsContent.size(); - VoteAction.logger.debug("maxIndex: " + maxIndex); voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); String firstEntry = (String) mapOptionsContent.get("1"); - VoteAction.logger.debug("firstEntry: " + firstEntry); voteGeneralAuthoringDTO.setDefaultOptionContent(firstEntry); voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(false).toString()); /* determine whether the request is from Monitoring url Edit Activity */ String sourceVoteStarter = (String) request.getAttribute(VoteAppConstants.SOURCE_VOTE_STARTER); - VoteAction.logger.debug("sourceVoteStarter: " + sourceVoteStarter); String destination = VoteUtils.getDestination(sourceVoteStarter); - VoteAction.logger.debug("destination: " + destination); VoteUtils.saveRichText(request, voteGeneralAuthoringDTO, sessionMap); String uuid = voteAuthoringForm.getUuid(); - VoteAction.logger.debug("uuid:" + uuid); List listOfflineFilesMetaData = (List) sessionMap.get(VoteAppConstants.LIST_OFFLINEFILES_METADATA_KEY); - VoteAction.logger.debug("listOfflineFilesMetaData:" + listOfflineFilesMetaData); listOfflineFilesMetaData = AuthoringUtil.removeFileItem(listOfflineFilesMetaData, uuid); - VoteAction.logger.debug("listOfflineFilesMetaData after remove:" + listOfflineFilesMetaData); sessionMap.put(VoteAppConstants.LIST_OFFLINEFILES_METADATA_KEY, listOfflineFilesMetaData); voteGeneralAuthoringDTO.setListOfflineFilesMetadata(listOfflineFilesMetaData); - VoteAction.logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); - List listOnlineFilesMetaData = (List) sessionMap.get(VoteAppConstants.LIST_ONLINEFILES_METADATA_KEY); - VoteAction.logger.debug("listOnlineFilesMetaData:" + listOnlineFilesMetaData); voteGeneralAuthoringDTO.setListOnlineFilesMetadata(listOnlineFilesMetaData); - VoteAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); - VoteAction.logger.debug("persisting sessionMap into session: " + sessionMap); request.getSession().setAttribute(httpSessionID, sessionMap); voteAuthoringForm.resetUserAction(); @@ -512,71 +343,52 @@ { VoteUtils.cleanUpUserExceptions(request); - VoteAction.logger.debug("dispatching deleteOnlineFile..."); IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteAction.logger.debug("voteService: " + voteService); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; - VoteAction.logger.debug("voteAuthoringForm :" + voteAuthoringForm); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteAction.logger.debug("sessionMap: " + sessionMap); Map mapOptionsContent = (Map) sessionMap.get(VoteAppConstants.MAP_OPTIONS_CONTENT_KEY); - VoteAction.logger.debug("mapOptionsContent: " + mapOptionsContent); voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); int maxIndex = mapOptionsContent.size(); - VoteAction.logger.debug("maxIndex: " + maxIndex); voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); String firstEntry = (String) mapOptionsContent.get("1"); - VoteAction.logger.debug("firstEntry: " + firstEntry); voteGeneralAuthoringDTO.setDefaultOptionContent(firstEntry); voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(false).toString()); /* determine whether the request is from Monitoring url Edit Activity */ String sourceVoteStarter = (String) request.getAttribute(VoteAppConstants.SOURCE_VOTE_STARTER); - VoteAction.logger.debug("sourceVoteStarter: " + sourceVoteStarter); String destination = VoteUtils.getDestination(sourceVoteStarter); - VoteAction.logger.debug("destination: " + destination); VoteUtils.saveRichText(request, voteGeneralAuthoringDTO, sessionMap); String uuid = voteAuthoringForm.getUuid(); - VoteAction.logger.debug("uuid:" + uuid); List listOnlineFilesMetaData = (List) sessionMap.get(VoteAppConstants.LIST_ONLINEFILES_METADATA_KEY); - VoteAction.logger.debug("listOnlineFilesMetaData:" + listOnlineFilesMetaData); listOnlineFilesMetaData = AuthoringUtil.removeFileItem(listOnlineFilesMetaData, uuid); - VoteAction.logger.debug("listOnlineFilesMetaData after remove:" + listOnlineFilesMetaData); sessionMap.put(VoteAppConstants.LIST_ONLINEFILES_METADATA_KEY, listOnlineFilesMetaData); voteGeneralAuthoringDTO.setListOnlineFilesMetadata(listOnlineFilesMetaData); - VoteAction.logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); - List listOfflineFilesMetaData = (List) sessionMap.get(VoteAppConstants.LIST_OFFLINEFILES_METADATA_KEY); - VoteAction.logger.debug("listOfflineFilesMetaData:" + listOfflineFilesMetaData); voteGeneralAuthoringDTO.setListOfflineFilesMetadata(listOfflineFilesMetaData); - VoteAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); - VoteAction.logger.debug("persisting sessionMap into session: " + sessionMap); request.getSession().setAttribute(httpSessionID, sessionMap); voteAuthoringForm.resetUserAction(); @@ -598,41 +410,29 @@ */ public ActionForward editActivityQuestions(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, ToolException { - VoteAction.logger.debug("dispatching editActivityQuestions..."); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; - VoteAction.logger.debug("voteAuthoringForm: " + voteAuthoringForm); IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteAction.logger.debug("voteService: " + voteService); String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteAction.logger.debug("httpSessionID: " + httpSessionID); voteAuthoringForm.setHttpSessionID(httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteAction.logger.debug("sessionMap: " + sessionMap); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); String activeModule = VoteAppConstants.DEFINE_LATER; String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteAction.logger.debug("strToolContentID: " + strToolContentID); VoteContent voteContent = voteService.retrieveVote(new Long(strToolContentID)); - VoteAction.logger.debug("voteContent: " + voteContent); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - VoteAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); voteGeneralAuthoringDTO.setHttpSessionID(httpSessionID); - VoteAction.logger.debug("title: " + voteContent.getTitle()); - VoteAction.logger.debug("instructions: " + voteContent.getInstructions()); - voteGeneralAuthoringDTO.setActivityTitle(voteContent.getTitle()); voteAuthoringForm.setTitle(voteContent.getTitle()); @@ -645,8 +445,6 @@ voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - VoteAction.logger.debug("isContentInUse:" + isContentInUse); - VoteUtils.setDefineLater(request, true, strToolContentID, voteService); voteGeneralAuthoringDTO.setToolContentID(strToolContentID); @@ -663,27 +461,21 @@ VoteQueContent voteQueContent = (VoteQueContent) queIterator.next(); if (voteQueContent != null) { - VoteAction.logger.debug("question: " + voteQueContent.getQuestion()); - VoteAction.logger.debug("displayorder: " + new Integer(voteQueContent.getDisplayOrder()).toString()); voteNominationContentDTO.setQuestion(voteQueContent.getQuestion()); voteNominationContentDTO.setDisplayOrder(new Integer(voteQueContent.getDisplayOrder()).toString()); // voteNominationContentDTO.setFeedback(voteQueContent.getFeedback()); listNominationContentDTO.add(voteNominationContentDTO); } } - VoteAction.logger.debug("listNominationContentDTO: " + listNominationContentDTO); request.setAttribute(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO, listNominationContentDTO); sessionMap.put(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY, listNominationContentDTO); request.setAttribute(VoteAppConstants.TOTAL_NOMINATION_COUNT, new Integer(listNominationContentDTO.size())); request.getSession().setAttribute(httpSessionID, sessionMap); - VoteAction.logger.debug("before fwding to jsp, voteAuthoringForm: " + voteAuthoringForm); - VoteAction.logger.debug("before saving final voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); - VoteAction.logger.debug("forwarding to : " + VoteAppConstants.LOAD_QUESTIONS); return mapping.findForward(VoteAppConstants.LOAD_QUESTIONS); } @@ -696,75 +488,60 @@ */ protected void repopulateRequestParameters(HttpServletRequest request, VoteAuthoringForm voteAuthoringForm, VoteGeneralAuthoringDTO voteGeneralAuthoringDTO) { - VoteAction.logger.debug("starting repopulateRequestParameters"); String toolContentID = request.getParameter(VoteAppConstants.TOOL_CONTENT_ID); - VoteAction.logger.debug("toolContentID: " + toolContentID); voteAuthoringForm.setToolContentID(toolContentID); voteGeneralAuthoringDTO.setToolContentID(toolContentID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteAction.logger.debug("activeModule: " + activeModule); voteAuthoringForm.setActiveModule(activeModule); voteGeneralAuthoringDTO.setActiveModule(activeModule); String httpSessionID = request.getParameter(VoteAppConstants.HTTP_SESSION_ID); - VoteAction.logger.debug("httpSessionID: " + httpSessionID); voteAuthoringForm.setHttpSessionID(httpSessionID); voteGeneralAuthoringDTO.setHttpSessionID(httpSessionID); String defineLaterInEditMode = request.getParameter(VoteAppConstants.DEFINE_LATER_IN_EDIT_MODE); - VoteAction.logger.debug("defineLaterInEditMode: " + defineLaterInEditMode); voteAuthoringForm.setDefineLaterInEditMode(defineLaterInEditMode); voteGeneralAuthoringDTO.setDefineLaterInEditMode(defineLaterInEditMode); String lockOnFinish = request.getParameter(VoteAppConstants.LOCK_ON_FINISH); - VoteAction.logger.debug("lockOnFinish: " + lockOnFinish); voteAuthoringForm.setLockOnFinish(lockOnFinish); voteGeneralAuthoringDTO.setLockOnFinish(lockOnFinish); String allowText = request.getParameter(VoteAppConstants.ALLOW_TEXT); - VoteAction.logger.debug("allowText: " + allowText); voteAuthoringForm.setAllowText(allowText); voteGeneralAuthoringDTO.setAllowText(allowText); String showResults = request.getParameter(VoteAppConstants.SHOW_RESULTS); - VoteAction.logger.debug("showResults: " + showResults); voteAuthoringForm.setShowResults(showResults); voteGeneralAuthoringDTO.setShowResults(showResults); String maxNominationCount = request.getParameter(VoteAppConstants.MAX_NOMINATION_COUNT); - VoteAction.logger.debug("maxNominationCount: " + maxNominationCount); voteAuthoringForm.setMaxNominationCount(maxNominationCount); voteGeneralAuthoringDTO.setMaxNominationCount(maxNominationCount); String minNominationCount=request.getParameter(MIN_NOMINATION_COUNT); - logger.debug("minNominationCount: " + minNominationCount); voteAuthoringForm.setMinNominationCount(minNominationCount); voteGeneralAuthoringDTO.setMinNominationCount(minNominationCount); String reflect = request.getParameter("reflect"); - VoteAction.logger.debug("reflect: " + reflect); voteAuthoringForm.setReflect(reflect); voteGeneralAuthoringDTO.setReflect(reflect); String reflectionSubject = request.getParameter("reflectionSubject"); - VoteAction.logger.debug("reflectionSubject: " + reflectionSubject); voteAuthoringForm.setReflectionSubject(reflectionSubject); voteGeneralAuthoringDTO.setReflectionSubject(reflectionSubject); String offlineInstructions = request.getParameter(VoteAppConstants.OFFLINE_INSTRUCTIONS); - VoteAction.logger.debug("offlineInstructions: " + offlineInstructions); voteAuthoringForm.setOfflineInstructions(offlineInstructions); voteGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); String onlineInstructions = request.getParameter(VoteAppConstants.ONLINE_INSTRUCTIONS); - VoteAction.logger.debug("onlineInstructions: " + onlineInstructions); voteAuthoringForm.setOnlineInstructions(onlineInstructions); voteGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); String maxInputs = request.getParameter(VoteAppConstants.MAX_INPUTS); - VoteAction.logger.debug("maxInputs: " + maxInputs); if (maxInputs == null) { maxInputs = "0"; } @@ -780,7 +557,6 @@ public void persistInRequestError(HttpServletRequest request, String message) { ActionMessages errors = new ActionMessages(); errors.add(Globals.ERROR_KEY, new ActionMessage(message)); - VoteAction.logger.debug("add " + message + " to ActionMessages:"); saveErrors(request, errors); } @@ -799,56 +575,36 @@ */ public ActionForward moveNominationDown(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - VoteAction.logger.debug("dispatching moveNominationDown"); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteAction.logger.debug("voteService: " + voteService); String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteAction.logger.debug("httpSessionID: " + httpSessionID); - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteAction.logger.debug("sessionMap: " + sessionMap); String questionIndex = request.getParameter("questionIndex"); - VoteAction.logger.debug("questionIndex: " + questionIndex); List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); - VoteAction.logger.debug("listNominationContentDTO: " + listNominationContentDTO); listNominationContentDTO = AuthoringUtil.swapNodes(listNominationContentDTO, questionIndex, "down"); - VoteAction.logger.debug("listNominationContentDTO after swap: " + listNominationContentDTO); - listNominationContentDTO = AuthoringUtil.reorderSimpleListNominationContentDTO(listNominationContentDTO); - VoteAction.logger.debug("listNominationContentDTO after reordersimple: " + listNominationContentDTO); - sessionMap.put(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY, listNominationContentDTO); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteAction.logger.debug("activeModule: " + activeModule); String richTextTitle = request.getParameter(VoteAppConstants.TITLE); - VoteAction.logger.debug("richTextTitle: " + richTextTitle); String richTextInstructions = request.getParameter(VoteAppConstants.INSTRUCTIONS); - VoteAction.logger.debug("richTextInstructions: " + richTextInstructions); sessionMap.put(VoteAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); sessionMap.put(VoteAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteAction.logger.debug("strToolContentID: " + strToolContentID); - VoteContent voteContent = voteService.retrieveVote(new Long(strToolContentID)); - VoteAction.logger.debug("voteContent: " + voteContent); - VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - VoteAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); @@ -858,33 +614,25 @@ voteGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - VoteAction.logger.debug("activeModule: " + activeModule); if (activeModule.equals(VoteAppConstants.AUTHORING)) { String onlineInstructions = (String) sessionMap.get(VoteAppConstants.ONLINE_INSTRUCTIONS_KEY); - VoteAction.logger.debug("onlineInstructions: " + onlineInstructions); voteGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); String offlineInstructions = (String) sessionMap.get(VoteAppConstants.OFFLINE_INSTRUCTIONS_KEY); - VoteAction.logger.debug("offlineInstructions: " + offlineInstructions); voteGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); List attachmentList = (List) sessionMap.get(VoteAppConstants.ATTACHMENT_LIST_KEY); - VoteAction.logger.debug("attachmentList: " + attachmentList); List deletedAttachmentList = (List) sessionMap.get(VoteAppConstants.DELETED_ATTACHMENT_LIST_KEY); - VoteAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList); voteGeneralAuthoringDTO.setAttachmentList(attachmentList); voteGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList); String strOnlineInstructions = request.getParameter("onlineInstructions"); String strOfflineInstructions = request.getParameter("offlineInstructions"); - VoteAction.logger.debug("onlineInstructions: " + strOnlineInstructions); - VoteAction.logger.debug("offlineInstructions: " + strOnlineInstructions); voteAuthoringForm.setOnlineInstructions(strOnlineInstructions); voteAuthoringForm.setOfflineInstructions(strOfflineInstructions); } - AuthoringUtil authoringUtil = new AuthoringUtil(); voteGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString()); request.getSession().setAttribute(httpSessionID, sessionMap); @@ -898,16 +646,13 @@ voteAuthoringForm.setCurrentTab("1"); request.setAttribute(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO, listNominationContentDTO); - VoteAction.logger.debug("listNominationContentDTO now: " + listNominationContentDTO); voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - VoteAction.logger.debug("before saving final voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.TOTAL_NOMINATION_COUNT, new Integer(listNominationContentDTO.size())); - VoteAction.logger.debug("fwd ing to LOAD_NOMINATIONS: " + VoteAppConstants.LOAD_QUESTIONS); return mapping.findForward(VoteAppConstants.LOAD_QUESTIONS); } @@ -926,56 +671,38 @@ */ public ActionForward moveNominationUp(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - VoteAction.logger.debug("dispatching moveNominationUp"); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteAction.logger.debug("voteService: " + voteService); String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteAction.logger.debug("httpSessionID: " + httpSessionID); - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteAction.logger.debug("sessionMap: " + sessionMap); String questionIndex = request.getParameter("questionIndex"); - VoteAction.logger.debug("questionIndex: " + questionIndex); List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); - VoteAction.logger.debug("listNominationContentDTO: " + listNominationContentDTO); listNominationContentDTO = AuthoringUtil.swapNodes(listNominationContentDTO, questionIndex, "up"); - VoteAction.logger.debug("listNominationContentDTO after swap: " + listNominationContentDTO); listNominationContentDTO = AuthoringUtil.reorderSimpleListNominationContentDTO(listNominationContentDTO); - VoteAction.logger.debug("listNominationContentDTO after reordersimple: " + listNominationContentDTO); sessionMap.put(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY, listNominationContentDTO); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteAction.logger.debug("activeModule: " + activeModule); String richTextTitle = request.getParameter(VoteAppConstants.TITLE); - VoteAction.logger.debug("richTextTitle: " + richTextTitle); String richTextInstructions = request.getParameter(VoteAppConstants.INSTRUCTIONS); - VoteAction.logger.debug("richTextInstructions: " + richTextInstructions); sessionMap.put(VoteAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); sessionMap.put(VoteAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteAction.logger.debug("strToolContentID: " + strToolContentID); - VoteContent voteContent = voteService.retrieveVote(new Long(strToolContentID)); - VoteAction.logger.debug("voteContent: " + voteContent); - VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - VoteAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); @@ -985,33 +712,25 @@ voteGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - VoteAction.logger.debug("activeModule: " + activeModule); if (activeModule.equals(VoteAppConstants.AUTHORING)) { String onlineInstructions = (String) sessionMap.get(VoteAppConstants.ONLINE_INSTRUCTIONS_KEY); - VoteAction.logger.debug("onlineInstructions: " + onlineInstructions); voteGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); String offlineInstructions = (String) sessionMap.get(VoteAppConstants.OFFLINE_INSTRUCTIONS_KEY); - VoteAction.logger.debug("offlineInstructions: " + offlineInstructions); voteGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); List attachmentList = (List) sessionMap.get(VoteAppConstants.ATTACHMENT_LIST_KEY); - VoteAction.logger.debug("attachmentList: " + attachmentList); List deletedAttachmentList = (List) sessionMap.get(VoteAppConstants.DELETED_ATTACHMENT_LIST_KEY); - VoteAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList); voteGeneralAuthoringDTO.setAttachmentList(attachmentList); voteGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList); String strOnlineInstructions = request.getParameter("onlineInstructions"); String strOfflineInstructions = request.getParameter("offlineInstructions"); - VoteAction.logger.debug("onlineInstructions: " + strOnlineInstructions); - VoteAction.logger.debug("offlineInstructions: " + strOnlineInstructions); voteAuthoringForm.setOnlineInstructions(strOnlineInstructions); voteAuthoringForm.setOfflineInstructions(strOfflineInstructions); } - AuthoringUtil authoringUtil = new AuthoringUtil(); voteGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString()); request.getSession().setAttribute(httpSessionID, sessionMap); @@ -1025,16 +744,10 @@ voteAuthoringForm.setCurrentTab("1"); request.setAttribute(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO, listNominationContentDTO); - VoteAction.logger.debug("listNominationContentDTO now: " + listNominationContentDTO); - voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - VoteAction.logger.debug("before saving final voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); - request.setAttribute(VoteAppConstants.TOTAL_NOMINATION_COUNT, new Integer(listNominationContentDTO.size())); - - VoteAction.logger.debug("fwd ing to LOAD_NOMINATIONS: " + VoteAppConstants.LOAD_QUESTIONS); return mapping.findForward(VoteAppConstants.LOAD_QUESTIONS); } @@ -1053,34 +766,20 @@ */ public ActionForward removeNomination(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - VoteAction.logger.debug("dispatching removeNomination"); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; - IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteAction.logger.debug("voteService: " + voteService); - String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteAction.logger.debug("httpSessionID: " + httpSessionID); - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteAction.logger.debug("sessionMap: " + sessionMap); String questionIndex = request.getParameter("questionIndex"); - VoteAction.logger.debug("questionIndex: " + questionIndex); - List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); - VoteAction.logger.debug("listNominationContentDTO: " + listNominationContentDTO); VoteNominationContentDTO voteNominationContentDTO = null; Iterator listIterator = listNominationContentDTO.iterator(); while (listIterator.hasNext()) { voteNominationContentDTO = (VoteNominationContentDTO) listIterator.next(); - VoteAction.logger.debug("voteNominationContentDTO:" + voteNominationContentDTO); - VoteAction.logger.debug("voteNominationContentDTO question:" + voteNominationContentDTO.getNomination()); - String question = voteNominationContentDTO.getNomination(); String displayOrder = voteNominationContentDTO.getDisplayOrder(); - VoteAction.logger.debug("displayOrder:" + displayOrder); if (displayOrder != null && !displayOrder.equals("")) { if (displayOrder.equals(questionIndex)) { @@ -1090,37 +789,27 @@ } } - VoteAction.logger.debug("voteNominationContentDTO found:" + voteNominationContentDTO); voteNominationContentDTO.setNomination(""); - VoteAction.logger.debug("listNominationContentDTO after remove:" + listNominationContentDTO); listNominationContentDTO = AuthoringUtil.reorderListNominationContentDTO(listNominationContentDTO, questionIndex); - VoteAction.logger.debug("listNominationContentDTO reordered:" + listNominationContentDTO); sessionMap.put(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY, listNominationContentDTO); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteAction.logger.debug("activeModule: " + activeModule); String richTextTitle = request.getParameter(VoteAppConstants.TITLE); - VoteAction.logger.debug("richTextTitle: " + richTextTitle); - String richTextInstructions = request.getParameter(VoteAppConstants.INSTRUCTIONS); - VoteAction.logger.debug("richTextInstructions: " + richTextInstructions); sessionMap.put(VoteAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); sessionMap.put(VoteAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteAction.logger.debug("strToolContentID: " + strToolContentID); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - VoteAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); @@ -1130,34 +819,25 @@ voteGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - VoteAction.logger.debug("activeModule: " + activeModule); if (activeModule.equals(VoteAppConstants.AUTHORING)) { String onlineInstructions = (String) sessionMap.get(VoteAppConstants.ONLINE_INSTRUCTIONS_KEY); - VoteAction.logger.debug("onlineInstructions: " + onlineInstructions); voteGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); String offlineInstructions = (String) sessionMap.get(VoteAppConstants.OFFLINE_INSTRUCTIONS_KEY); - VoteAction.logger.debug("offlineInstructions: " + offlineInstructions); voteGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); List attachmentList = (List) sessionMap.get(VoteAppConstants.ATTACHMENT_LIST_KEY); - VoteAction.logger.debug("attachmentList: " + attachmentList); List deletedAttachmentList = (List) sessionMap.get(VoteAppConstants.DELETED_ATTACHMENT_LIST_KEY); - VoteAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList); voteGeneralAuthoringDTO.setAttachmentList(attachmentList); voteGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList); String strOnlineInstructions = request.getParameter("onlineInstructions"); String strOfflineInstructions = request.getParameter("offlineInstructions"); - VoteAction.logger.debug("onlineInstructions: " + strOnlineInstructions); - VoteAction.logger.debug("offlineInstructions: " + strOnlineInstructions); voteAuthoringForm.setOnlineInstructions(strOnlineInstructions); voteAuthoringForm.setOfflineInstructions(strOfflineInstructions); } - AuthoringUtil authoringUtil = new AuthoringUtil(); - voteGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString()); request.getSession().setAttribute(httpSessionID, sessionMap); @@ -1170,17 +850,13 @@ voteAuthoringForm.setCurrentTab("1"); request.setAttribute(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO, listNominationContentDTO); - VoteAction.logger.debug("voteNominationContentDTO now: " + voteNominationContentDTO); - VoteAction.logger.debug("listNominationContentDTO now: " + listNominationContentDTO); voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - VoteAction.logger.debug("before saving final voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.TOTAL_NOMINATION_COUNT, new Integer(listNominationContentDTO.size())); - VoteAction.logger.debug("fwd ing to LOAD_QUESTIONS: " + VoteAppConstants.LOAD_QUESTIONS); return mapping.findForward(VoteAppConstants.LOAD_QUESTIONS); } @@ -1199,73 +875,49 @@ */ public ActionForward newEditableNominationBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - VoteAction.logger.debug("dispathcing newEditableNominationBox"); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteAction.logger.debug("voteService: " + voteService); String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteAction.logger.debug("sessionMap: " + sessionMap); String questionIndex = request.getParameter("questionIndex"); - VoteAction.logger.debug("questionIndex: " + questionIndex); voteAuthoringForm.setEditableNominationIndex(questionIndex); List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); - VoteAction.logger.debug("listNominationContentDTO: " + listNominationContentDTO); String editableNomination = ""; String editableFeedback = ""; Iterator listIterator = listNominationContentDTO.iterator(); while (listIterator.hasNext()) { VoteNominationContentDTO voteNominationContentDTO = (VoteNominationContentDTO) listIterator.next(); - VoteAction.logger.debug("voteNominationContentDTO:" + voteNominationContentDTO); - VoteAction.logger.debug("voteNominationContentDTO question:" + voteNominationContentDTO.getNomination()); String question = voteNominationContentDTO.getNomination(); String displayOrder = voteNominationContentDTO.getDisplayOrder(); if (displayOrder != null && !displayOrder.equals("")) { if (displayOrder.equals(questionIndex)) { editableFeedback = voteNominationContentDTO.getFeedback(); editableNomination = voteNominationContentDTO.getNomination(); - VoteAction.logger.debug("editableFeedback found :" + editableFeedback); break; } } } - VoteAction.logger.debug("editableFeedback found :" + editableFeedback); - VoteAction.logger.debug("editableNomination found :" + editableNomination); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteAction.logger.debug("activeModule: " + activeModule); - - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteAction.logger.debug("strToolContentID: " + strToolContentID); - - VoteContent voteContent = voteService.retrieveVote(new Long(strToolContentID)); - VoteAction.logger.debug("voteContent: " + voteContent); - VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - VoteAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); String richTextTitle = request.getParameter(VoteAppConstants.TITLE); String richTextInstructions = request.getParameter(VoteAppConstants.INSTRUCTIONS); - VoteAction.logger.debug("richTextTitle: " + richTextTitle); - VoteAction.logger.debug("richTextInstructions: " + richTextInstructions); voteGeneralAuthoringDTO.setActivityTitle(richTextTitle); voteAuthoringForm.setTitle(richTextTitle); voteGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); @@ -1276,22 +928,17 @@ voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - VoteAction.logger.debug("voteGeneralAuthoringDTO now: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.TOTAL_NOMINATION_COUNT, new Integer(listNominationContentDTO.size())); - VoteAction.logger.debug("activeModule: " + activeModule); if (activeModule.equals(VoteAppConstants.AUTHORING)) { String strOnlineInstructions = request.getParameter("onlineInstructions"); String strOfflineInstructions = request.getParameter("offlineInstructions"); - VoteAction.logger.debug("onlineInstructions: " + strOnlineInstructions); - VoteAction.logger.debug("offlineInstructions: " + strOnlineInstructions); voteAuthoringForm.setOnlineInstructions(strOnlineInstructions); voteAuthoringForm.setOfflineInstructions(strOfflineInstructions); } - VoteAction.logger.debug("fwd ing to editNominationBox: "); return mapping.findForward("editNominationBox"); } @@ -1310,68 +957,44 @@ */ public ActionForward newNominationBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - VoteAction.logger.debug("dispathcing newNominationBox"); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; - IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteAction.logger.debug("voteService: " + voteService); - String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteAction.logger.debug("sessionMap: " + sessionMap); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteAction.logger.debug("activeModule: " + activeModule); - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteAction.logger.debug("strToolContentID: " + strToolContentID); - - VoteContent voteContent = voteService.retrieveVote(new Long(strToolContentID)); - VoteAction.logger.debug("voteContent: " + voteContent); - VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - VoteAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); String richTextTitle = request.getParameter(VoteAppConstants.TITLE); String richTextInstructions = request.getParameter(VoteAppConstants.INSTRUCTIONS); - VoteAction.logger.debug("richTextTitle: " + richTextTitle); - VoteAction.logger.debug("richTextInstructions: " + richTextInstructions); voteGeneralAuthoringDTO.setActivityTitle(richTextTitle); voteAuthoringForm.setTitle(richTextTitle); voteGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - VoteAction.logger.debug("activeModule: " + activeModule); if (activeModule.equals(VoteAppConstants.AUTHORING)) { String strOnlineInstructions = request.getParameter("onlineInstructions"); String strOfflineInstructions = request.getParameter("offlineInstructions"); - VoteAction.logger.debug("onlineInstructions: " + strOnlineInstructions); - VoteAction.logger.debug("offlineInstructions: " + strOnlineInstructions); voteAuthoringForm.setOnlineInstructions(strOnlineInstructions); voteAuthoringForm.setOfflineInstructions(strOfflineInstructions); } voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - VoteAction.logger.debug("voteGeneralAuthoringDTO now: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); - VoteAction.logger.debug("listNominationContentDTO: " + listNominationContentDTO); request.setAttribute(VoteAppConstants.TOTAL_NOMINATION_COUNT, new Integer(listNominationContentDTO.size())); - - VoteAction.logger.debug("fwd ing to newNominationBox: "); return mapping.findForward("newNominationBox"); } @@ -1390,33 +1013,22 @@ */ public ActionForward addSingleNomination(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - VoteAction.logger.debug("dispathcing addSingleNomination"); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteAction.logger.debug("voteService: " + voteService); String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteAction.logger.debug("sessionMap: " + sessionMap); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteAction.logger.debug("activeModule: " + activeModule); - String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteAction.logger.debug("strToolContentID: " + strToolContentID); VoteContent voteContent = voteService.retrieveVote(new Long(strToolContentID)); - VoteAction.logger.debug("voteContent: " + voteContent); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - VoteAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); @@ -1426,20 +1038,15 @@ AuthoringUtil authoringUtil = new AuthoringUtil(); List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); - VoteAction.logger.debug("listNominationContentDTO: " + listNominationContentDTO); String newNomination = request.getParameter("newNomination"); - VoteAction.logger.debug("newNomination: " + newNomination); String feedback = request.getParameter("feedback"); - VoteAction.logger.debug("feedback: " + feedback); int listSize = listNominationContentDTO.size(); - VoteAction.logger.debug("listSize: " + listSize); if (newNomination != null && newNomination.length() > 0) { boolean duplicates = AuthoringUtil.checkDuplicateNominations(listNominationContentDTO, newNomination); - VoteAction.logger.debug("duplicates: " + duplicates); if (!duplicates) { VoteNominationContentDTO voteNominationContentDTO = new VoteNominationContentDTO(); @@ -1448,53 +1055,35 @@ voteNominationContentDTO.setNomination(newNomination); listNominationContentDTO.add(voteNominationContentDTO); - VoteAction.logger.debug("updated listNominationContentDTO: " + listNominationContentDTO); - } else { - VoteAction.logger.debug("entry duplicate, not adding"); - } - } else { - VoteAction.logger.debug("entry blank, not adding"); - } - + request.setAttribute(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO, listNominationContentDTO); sessionMap.put(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY, listNominationContentDTO); String richTextTitle = (String) sessionMap.get(VoteAppConstants.ACTIVITY_TITLE_KEY); - VoteAction.logger.debug("richTextTitle: " + richTextTitle); String richTextInstructions = (String) sessionMap.get(VoteAppConstants.ACTIVITY_INSTRUCTIONS_KEY); - VoteAction.logger.debug("richTextInstructions: " + richTextInstructions); - VoteAction.logger.debug("richTextTitle: " + richTextTitle); - VoteAction.logger.debug("richTextInstructions: " + richTextInstructions); voteGeneralAuthoringDTO.setActivityTitle(richTextTitle); voteAuthoringForm.setTitle(richTextTitle); voteGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - VoteAction.logger.debug("activeModule: " + activeModule); if (activeModule.equals(VoteAppConstants.AUTHORING)) { String onlineInstructions = (String) sessionMap.get(VoteAppConstants.ONLINE_INSTRUCTIONS_KEY); - VoteAction.logger.debug("onlineInstructions: " + onlineInstructions); voteGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); String offlineInstructions = (String) sessionMap.get(VoteAppConstants.OFFLINE_INSTRUCTIONS_KEY); - VoteAction.logger.debug("offlineInstructions: " + offlineInstructions); voteGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); List attachmentList = (List) sessionMap.get(VoteAppConstants.ATTACHMENT_LIST_KEY); - VoteAction.logger.debug("attachmentList: " + attachmentList); List deletedAttachmentList = (List) sessionMap.get(VoteAppConstants.DELETED_ATTACHMENT_LIST_KEY); - VoteAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList); voteGeneralAuthoringDTO.setAttachmentList(attachmentList); voteGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList); String strOnlineInstructions = request.getParameter("onlineInstructions"); String strOfflineInstructions = request.getParameter("offlineInstructions"); - VoteAction.logger.debug("onlineInstructions: " + strOnlineInstructions); - VoteAction.logger.debug("offlineInstructions: " + strOfflineInstructions); voteAuthoringForm.setOnlineInstructions(strOnlineInstructions); voteAuthoringForm.setOfflineInstructions(strOfflineInstructions); } @@ -1513,20 +1102,12 @@ voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - VoteAction.logger.debug("voteGeneralAuthoringDTO now: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); - VoteAction.logger.debug("httpSessionID: " + httpSessionID); - VoteAction.logger.debug("sessionMap: " + sessionMap); - request.getSession().setAttribute(httpSessionID, sessionMap); - VoteAction.logger.debug("voteGeneralAuthoringDTO.getMapNominationContent(); " - + voteGeneralAuthoringDTO.getMapNominationContent()); - request.setAttribute(VoteAppConstants.TOTAL_NOMINATION_COUNT, new Integer(listNominationContentDTO.size())); - VoteAction.logger.debug("fwd ing to LOAD_QUESTIONS: " + VoteAppConstants.LOAD_QUESTIONS); return mapping.findForward(VoteAppConstants.LOAD_QUESTIONS); } @@ -1544,37 +1125,27 @@ public ActionForward saveSingleNomination(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - VoteAction.logger.debug("dispathcing saveSingleNomination"); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteAction.logger.debug("voteService: " + voteService); String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteAction.logger.debug("sessionMap: " + sessionMap); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteAction.logger.debug("activeModule: " + activeModule); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteAction.logger.debug("strToolContentID: " + strToolContentID); String editNominationBoxRequest = request.getParameter("editNominationBoxRequest"); - VoteAction.logger.debug("editNominationBoxRequest: " + editNominationBoxRequest); VoteContent voteContent = voteService.retrieveVote(new Long(strToolContentID)); - VoteAction.logger.debug("voteContent: " + voteContent); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - VoteAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); @@ -1584,35 +1155,25 @@ AuthoringUtil authoringUtil = new AuthoringUtil(); List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); - VoteAction.logger.debug("listNominationContentDTO: " + listNominationContentDTO); String newNomination = request.getParameter("newNomination"); - VoteAction.logger.debug("newNomination: " + newNomination); String feedback = request.getParameter("feedback"); - VoteAction.logger.debug("feedback: " + feedback); String editableNominationIndex = request.getParameter("editableNominationIndex"); - VoteAction.logger.debug("editableNominationIndex: " + editableNominationIndex); if (newNomination != null && newNomination.length() > 0) { if (editNominationBoxRequest != null && editNominationBoxRequest.equals("false")) { - VoteAction.logger.debug("request for add and save"); boolean duplicates = AuthoringUtil.checkDuplicateNominations(listNominationContentDTO, newNomination); - VoteAction.logger.debug("duplicates: " + duplicates); if (!duplicates) { VoteNominationContentDTO voteNominationContentDTO = null; Iterator listIterator = listNominationContentDTO.iterator(); while (listIterator.hasNext()) { voteNominationContentDTO = (VoteNominationContentDTO) listIterator.next(); - VoteAction.logger.debug("voteNominationContentDTO:" + voteNominationContentDTO); - VoteAction.logger.debug("voteNominationContentDTO question:" - + voteNominationContentDTO.getQuestion()); String question = voteNominationContentDTO.getNomination(); String displayOrder = voteNominationContentDTO.getDisplayOrder(); - VoteAction.logger.debug("displayOrder:" + displayOrder); if (displayOrder != null && !displayOrder.equals("")) { if (displayOrder.equals(editableNominationIndex)) { @@ -1621,32 +1182,25 @@ } } - VoteAction.logger.debug("voteNominationContentDTO found:" + voteNominationContentDTO); voteNominationContentDTO.setQuestion(newNomination); voteNominationContentDTO.setFeedback(feedback); voteNominationContentDTO.setDisplayOrder(editableNominationIndex); listNominationContentDTO = AuthoringUtil.reorderUpdateListNominationContentDTO( listNominationContentDTO, voteNominationContentDTO, editableNominationIndex); - VoteAction.logger.debug("post reorderUpdateListNominationContentDTO listNominationContentDTO: " - + listNominationContentDTO); } else { - VoteAction.logger.debug("duplicate question entry, not adding"); + //duplicate question entry, not adding } } else { - VoteAction.logger.debug("request for edit and save."); + //request for edit and save VoteNominationContentDTO voteNominationContentDTO = null; Iterator listIterator = listNominationContentDTO.iterator(); while (listIterator.hasNext()) { voteNominationContentDTO = (VoteNominationContentDTO) listIterator.next(); - VoteAction.logger.debug("voteNominationContentDTO:" + voteNominationContentDTO); - VoteAction.logger.debug("voteNominationContentDTO question:" - + voteNominationContentDTO.getNomination()); String question = voteNominationContentDTO.getNomination(); String displayOrder = voteNominationContentDTO.getDisplayOrder(); - VoteAction.logger.debug("displayOrder:" + displayOrder); if (displayOrder != null && !displayOrder.equals("")) { if (displayOrder.equals(editableNominationIndex)) { @@ -1655,59 +1209,44 @@ } } - VoteAction.logger.debug("voteNominationContentDTO found:" + voteNominationContentDTO); voteNominationContentDTO.setNomination(newNomination); voteNominationContentDTO.setFeedback(feedback); voteNominationContentDTO.setDisplayOrder(editableNominationIndex); listNominationContentDTO = AuthoringUtil.reorderUpdateListNominationContentDTO( listNominationContentDTO, voteNominationContentDTO, editableNominationIndex); - VoteAction.logger.debug("post reorderUpdateListNominationContentDTO listNominationContentDTO: " - + listNominationContentDTO); } } else { - VoteAction.logger.debug("entry blank, not adding"); + //entry blank, not adding } request.setAttribute(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO, listNominationContentDTO); sessionMap.put(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY, listNominationContentDTO); - VoteAction.logger.debug("listNominationContentDTO now: " + listNominationContentDTO); String richTextTitle = (String) sessionMap.get(VoteAppConstants.ACTIVITY_TITLE_KEY); - VoteAction.logger.debug("richTextTitle: " + richTextTitle); String richTextInstructions = (String) sessionMap.get(VoteAppConstants.ACTIVITY_INSTRUCTIONS_KEY); - VoteAction.logger.debug("richTextInstructions: " + richTextInstructions); - VoteAction.logger.debug("richTextTitle: " + richTextTitle); - VoteAction.logger.debug("richTextInstructions: " + richTextInstructions); voteGeneralAuthoringDTO.setActivityTitle(richTextTitle); voteAuthoringForm.setTitle(richTextTitle); voteGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - VoteAction.logger.debug("activeModule: " + activeModule); if (activeModule.equals(VoteAppConstants.AUTHORING)) { String onlineInstructions = (String) sessionMap.get(VoteAppConstants.ONLINE_INSTRUCTIONS_KEY); - VoteAction.logger.debug("onlineInstructions: " + onlineInstructions); voteGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); String offlineInstructions = (String) sessionMap.get(VoteAppConstants.OFFLINE_INSTRUCTIONS_KEY); - VoteAction.logger.debug("offlineInstructions: " + offlineInstructions); voteGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); List attachmentList = (List) sessionMap.get(VoteAppConstants.ATTACHMENT_LIST_KEY); - VoteAction.logger.debug("attachmentList: " + attachmentList); List deletedAttachmentList = (List) sessionMap.get(VoteAppConstants.DELETED_ATTACHMENT_LIST_KEY); - VoteAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList); voteGeneralAuthoringDTO.setAttachmentList(attachmentList); voteGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList); String strOnlineInstructions = request.getParameter("onlineInstructions"); String strOfflineInstructions = request.getParameter("offlineInstructions"); - VoteAction.logger.debug("onlineInstructions: " + strOnlineInstructions); - VoteAction.logger.debug("offlineInstructions: " + strOfflineInstructions); voteAuthoringForm.setOnlineInstructions(strOnlineInstructions); voteAuthoringForm.setOfflineInstructions(strOfflineInstructions); @@ -1729,19 +1268,12 @@ voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - VoteAction.logger.debug("voteGeneralAuthoringDTO now: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); - VoteAction.logger.debug("httpSessionID: " + httpSessionID); - VoteAction.logger.debug("sessionMap: " + sessionMap); - request.getSession().setAttribute(httpSessionID, sessionMap); - VoteAction.logger.debug("voteGeneralAuthoringDTO.getMapNominationContent(); " - + voteGeneralAuthoringDTO.getMapNominationContent()); request.setAttribute(VoteAppConstants.TOTAL_NOMINATION_COUNT, new Integer(listNominationContentDTO.size())); - VoteAction.logger.debug("fwd ing to LOAD_QUESTIONS: " + VoteAppConstants.LOAD_QUESTIONS); return mapping.findForward(VoteAppConstants.LOAD_QUESTIONS); } @@ -1760,40 +1292,29 @@ */ public ActionForward submitAllContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - VoteAction.logger.debug("dispathcing submitAllContent :" + form); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteAction.logger.debug("voteService: " + voteService); String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteAction.logger.debug("sessionMap: " + sessionMap); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteAction.logger.debug("activeModule: " + activeModule); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteAction.logger.debug("strToolContentID: " + strToolContentID); List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); - VoteAction.logger.debug("listNominationContentDTO: " + listNominationContentDTO); Map mapNominationContent = AuthoringUtil.extractMapNominationContent(listNominationContentDTO); - VoteAction.logger.debug("extracted mapNominationContent: " + mapNominationContent); Map mapFeedback = AuthoringUtil.extractMapFeedback(listNominationContentDTO); - VoteAction.logger.debug("extracted mapFeedback: " + mapFeedback); ActionMessages errors = new ActionMessages(); - VoteAction.logger.debug("mapNominationContent size: " + mapNominationContent.size()); if (mapNominationContent.size() == 0 && (voteAuthoringForm.getAssignedDataFlowObject() == null || voteAuthoringForm @@ -1803,7 +1324,6 @@ } String maxNomCount = voteAuthoringForm.getMaxNominationCount(); - VoteAction.logger.debug("maxNomCount:" + maxNomCount); if (activeModule != null) { if (activeModule.equals(VoteAppConstants.AUTHORING)) { @@ -1815,7 +1335,6 @@ try { int intMaxNomCount = new Integer(maxNomCount).intValue(); - VoteAction.logger.debug("intMaxNomCount : " + intMaxNomCount); } catch (NumberFormatException e) { ActionMessage error = new ActionMessage("maxNomination.invalid"); errors.add(ActionMessages.GLOBAL_MESSAGE, error); @@ -1825,49 +1344,39 @@ } boolean nominationsDuplicate = AuthoringUtil.verifyDuplicateNominations(mapNominationContent); - VoteAction.logger.debug("nominationsDuplicate :" + nominationsDuplicate); if (nominationsDuplicate == true) { ActionMessage error = new ActionMessage("nominations.duplicate"); errors.add(ActionMessages.GLOBAL_MESSAGE, error); } - VoteAction.logger.debug("errors: " + errors); - AuthoringUtil authoringUtil = new AuthoringUtil(); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); DataFlowObject assignedDataFlowObject = null; - VoteAction.logger.debug("activeModule: " + activeModule); if (activeModule.equals(VoteAppConstants.AUTHORING)) { List attachmentListBackup = new ArrayList(); List attachmentList = (List) sessionMap.get(VoteAppConstants.ATTACHMENT_LIST_KEY); - VoteAction.logger.debug("attachmentList: " + attachmentList); attachmentListBackup = attachmentList; List deletedAttachmentListBackup = new ArrayList(); List deletedAttachmentList = (List) sessionMap.get(VoteAppConstants.DELETED_ATTACHMENT_LIST_KEY); - VoteAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList); deletedAttachmentListBackup = deletedAttachmentList; String onlineInstructions = (String) sessionMap.get(VoteAppConstants.ONLINE_INSTRUCTIONS_KEY); - VoteAction.logger.debug("onlineInstructions: " + onlineInstructions); voteGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); String offlineInstructions = (String) sessionMap.get(VoteAppConstants.OFFLINE_INSTRUCTIONS_KEY); - VoteAction.logger.debug("offlineInstructions: " + offlineInstructions); voteGeneralAuthoringDTO.setOfflineInstructions(offlineInstructions); voteGeneralAuthoringDTO.setAttachmentList(attachmentList); voteGeneralAuthoringDTO.setDeletedAttachmentList(deletedAttachmentList); String strOnlineInstructions = request.getParameter("onlineInstructions"); String strOfflineInstructions = request.getParameter("offlineInstructions"); - VoteAction.logger.debug("onlineInstructions: " + strOnlineInstructions); - VoteAction.logger.debug("offlineInstructions: " + strOfflineInstructions); voteAuthoringForm.setOfflineInstructions(strOfflineInstructions); voteAuthoringForm.setOnlineInstructions(strOnlineInstructions); @@ -1900,9 +1409,6 @@ String richTextTitle = request.getParameter(VoteAppConstants.TITLE); String richTextInstructions = request.getParameter(VoteAppConstants.INSTRUCTIONS); - VoteAction.logger.debug("richTextTitle: " + richTextTitle); - VoteAction.logger.debug("richTextInstructions: " + richTextInstructions); - voteGeneralAuthoringDTO.setActivityTitle(richTextTitle); voteAuthoringForm.setTitle(richTextTitle); @@ -1912,80 +1418,57 @@ sessionMap.put(VoteAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); voteGeneralAuthoringDTO.setMapNominationContent(mapNominationContent); - VoteAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); - - VoteAction.logger.debug("voteGeneralAuthoringDTO now: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); - VoteAction.logger.debug("there are no issues with input, continue and submit data"); - VoteContent voteContentTest = voteService.retrieveVote(new Long(strToolContentID)); - VoteAction.logger.debug("voteContentTest: " + voteContentTest); - - VoteAction.logger.debug("errors: " + errors); if (!errors.isEmpty()) { saveErrors(request, errors); - VoteAction.logger.debug("errors saved: " + errors); + VoteAction.logger.error("errors saved: " + errors); } VoteContent voteContent = voteContentTest; if (errors.isEmpty()) { - VoteAction.logger.debug("errors is empty: " + errors); /* to remove deleted entries in the questions table based on mapNominationContent */ authoringUtil.removeRedundantNominations(mapNominationContent, voteService, voteAuthoringForm, request, strToolContentID); - VoteAction.logger.debug("end of removing unused entries... "); voteContent = authoringUtil.saveOrUpdateVoteContent(mapNominationContent, mapFeedback, voteService, voteAuthoringForm, request, voteContentTest, strToolContentID, assignedDataFlowObject); - VoteAction.logger.debug("voteContent: " + voteContent); long defaultContentID = 0; - VoteAction.logger.debug("attempt retrieving tool with signatute : " + VoteAppConstants.MY_SIGNATURE); defaultContentID = voteService.getToolDefaultContentIdBySignature(VoteAppConstants.MY_SIGNATURE); - VoteAction.logger.debug("retrieved tool default contentId: " + defaultContentID); if (voteContent != null) { voteGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID).toString()); } - VoteAction.logger.debug("updated voteGeneralAuthoringDTO to: " + voteGeneralAuthoringDTO); authoringUtil.reOrganizeDisplayOrder(mapNominationContent, voteService, voteAuthoringForm, voteContent); - VoteAction.logger.debug("activeModule: " + activeModule); if (activeModule.equals(VoteAppConstants.AUTHORING)) { - VoteAction.logger.debug("since it is authoring save the attachments: "); + //since it is authoring save the attachments List attachmentList = (List) sessionMap.get(VoteAppConstants.ATTACHMENT_LIST_KEY); - VoteAction.logger.debug("attachmentList: " + attachmentList); - List deletedAttachmentList = (List) sessionMap.get(VoteAppConstants.DELETED_ATTACHMENT_LIST_KEY); List attachments = saveAttachments(voteContent, attachmentList, deletedAttachmentList, mapping, request); - VoteAction.logger.debug("attachments: " + attachments); } - VoteAction.logger.debug("strToolContentID: " + strToolContentID); VoteUtils.setDefineLater(request, false, strToolContentID, voteService); - VoteAction.logger.debug("define later set to false"); if (activeModule.equals(VoteAppConstants.AUTHORING)) { - VoteAction.logger.debug("standard authoring close"); + //standard authoring close request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG, Boolean.TRUE); voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); } else { - VoteAction.logger.debug("go back to view only screen"); + //go back to view only screen voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(false).toString()); } } else { - VoteAction.logger.debug("errors is not empty: " + errors); if (voteContent != null) { long defaultContentID = 0; - VoteAction.logger.debug("attempt retrieving tool with signatute : " + VoteAppConstants.MY_SIGNATURE); defaultContentID = voteService.getToolDefaultContentIdBySignature(VoteAppConstants.MY_SIGNATURE); - VoteAction.logger.debug("retrieved tool default contentId: " + defaultContentID); if (voteContent != null) { voteGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID).toString()); @@ -1999,7 +1482,6 @@ voteAuthoringForm.resetUserAction(); voteGeneralAuthoringDTO.setMapNominationContent(mapNominationContent); - VoteAction.logger.debug("before saving final voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO, listNominationContentDTO); @@ -2017,7 +1499,6 @@ voteAuthoringForm.setActiveModule(activeModule); voteAuthoringForm.setCurrentTab("1"); - VoteAction.logger.debug("forwarding to :" + VoteAppConstants.LOAD_QUESTIONS); return mapping.findForward(VoteAppConstants.LOAD_QUESTIONS); } @@ -2045,42 +1526,31 @@ private List saveAttachments(VoteContent voteContent, List attachmentList, List deletedAttachmentList, ActionMapping mapping, HttpServletRequest request) { - VoteAction.logger.debug("start saveAttachments, attachmentList " + attachmentList); - VoteAction.logger.debug("start deletedAttachmentList, deletedAttachmentList " + deletedAttachmentList); - if (attachmentList == null || deletedAttachmentList == null) { return null; } IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteAction.logger.debug("voteService: " + voteService); if (deletedAttachmentList != null) { - VoteAction.logger.debug("deletedAttachmentList is iterated..."); Iterator iter = deletedAttachmentList.iterator(); while (iter.hasNext()) { VoteUploadedFile attachment = (VoteUploadedFile) iter.next(); - VoteAction.logger.debug("attachment: " + attachment); if (attachment.getSubmissionId() != null) { voteService.removeFile(attachment.getSubmissionId()); } } deletedAttachmentList.clear(); - VoteAction.logger.error("cleared attachment list."); } if (attachmentList != null) { - VoteAction.logger.debug("attachmentList is iterated..."); Iterator iter = attachmentList.iterator(); while (iter.hasNext()) { VoteUploadedFile attachment = (VoteUploadedFile) iter.next(); - VoteAction.logger.debug("attachment: " + attachment); - VoteAction.logger.debug("attachment submission id: " + attachment.getSubmissionId()); if (attachment.getSubmissionId() == null) { /* add entry to tool table - file already in content repository */ - VoteAction.logger.debug("calling persistFile with attachment: " + attachment); voteService.persistFile(voteContent, attachment); } } @@ -2104,39 +1574,29 @@ */ public ActionForward deleteFile(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - VoteAction.logger.debug("dispatching deleteFile"); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteAction.logger.debug("voteService: " + voteService); String httpSessionID = request.getParameter(VoteAppConstants.HTTP_SESSION_ID); - VoteAction.logger.debug("httpSessionID: " + httpSessionID); voteAuthoringForm.setHttpSessionID(httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteAction.logger.debug("sessionMap: " + sessionMap); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteAction.logger.debug("activeModule: " + activeModule); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteAction.logger.debug("strToolContentID: " + strToolContentID); List listQuestionContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); - VoteAction.logger.debug("listQuestionContentDTO: " + listQuestionContentDTO); request.setAttribute(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO, listQuestionContentDTO); VoteContent voteContent = voteService.retrieveVote(new Long(strToolContentID)); - VoteAction.logger.debug("voteContent: " + voteContent); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - VoteAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); voteGeneralAuthoringDTO.setHttpSessionID(httpSessionID); @@ -2145,13 +1605,7 @@ voteGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString()); String onlineInstructions = (String) sessionMap.get(VoteAppConstants.ONLINE_INSTRUCTIONS_KEY); - VoteAction.logger.debug("onlineInstructions: " + onlineInstructions); - String offlineInstructions = (String) sessionMap.get(VoteAppConstants.OFFLINE_INSTRUCTIONS_KEY); - VoteAction.logger.debug("offlineInstructions: " + offlineInstructions); - - VoteAction.logger.debug("onlineInstructions: " + onlineInstructions); - VoteAction.logger.debug("offlineInstructions: " + offlineInstructions); voteAuthoringForm.setOnlineInstructions(onlineInstructions); voteAuthoringForm.setOfflineInstructions(offlineInstructions); voteGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); @@ -2160,8 +1614,6 @@ String richTextTitle = (String) sessionMap.get(VoteAppConstants.ACTIVITY_TITLE_KEY); String richTextInstructions = (String) sessionMap.get(VoteAppConstants.ACTIVITY_INSTRUCTIONS_KEY); - VoteAction.logger.debug("richTextTitle: " + richTextTitle); - VoteAction.logger.debug("richTextInstructions: " + richTextInstructions); voteGeneralAuthoringDTO.setActivityTitle(richTextTitle); voteAuthoringForm.setTitle(richTextTitle); voteGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); @@ -2172,15 +1624,11 @@ long uuid = WebUtil.readLongParam(request, VoteAppConstants.UUID); List attachmentList = (List) sessionMap.get(VoteAppConstants.ATTACHMENT_LIST_KEY); - VoteAction.logger.debug("attachmentList: " + attachmentList); - if (attachmentList == null) { attachmentList = new ArrayList(); } List deletedAttachmentList = (List) sessionMap.get(VoteAppConstants.DELETED_ATTACHMENT_LIST_KEY); - VoteAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList); - if (deletedAttachmentList == null) { deletedAttachmentList = new ArrayList(); } @@ -2191,9 +1639,6 @@ */ deletedAttachmentList = VoteUtils.moveToDelete(Long.toString(uuid), attachmentList, deletedAttachmentList); - VoteAction.logger.debug("post moveToDelete, attachmentList: " + attachmentList); - VoteAction.logger.debug("post moveToDelete, deletedAttachmentList: " + deletedAttachmentList); - sessionMap.put(VoteAppConstants.ATTACHMENT_LIST_KEY, attachmentList); sessionMap.put(VoteAppConstants.DELETED_ATTACHMENT_LIST_KEY, deletedAttachmentList); @@ -2210,14 +1655,11 @@ voteAuthoringForm.setActiveModule(activeModule); voteAuthoringForm.setCurrentTab("3"); - VoteAction.logger.debug("before saving final voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.TOTAL_NOMINATION_COUNT, new Integer(listQuestionContentDTO.size())); voteAuthoringForm.resetUserAction(); - VoteAction.logger.debug("fwd ing to LOAD_QUESTIONS: " + VoteAppConstants.LOAD_QUESTIONS); - return mapping.findForward(VoteAppConstants.LOAD_QUESTIONS); } @@ -2236,47 +1678,30 @@ */ public ActionForward addNewFile(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - VoteAction.logger.debug("dispathching addNewFile"); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteAction.logger.debug("voteService: " + voteService); - String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteAction.logger.debug("httpSessionID: " + httpSessionID); - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteAction.logger.debug("sessionMap: " + sessionMap); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteAction.logger.debug("activeModule: " + activeModule); String onlineInstructions = request.getParameter(VoteAppConstants.ONLINE_INSTRUCTIONS); - VoteAction.logger.debug("onlineInstructions: " + onlineInstructions); String offlineInstructions = request.getParameter(VoteAppConstants.OFFLINE_INSTRUCTIONS); - VoteAction.logger.debug("offlineInstructions: " + offlineInstructions); sessionMap.put(VoteAppConstants.ONLINE_INSTRUCTIONS_KEY, onlineInstructions); sessionMap.put(VoteAppConstants.OFFLINE_INSTRUCTIONS, offlineInstructions); List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); - VoteAction.logger.debug("listNominationContentDTO: " + listNominationContentDTO); - request.setAttribute(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO, listNominationContentDTO); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteAction.logger.debug("strToolContentID: " + strToolContentID); - VoteContent voteContent = voteService.retrieveVote(new Long(strToolContentID)); - VoteAction.logger.debug("voteContent: " + voteContent); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - VoteAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); voteGeneralAuthoringDTO.setOnlineInstructions(onlineInstructions); @@ -2289,8 +1714,6 @@ String richTextTitle = request.getParameter(VoteAppConstants.TITLE); String richTextInstructions = request.getParameter(VoteAppConstants.INSTRUCTIONS); - VoteAction.logger.debug("richTextTitle: " + richTextTitle); - VoteAction.logger.debug("richTextInstructions: " + richTextInstructions); voteGeneralAuthoringDTO.setActivityTitle(richTextTitle); voteAuthoringForm.setTitle(richTextTitle); @@ -2300,14 +1723,10 @@ sessionMap.put(VoteAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); List attachmentList = (List) sessionMap.get(VoteAppConstants.ATTACHMENT_LIST_KEY); - VoteAction.logger.debug("attachmentList: " + attachmentList); List deletedAttachmentList = (List) sessionMap.get(VoteAppConstants.DELETED_ATTACHMENT_LIST_KEY); - VoteAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList); addFileToContentRepository(request, voteAuthoringForm, attachmentList, deletedAttachmentList, sessionMap, voteGeneralAuthoringDTO); - VoteAction.logger.debug("post addFileToContentRepository, attachmentList: " + attachmentList); - VoteAction.logger.debug("post addFileToContentRepository, deletedAttachmentList: " + deletedAttachmentList); sessionMap.put(VoteAppConstants.ATTACHMENT_LIST_KEY, attachmentList); sessionMap.put(VoteAppConstants.DELETED_ATTACHMENT_LIST_KEY, deletedAttachmentList); @@ -2325,27 +1744,20 @@ voteAuthoringForm.setActiveModule(activeModule); voteAuthoringForm.setCurrentTab("3"); - VoteAction.logger.debug("before saving final voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); voteAuthoringForm.resetUserAction(); String strOnlineInstructions = request.getParameter("onlineInstructions"); String strOfflineInstructions = request.getParameter("offlineInstructions"); - VoteAction.logger.debug("onlineInstructions: " + strOnlineInstructions); - VoteAction.logger.debug("offlineInstructions: " + strOnlineInstructions); voteAuthoringForm.setOnlineInstructions(strOnlineInstructions); voteAuthoringForm.setOfflineInstructions(strOfflineInstructions); request.setAttribute(VoteAppConstants.TOTAL_NOMINATION_COUNT, new Integer(listNominationContentDTO.size())); - - VoteAction.logger.debug("fwd ing to LOAD_QUESTIONS: " + VoteAppConstants.LOAD_QUESTIONS); return mapping.findForward(VoteAppConstants.LOAD_QUESTIONS); } /** - * addFileToContentRepository - * * persists files data in the content repository * * @param request @@ -2358,11 +1770,7 @@ public void addFileToContentRepository(HttpServletRequest request, VoteAuthoringForm voteAuthoringForm, List attachmentList, List deletedAttachmentList, SessionMap sessionMap, VoteGeneralAuthoringDTO voteGeneralAuthoringDTO) { - VoteAction.logger.debug("attempt addFileToContentRepository"); - VoteAction.logger.debug("attachmentList: " + attachmentList); - VoteAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList); IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteAction.logger.debug("voteService: " + voteService); if (attachmentList == null) { attachmentList = new ArrayList(); @@ -2376,15 +1784,11 @@ boolean isOnlineFile = false; String fileType = null; if (voteAuthoringForm.getTheOfflineFile() != null && voteAuthoringForm.getTheOfflineFile().getFileSize() > 0) { - VoteAction.logger.debug("theOfflineFile is available: "); uploadedFile = voteAuthoringForm.getTheOfflineFile(); - VoteAction.logger.debug("uploadedFile: " + uploadedFile); fileType = IToolContentHandler.TYPE_OFFLINE; } else if (voteAuthoringForm.getTheOnlineFile() != null && voteAuthoringForm.getTheOnlineFile().getFileSize() > 0) { - VoteAction.logger.debug("theOnlineFile is available: "); uploadedFile = voteAuthoringForm.getTheOnlineFile(); - VoteAction.logger.debug("uploadedFile: " + uploadedFile); isOnlineFile = true; fileType = IToolContentHandler.TYPE_ONLINE; } else { @@ -2400,12 +1804,9 @@ return; } - VoteAction.logger.debug("uploadedFile.getFileName(): " + uploadedFile.getFileName()); - /* if a file with the same name already exists then move the old one to deleted */ deletedAttachmentList = VoteUtils.moveToDelete(uploadedFile.getFileName(), isOnlineFile, attachmentList, deletedAttachmentList); - VoteAction.logger.debug("deletedAttachmentList: " + deletedAttachmentList); try { /* @@ -2416,12 +1817,9 @@ uploadedFile.getFileName(), uploadedFile.getContentType(), fileType); VoteUploadedFile file = new VoteUploadedFile(); String fileName = uploadedFile.getFileName(); - VoteAction.logger.debug("fileName: " + fileName); - VoteAction.logger.debug("fileName length: " + fileName.length()); if (fileName != null && fileName.length() > 30) { fileName = fileName.substring(0, 31); - VoteAction.logger.debug("shortened fileName: " + fileName); } file.setFileName(fileName); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteChartGeneratorAction.java =================================================================== diff -u -rd25b9e0ce0aa1cc320186300d26c05ef385b780c -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteChartGeneratorAction.java (.../VoteChartGeneratorAction.java) (revision d25b9e0ce0aa1cc320186300d26c05ef385b780c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteChartGeneratorAction.java (.../VoteChartGeneratorAction.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -29,7 +29,6 @@ import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang.StringUtils; -import org.apache.log4j.Logger; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; @@ -50,7 +49,6 @@ * @author Marcin Cieslak */ public class VoteChartGeneratorAction extends LamsDispatchAction { - private static final Logger logger = Logger.getLogger(VoteChartGeneratorAction.class.getName()); private static IVoteService voteService; private static MessageService messageService; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteDLStarterAction.java =================================================================== diff -u -r00759d7592ccc90e8769763524afb69546f641d4 -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteDLStarterAction.java (.../VoteDLStarterAction.java) (revision 00759d7592ccc90e8769763524afb69546f641d4) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteDLStarterAction.java (.../VoteDLStarterAction.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -57,7 +57,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.log4j.Logger; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; @@ -70,17 +69,14 @@ public class VoteDLStarterAction extends Action implements VoteAppConstants { - static Logger logger = Logger.getLogger(VoteDLStarterAction.class.getName()); public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, VoteApplicationException { VoteUtils.cleanUpSessionAbsolute(request); - logger.debug("init defineLater mode. removed attributes..."); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("voteService: " + voteService); voteAuthoringForm.setVoteService(voteService); VoteStarterAction voteStarterAction= new VoteStarterAction(); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java =================================================================== diff -u -r8aded0b18a5a7712622ae56f38923fa297449977 -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java (.../VoteLearningAction.java) (revision 8aded0b18a5a7712622ae56f38923fa297449977) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java (.../VoteLearningAction.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -49,7 +49,6 @@ import org.lamsfoundation.lams.tool.exception.DataMissingException; import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.tool.vote.VoteAppConstants; -import org.lamsfoundation.lams.tool.vote.VoteApplicationException; import org.lamsfoundation.lams.tool.vote.VoteComparator; import org.lamsfoundation.lams.tool.vote.VoteGeneralLearnerFlowDTO; import org.lamsfoundation.lams.tool.vote.VoteGeneralMonitoringDTO; @@ -68,143 +67,13 @@ import org.lamsfoundation.lams.web.util.AttributeNames; /** - *

- * Action class that controls the logic of tool behavior. - *

- * - *

- * Note that Struts action class only has the responsibility to navigate page - * flow. All database operation should go to service layer and data - * transformation from domain model to struts form bean should go to form bean - * class. This ensure clean and maintainable code. - *

- * - * SystemException is thrown whenever an known error condition is - * identified. No system exception error handling code should appear in the - * Struts action class as all of them are handled in - * CustomStrutsExceptionHandler. - * * @author Ozgur Demirtas - * - * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * */ public class VoteLearningAction extends LamsDispatchAction implements VoteAppConstants { static Logger logger = Logger.getLogger(VoteLearningAction.class.getName()); /** - *

- * Default struts dispatch method. - *

* - *

- * It is assuming that progress engine should pass in the tool access mode - * and the tool session id as http parameters. - *

- * - * @param mapping - * An ActionMapping class that will be used by the Action - * class to tell the ActionServlet where to send the - * end-user. - * - * @param form - * The ActionForm class that will contain any data submitted - * by the end-user via a form. - * @param request - * A standard Servlet HttpServletRequest class. - * @param response - * A standard Servlet HttpServletResponse class. - * @return An ActionForward class that will be returned to the ActionServlet - * indicating where the user is to go next. - * @throws IOException - * @throws ServletException - * @throws VoteApplicationException - * the known runtime exception - * - * unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest - * request, HttpServletResponse response) throws IOException, - * ServletException - * * main content/question content management and workflow logic * * if the passed toolContentID exists in the db, we need to get the relevant @@ -226,7 +95,6 @@ public ActionForward viewAllResults(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { VoteUtils.cleanUpUserExceptions(request); - logger.debug("dispatching viewAllResults..."); VoteLearningForm voteLearningForm = (VoteLearningForm) form; VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO = new VoteGeneralLearnerFlowDTO(); @@ -239,78 +107,59 @@ voteGeneralLearnerFlowDTO.setMinNominationCountReached(new Boolean(false).toString()); IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("retrieving voteService from session: " + voteService); - repopulateRequestParameters(request, voteLearningForm); String toolSessionID = request.getParameter(TOOL_SESSION_ID); - logger.debug("toolSessionID: " + toolSessionID); voteLearningForm.setToolSessionID(toolSessionID); String userID = request.getParameter(USER_ID); - logger.debug("userID: " + userID); voteLearningForm.setUserID(userID); VoteSession voteSession = voteService.retrieveVoteSession(new Long(toolSessionID)); - logger.debug("retrieving voteSession: " + voteSession); - VoteContent voteContent = voteSession.getVoteContent(); - logger.debug("retrieving voteContent: " + voteContent); voteGeneralLearnerFlowDTO.setActivityTitle(voteContent.getTitle()); voteGeneralLearnerFlowDTO.setActivityInstructions(voteContent.getInstructions()); Long toolContentID = voteContent.getVoteContentId(); - logger.debug("toolContentID: " + toolContentID); setContentInUse(request, voteService, toolContentID); Long toolSessionUid = voteSession.getUid(); - logger.debug("toolSessionUid: " + toolSessionUid); VoteQueUsr existingVoteQueUsr = voteService.getVoteUserBySession(new Long(userID), voteSession.getUid()); - logger.debug("existingVoteQueUsr: " + existingVoteQueUsr); existingVoteQueUsr.setFinalScreenRequested(true); voteService.updateVoteUser(existingVoteQueUsr); - logger.debug("final screen requested by: " + existingVoteQueUsr); Set userAttempts = voteService.getAttemptsForUserAndSession(existingVoteQueUsr.getUid(), toolSessionUid); - logger.debug("userAttempts: " + userAttempts); request.setAttribute(LIST_GENERAL_CHECKED_OPTIONS_CONTENT, userAttempts); request.setAttribute(LIST_GENERAL_CHECKED_OPTIONS_CONTENT, userAttempts); - logger.debug("voteSession uid:" + voteSession.getUid()); - logger.debug("calling prepareChartData:" + voteContent.getVoteContentId() + " " + voteSession.getUid()); - VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); MonitoringUtil.prepareChartData(request, voteService, null, voteContent.getVoteContentId().toString(), voteSession.getUid().toString(), voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO, getMessageService()); - logger.debug("end of prepareChartData:" + voteContent.getVoteContentId() + " " + voteSession.getUid()); voteGeneralLearnerFlowDTO.setReflection(new Boolean(voteContent.isReflect()).toString()); String reflectionSubject = VoteUtils.replaceNewLines(voteContent.getReflectionSubject()); voteGeneralLearnerFlowDTO.setReflectionSubject(reflectionSubject); voteLearningForm.resetCommands(); - logger.debug("view-only voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); request.setAttribute(VOTE_GENERAL_LEARNER_FLOW_DTO, voteGeneralLearnerFlowDTO); LearningWebUtil.putActivityPositionInRequestByToolSessionId(new Long(toolSessionID), request, getServlet() .getServletContext()); - logger.debug("fwding to ALL_NOMINATIONS: " + ALL_NOMINATIONS); return (mapping.findForward(ALL_NOMINATIONS)); } public ActionForward viewAnswers(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { VoteUtils.cleanUpUserExceptions(request); - logger.debug("dispatching viewAnswers..."); VoteLearningForm voteLearningForm = (VoteLearningForm) form; VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO = new VoteGeneralLearnerFlowDTO(); @@ -324,100 +173,74 @@ voteGeneralLearnerFlowDTO.setMinNominationCountReached(new Boolean(false).toString()); IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("retrieving voteService from session: " + voteService); repopulateRequestParameters(request, voteLearningForm); String toolSessionID = request.getParameter(TOOL_SESSION_ID); - logger.debug("toolSessionID: " + toolSessionID); voteLearningForm.setToolSessionID(toolSessionID); String userID = request.getParameter(USER_ID); - logger.debug("userID: " + userID); voteLearningForm.setUserID(userID); String revisitingUser = request.getParameter(REVISITING_USER); - logger.debug("revisitingUser: " + revisitingUser); voteLearningForm.setRevisitingUser(revisitingUser); VoteSession voteSession = voteService.retrieveVoteSession(new Long(toolSessionID)); - logger.debug("retrieving voteSession: " + voteSession); - VoteContent voteContent = voteSession.getVoteContent(); - logger.debug("retrieving voteContent: " + voteContent); voteGeneralLearnerFlowDTO.setActivityTitle(voteContent.getTitle()); voteGeneralLearnerFlowDTO.setActivityInstructions(voteContent.getInstructions()); Long toolContentID = voteContent.getVoteContentId(); - logger.debug("toolContentID: " + toolContentID); - setContentInUse(request, voteService, toolContentID); if (revisitingUser.equals("true")) { - logger.debug("this is a revisiting user, get the nominations from the db: " + revisitingUser); - logger.debug("toolContentID: " + toolContentID); - VoteQueUsr voteQueUsr = LearningUtil.getUser(request, voteService); - logger.debug("voteQueUsr: " + voteQueUsr); List attempts = voteService.getAttemptsForUser(voteQueUsr.getUid()); - logger.debug("attempts: " + attempts); Map mapQuestionsContent = new TreeMap(new VoteComparator()); Iterator listIterator = attempts.iterator(); int order = 0; while (listIterator.hasNext()) { VoteUsrAttempt attempt = (VoteUsrAttempt) listIterator.next(); - logger.debug("attempt: " + attempt); VoteQueContent voteQueContent = attempt.getVoteQueContent(); - logger.debug("voteQueContent: " + voteQueContent); order++; if (voteQueContent != null) { mapQuestionsContent.put(new Integer(order).toString(), voteQueContent.getQuestion()); } } request.setAttribute(MAP_GENERAL_CHECKED_OPTIONS_CONTENT, mapQuestionsContent); } else { - logger.debug("this is not a revisiting user: " + revisitingUser); + //this is not a revisiting user } voteLearningForm.resetCommands(); - logger.debug("final voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); request.setAttribute(VOTE_GENERAL_LEARNER_FLOW_DTO, voteGeneralLearnerFlowDTO); - - LearningWebUtil.putActivityPositionInRequestByToolSessionId(new Long(toolSessionID), request, getServlet() .getServletContext()); - - logger.debug("fwd'ing to : " + VIEW_ANSWERS); return (mapping.findForward(VIEW_ANSWERS)); } public ActionForward redoQuestionsOk(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { VoteUtils.cleanUpUserExceptions(request); - logger.debug("dispatching redoQuestionsOk..."); IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("retrieving voteService from session: " + voteService); VoteLearningForm voteLearningForm = (VoteLearningForm) form; VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO = new VoteGeneralLearnerFlowDTO(); repopulateRequestParameters(request, voteLearningForm); String toolSessionID = request.getParameter(TOOL_SESSION_ID); - logger.debug("toolSessionID: " + toolSessionID); voteLearningForm.setToolSessionID(toolSessionID); String userID = request.getParameter(USER_ID); - logger.debug("userID: " + userID); voteLearningForm.setUserID(userID); String revisitingUser = request.getParameter(REVISITING_USER); - logger.debug("revisitingUser: " + revisitingUser); voteLearningForm.setRevisitingUser(revisitingUser); voteLearningForm.setNominationsSubmited(new Boolean(false).toString()); @@ -429,36 +252,25 @@ voteGeneralLearnerFlowDTO.setMinNominationCountReached(new Boolean(false).toString()); VoteSession voteSession = voteService.retrieveVoteSession(new Long(toolSessionID)); - logger.debug("retrieving voteSession: " + voteSession); - VoteContent voteContent = voteSession.getVoteContent(); - logger.debug("retrieving voteContent: " + voteContent); - voteGeneralLearnerFlowDTO.setActivityTitle(voteContent.getTitle()); voteGeneralLearnerFlowDTO.setActivityInstructions(voteContent.getInstructions()); Long toolContentID = voteContent.getVoteContentId(); - logger.debug("toolContentID: " + toolContentID); - setContentInUse(request, voteService, toolContentID); - logger.debug("requested redoQuestionsOk, user is sure to redo the questions."); voteGeneralLearnerFlowDTO.setReflection(new Boolean(voteContent.isReflect()).toString()); String reflectionSubject = VoteUtils.replaceNewLines(voteContent.getReflectionSubject()); voteGeneralLearnerFlowDTO.setReflectionSubject(reflectionSubject); voteLearningForm.resetCommands(); - logger.debug("final voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); request.setAttribute(VOTE_GENERAL_LEARNER_FLOW_DTO, voteGeneralLearnerFlowDTO); return redoQuestions(mapping, form, request, response); } public ActionForward learnerFinished(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - logger.debug("dispatching learnerFinished"); - logger.debug("requested learner finished, the learner should be directed to next activity."); - VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO = new VoteGeneralLearnerFlowDTO(); VoteLearningForm voteLearningForm = (VoteLearningForm) form; @@ -471,45 +283,30 @@ voteGeneralLearnerFlowDTO.setMinNominationCountReached(new Boolean(false).toString()); IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("retrieving voteService from session: " + voteService); repopulateRequestParameters(request, voteLearningForm); String toolSessionID = request.getParameter(TOOL_SESSION_ID); - logger.debug("toolSessionID: " + toolSessionID); voteLearningForm.setToolSessionID(toolSessionID); VoteSession voteSession = voteService.retrieveVoteSession(new Long(toolSessionID)); - logger.debug("retrieving voteSession: " + voteSession); - String userID = request.getParameter(USER_ID); - logger.debug("userID: " + userID); voteLearningForm.setUserID(userID); VoteQueUsr voteQueUsr = voteService.getVoteUserBySession(new Long(userID), voteSession.getUid()); - logger.debug("voteQueUsr:" + voteQueUsr); - /* it is possible that voteQueUsr can be null if the content is set as runoffline and reflection is on*/ if (voteQueUsr == null) { - logger.debug("attempt creating user record since it must exist for the runOffline + reflection screens"); + //attempt creating user record since it must exist for the runOffline + reflection screens HttpSession ss = SessionManager.getSession(); UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER); - logger.debug("retrieving toolUser: " + toolUser); - logger.debug("retrieving toolUser userId: " + toolUser.getUserID()); - logger.debug("retrieving toolUser username: " + toolUser.getLogin()); String userName = toolUser.getLogin(); String fullName = toolUser.getFirstName() + " " + toolUser.getLastName(); - logger.debug("retrieving toolUser fullname: " + fullName); Long userId = new Long(toolUser.getUserID().longValue()); - logger.debug("retrieving toolUser fullname: " + fullName); - voteQueUsr = new VoteQueUsr(new Long(userID), userName, fullName, voteSession, new TreeSet()); voteService.createVoteQueUsr(voteQueUsr); - logger.debug("createVoteQueUsr - voteQueUsr: " + voteQueUsr); - logger.debug("session uid: " + voteSession.getUid()); } voteQueUsr.setResponseFinalised(true); @@ -518,56 +315,46 @@ voteQueUsr.setFinalScreenRequested(true); } voteService.updateVoteUser(voteQueUsr); - logger.debug("user's response is finalised:" + voteQueUsr); String revisitingUser = request.getParameter(REVISITING_USER); - logger.debug("revisitingUser: " + revisitingUser); voteLearningForm.setRevisitingUser(revisitingUser); VoteContent voteContent = voteSession.getVoteContent(); - logger.debug("retrieving voteContent: " + voteContent); voteGeneralLearnerFlowDTO.setActivityTitle(voteContent.getTitle()); voteGeneralLearnerFlowDTO.setActivityInstructions(voteContent.getInstructions()); - logger.debug("attempting to leave/complete session with toolSessionID:" + toolSessionID + " and userID:" - + userID); - voteGeneralLearnerFlowDTO.setReflection(new Boolean(voteContent.isReflect()).toString()); String reflectionSubject = VoteUtils.replaceNewLines(voteContent.getReflectionSubject()); voteGeneralLearnerFlowDTO.setReflectionSubject(reflectionSubject); - logger.debug("final voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); request.setAttribute(VOTE_GENERAL_LEARNER_FLOW_DTO, voteGeneralLearnerFlowDTO); VoteUtils.cleanUpSessionAbsolute(request); String nextUrl = null; try { nextUrl = voteService.leaveToolSession(new Long(toolSessionID), new Long(userID)); - logger.debug("nextUrl: " + nextUrl); } catch (DataMissingException e) { - logger.debug("failure getting nextUrl: " + e); + logger.error("failure getting nextUrl: " + e); voteLearningForm.resetCommands(); //throw new ServletException(e); return (mapping.findForward(LEARNING_STARTER)); } catch (ToolException e) { - logger.debug("failure getting nextUrl: " + e); + logger.error("failure getting nextUrl: " + e); voteLearningForm.resetCommands(); //throw new ServletException(e); return (mapping.findForward(LEARNING_STARTER)); } catch (Exception e) { - logger.debug("unknown exception getting nextUrl: " + e); + logger.error("unknown exception getting nextUrl: " + e); voteLearningForm.resetCommands(); //throw new ServletException(e); return (mapping.findForward(LEARNING_STARTER)); } - logger.debug("success getting nextUrl: " + nextUrl); voteLearningForm.resetCommands(); /* pay attention here*/ - logger.debug("redirecting to the nextUrl: " + nextUrl); response.sendRedirect(nextUrl); return null; @@ -577,39 +364,28 @@ public ActionForward continueOptionsCombined(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { VoteUtils.cleanUpUserExceptions(request); - logger.debug("dispatching continueOptionsCombined..."); - VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO = new VoteGeneralLearnerFlowDTO(); VoteLearningForm voteLearningForm = (VoteLearningForm) form; IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("retrieving voteService from session: " + voteService); - repopulateRequestParameters(request, voteLearningForm); String toolSessionID = request.getParameter(TOOL_SESSION_ID); - logger.debug("toolSessionID: " + toolSessionID); voteLearningForm.setToolSessionID(toolSessionID); String userID = request.getParameter(USER_ID); - logger.debug("userID: " + userID); voteLearningForm.setUserID(userID); String maxNominationCount = request.getParameter(MAX_NOMINATION_COUNT); - logger.debug("maxNominationCount: " + maxNominationCount); voteLearningForm.setMaxNominationCount(maxNominationCount); String minNominationCount = request.getParameter(MIN_NOMINATION_COUNT); - logger.debug("minNominationCount: " + minNominationCount); voteLearningForm.setMinNominationCount(minNominationCount); String userEntry = request.getParameter(USER_ENTRY); - logger.debug("userEntry: " + userEntry); voteLearningForm.setUserEntry(userEntry); VoteSession voteSession = voteService.retrieveVoteSession(new Long(toolSessionID)); - logger.debug("retrieving voteSession: " + voteSession); - voteLearningForm.setNominationsSubmited(new Boolean(false).toString()); voteLearningForm.setMaxNominationCountReached(new Boolean(false).toString()); voteLearningForm.setMinNominationCountReached(new Boolean(false).toString()); @@ -619,182 +395,130 @@ voteGeneralLearnerFlowDTO.setMinNominationCountReached(new Boolean(false).toString()); Collection voteDisplayOrderIds = voteLearningForm.votesAsCollection(); - logger.debug("Checkbox votes " + voteDisplayOrderIds); // check number of votes int castVoteCount = voteDisplayOrderIds != null ? voteDisplayOrderIds.size() : 0; - logger.debug("userEntry: " + userEntry); - if ((userEntry != null) && (userEntry.length() > 0)) { - logger.debug("userEntry available: " + userEntry); ++castVoteCount; } - logger.debug("castVoteCount post user entry count: " + castVoteCount); - logger.debug("maxNominationCount: " + maxNominationCount); int intMaxNominationCount = 0; if (maxNominationCount != null) intMaxNominationCount = new Integer(maxNominationCount).intValue(); - logger.debug("intMaxNominationCount: " + intMaxNominationCount); - logger.debug("intMaxNominationCount versus current voting count: " + intMaxNominationCount + " versus " - + castVoteCount); if (castVoteCount > intMaxNominationCount) { voteLearningForm.setMaxNominationCountReached(new Boolean(true).toString()); voteGeneralLearnerFlowDTO.setMaxNominationCountReached(new Boolean(true).toString()); persistInRequestError(request, "error.maxNominationCount.reached"); - logger.debug("give warning, max nom count reached..."); - logger.debug("fwd'ing to: " + LOAD_LEARNER); return (mapping.findForward(LOAD_LEARNER)); } VoteContent voteContent = voteSession.getVoteContent(); - logger.debug("retrieving voteContent: " + voteContent); voteGeneralLearnerFlowDTO.setActivityTitle(voteContent.getTitle()); voteGeneralLearnerFlowDTO.setActivityInstructions(voteContent.getInstructions()); Long toolContentID = voteContent.getVoteContentId(); - logger.debug("toolContentID: " + toolContentID); Long toolContentUID = voteContent.getUid(); - logger.debug("toolContentUID: " + toolContentUID); - logger.debug("userEntry: " + userEntry); setContentInUse(request, voteService, toolContentID); boolean userEntryAvailable = false; if ((userEntry != null) && (userEntry.length() > 0)) { - logger.debug("userEntry available: " + userEntry); userEntryAvailable = true; } - logger.debug("userEntryAvailable " + userEntryAvailable); Long toolSessionUid = voteSession.getUid(); - logger.debug("toolSessionUid: " + toolSessionUid); boolean isUserDefined = false; - logger.debug("userID: " + userID); VoteQueUsr existingVoteQueUsr = voteService.getVoteUserBySession(new Long(userID), voteSession.getUid()); - logger.debug("existingVoteQueUsr: " + existingVoteQueUsr); if (existingVoteQueUsr != null) isUserDefined = true; - logger.debug("isUserDefined: " + isUserDefined); - VoteQueUsr voteQueUsr = null; if (isUserDefined == false) { voteQueUsr = LearningUtil.createUser(request, voteService, new Long(toolSessionID)); - logger.debug("created user in the db"); - logger.debug("new create"); } else { voteQueUsr = existingVoteQueUsr; - logger.debug("assign"); } - logger.debug("voteQueUsr: " + voteQueUsr); - logger.debug("voteQueUsr is : " + voteQueUsr); - if (existingVoteQueUsr != null) { - logger.debug("attempt removing attempts for user id and session id:" + existingVoteQueUsr.getUid() + " " - + voteSession.getUid()); voteService.removeAttemptsForUserandSession(existingVoteQueUsr.getUid(), voteSession.getUid()); - logger.debug("votes deleted for user: " + voteQueUsr.getUid()); } /* to mimize changes to working code, convert the String[] array to the mapGeneralCheckedOptionsContent structure */ Map mapGeneralCheckedOptionsContent = LearningUtil.buildQuestionContentMap(request, voteService, voteContent, voteDisplayOrderIds); - logger.debug("mapGeneralCheckedOptionsContent size: " + mapGeneralCheckedOptionsContent.size()); if (mapGeneralCheckedOptionsContent.size() > 0) { LearningUtil.createAttempt(request, voteService, voteQueUsr, mapGeneralCheckedOptionsContent, "", false, voteSession, toolContentUID); } if ((mapGeneralCheckedOptionsContent.size() == 0 && (userEntryAvailable == true))) { - logger.debug("mapGeneralCheckedOptionsContent size is 0"); Map mapLeanerCheckedOptionsContent = new TreeMap(new VoteComparator()); - logger.debug("after mapsize check mapLeanerCheckedOptionsContent " + mapLeanerCheckedOptionsContent); if (userEntry.length() > 0) { - logger.debug("creating entry for: " + userEntry); LearningUtil.createAttempt(request, voteService, voteQueUsr, mapLeanerCheckedOptionsContent, userEntry, true, voteSession, toolContentUID); } } if ((mapGeneralCheckedOptionsContent.size() > 0) && (userEntryAvailable == true)) { - logger.debug("mapGeneralCheckedOptionsContent size is > 0" + userEntry); Map mapLeanerCheckedOptionsContent = new TreeMap(new VoteComparator()); - logger.debug("after mapsize check mapLeanerCheckedOptionsContent " + mapLeanerCheckedOptionsContent); if (userEntry.length() > 0) { - logger.debug("creating entry for: " + userEntry); LearningUtil.createAttempt(request, voteService, voteQueUsr, mapLeanerCheckedOptionsContent, userEntry, false, voteSession, toolContentUID); } } - logger.debug("created user attempt in the db"); - /* put the map in the request ready for the next screen */ request.setAttribute(MAP_GENERAL_CHECKED_OPTIONS_CONTENT, mapGeneralCheckedOptionsContent); - logger.debug("final mapGeneralCheckedOptionsContent: " + mapGeneralCheckedOptionsContent); voteLearningForm.setMapGeneralCheckedOptionsContent(mapGeneralCheckedOptionsContent); voteGeneralLearnerFlowDTO.setMapGeneralCheckedOptionsContent(mapGeneralCheckedOptionsContent); voteLearningForm.setNominationsSubmited(new Boolean(true).toString()); voteGeneralLearnerFlowDTO.setNominationsSubmited(new Boolean(true).toString()); VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); - logger.debug("calling prepareChartData: " + toolContentID); MonitoringUtil.prepareChartData(request, voteService, null, toolContentID.toString(), toolSessionUid.toString(), voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO, getMessageService()); voteGeneralLearnerFlowDTO.setReflection(new Boolean(voteContent.isReflect()).toString()); voteGeneralLearnerFlowDTO.setReflectionSubject(voteContent.getReflectionSubject()); - logger.debug("fwding to INDIVIDUAL_REPORT: " + INDIVIDUAL_REPORT); voteLearningForm.resetCommands(); - - logger.debug("final voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); request.setAttribute(VOTE_GENERAL_LEARNER_FLOW_DTO, voteGeneralLearnerFlowDTO); return (mapping.findForward(INDIVIDUAL_REPORT)); } public ActionForward redoQuestions(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - logger.debug("dispatching redoQuestions..."); VoteUtils.cleanUpUserExceptions(request); VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO = new VoteGeneralLearnerFlowDTO(); VoteLearningForm voteLearningForm = (VoteLearningForm) form; IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("retrieving voteService from session: " + voteService); repopulateRequestParameters(request, voteLearningForm); String toolSessionID = request.getParameter(TOOL_SESSION_ID); - logger.debug("toolSessionID: " + toolSessionID); voteLearningForm.setToolSessionID(toolSessionID); String userID = request.getParameter(USER_ID); - logger.debug("userID: " + userID); voteLearningForm.setUserID(userID); String revisitingUser = request.getParameter(REVISITING_USER); - logger.debug("revisitingUser: " + revisitingUser); voteLearningForm.setRevisitingUser(revisitingUser); VoteSession voteSession = voteService.retrieveVoteSession(new Long(toolSessionID)); - logger.debug("retrieving voteSession: " + voteSession); VoteContent voteContent = voteSession.getVoteContent(); - logger.debug("retrieving voteContent: " + voteContent); voteGeneralLearnerFlowDTO.setActivityTitle(voteContent.getTitle()); voteGeneralLearnerFlowDTO.setActivityInstructions(voteContent.getInstructions()); @@ -806,15 +530,10 @@ voteGeneralLearnerFlowDTO.setMaxNominationCountReached(new Boolean(false).toString()); Long toolContentID = voteContent.getVoteContentId(); - logger.debug("toolContentID:" + toolContentID); - Map mapQuestionsContent = new TreeMap(new VoteComparator()); mapQuestionsContent = LearningUtil.buildQuestionContentMap(request, voteService, voteContent, null); - logger.debug("mapQuestionsContent: " + mapQuestionsContent); request.setAttribute(MAP_QUESTION_CONTENT_LEARNER, mapQuestionsContent); - logger.debug("MAP_QUESTION_CONTENT_LEARNER: " + request.getAttribute(MAP_QUESTION_CONTENT_LEARNER)); - logger.debug("voteContent has : " + mapQuestionsContent.size() + " entries."); Map mapGeneralCheckedOptionsContent = new TreeMap(new VoteComparator()); request.setAttribute(MAP_GENERAL_CHECKED_OPTIONS_CONTENT, mapGeneralCheckedOptionsContent); @@ -823,23 +542,15 @@ voteGeneralLearnerFlowDTO.setReflection(new Boolean(voteContent.isReflect()).toString()); voteGeneralLearnerFlowDTO.setReflectionSubject(voteContent.getReflectionSubject()); - - logger.debug("fwd'ing to LOAD_LEARNER : " + LOAD_LEARNER); voteLearningForm.resetCommands(); - - logger.debug("final voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); request.setAttribute(VOTE_GENERAL_LEARNER_FLOW_DTO, voteGeneralLearnerFlowDTO); return (mapping.findForward(LOAD_LEARNER)); } protected void setContentInUse(HttpServletRequest request, IVoteService voteService, Long toolContentID) { - logger.debug("toolContentID:" + toolContentID); - VoteContent voteContent = voteService.retrieveVote(toolContentID); - logger.debug("voteContent:" + voteContent); voteContent.setContentInUse(true); - logger.debug("content has been set to inuse"); voteService.saveVoteContent(voteContent); } @@ -852,67 +563,40 @@ public void persistInRequestError(HttpServletRequest request, String message) { ActionMessages errors = new ActionMessages(); errors.add(Globals.ERROR_KEY, new ActionMessage(message)); - logger.debug("add " + message + " to ActionMessages:"); saveErrors(request, errors); } public ActionForward submitReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, ToolException { - logger.debug("dispatching submitReflection..."); VoteLearningForm voteLearningForm = (VoteLearningForm) form; repopulateRequestParameters(request, voteLearningForm); IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("voteService: " + voteService); - String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); - logger.debug("toolSessionID: " + toolSessionID); voteLearningForm.setToolSessionID(toolSessionID); String userID = request.getParameter("userID"); - logger.debug("userID: " + userID); voteLearningForm.setUserID(userID); String reflectionEntry = request.getParameter(ENTRY_TEXT); - logger.debug("reflectionEntry: " + reflectionEntry); - VoteSession voteSession = voteService.retrieveVoteSession(new Long(toolSessionID)); - logger.debug("retrieving voteSession: " + voteSession); - VoteQueUsr voteQueUsr = voteService.getVoteUserBySession(new Long(userID), voteSession.getUid()); - logger.debug("voteQueUsr:" + voteQueUsr); /* it is possible that voteQueUsr can be null if the content is set as runoffline and reflection is on*/ if (voteQueUsr == null) { - logger.debug("attempt creating user record since it must exist for the runOffline + reflection screens"); HttpSession ss = SessionManager.getSession(); UserDTO toolUser = (UserDTO) ss.getAttribute(AttributeNames.USER); - logger.debug("retrieving toolUser: " + toolUser); - logger.debug("retrieving toolUser userId: " + toolUser.getUserID()); - logger.debug("retrieving toolUser username: " + toolUser.getLogin()); - String userName = toolUser.getLogin(); String fullName = toolUser.getFirstName() + " " + toolUser.getLastName(); - logger.debug("retrieving toolUser fullname: " + fullName); Long userId = new Long(toolUser.getUserID().longValue()); - logger.debug("retrieving toolUser fullname: " + fullName); voteQueUsr = new VoteQueUsr(new Long(userID), userName, fullName, voteSession, new TreeSet()); voteService.createVoteQueUsr(voteQueUsr); - logger.debug("createVoteQueUsr - voteQueUsr: " + voteQueUsr); - logger.debug("session uid: " + voteSession.getUid()); } - logger.debug("voteQueUsr:" + voteQueUsr); - logger.debug("toolSessionID:" + toolSessionID); - logger.debug("CoreNotebookConstants.NOTEBOOK_TOOL:" + CoreNotebookConstants.NOTEBOOK_TOOL); - logger.debug("MY_SIGNATURE:" + MY_SIGNATURE); - logger.debug("userID:" + userID); - logger.debug("reflectionEntry:" + reflectionEntry); - voteService.createNotebookEntry(new Long(toolSessionID), CoreNotebookConstants.NOTEBOOK_TOOL, MY_SIGNATURE, new Integer(userID), reflectionEntry); @@ -922,20 +606,13 @@ public ActionForward forwardtoReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, ToolException { - logger.debug("dispatching forwardtoReflection..."); VoteLearningForm voteLearningForm = (VoteLearningForm) form; IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("voteService: " + voteService); String toolSessionID = request.getParameter(AttributeNames.PARAM_TOOL_SESSION_ID); - logger.debug("toolSessionID: " + toolSessionID); - VoteSession voteSession = voteService.retrieveVoteSession(new Long(toolSessionID)); - logger.debug("retrieving voteSession: " + voteSession); VoteContent voteContent = voteSession.getVoteContent(); - logger.debug("using voteContent: " + voteContent); - VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO = new VoteGeneralLearnerFlowDTO(); voteGeneralLearnerFlowDTO.setActivityTitle(voteContent.getTitle()); @@ -945,78 +622,59 @@ voteGeneralLearnerFlowDTO.setReflectionSubject(reflectionSubject); String userID = request.getParameter("userID"); - logger.debug("userID: " + userID); voteLearningForm.setUserID(userID); - logger.debug("attempt getting notebookEntry: "); NotebookEntry notebookEntry = voteService.getEntry(new Long(toolSessionID), CoreNotebookConstants.NOTEBOOK_TOOL, MY_SIGNATURE, new Integer(userID)); - logger.debug("notebookEntry: " + notebookEntry); - if (notebookEntry != null) { String notebookEntryPresentable = notebookEntry.getEntry(); - logger.debug("notebookEntryPresentable: " + notebookEntryPresentable); voteGeneralLearnerFlowDTO.setNotebookEntry(notebookEntryPresentable); voteLearningForm.setEntryText(notebookEntryPresentable); } request.setAttribute(VOTE_GENERAL_LEARNER_FLOW_DTO, voteGeneralLearnerFlowDTO); - logger.debug("final voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); voteLearningForm.resetCommands(); LearningWebUtil.putActivityPositionInRequestByToolSessionId(new Long(toolSessionID), request, getServlet() .getServletContext()); - logger.debug("fwd'ing to: " + NOTEBOOK); return (mapping.findForward(NOTEBOOK)); } protected void repopulateRequestParameters(HttpServletRequest request, VoteLearningForm voteLearningForm) { - logger.debug("starting repopulateRequestParameters"); - String toolSessionID = request.getParameter(TOOL_SESSION_ID); - logger.debug("toolSessionID: " + toolSessionID); voteLearningForm.setToolSessionID(toolSessionID); String userID = request.getParameter(USER_ID); - logger.debug("userID: " + userID); voteLearningForm.setUserID(userID); String revisitingUser = request.getParameter(REVISITING_USER); - logger.debug("revisitingUser: " + revisitingUser); voteLearningForm.setRevisitingUser(revisitingUser); String previewOnly = request.getParameter(PREVIEW_ONLY); - logger.debug("previewOnly: " + previewOnly); voteLearningForm.setPreviewOnly(previewOnly); String maxNominationCount = request.getParameter(MAX_NOMINATION_COUNT); - logger.debug("maxNominationCount: " + maxNominationCount); voteLearningForm.setMaxNominationCount(maxNominationCount); String minNominationCount = request.getParameter(MIN_NOMINATION_COUNT); - logger.debug("minNominationCount: " + minNominationCount); voteLearningForm.setMinNominationCount(minNominationCount); String allowTextEntry = request.getParameter(ALLOW_TEXT_ENTRY); - logger.debug("allowTextEntry: " + allowTextEntry); voteLearningForm.setAllowTextEntry(allowTextEntry); String showResults = request.getParameter(SHOW_RESULTS); voteLearningForm.setShowResults(showResults); String lockOnFinish = request.getParameter(LOCK_ON_FINISH); - logger.debug("lockOnFinish: " + lockOnFinish); voteLearningForm.setLockOnFinish(lockOnFinish); String reportViewOnly = request.getParameter(REPORT_VIEW_ONLY); - logger.debug("reportViewOnly: " + reportViewOnly); voteLearningForm.setReportViewOnly(reportViewOnly); String userEntry = request.getParameter(USER_ENTRY); - logger.debug("userEntry: " + userEntry); voteLearningForm.setUserEntry(userEntry); } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java =================================================================== diff -u -r8aded0b18a5a7712622ae56f38923fa297449977 -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (.../VoteLearningStarterAction.java) (revision 8aded0b18a5a7712622ae56f38923fa297449977) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (.../VoteLearningStarterAction.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -153,14 +153,14 @@ package org.lamsfoundation.lams.tool.vote.web; import java.io.IOException; +import java.util.Date; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.TreeMap; import java.util.TimeZone; -import java.util.Date; +import java.util.TreeMap; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; @@ -217,8 +217,6 @@ Map mapAnswers = new TreeMap(new VoteComparator()); IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteLearningStarterAction.logger.debug("retrieving voteService from session: " + voteService); - VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO = new VoteGeneralLearnerFlowDTO(); VoteLearningForm voteLearningForm = (VoteLearningForm) form; @@ -239,25 +237,22 @@ */ VoteUtils.saveTimeZone(request); ActionForward validateParameters = validateParameters(request, mapping, voteLearningForm); - VoteLearningStarterAction.logger.debug("validateParameters: " + validateParameters); if (validateParameters != null) { return validateParameters; } String toolSessionID = voteLearningForm.getToolSessionID(); - VoteLearningStarterAction.logger.debug("retrieved toolSessionID: " + toolSessionID); /* * by now, we made sure that the passed tool session id exists in the db as a new record Make sure we can * retrieve it and the relavent content */ VoteSession voteSession = voteService.retrieveVoteSession(new Long(toolSessionID)); - VoteLearningStarterAction.logger.debug("retrieving voteSession: " + voteSession); if (voteSession == null) { VoteUtils.cleanUpSessionAbsolute(request); - VoteLearningStarterAction.logger.debug("error: The tool expects voteSession."); + VoteLearningStarterAction.logger.error("error: The tool expects voteSession."); return mapping.findForward(VoteAppConstants.ERROR_LIST); } @@ -266,11 +261,9 @@ * tool session id points to a particular content. Many to one mapping. */ VoteContent voteContent = voteSession.getVoteContent(); - VoteLearningStarterAction.logger.debug("using voteContent: " + voteContent); - if (voteContent == null) { VoteUtils.cleanUpSessionAbsolute(request); - VoteLearningStarterAction.logger.debug("error: The tool expects voteContent."); + VoteLearningStarterAction.logger.error("error: The tool expects voteContent."); persistInRequestError(request, "error.content.doesNotExist"); return mapping.findForward(VoteAppConstants.ERROR_LIST); } @@ -281,46 +274,30 @@ */ setupAttributes(request, voteContent, voteLearningForm, voteGeneralLearnerFlowDTO); - VoteLearningStarterAction.logger.debug("using TOOL_CONTENT_ID: " + voteContent.getVoteContentId()); voteLearningForm.setToolContentID(voteContent.getVoteContentId().toString()); voteGeneralLearnerFlowDTO.setToolContentID(voteContent.getVoteContentId().toString()); - VoteLearningStarterAction.logger.debug("using TOOL_CONTENT_UID: " + voteContent.getUid()); voteLearningForm.setToolContentUID(voteContent.getUid().toString()); voteGeneralLearnerFlowDTO.setToolContentUID(voteContent.getUid().toString()); String userID = voteLearningForm.getUserID(); - VoteLearningStarterAction.logger.debug("userID: " + userID); - - VoteLearningStarterAction.logger.debug("is tool reflective: " + voteContent.isReflect()); voteGeneralLearnerFlowDTO.setReflection(new Boolean(voteContent.isReflect()).toString()); - VoteLearningStarterAction.logger.debug("reflection subject: " + voteContent.getReflectionSubject()); String reflectionSubject = VoteUtils.replaceNewLines(voteContent.getReflectionSubject()); voteGeneralLearnerFlowDTO.setReflectionSubject(reflectionSubject); - VoteLearningStarterAction.logger.debug("is vote lockOnFinish: " + voteContent.isLockOnFinish()); - /* * Is the request for a preview by the author? Preview The tool must be able to show the specified content as if * it was running in a lesson. It will be the learner url with tool access mode set to ToolAccessMode.AUTHOR 3 * modes are: author teacher learner */ /* ? CHECK THIS: how do we determine whether preview is requested? Mode is not enough on its own. */ - VoteLearningStarterAction.logger.debug("before checking for preview voteGeneralLearnerFlowDTO: " - + voteGeneralLearnerFlowDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_LEARNER_FLOW_DTO, voteGeneralLearnerFlowDTO); /* handle PREVIEW mode */ String mode = voteLearningForm.getLearningMode(); - VoteLearningStarterAction.logger.debug("mode: " + mode); if (mode != null && mode.equals("author")) { - VoteLearningStarterAction.logger.debug("Author requests for a preview of the content."); - VoteLearningStarterAction.logger.debug("existing voteContent:" + voteContent); - commonContentSetup(request, voteService, voteContent, voteGeneralLearnerFlowDTO); - - VoteLearningStarterAction.logger.debug("preview voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_LEARNER_FLOW_DTO, voteGeneralLearnerFlowDTO); } @@ -330,7 +307,6 @@ */ String learnerProgressUserId = request.getParameter(VoteAppConstants.USER_ID); - VoteLearningStarterAction.logger.debug("learnerProgressUserId: " + learnerProgressUserId); if (learnerProgressUserId != null && mode.equals("teacher")) { VoteQueUsr voteQueUsr = voteService.getVoteUserBySession(new Long(learnerProgressUserId), voteSession @@ -340,17 +316,10 @@ Long sessionUid = voteQueUsr.getVoteSessionId(); - VoteLearningStarterAction.logger.debug("start building MAP_GENERAL_CHECKED_OPTIONS_CONTENT"); String toolContentId = voteLearningForm.getToolContentID(); - VoteLearningStarterAction.logger.debug("toolContentId: " + toolContentId); - putMapQuestionsContentIntoRequest(request, voteService, voteQueUsr); - - VoteLearningStarterAction.logger.debug("geting user answers for user uid and sessionUid" - + voteQueUsr.getUid() + " " + sessionUid); Set userAttempts = voteService.getAttemptsForUserAndSessionUseOpenAnswer(voteQueUsr.getUid(), sessionUid); - VoteLearningStarterAction.logger.debug("userAttempts: " + userAttempts); request.setAttribute(VoteAppConstants.LIST_GENERAL_CHECKED_OPTIONS_CONTENT, userAttempts); } else { @@ -359,8 +328,7 @@ request.setAttribute(VoteAppConstants.LIST_GENERAL_CHECKED_OPTIONS_CONTENT, new HashSet()); } - VoteLearningStarterAction.logger - .debug("since this is progress view, present a screen which can not be edited"); + //since this is progress view, present a screen which can not be edited voteLearningForm.setReportViewOnly(new Boolean(true).toString()); voteGeneralLearnerFlowDTO.setReportViewOnly(new Boolean(true).toString()); voteGeneralLearnerFlowDTO.setLearningMode(mode); @@ -375,7 +343,6 @@ boolean isGroupedActivity = voteService.isGroupedActivity(new Long(voteLearningForm.getToolContentID())); request.setAttribute("isGroupedActivity", isGroupedActivity); - VoteLearningStarterAction.logger.debug("fwd'ing to: " + VoteAppConstants.EXIT_PAGE); return mapping.findForward(VoteAppConstants.EXIT_PAGE); } @@ -390,24 +357,19 @@ * informed about that. */ boolean isRunOffline = VoteUtils.isRunOffline(voteContent); - VoteLearningStarterAction.logger.debug("isRunOffline: " + isRunOffline); if (isRunOffline == true) { VoteUtils.cleanUpSessionAbsolute(request); - VoteLearningStarterAction.logger.debug("warning to learner: the activity is offline."); + //warning to learner: the activity is offline voteLearningForm.setActivityRunOffline(new Boolean(true).toString()); voteGeneralLearnerFlowDTO.setActivityRunOffline(new Boolean(true).toString()); - VoteLearningStarterAction.logger - .debug("runOffline voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_LEARNER_FLOW_DTO, voteGeneralLearnerFlowDTO); // return (mapping.findForward(ERROR_LIST)); - VoteLearningStarterAction.logger.debug("fwding to :" + VoteAppConstants.RUN_OFFLINE); return mapping.findForward(VoteAppConstants.RUN_OFFLINE); } /* find out if the content is being modified at the moment. */ boolean isDefineLater = VoteUtils.isDefineLater(voteContent); - VoteLearningStarterAction.logger.debug("isDefineLater: " + isDefineLater); if (isDefineLater == true) { VoteUtils.cleanUpSessionAbsolute(request); return mapping.findForward(VoteAppConstants.DEFINE_LATER); @@ -439,73 +401,46 @@ * fetch question content from content */ mapQuestionsContent = LearningUtil.buildQuestionContentMap(request, voteService, voteContent, null); - VoteLearningStarterAction.logger.debug("mapQuestionsContent: " + mapQuestionsContent); - request.setAttribute(VoteAppConstants.MAP_QUESTION_CONTENT_LEARNER, mapQuestionsContent); - VoteLearningStarterAction.logger.debug("MAP_QUESTION_CONTENT_LEARNER: " - + request.getAttribute(VoteAppConstants.MAP_QUESTION_CONTENT_LEARNER)); request.setAttribute(VoteAppConstants.MAP_OPTIONS_CONTENT, mapQuestionsContent); /* * verify that userId does not already exist in the db. If it does exist, that means, that user already * responded to the content and his answers must be displayed read-only * */ - - VoteLearningStarterAction.logger.debug("userID:" + userID); - - VoteLearningStarterAction.logger.debug("voteSession uid :" + voteSession.getUid()); VoteQueUsr voteQueUsr = voteService.getVoteUserBySession(new Long(userID), voteSession.getUid()); - VoteLearningStarterAction.logger.debug("voteQueUsr:" + voteQueUsr); - if (voteQueUsr != null) { - VoteLearningStarterAction.logger.debug("voteQueUsr is available in the db:" + voteQueUsr); Long queUsrId = voteQueUsr.getUid(); - VoteLearningStarterAction.logger.debug("queUsrId: " + queUsrId); } else { - VoteLearningStarterAction.logger.debug("voteQueUsr is not available in the db:" + voteQueUsr); + //voteQueUsr is not available in the db } String learningMode = voteLearningForm.getLearningMode(); - VoteLearningStarterAction.logger.debug("users learning mode is: " + learningMode); /* * the user's session id AND user id exists in the tool tables goto this screen if the OverAll Results scren has * been already called up by this user */ if (voteQueUsr != null && voteQueUsr.isFinalScreenRequested()) { Long sessionUid = voteQueUsr.getVoteSessionId(); - VoteLearningStarterAction.logger.debug("users sessionUid: " + sessionUid); VoteSession voteUserSession = voteService.getVoteSessionByUID(sessionUid); - VoteLearningStarterAction.logger.debug("voteUserSession: " + voteUserSession); String userSessionId = voteUserSession.getVoteSessionId().toString(); - VoteLearningStarterAction.logger.debug("userSessionId: " + userSessionId); - VoteLearningStarterAction.logger.debug("current toolSessionID: " + toolSessionID); if (toolSessionID.toString().equals(userSessionId)) { - VoteLearningStarterAction.logger - .debug("the learner has already responsed to this content, just generate a read-only report. Use redo questions for this."); - - VoteLearningStarterAction.logger.debug("start building MAP_GENERAL_CHECKED_OPTIONS_CONTENT"); + //the learner has already responsed to this content, just generate a read-only report. Use redo questions for this String toolContentId = voteLearningForm.getToolContentID(); - VoteLearningStarterAction.logger.debug("toolContentId: " + toolContentId); - putMapQuestionsContentIntoRequest(request, voteService, voteQueUsr); boolean isResponseFinalised = voteQueUsr.isResponseFinalised(); - VoteLearningStarterAction.logger.debug("isResponseFinalised: " + isResponseFinalised); if (isResponseFinalised) { - VoteLearningStarterAction.logger - .debug("since the response is finalised present a screen which can not be edited"); + //since the response is finalised present a screen which can not be edited voteLearningForm.setReportViewOnly(new Boolean(true).toString()); voteGeneralLearnerFlowDTO.setReportViewOnly(new Boolean(true).toString()); } - VoteLearningStarterAction.logger.debug("geting user answers for user uid and sessionUid" - + voteQueUsr.getUid() + " " + sessionUid); Set userAttempts = voteService.getAttemptsForUserAndSessionUseOpenAnswer(voteQueUsr.getUid(), sessionUid); - VoteLearningStarterAction.logger.debug("userAttempts: " + userAttempts); request.setAttribute(VoteAppConstants.LIST_GENERAL_CHECKED_OPTIONS_CONTENT, userAttempts); VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); @@ -514,48 +449,32 @@ getMessageService()); String isContentLockOnFinish = voteLearningForm.getLockOnFinish(); - VoteLearningStarterAction.logger.debug("isContentLockOnFinish: " + isContentLockOnFinish); if (isContentLockOnFinish.equals(new Boolean(true).toString()) && isResponseFinalised == true) { - VoteLearningStarterAction.logger.debug("user with session id: " + userSessionId - + " should not redo votes. session is locked."); - VoteLearningStarterAction.logger.debug("fwd'ing to: " + VoteAppConstants.EXIT_PAGE); + //user with session id: userSessionId should not redo votes. session is locked return mapping.findForward(VoteAppConstants.EXIT_PAGE); } - VoteLearningStarterAction.logger - .debug("the user's session id AND user id exists in the tool tables go to redo questions. " - + toolSessionID + " voteQueUsr: " + voteQueUsr + " user id: " - + voteQueUsr.getQueUsrId()); voteLearningForm.setRevisitingUser(new Boolean(true).toString()); voteGeneralLearnerFlowDTO.setRevisitingUser(new Boolean(true).toString()); - VoteLearningStarterAction.logger.debug("preparing chart data for readonly mode"); - - VoteLearningStarterAction.logger.debug("view-only voteGeneralLearnerFlowDTO: " - + voteGeneralLearnerFlowDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_LEARNER_FLOW_DTO, voteGeneralLearnerFlowDTO); if (isContentLockOnFinish.equals(new Boolean(false).toString()) && isResponseFinalised == true) { - VoteLearningStarterAction.logger.debug("isContentLockOnFinish is false, enable redo of votes : "); - VoteLearningStarterAction.logger.debug("fwd'ing to: " + VoteAppConstants.REVISITED_ALL_NOMINATIONS); + //isContentLockOnFinish is false, enable redo of votes return mapping.findForward(VoteAppConstants.REVISITED_ALL_NOMINATIONS); } - VoteLearningStarterAction.logger.debug("fwd'ing to: " + VoteAppConstants.ALL_NOMINATIONS); return mapping.findForward(VoteAppConstants.ALL_NOMINATIONS); } } - VoteLearningStarterAction.logger.debug("presenting standard learner screen.."); + //presenting standard learner screen.. return mapping.findForward(VoteAppConstants.LOAD_LEARNER); } private void putNotebookEntryIntoVoteGeneralLearnerFlowDTO(IVoteService voteService, VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO, String toolSessionID, String userID) { - VoteLearningStarterAction.logger.debug("attempt getting notebookEntry: "); NotebookEntry notebookEntry = voteService.getEntry(new Long(toolSessionID), CoreNotebookConstants.NOTEBOOK_TOOL, VoteAppConstants.MY_SIGNATURE, new Integer(userID)); - VoteLearningStarterAction.logger.debug("notebookEntry: " + notebookEntry); - if (notebookEntry != null) { String notebookEntryPresentable = VoteUtils.replaceNewLines(notebookEntry.getEntry()); voteGeneralLearnerFlowDTO.setNotebookEntry(notebookEntryPresentable); @@ -572,8 +491,6 @@ if (voteQueUsr != null) { attempts = voteService.getAttemptsForUser(voteQueUsr.getUid()); } - VoteLearningStarterAction.logger.debug("attempts: " + attempts); - Map localMapQuestionsContent = new TreeMap(new VoteComparator()); if (attempts != null) { @@ -582,26 +499,16 @@ int order = 0; while (listIterator.hasNext()) { VoteUsrAttempt attempt = (VoteUsrAttempt) listIterator.next(); - VoteLearningStarterAction.logger.debug("attempt: " + attempt); VoteQueContent voteQueContent = attempt.getVoteQueContent(); - VoteLearningStarterAction.logger.debug("voteQueContent: " + voteQueContent); order++; if (voteQueContent != null) { String entry = voteQueContent.getQuestion(); - VoteLearningStarterAction.logger.debug("entry: " + entry); String voteQueContentId = attempt.getVoteQueContentId().toString(); - VoteLearningStarterAction.logger.debug("voteQueContentId: " + voteQueContentId); if (entry != null) { if (entry.equals("sample nomination") && voteQueContentId.equals("1")) { - VoteLearningStarterAction.logger - .debug("this nomination entry points to a user entered nomination: " - + attempt.getUserEntry()); localMapQuestionsContent.put(new Integer(order).toString(), attempt.getUserEntry()); } else { - VoteLearningStarterAction.logger - .debug("this nomination entry points to a standard nomination: " - + voteQueContent.getQuestion()); localMapQuestionsContent.put(new Integer(order).toString(), voteQueContent.getQuestion()); } } @@ -610,8 +517,6 @@ } request.setAttribute(VoteAppConstants.MAP_GENERAL_CHECKED_OPTIONS_CONTENT, localMapQuestionsContent); - VoteLearningStarterAction.logger.debug("end building MAP_GENERAL_CHECKED_OPTIONS_CONTENT: " - + localMapQuestionsContent); } /** @@ -624,12 +529,8 @@ protected void commonContentSetup(HttpServletRequest request, IVoteService voteService, VoteContent voteContent, VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO) { Map mapQuestionsContent = LearningUtil.buildQuestionContentMap(request, voteService, voteContent, null); - VoteLearningStarterAction.logger.debug("mapQuestionsContent: " + mapQuestionsContent); request.setAttribute(VoteAppConstants.MAP_QUESTION_CONTENT_LEARNER, mapQuestionsContent); - VoteLearningStarterAction.logger.debug("MAP_QUESTION_CONTENT_LEARNER: " - + request.getAttribute(VoteAppConstants.MAP_QUESTION_CONTENT_LEARNER)); - VoteLearningStarterAction.logger.debug("voteContent has : " + mapQuestionsContent.size() + " entries."); voteGeneralLearnerFlowDTO.setTotalQuestionCount(new Long(mapQuestionsContent.size()).toString()); } @@ -643,24 +544,12 @@ protected void setupAttributes(HttpServletRequest request, VoteContent voteContent, VoteLearningForm voteLearningForm, VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO) { - VoteLearningStarterAction.logger.debug("IS_CONTENT_IN_USE: " + voteContent.isContentInUse()); - Map mapGeneralCheckedOptionsContent = new TreeMap(new VoteComparator()); request.setAttribute(VoteAppConstants.MAP_GENERAL_CHECKED_OPTIONS_CONTENT, mapGeneralCheckedOptionsContent); /* * Is the tool activity been checked as Run Offline in the property inspector? */ - VoteLearningStarterAction.logger.debug("IS_TOOL_ACTIVITY_OFFLINE: " + voteContent.isRunOffline()); - VoteLearningStarterAction.logger.debug("advanced properties maxNominationCount: " - + voteContent.getMaxNominationCount()); - VoteLearningStarterAction.logger.debug("advanced properties isAllowText(): " - + new Boolean(voteContent.isAllowText()).toString()); - VoteLearningStarterAction.logger.debug("advanced properties isRunOffline(): " - + new Boolean(voteContent.isRunOffline()).toString()); - VoteLearningStarterAction.logger.debug("advanced properties isLockOnFinish(): " - + new Boolean(voteContent.isLockOnFinish()).toString()); - voteLearningForm.setActivityTitle(voteContent.getTitle()); voteLearningForm.setActivityInstructions(voteContent.getInstructions()); voteLearningForm.setActivityRunOffline(new Boolean(voteContent.isRunOffline()).toString()); @@ -689,13 +578,11 @@ String userID = ""; HttpSession ss = SessionManager.getSession(); - VoteLearningStarterAction.logger.debug("ss: " + ss); if (ss != null) { UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); if (user != null && user.getUserID() != null) { userID = user.getUserID().toString(); - VoteLearningStarterAction.logger.debug("retrieved userId: " + userID); voteLearningForm.setUserID(userID); } } @@ -712,19 +599,17 @@ } else { try { toolSessionID = new Long(strToolSessionId).longValue(); - VoteLearningStarterAction.logger.debug("passed TOOL_SESSION_ID : " + new Long(toolSessionID)); voteLearningForm.setToolSessionID(new Long(toolSessionID).toString()); } catch (NumberFormatException e) { VoteUtils.cleanUpSessionAbsolute(request); // persistInRequestError(request, "error.sessionId.numberFormatException"); - VoteLearningStarterAction.logger.debug("add error.sessionId.numberFormatException to ActionMessages."); + VoteLearningStarterAction.logger.error("add error.sessionId.numberFormatException to ActionMessages."); return mapping.findForward(VoteAppConstants.ERROR_LIST); } } /* mode can be learner, teacher or author */ String mode = request.getParameter(VoteAppConstants.MODE); - VoteLearningStarterAction.logger.debug("mode: " + mode); if (mode == null || mode.length() == 0) { VoteUtils.cleanUpSessionAbsolute(request); @@ -737,20 +622,14 @@ VoteLearningStarterAction.logger.error("mode invalid: "); return mapping.findForward(VoteAppConstants.ERROR_LIST); } - VoteLearningStarterAction.logger.debug("session LEARNING_MODE set to:" + mode); voteLearningForm.setLearningMode(mode); return null; } boolean isSessionCompleted(String userSessionId, IVoteService voteService) { - VoteLearningStarterAction.logger.debug("userSessionId:" + userSessionId); VoteSession voteSession = voteService.retrieveVoteSession(new Long(userSessionId)); - VoteLearningStarterAction.logger.debug("retrieving voteSession: " + voteSession); - VoteLearningStarterAction.logger.debug("voteSession status : " + voteSession.getSessionStatus()); if (voteSession.getSessionStatus() != null && voteSession.getSessionStatus().equals(VoteAppConstants.COMPLETED)) { - VoteLearningStarterAction.logger.debug("this session is COMPLETED voteSession status : " + userSessionId - + "->" + voteSession.getSessionStatus()); return true; } return false; @@ -765,7 +644,6 @@ public void persistInRequestError(HttpServletRequest request, String message) { ActionMessages errors = new ActionMessages(); errors.add(Globals.ERROR_KEY, new ActionMessage(message)); - VoteLearningStarterAction.logger.debug("add " + message + " to ActionMessages:"); saveErrors(request, errors); } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java =================================================================== diff -u -rddc0da3d278fb12ac8374ad59146a8990ea2f3a2 -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision ddc0da3d278fb12ac8374ad59146a8990ea2f3a2) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -24,21 +24,20 @@ import java.io.IOException; import java.util.ArrayList; +import java.util.Date; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.TreeMap; -import java.util.Date; import java.util.TimeZone; +import java.util.TreeMap; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import org.apache.log4j.Logger; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; @@ -51,7 +50,6 @@ import org.lamsfoundation.lams.tool.vote.ExportPortfolioDTO; import org.lamsfoundation.lams.tool.vote.ReflectionDTO; import org.lamsfoundation.lams.tool.vote.VoteAppConstants; -import org.lamsfoundation.lams.tool.vote.VoteApplicationException; import org.lamsfoundation.lams.tool.vote.VoteComparator; import org.lamsfoundation.lams.tool.vote.VoteGeneralAuthoringDTO; import org.lamsfoundation.lams.tool.vote.VoteGeneralLearnerFlowDTO; @@ -67,7 +65,6 @@ import org.lamsfoundation.lams.tool.vote.pojos.VoteUsrAttempt; import org.lamsfoundation.lams.tool.vote.service.IVoteService; import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy; -import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.util.DateUtil; import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.util.WebUtil; @@ -77,194 +74,54 @@ import org.lamsfoundation.lams.web.util.SessionMap; /** - *

- * Action class that controls the logic of tool behavior. - *

- * - *

- * Note that Struts action class only has the responsibility to navigate page flow. All database operation should go to - * service layer and data transformation from domain model to struts form bean should go to form bean class. This ensure - * clean and maintainable code. - *

- * - * SystemException is thrown whenever an known error condition is identified. No system exception error - * handling code should appear in the Struts action class as all of them are handled in - * CustomStrutsExceptionHandler. - * * @author Ozgur Demirtas - * - * - - - - - - - - - - - - - - - - - - - - - - * */ public class VoteMonitoringAction extends LamsDispatchAction implements VoteAppConstants { - static Logger logger = Logger.getLogger(VoteMonitoringAction.class.getName()); /** - *

- * Default struts dispatch method. - *

- * - *

- * It is assuming that progress engine should pass in the tool access mode and the tool session id as http - * parameters. - *

- * - * @param mapping - * An ActionMapping class that will be used by the Action class to tell the ActionServlet where to - * send the end-user. - * - * @param form - * The ActionForm class that will contain any data submitted by the end-user via a form. - * @param request - * A standard Servlet HttpServletRequest class. - * @param response - * A standard Servlet HttpServletResponse class. - * @return An ActionForward class that will be returned to the ActionServlet indicating where the user is to go - * next. - * @throws IOException - * @throws ServletException - * @throws VoteApplicationException - * the known runtime exception - * - * unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - * throws IOException, ServletException - * * main content/question content management and workflow logic - * */ - @Override public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { VoteUtils.cleanUpUserExceptions(request); - VoteMonitoringAction.logger.debug("dispatching unspecified..."); return null; } public ActionForward submitSession(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, IVoteService voteService, MessageService messageService, VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) throws IOException, ServletException { - VoteMonitoringAction.logger.debug("calling submitSession...voteGeneralMonitoringDTO:" - + voteGeneralMonitoringDTO); commonSubmitSessionCode(form, request, voteService, messageService, voteGeneralMonitoringDTO); - VoteMonitoringAction.logger.debug("post commonSubmitSessionCode: " + voteGeneralMonitoringDTO); return mapping.findForward(VoteAppConstants.LOAD_MONITORING); } protected void commonSubmitSessionCode(ActionForm form, HttpServletRequest request, IVoteService voteService, MessageService messageService, VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) throws IOException, ServletException { - VoteMonitoringAction.logger.debug("starting commonSubmitSessionCode...voteGeneralMonitoringDTO:" - + voteGeneralMonitoringDTO); - - VoteMonitoringAction.logger.debug("voteService:" + voteService); VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); - VoteMonitoringAction.logger.debug("done repopulateRequestParameters"); - String currentMonitoredToolSession = voteMonitoringForm.getSelectedToolSessionId(); - VoteMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession); - String toolContentID = voteMonitoringForm.getToolContentID(); - VoteMonitoringAction.logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); - VoteMonitoringAction.logger.debug("existing voteContent:" + voteContent); - if (currentMonitoredToolSession.equals("All")) { voteGeneralMonitoringDTO.setSelectionCase(new Long(2)); request.setAttribute(VoteAppConstants.SELECTION_CASE, new Long(2)); - VoteMonitoringAction.logger.debug("generate DTO for All sessions: "); List listVoteAllSessionsDTO = MonitoringUtil.prepareChartDTO(request, voteService, voteMonitoringForm, voteContent.getVoteContentId(), messageService); - VoteMonitoringAction.logger.debug("listVoteAllSessionsDTO: " + listVoteAllSessionsDTO); voteGeneralMonitoringDTO.setListVoteAllSessionsDTO(listVoteAllSessionsDTO); } else { - VoteMonitoringAction.logger.debug("preparing chart data for content id: " + voteContent.getVoteContentId()); - VoteMonitoringAction.logger.debug("preparing chart data for currentMonitoredToolSession: " - + currentMonitoredToolSession); request.setAttribute(VoteAppConstants.SELECTION_CASE, new Long(1)); VoteSession voteSession = voteService.retrieveVoteSession(new Long(currentMonitoredToolSession)); - VoteMonitoringAction.logger.debug("voteSession uid:" + voteSession.getUid()); MonitoringUtil.prepareChartData(request, voteService, voteMonitoringForm, voteContent.getVoteContentId() .toString(), voteSession.getUid().toString(), null, voteGeneralMonitoringDTO, getMessageService()); - VoteMonitoringAction.logger.debug("post prepareChartData, voteGeneralMonitoringDTO:" - + voteGeneralMonitoringDTO); - refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, true, null, voteGeneralMonitoringDTO, null); - VoteMonitoringAction.logger.debug("session_name: " + voteSession.getSession_name()); voteGeneralMonitoringDTO.setGroupName(voteSession.getSession_name()); - VoteMonitoringAction.logger.debug("post refreshSummaryData, voteGeneralMonitoringDTO:" - + voteGeneralMonitoringDTO); voteGeneralMonitoringDTO.setSelectionCase(new Long(1)); } - VoteMonitoringAction.logger.debug("SELECTION_CASE: " + voteGeneralMonitoringDTO.getSelectionCase()); - - VoteMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(VoteAppConstants.SELECTION_CASE)); request.setAttribute(VoteAppConstants.CURRENT_MONITORED_TOOL_SESSION, currentMonitoredToolSession); boolean isGroupedActivity = voteService.isGroupedActivity(new Long(toolContentID)); @@ -276,23 +133,13 @@ voteGeneralMonitoringDTO.setRequestLearningReport(new Boolean(false).toString()); Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, voteContent, voteService); - VoteMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); voteGeneralMonitoringDTO.setSummaryToolSessions(summaryToolSessions); Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, voteContent, voteService); - VoteMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); voteGeneralMonitoringDTO.setSummaryToolSessionsId(summaryToolSessionsId); - VoteMonitoringAction.logger.debug("calling initInstructionsContent."); // initInstructionsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - VoteMonitoringAction.logger.debug("post initInstructionsContent, voteGeneralMonitoringDTO: " - + voteGeneralMonitoringDTO); - - VoteMonitoringAction.logger.debug("calling initStatsContent."); initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - VoteMonitoringAction.logger.debug("post initStatsContent, voteGeneralMonitoringDTO: " - + voteGeneralMonitoringDTO); - /* setting editable screen properties */ VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); voteGeneralAuthoringDTO.setActivityTitle(voteContent.getTitle()); @@ -301,11 +148,9 @@ Map mapOptionsContent = new TreeMap(new VoteComparator()); Iterator queIterator = voteContent.getVoteQueContents().iterator(); Long mapIndex = new Long(1); - VoteMonitoringAction.logger.debug("mapOptionsContent: " + mapOptionsContent); while (queIterator.hasNext()) { VoteQueContent voteQueContent = (VoteQueContent) queIterator.next(); if (voteQueContent != null) { - VoteMonitoringAction.logger.debug("question: " + voteQueContent.getQuestion()); mapOptionsContent.put(mapIndex.toString(), voteQueContent.getQuestion()); /** * make the first entry the default(first) one for jsp @@ -318,33 +163,26 @@ } } - VoteMonitoringAction.logger.debug("mapOptionsContent: " + mapOptionsContent); int maxIndex = mapOptionsContent.size(); - VoteMonitoringAction.logger.debug("maxIndex: " + maxIndex); voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - VoteMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(false).toString()); if (isContentInUse == true) { - VoteMonitoringAction.logger - .debug("monitoring url does not allow editActivity since the content is in use."); + //monitoring url does not allow editActivity since the content is in use voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); } - VoteMonitoringAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); // prepareReflectionData(request, voteContent, voteService, null,false); prepareReflectionData(request, voteContent, voteService, null, false, "All"); if (voteService.studentActivityOccurredGlobal(voteContent)) { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); } else { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } @@ -353,34 +191,27 @@ voteGeneralMonitoringDTO.setOfflineInstructions(voteContent.getOfflineInstructions()); List attachmentList = voteService.retrieveVoteUploadedFiles(voteContent); - VoteMonitoringAction.logger.debug("attachmentList: " + attachmentList); voteGeneralMonitoringDTO.setAttachmentList(attachmentList); voteGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ - VoteMonitoringAction.logger.debug("end of commonSubmitSessionCode, voteGeneralMonitoringDTO: " - + voteGeneralMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); EditActivityDTO editActivityDTO = new EditActivityDTO(); - VoteMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } request.setAttribute(VoteAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - VoteMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); - if (notebookEntriesExist) { request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - VoteMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions); if (userExceptionNoToolSessions.equals("true")) { - VoteMonitoringAction.logger.debug("there are no online student activity but there are reflections : "); + //there are no online student activity but there are reflections request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } } else { @@ -394,14 +225,10 @@ public ActionForward submitSession(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - VoteMonitoringAction.logger.debug("dispathcing submitSession.."); IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringAction.logger.debug("voteService: " + voteService); - VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); commonSubmitSessionCode(form, request, voteService, getMessageService(), voteGeneralMonitoringDTO); - VoteMonitoringAction.logger.debug("post commonSubmitSessionCode: " + voteGeneralMonitoringDTO); return mapping.findForward(VoteAppConstants.LOAD_MONITORING); } @@ -410,81 +237,55 @@ boolean isUserNamesVisible, boolean isLearnerRequest, String currentSessionId, String userId, boolean showUserEntriesBySession, VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO, VoteGeneralMonitoringDTO voteGeneralMonitoringDTO, ExportPortfolioDTO exportPortfolioDTO) { - VoteMonitoringAction.logger.debug("doing refreshSummaryData." + voteGeneralLearnerFlowDTO); - VoteMonitoringAction.logger.debug("voteGeneralMonitoringDTO:" + voteGeneralMonitoringDTO); - VoteMonitoringAction.logger.debug("exportPortfolioDTO:" + exportPortfolioDTO); if (voteService == null) { - VoteMonitoringAction.logger.debug("will retrieve voteService"); voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringAction.logger.debug("retrieving voteService from session: " + voteService); } - VoteMonitoringAction.logger.debug("voteService: " + voteService); - VoteMonitoringAction.logger.debug("isUserNamesVisible: " + isUserNamesVisible); - VoteMonitoringAction.logger.debug("isLearnerRequest: " + isLearnerRequest); - /* this section is related to summary tab. Starts here. */ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, voteContent, voteService); - VoteMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { if (voteGeneralMonitoringDTO != null) { voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); } - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); } else { if (voteGeneralMonitoringDTO != null) { voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); } String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - VoteMonitoringAction.logger.debug("userExceptionNoToolSessions: " + userExceptionNoToolSessions); if (exportPortfolioDTO != null) { exportPortfolioDTO.setUserExceptionNoToolSessions(userExceptionNoToolSessions); } Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, voteContent, voteService); - VoteMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); - VoteMonitoringAction.logger.debug("currentSessionId: " + currentSessionId); if (currentSessionId != null && !currentSessionId.equals("All")) { VoteSession voteSession = voteService.retrieveVoteSession(new Long(currentSessionId)); - VoteMonitoringAction.logger.debug("voteSession:" + voteSession); if (voteGeneralMonitoringDTO != null) { voteGeneralMonitoringDTO.setGroupName(voteSession.getSession_name()); } } else { voteGeneralMonitoringDTO.setGroupName("All Groups"); } - VoteMonitoringAction.logger.debug("using allUsersData to retrieve data: " + isUserNamesVisible); List listMonitoredAnswersContainerDTO = MonitoringUtil.buildGroupsQuestionData(request, voteContent, isUserNamesVisible, isLearnerRequest, currentSessionId, userId, voteService); - VoteMonitoringAction.logger.debug("listMonitoredAnswersContainerDTO: " + listMonitoredAnswersContainerDTO); /* ends here. */ - VoteMonitoringAction.logger.debug("decide processing user entered values based on isLearnerRequest: " - + isLearnerRequest); - List listUserEntries = processUserEnteredNominations(voteService, voteContent, currentSessionId, showUserEntriesBySession, userId, isLearnerRequest); - VoteMonitoringAction.logger.debug("listUserEntries: " + listUserEntries); if (voteGeneralLearnerFlowDTO != null) { - VoteMonitoringAction.logger.debug("placing dtos within the voteGeneralLearnerFlowDTO: "); voteGeneralLearnerFlowDTO.setListMonitoredAnswersContainerDto(listMonitoredAnswersContainerDTO); voteGeneralLearnerFlowDTO.setListUserEntries(listUserEntries); - ; } if (exportPortfolioDTO != null) { - VoteMonitoringAction.logger.debug("placing dtos within the exportPortfolioDTO: "); exportPortfolioDTO.setListMonitoredAnswersContainerDto(listMonitoredAnswersContainerDTO); exportPortfolioDTO.setListUserEntries(listUserEntries); - ; } if (voteGeneralMonitoringDTO != null) { @@ -501,26 +302,19 @@ } } - VoteMonitoringAction.logger.debug("final voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); - VoteMonitoringAction.logger.debug("final voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); - boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - VoteMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(false).toString()); if (isContentInUse == true) { - VoteMonitoringAction.logger - .debug("monitoring url does not allow editActivity since the content is in use."); + //monitoring url does not allow editActivity since the content is in use voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); } // prepareReflectionData(request, voteContent, voteService, null,false); prepareReflectionData(request, voteContent, voteService, null, false, "All"); if (voteService.studentActivityOccurredGlobal(voteContent)) { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); } else { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } @@ -529,35 +323,29 @@ voteGeneralMonitoringDTO.setOfflineInstructions(voteContent.getOfflineInstructions()); List attachmentList = voteService.retrieveVoteUploadedFiles(voteContent); - VoteMonitoringAction.logger.debug("attachmentList: " + attachmentList); voteGeneralMonitoringDTO.setAttachmentList(attachmentList); voteGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ - VoteMonitoringAction.logger.debug("end of refreshSummaryData, voteGeneralMonitoringDTO" - + voteGeneralMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); EditActivityDTO editActivityDTO = new EditActivityDTO(); isContentInUse = VoteUtils.isContentInUse(voteContent); - VoteMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } request.setAttribute(VoteAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - VoteMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); if (notebookEntriesExist) { request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - VoteMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions); if (userExceptionNoToolSessions.equals("true")) { - VoteMonitoringAction.logger.debug("there are no online student activity but there are reflections : "); + //there are no online student activity but there are reflections request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } } else { @@ -571,55 +359,29 @@ public List processUserEnteredNominations(IVoteService voteService, VoteContent voteContent, String currentSessionId, boolean showUserEntriesBySession, String userId, boolean showUserEntriesByUserId) { - VoteMonitoringAction.logger.debug("start getting user entries, showUserEntriesBySession: " - + showUserEntriesBySession); - VoteMonitoringAction.logger.debug("start getting user entries, currentSessionId: " + currentSessionId); - VoteMonitoringAction.logger.debug("start getting user entries, showUserEntriesByUserId: " - + showUserEntriesByUserId); - VoteMonitoringAction.logger.debug("start getting user entries, userId: " + userId); - VoteMonitoringAction.logger.debug("start getting user entries, voteContent: " + voteContent); - VoteMonitoringAction.logger.debug("start getting user entries, voteContent id: " - + voteContent.getVoteContentId()); - Set userEntries = voteService.getUserEntries(); - VoteMonitoringAction.logger.debug("userEntries: " + userEntries); List listUserEntries = new LinkedList(); Iterator itListNominations = userEntries.iterator(); while (itListNominations.hasNext()) { String userEntry = (String) itListNominations.next(); - VoteMonitoringAction.logger.debug("userEntry:..." + userEntry); if (userEntry != null && userEntry.length() > 0) { VoteMonitoredAnswersDTO voteMonitoredAnswersDTO = new VoteMonitoredAnswersDTO(); - VoteMonitoringAction.logger.debug("adding user entry : " + userEntry); voteMonitoredAnswersDTO.setQuestion(userEntry); List userRecords = voteService.getUserRecords(userEntry); - VoteMonitoringAction.logger.debug("userRecords: " + userRecords); - - VoteMonitoringAction.logger.debug("start processing user records: "); - List listMonitoredUserContainerDTO = new LinkedList(); Iterator itUserRecords = userRecords.iterator(); while (itUserRecords.hasNext()) { VoteMonitoredUserDTO voteMonitoredUserDTO = new VoteMonitoredUserDTO(); - VoteMonitoringAction.logger.debug("new DTO created"); VoteUsrAttempt voteUsrAttempt = (VoteUsrAttempt) itUserRecords.next(); - VoteMonitoringAction.logger.debug("voteUsrAttempt: " + voteUsrAttempt); VoteSession localUserSession = voteUsrAttempt.getVoteQueUsr().getVoteSession(); - VoteMonitoringAction.logger.debug("localUserSession: " + localUserSession); - VoteMonitoringAction.logger.debug("localUserSession's content id: " - + localUserSession.getVoteContentId()); - VoteMonitoringAction.logger.debug("incoming content uid versus localUserSession's content id: " - + voteContent.getUid() + " versus " + localUserSession.getVoteContentId()); if (showUserEntriesBySession == false) { - VoteMonitoringAction.logger.debug("showUserEntriesBySession is false"); - VoteMonitoringAction.logger.debug("show user entries by same content only"); if (voteContent.getUid().toString().equals(localUserSession.getVoteContentId().toString())) { voteMonitoredUserDTO.setAttemptTime(voteUsrAttempt.getAttemptTime()); voteMonitoredUserDTO.setTimeZone(voteUsrAttempt.getTimeZone()); @@ -631,22 +393,16 @@ listMonitoredUserContainerDTO.add(voteMonitoredUserDTO); } } else { - VoteMonitoringAction.logger - .debug("showUserEntriesBySession is true: the case with learner export portfolio"); - VoteMonitoringAction.logger - .debug("show user entries by same content and same session and same user"); + //showUserEntriesBySession is true: the case with learner export portfolio + //show user entries by same content and same session and same user String userSessionId = voteUsrAttempt.getVoteQueUsr().getVoteSession().getVoteSessionId() .toString(); - VoteMonitoringAction.logger.debug("userSessionId versus currentSessionId: " + userSessionId - + " versus " + currentSessionId); if (showUserEntriesByUserId == true) { if (voteContent.getUid().toString().equals(localUserSession.getVoteContentId().toString())) { - VoteMonitoringAction.logger.debug("showUserEntriesByUserId is true"); if (userSessionId.equals(currentSessionId)) { String localUserId = voteUsrAttempt.getVoteQueUsr().getQueUsrId().toString(); if (userId.equals(localUserId)) { - VoteMonitoringAction.logger.debug("this is requested by user id: " + userId); voteMonitoredUserDTO.setAttemptTime(voteUsrAttempt.getAttemptTime()); voteMonitoredUserDTO.setTimeZone(voteUsrAttempt.getTimeZone()); voteMonitoredUserDTO.setUserName(voteUsrAttempt.getVoteQueUsr().getFullname()); @@ -657,30 +413,18 @@ voteMonitoredUserDTO.setUid(voteUsrAttempt.getUid().toString()); voteMonitoredUserDTO.setVisible(new Boolean(voteUsrAttempt.isVisible()) .toString()); - VoteMonitoringAction.logger - .debug("overriding the nomination text with 'Nomination Hidden' if needed"); - VoteMonitoringAction.logger.debug("is entry visible: " - + voteUsrAttempt.isVisible()); if (voteUsrAttempt.isVisible() == false) { voteMonitoredAnswersDTO.setQuestion("Nomination Hidden"); - VoteMonitoringAction.logger.debug("overwrote the nomination text"); } } } } } else { - VoteMonitoringAction.logger.debug("showUserEntriesByUserId is false"); - VoteMonitoringAction.logger.debug("show user entries by same content and same session"); - VoteMonitoringAction.logger - .debug("voteContent.getVoteContentId() versus localUserSession.getVoteContentId().toString(): " - + voteContent.getVoteContentId() - + " versus " - + localUserSession.getVoteContentId()); + //showUserEntriesByUserId is false + //show user entries by same content and same session if (voteContent.getUid().toString().equals(localUserSession.getVoteContentId().toString())) { if (userSessionId.equals(currentSessionId)) { - VoteMonitoringAction.logger.debug("this is requested by session id: " - + currentSessionId); voteMonitoredUserDTO.setAttemptTime(voteUsrAttempt.getAttemptTime()); voteMonitoredUserDTO.setTimeZone(voteUsrAttempt.getTimeZone()); voteMonitoredUserDTO.setUserName(voteUsrAttempt.getVoteQueUsr().getFullname()); @@ -697,65 +441,43 @@ } - VoteMonitoringAction.logger.debug("final listMonitoredUserContainerDTO: " - + listMonitoredUserContainerDTO); - - VoteMonitoringAction.logger.debug("final listMonitoredUserContainerDTO size: " - + listMonitoredUserContainerDTO.size()); if (listMonitoredUserContainerDTO.size() > 0) { - VoteMonitoringAction.logger.debug("adding user entry's data"); Map mapMonitoredUserContainerDTO = MonitoringUtil .convertToVoteMonitoredUserDTOMap(listMonitoredUserContainerDTO); - VoteMonitoringAction.logger.debug("final user entry mapMonitoredUserContainerDTO:..." - + mapMonitoredUserContainerDTO); voteMonitoredAnswersDTO.setQuestionAttempts(mapMonitoredUserContainerDTO); listUserEntries.add(voteMonitoredAnswersDTO); } } } - VoteMonitoringAction.logger.debug("finish getting user entries: " + listUserEntries); return listUserEntries; } public void initSummaryContent(String toolContentID, HttpServletRequest request, IVoteService voteService, VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) throws IOException, ServletException { - VoteMonitoringAction.logger.debug("start initSummaryContent...toolContentID: " + toolContentID); - VoteMonitoringAction.logger.debug("dispatching getSummary...voteGeneralMonitoringDTO:" - + voteGeneralMonitoringDTO); - - VoteMonitoringAction.logger.debug("voteService: " + voteService); - VoteMonitoringAction.logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); - VoteMonitoringAction.logger.debug("existing voteContent:" + voteContent); /* this section is related to summary tab. Starts here. */ Map summaryToolSessions = MonitoringUtil.populateToolSessions(request, voteContent, voteService); - VoteMonitoringAction.logger.debug("summaryToolSessions: " + summaryToolSessions); voteGeneralMonitoringDTO.setSummaryToolSessions(summaryToolSessions); Map summaryToolSessionsId = MonitoringUtil.populateToolSessionsId(request, voteContent, voteService); - VoteMonitoringAction.logger.debug("summaryToolSessionsId: " + summaryToolSessionsId); voteGeneralMonitoringDTO.setSummaryToolSessionsId(summaryToolSessionsId); /* ends here. */ /* true means there is at least 1 response */ if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); } else { voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); } // prepareReflectionData(request, voteContent, voteService, null,false); prepareReflectionData(request, voteContent, voteService, null, false, "All"); EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - VoteMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -766,29 +488,24 @@ voteGeneralMonitoringDTO.setOfflineInstructions(voteContent.getOfflineInstructions()); List attachmentList = voteService.retrieveVoteUploadedFiles(voteContent); - VoteMonitoringAction.logger.debug("attachmentList: " + attachmentList); voteGeneralMonitoringDTO.setAttachmentList(attachmentList); voteGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ voteGeneralMonitoringDTO.setCurrentMonitoringTab("summary"); - VoteMonitoringAction.logger.debug("end of refreshSummaryData, voteGeneralMonitoringDTO" - + voteGeneralMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - VoteMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); if (notebookEntriesExist) { request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - VoteMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions); if (userExceptionNoToolSessions.equals("true")) { - VoteMonitoringAction.logger.debug("there are no online student activity but there are reflections : "); + //there are no online student activity but there are reflections request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } } else { @@ -798,36 +515,25 @@ MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - VoteMonitoringAction.logger.debug("end initSummaryContent..."); } public void initStatsContent(String toolContentID, HttpServletRequest request, IVoteService voteService, VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) throws IOException, ServletException { - VoteMonitoringAction.logger.debug("starting initStatsContent...:" + toolContentID); - VoteMonitoringAction.logger.debug("dispatching getStats..." + request); - VoteMonitoringAction.logger.debug("voteService: " + voteService); - VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); - VoteMonitoringAction.logger.debug("existing voteContent:" + voteContent); if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); } else { voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); } refreshStatsData(request, voteService, voteGeneralMonitoringDTO); - VoteMonitoringAction.logger.debug("post refreshStatsData, voteGeneralMonitoringDTO: " - + voteGeneralMonitoringDTO); // prepareReflectionData(request, voteContent, voteService, null,false); prepareReflectionData(request, voteContent, voteService, null, false, "All"); EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - VoteMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -838,29 +544,24 @@ voteGeneralMonitoringDTO.setOfflineInstructions(voteContent.getOfflineInstructions()); List attachmentList = voteService.retrieveVoteUploadedFiles(voteContent); - VoteMonitoringAction.logger.debug("attachmentList: " + attachmentList); voteGeneralMonitoringDTO.setAttachmentList(attachmentList); voteGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ voteGeneralMonitoringDTO.setCurrentMonitoringTab("stats"); - VoteMonitoringAction.logger.debug("end of refreshSummaryData, voteGeneralMonitoringDTO" - + voteGeneralMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - VoteMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); if (notebookEntriesExist) { request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - VoteMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions); if (userExceptionNoToolSessions.equals("true")) { - VoteMonitoringAction.logger.debug("there are no online student activity but there are reflections : "); + //there are no online student activity but there are reflections request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } } else { @@ -869,42 +570,30 @@ /* ... till here */ MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - - VoteMonitoringAction.logger.debug("ending initStatsContent..."); } public void refreshStatsData(HttpServletRequest request, IVoteService voteService, VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) { - VoteMonitoringAction.logger.debug("starting refreshStatsData: " + voteService); /* it is possible that no users has ever logged in for the activity yet */ if (voteService == null) { - VoteMonitoringAction.logger.debug("will retrieve voteService"); voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringAction.logger.debug("retrieving voteService from session: " + voteService); } int countAllUsers = voteService.getTotalNumberOfUsers(); - VoteMonitoringAction.logger.debug("countAllUsers: " + countAllUsers); - if (countAllUsers == 0) { - VoteMonitoringAction.logger.debug("error: countAllUsers is 0"); voteGeneralMonitoringDTO.setUserExceptionNoStudentActivity(new Boolean(true).toString()); } voteGeneralMonitoringDTO.setCountAllUsers(new Integer(countAllUsers).toString()); int countSessionComplete = voteService.countSessionComplete(); - VoteMonitoringAction.logger.debug("countSessionComplete: " + countSessionComplete); voteGeneralMonitoringDTO.setCountSessionComplete(new Integer(countSessionComplete).toString()); - VoteMonitoringAction.logger.debug("end of refreshStatsData, voteGeneralMonitoringDTO" - + voteGeneralMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); } /** - * calls learning action endLearning functionality ActionForward endLearning(ActionMapping mapping, ActionForm form, - * HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, ToolException + * calls learning action endLearning functionality * * @param mapping * @param form @@ -917,13 +606,8 @@ */ public ActionForward endLearning(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, ToolException { - VoteMonitoringAction.logger.debug("dispatching proxy endLearning to learning module..."); - IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringAction.logger.debug("voteService :" + voteService); - VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; - VoteMonitoringAction.logger.debug("voteMonitoringForm :" + voteMonitoringForm); voteMonitoringForm.setVoteService(voteService); VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); @@ -936,64 +620,35 @@ public ActionForward viewOpenVotes(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, ToolException { - VoteMonitoringAction.logger.debug("dispatching viewOpenVotes..."); - IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringAction.logger.debug("voteService :" + voteService); - VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; - VoteMonitoringAction.logger.debug("voteMonitoringForm :" + voteMonitoringForm); voteMonitoringForm.setVoteService(voteService); VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); if (voteService == null) { - VoteMonitoringAction.logger.debug("will retrieve voteService"); voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); } - VoteMonitoringAction.logger.debug("voteService: " + voteService); voteMonitoringForm.setShowOpenVotesSection(new Boolean(true).toString()); voteGeneralMonitoringDTO.setShowOpenVotesSection(new Boolean(true).toString()); - VoteMonitoringAction.logger.debug("showOpen votes set to true: "); - String toolContentID = voteMonitoringForm.getToolContentID(); - VoteMonitoringAction.logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); - VoteMonitoringAction.logger.debug("existing voteContent:" + voteContent); - String currentMonitoredToolSession = voteMonitoringForm.getSelectedToolSessionId(); - VoteMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession); - refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, true, null, voteGeneralMonitoringDTO, null); initSummaryContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - VoteMonitoringAction.logger.debug("post initSummaryContent, voteGeneralMonitoringDTO: " - + voteGeneralMonitoringDTO); - VoteMonitoringAction.logger.debug("calling initInstructionsContent."); - VoteMonitoringAction.logger.debug("post initInstructionsContent, voteGeneralMonitoringDTO: " - + voteGeneralMonitoringDTO); - - VoteMonitoringAction.logger.debug("calling initStatsContent."); initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - VoteMonitoringAction.logger.debug("post initStatsContent, voteGeneralMonitoringDTO: " - + voteGeneralMonitoringDTO); - if (voteService.studentActivityOccurredGlobal(voteContent)) { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); } else { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } - - VoteMonitoringAction.logger.debug("voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); if (currentMonitoredToolSession.equals("All")) { @@ -1010,13 +665,10 @@ voteGeneralMonitoringDTO.setOfflineInstructions(voteContent.getOfflineInstructions()); List attachmentList = voteService.retrieveVoteUploadedFiles(voteContent); - VoteMonitoringAction.logger.debug("attachmentList: " + attachmentList); voteGeneralMonitoringDTO.setAttachmentList(attachmentList); voteGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ - VoteMonitoringAction.logger.debug("ending editActivityQuestions, voteGeneralMonitoringDTO: " - + voteGeneralMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); if (voteContent != null) { @@ -1025,7 +677,6 @@ EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - VoteMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -1034,24 +685,20 @@ EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - VoteMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } request.setAttribute(VoteAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - VoteMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); if (notebookEntriesExist) { request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - VoteMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions); - if (userExceptionNoToolSessions.equals("true")) { - VoteMonitoringAction.logger.debug("there are no online student activity but there are reflections : "); + //there are no online student activity but there are reflections request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } } else { @@ -1061,8 +708,6 @@ MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - VoteMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession); - if (currentMonitoredToolSession.equals("")) { currentMonitoredToolSession = "All"; } @@ -1073,22 +718,14 @@ request.setAttribute(VoteAppConstants.SELECTION_CASE, new Long(1)); } - VoteMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(VoteAppConstants.SELECTION_CASE)); - - VoteMonitoringAction.logger - .debug("ending viewOpenVotes, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); - VoteMonitoringAction.logger.debug("fwd'ing to LOAD_MONITORING: " + VoteAppConstants.LOAD_MONITORING); return mapping.findForward(VoteAppConstants.LOAD_MONITORING); } public ActionForward closeOpenVotes(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, ToolException { - VoteMonitoringAction.logger.debug("dispatching closeOpenVotes..."); IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringAction.logger.debug("voteService :" + voteService); VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; - VoteMonitoringAction.logger.debug("voteMonitoringForm :" + voteMonitoringForm); voteMonitoringForm.setVoteService(voteService); VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); @@ -1098,35 +735,16 @@ voteMonitoringForm.setShowOpenVotesSection(new Boolean(false).toString()); voteGeneralMonitoringDTO.setShowOpenVotesSection(new Boolean(false).toString()); - VoteMonitoringAction.logger.debug("showOpen votes set to false: "); - String toolContentID = voteMonitoringForm.getToolContentID(); - VoteMonitoringAction.logger.debug("toolContentID: " + toolContentID); - initSummaryContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - VoteMonitoringAction.logger.debug("post initSummaryContent, voteGeneralMonitoringDTO: " - + voteGeneralMonitoringDTO); - - VoteMonitoringAction.logger.debug("calling initInstructionsContent."); - VoteMonitoringAction.logger.debug("post initInstructionsContent, voteGeneralMonitoringDTO: " - + voteGeneralMonitoringDTO); - - VoteMonitoringAction.logger.debug("calling initStatsContent."); initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - VoteMonitoringAction.logger.debug("post initStatsContent, voteGeneralMonitoringDTO: " - + voteGeneralMonitoringDTO); - voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); - VoteMonitoringAction.logger.debug("existing voteContent:" + voteContent); - if (voteContent != null) { if (voteService.studentActivityOccurredGlobal(voteContent)) { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); } else { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } } @@ -1136,12 +754,10 @@ voteGeneralMonitoringDTO.setOfflineInstructions(voteContent.getOfflineInstructions()); List attachmentList = voteService.retrieveVoteUploadedFiles(voteContent); - VoteMonitoringAction.logger.debug("attachmentList: " + attachmentList); voteGeneralMonitoringDTO.setAttachmentList(attachmentList); voteGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ - VoteMonitoringAction.logger.debug("voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); if (voteContent != null) { @@ -1150,7 +766,6 @@ EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - VoteMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -1159,24 +774,20 @@ EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - VoteMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } request.setAttribute(VoteAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - VoteMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); if (notebookEntriesExist) { request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - VoteMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions); if (userExceptionNoToolSessions.equals("true")) { - VoteMonitoringAction.logger.debug("there are no online student activity but there are reflections : "); request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } } else { @@ -1185,9 +796,6 @@ /* ... till here */ MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - VoteMonitoringAction.logger.debug("ending closeOpenVotes, voteGeneralMonitoringDTO: " - + voteGeneralMonitoringDTO); - String currentMonitoredToolSession = voteMonitoringForm.getSelectedToolSessionId(); if (currentMonitoredToolSession.equals("")) { currentMonitoredToolSession = "All"; @@ -1199,58 +807,33 @@ request.setAttribute(VoteAppConstants.SELECTION_CASE, new Long(1)); } - VoteMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(VoteAppConstants.SELECTION_CASE)); - return mapping.findForward(VoteAppConstants.LOAD_MONITORING); } public ActionForward hideOpenVote(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, ToolException { - VoteMonitoringAction.logger.debug("dispatching hideOpenVote..."); IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringAction.logger.debug("voteService :" + voteService); VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; - VoteMonitoringAction.logger.debug("voteMonitoringForm :" + voteMonitoringForm); voteMonitoringForm.setVoteService(voteService); VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); String currentUid = voteMonitoringForm.getCurrentUid(); - VoteMonitoringAction.logger.debug("currentUid: " + currentUid); VoteUsrAttempt voteUsrAttempt = voteService.getAttemptByUID(new Long(currentUid)); - VoteMonitoringAction.logger.debug("voteUsrAttempt: " + voteUsrAttempt); voteUsrAttempt.setVisible(false); voteService.updateVoteUsrAttempt(voteUsrAttempt); - VoteMonitoringAction.logger.debug("hiding the user entry : " + voteUsrAttempt.getUserEntry()); voteService.hideOpenVote(voteUsrAttempt); String toolContentID = voteMonitoringForm.getToolContentID(); - VoteMonitoringAction.logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); - VoteMonitoringAction.logger.debug("existing voteContent:" + voteContent); - initSummaryContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - VoteMonitoringAction.logger.debug("post initSummaryContent, voteGeneralMonitoringDTO: " - + voteGeneralMonitoringDTO); - - VoteMonitoringAction.logger.debug("calling initInstructionsContent."); - VoteMonitoringAction.logger.debug("post initInstructionsContent, voteGeneralMonitoringDTO: " - + voteGeneralMonitoringDTO); - - VoteMonitoringAction.logger.debug("calling initStatsContent."); initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - VoteMonitoringAction.logger.debug("post initStatsContent, voteGeneralMonitoringDTO: " - + voteGeneralMonitoringDTO); - String currentMonitoredToolSession = voteMonitoringForm.getSelectedToolSessionId(); - VoteMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession); - refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, true, null, voteGeneralMonitoringDTO, null); @@ -1271,10 +854,8 @@ voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); if (voteService.studentActivityOccurredGlobal(voteContent)) { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); } else { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } @@ -1283,16 +864,12 @@ voteGeneralMonitoringDTO.setOfflineInstructions(voteContent.getOfflineInstructions()); List attachmentList = voteService.retrieveVoteUploadedFiles(voteContent); - VoteMonitoringAction.logger.debug("attachmentList: " + attachmentList); voteGeneralMonitoringDTO.setAttachmentList(attachmentList); voteGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ - VoteMonitoringAction.logger.debug("ending editActivityQuestions, voteGeneralMonitoringDTO: " - + voteGeneralMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); - VoteMonitoringAction.logger.debug("voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); if (voteContent != null) { @@ -1301,7 +878,6 @@ EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - VoteMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -1310,16 +886,13 @@ /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - VoteMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); if (notebookEntriesExist) { request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - VoteMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions); if (userExceptionNoToolSessions.equals("true")) { - VoteMonitoringAction.logger.debug("there are no online student activity but there are reflections : "); request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } } else { @@ -1329,57 +902,37 @@ MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - VoteMonitoringAction.logger.debug("submitting session to refresh the data from the database: "); return submitSession(mapping, form, request, response, voteService, getMessageService(), voteGeneralMonitoringDTO); } public ActionForward showOpenVote(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, ToolException { - VoteMonitoringAction.logger.debug("dispatching showOpenVote..."); IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringAction.logger.debug("voteService :" + voteService); VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; - VoteMonitoringAction.logger.debug("voteMonitoringForm :" + voteMonitoringForm); voteMonitoringForm.setVoteService(voteService); VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); repopulateRequestParameters(request, voteMonitoringForm, voteGeneralMonitoringDTO); String currentUid = voteMonitoringForm.getCurrentUid(); - VoteMonitoringAction.logger.debug("currentUid: " + currentUid); VoteUsrAttempt voteUsrAttempt = voteService.getAttemptByUID(new Long(currentUid)); - VoteMonitoringAction.logger.debug("voteUsrAttempt: " + voteUsrAttempt); voteUsrAttempt.setVisible(true); voteService.updateVoteUsrAttempt(voteUsrAttempt); voteService.showOpenVote(voteUsrAttempt); - VoteMonitoringAction.logger.debug("voteUsrAttempt: " + voteUsrAttempt); String toolContentID = voteMonitoringForm.getToolContentID(); - VoteMonitoringAction.logger.debug("toolContentID: " + toolContentID); VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); - VoteMonitoringAction.logger.debug("existing voteContent:" + voteContent); initSummaryContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - VoteMonitoringAction.logger.debug("post initSummaryContent, voteGeneralMonitoringDTO: " - + voteGeneralMonitoringDTO); - VoteMonitoringAction.logger.debug("calling initInstructionsContent."); - VoteMonitoringAction.logger.debug("post initInstructionsContent, voteGeneralMonitoringDTO: " - + voteGeneralMonitoringDTO); - - VoteMonitoringAction.logger.debug("calling initStatsContent."); initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - VoteMonitoringAction.logger.debug("post initStatsContent, voteGeneralMonitoringDTO: " - + voteGeneralMonitoringDTO); - String currentMonitoredToolSession = voteMonitoringForm.getSelectedToolSessionId(); - VoteMonitoringAction.logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession); refreshSummaryData(request, voteContent, voteService, true, false, currentMonitoredToolSession, null, true, null, voteGeneralMonitoringDTO, null); @@ -1396,16 +949,12 @@ request.setAttribute(VoteAppConstants.SELECTION_CASE, new Long(1)); } - VoteMonitoringAction.logger.debug("SELECTION_CASE: " + request.getAttribute(VoteAppConstants.SELECTION_CASE)); - voteGeneralMonitoringDTO.setCurrentMonitoredToolSession(currentMonitoredToolSession); voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); if (voteService.studentActivityOccurredGlobal(voteContent)) { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); } else { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } @@ -1414,12 +963,10 @@ voteGeneralMonitoringDTO.setOfflineInstructions(voteContent.getOfflineInstructions()); List attachmentList = voteService.retrieveVoteUploadedFiles(voteContent); - VoteMonitoringAction.logger.debug("attachmentList: " + attachmentList); voteGeneralMonitoringDTO.setAttachmentList(attachmentList); voteGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ - VoteMonitoringAction.logger.debug("voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); if (voteContent != null) { @@ -1428,7 +975,6 @@ EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - VoteMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } @@ -1437,16 +983,12 @@ /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - VoteMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); - if (notebookEntriesExist) { request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - VoteMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions); if (userExceptionNoToolSessions.equals("true")) { - VoteMonitoringAction.logger.debug("there are no online student activity but there are reflections : "); request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } } else { @@ -1455,21 +997,16 @@ /* ... till here */ MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - - VoteMonitoringAction.logger.debug("submitting session to refresh the data from the database: "); return submitSession(mapping, form, request, response, voteService, getMessageService(), voteGeneralMonitoringDTO); } public ActionForward getVoteNomination(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, ToolException { - VoteMonitoringAction.logger.debug("dispatching getVoteNomination..."); IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringAction.logger.debug("voteService :" + voteService); VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; - VoteMonitoringAction.logger.debug("voteMonitoringForm :" + voteMonitoringForm); voteMonitoringForm.setVoteService(voteService); VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); @@ -1478,12 +1015,8 @@ String questionUid = request.getParameter("questionUid"); String sessionUid = request.getParameter("sessionUid"); - VoteMonitoringAction.logger.debug("questionUid: " + questionUid); - VoteMonitoringAction.logger.debug("sessionUid: " + sessionUid); - List userNames = voteService.getStandardAttemptUsersForQuestionContentAndSessionUid(new Long(questionUid), new Long(sessionUid)); - VoteMonitoringAction.logger.debug("userNames: " + userNames); List listVotedLearnersDTO = new LinkedList(); VoteContent voteContent = null; @@ -1492,7 +1025,6 @@ VoteUsrAttempt voteUsrAttempt = (VoteUsrAttempt) userIterator.next(); if (voteUsrAttempt != null) { - VoteMonitoringAction.logger.debug("used voteContent is: "); voteContent = voteUsrAttempt.getVoteQueContent().getVoteContent(); } @@ -1501,120 +1033,90 @@ voteMonitoredUserDTO.setAttemptTime(voteUsrAttempt.getAttemptTime()); listVotedLearnersDTO.add(voteMonitoredUserDTO); } - VoteMonitoringAction.logger.debug("listVoteAllSessionsDTO: " + listVotedLearnersDTO); - VoteMonitoringAction.logger.debug("voteContent: " + voteContent); - EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - VoteMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); } request.setAttribute(VoteAppConstants.EDIT_ACTIVITY_DTO, editActivityDTO); voteGeneralMonitoringDTO.setMapStudentsVoted(listVotedLearnersDTO); voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); - VoteMonitoringAction.logger.debug("ending getVoteNomination, voteGeneralMonitoringDTO: " - + voteGeneralMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); - VoteMonitoringAction.logger.debug("fdwing to: " + VoteAppConstants.VOTE_NOMINATION_VIEWER); return mapping.findForward(VoteAppConstants.VOTE_NOMINATION_VIEWER); } public ActionForward openNotebook(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, ToolException { - VoteMonitoringAction.logger.debug("dispatching openNotebook..."); IVoteService VoteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringAction.logger.debug("VoteService: " + VoteService); String uid = request.getParameter("uid"); - VoteMonitoringAction.logger.debug("uid: " + uid); String userId = request.getParameter("userId"); - VoteMonitoringAction.logger.debug("userId: " + userId); String userName = request.getParameter("userName"); - VoteMonitoringAction.logger.debug("userName: " + userName); String sessionId = request.getParameter("sessionId"); - VoteMonitoringAction.logger.debug("sessionId: " + sessionId); NotebookEntry notebookEntry = VoteService.getEntry(new Long(sessionId), CoreNotebookConstants.NOTEBOOK_TOOL, VoteAppConstants.MY_SIGNATURE, new Integer(userId)); - VoteMonitoringAction.logger.debug("notebookEntry: " + notebookEntry); - VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO = new VoteGeneralLearnerFlowDTO(); if (notebookEntry != null) { String notebookEntryPresentable = VoteUtils.replaceNewLines(notebookEntry.getEntry()); voteGeneralLearnerFlowDTO.setNotebookEntry(notebookEntryPresentable); voteGeneralLearnerFlowDTO.setUserName(userName); } - - VoteMonitoringAction.logger.debug("voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_LEARNER_FLOW_DTO, voteGeneralLearnerFlowDTO); - VoteMonitoringAction.logger.debug("fwding to : " + VoteAppConstants.LEARNER_NOTEBOOK); return mapping.findForward(VoteAppConstants.LEARNER_NOTEBOOK); } protected void repopulateRequestParameters(HttpServletRequest request, VoteMonitoringForm voteMonitoringForm, VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) { - VoteMonitoringAction.logger.debug("starting repopulateRequestParameters"); String toolContentID = request.getParameter(VoteAppConstants.TOOL_CONTENT_ID); - VoteMonitoringAction.logger.debug("toolContentID: " + toolContentID); voteMonitoringForm.setToolContentID(toolContentID); voteGeneralMonitoringDTO.setToolContentID(toolContentID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteMonitoringAction.logger.debug("activeModule: " + activeModule); voteMonitoringForm.setActiveModule(activeModule); voteGeneralMonitoringDTO.setActiveModule(activeModule); String defineLaterInEditMode = request.getParameter(VoteAppConstants.DEFINE_LATER_IN_EDIT_MODE); - VoteMonitoringAction.logger.debug("defineLaterInEditMode: " + defineLaterInEditMode); voteMonitoringForm.setDefineLaterInEditMode(defineLaterInEditMode); voteGeneralMonitoringDTO.setDefineLaterInEditMode(defineLaterInEditMode); String isToolSessionChanged = request.getParameter(VoteAppConstants.IS_TOOL_SESSION_CHANGED); - VoteMonitoringAction.logger.debug("isToolSessionChanged: " + isToolSessionChanged); voteMonitoringForm.setIsToolSessionChanged(isToolSessionChanged); voteGeneralMonitoringDTO.setIsToolSessionChanged(isToolSessionChanged); String responseId = request.getParameter(VoteAppConstants.RESPONSE_ID); - VoteMonitoringAction.logger.debug("responseId: " + responseId); voteMonitoringForm.setResponseId(responseId); voteGeneralMonitoringDTO.setResponseId(responseId); String currentUid = request.getParameter(VoteAppConstants.CURRENT_UID); - VoteMonitoringAction.logger.debug("currentUid: " + currentUid); voteMonitoringForm.setCurrentUid(currentUid); voteGeneralMonitoringDTO.setCurrentUid(currentUid); } protected void repopulateRequestParameters(HttpServletRequest request, VoteMonitoringForm voteMonitoringForm, VoteGeneralAuthoringDTO voteGeneralAuthoringDTO) { - VoteMonitoringAction.logger.debug("starting repopulateRequestParameters"); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); voteMonitoringForm.setContentFolderID(contentFolderID); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); String toolContentID = request.getParameter(VoteAppConstants.TOOL_CONTENT_ID); - VoteMonitoringAction.logger.debug("toolContentID: " + toolContentID); voteMonitoringForm.setToolContentID(toolContentID); voteGeneralAuthoringDTO.setToolContentID(toolContentID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteMonitoringAction.logger.debug("activeModule: " + activeModule); voteMonitoringForm.setActiveModule(activeModule); voteGeneralAuthoringDTO.setActiveModule(activeModule); String defineLaterInEditMode = request.getParameter(VoteAppConstants.DEFINE_LATER_IN_EDIT_MODE); - VoteMonitoringAction.logger.debug("defineLaterInEditMode: " + defineLaterInEditMode); voteMonitoringForm.setDefineLaterInEditMode(defineLaterInEditMode); voteGeneralAuthoringDTO.setDefineLaterInEditMode(defineLaterInEditMode); @@ -1634,13 +1136,10 @@ */ public ActionForward editActivityQuestions(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, ToolException { - VoteMonitoringAction.logger.debug("dispatching editActivityQuestions..."); VoteMonitoringForm VoteMonitoringForm = (VoteMonitoringForm) form; - VoteMonitoringAction.logger.debug("VoteMonitoringForm: " + VoteMonitoringForm); IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringAction.logger.debug("voteService: " + voteService); VoteGeneralMonitoringDTO generalMonitoringDTO = new VoteGeneralMonitoringDTO(); @@ -1652,23 +1151,18 @@ generalMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); - VoteMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, generalMonitoringDTO); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); VoteMonitoringForm.setToolContentID(strToolContentID); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); VoteMonitoringForm.setContentFolderID(contentFolderID); String httpSessionID = request.getParameter("httpSessionID"); - VoteMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); VoteMonitoringForm.setHttpSessionID(httpSessionID); VoteContent voteContent = voteService.retrieveVote(new Long(strToolContentID)); - VoteMonitoringAction.logger.debug("existing voteContent:" + voteContent); VoteMonitoringForm.setTitle(voteContent.getTitle()); @@ -1680,10 +1174,8 @@ prepareReflectionData(request, voteContent, voteService, null, false, "All"); if (voteService.studentActivityOccurredGlobal(voteContent)) { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); } else { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); generalMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } @@ -1692,12 +1184,10 @@ generalMonitoringDTO.setOfflineInstructions(voteContent.getOfflineInstructions()); List attachmentList = voteService.retrieveVoteUploadedFiles(voteContent); - VoteMonitoringAction.logger.debug("attachmentList: " + attachmentList); generalMonitoringDTO.setAttachmentList(attachmentList); generalMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ - VoteMonitoringAction.logger.debug("final generalMonitoringDTO: " + generalMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, generalMonitoringDTO); List listNominationContentDTO = new LinkedList(); @@ -1708,16 +1198,11 @@ VoteQueContent voteQueContent = (VoteQueContent) queIterator.next(); if (voteQueContent != null) { - VoteMonitoringAction.logger.debug("question: " + voteQueContent.getQuestion()); - VoteMonitoringAction.logger.debug("displayorder: " - + new Integer(voteQueContent.getDisplayOrder()).toString()); - voteNominationContentDTO.setQuestion(voteQueContent.getQuestion()); voteNominationContentDTO.setDisplayOrder(new Integer(voteQueContent.getDisplayOrder()).toString()); listNominationContentDTO.add(voteNominationContentDTO); } } - VoteMonitoringAction.logger.debug("listNominationContentDTO: " + listNominationContentDTO); request.setAttribute(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO, listNominationContentDTO); request.setAttribute(VoteAppConstants.TOTAL_NOMINATION_COUNT, new Integer(listNominationContentDTO.size())); @@ -1734,16 +1219,12 @@ /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - VoteMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); - if (notebookEntriesExist) { request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions = generalMonitoringDTO.getUserExceptionNoToolSessions(); - VoteMonitoringAction.logger.debug(": " + userExceptionNoToolSessions); if (userExceptionNoToolSessions.equals("true")) { - VoteMonitoringAction.logger.debug("there are no online student activity but there are reflections : "); request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } } else { @@ -1758,7 +1239,6 @@ } public void prepareEditActivityScreenData(HttpServletRequest request, VoteContent voteContent) { - VoteMonitoringAction.logger.debug("starting prepareEditActivityScreenData: " + voteContent); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); if (voteContent.getTitle() == null) { @@ -1773,13 +1253,11 @@ voteGeneralAuthoringDTO.setActivityInstructions(voteContent.getInstructions()); } - VoteMonitoringAction.logger.debug("final voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); } /** - * submits content into the tool database ActionForward submitAllContent(ActionMapping mapping, ActionForm form, - * HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + * submits content into the tool database * * @param mapping * @param form @@ -1791,64 +1269,42 @@ */ public ActionForward submitAllContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - - VoteMonitoringAction.logger.debug("dispathcing submitAllContent :" + form); - VoteMonitoringForm voteAuthoringForm = (VoteMonitoringForm) form; IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringAction.logger.debug("voteService: " + voteService); String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteMonitoringAction.logger.debug("sessionMap: " + sessionMap); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteMonitoringAction.logger.debug("activeModule: " + activeModule); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); - String defaultContentIdStr = request.getParameter(VoteAppConstants.DEFAULT_CONTENT_ID_STR); - VoteMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); - List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); - VoteMonitoringAction.logger.debug("listNominationContentDTO: " + listNominationContentDTO); - Map mapNominationContent = AuthoringUtil.extractMapNominationContent(listNominationContentDTO); - VoteMonitoringAction.logger.debug("extracted mapNominationContent: " + mapNominationContent); Map mapFeedback = AuthoringUtil.extractMapFeedback(listNominationContentDTO); - VoteMonitoringAction.logger.debug("extracted mapFeedback: " + mapFeedback); ActionMessages errors = new ActionMessages(); - VoteMonitoringAction.logger.debug("mapNominationContent size: " + mapNominationContent.size()); if (mapNominationContent.size() == 0) { ActionMessage error = new ActionMessage("nominations.none.submitted"); errors.add(ActionMessages.GLOBAL_MESSAGE, error); } - VoteMonitoringAction.logger.debug("errors: " + errors); AuthoringUtil authoringUtil = new AuthoringUtil(); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - VoteMonitoringAction.logger.debug("activeModule: " + activeModule); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); String richTextTitle = request.getParameter(VoteAppConstants.TITLE); String richTextInstructions = request.getParameter(VoteAppConstants.INSTRUCTIONS); - VoteMonitoringAction.logger.debug("richTextTitle: " + richTextTitle); - VoteMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions); - voteGeneralAuthoringDTO.setActivityTitle(richTextTitle); voteAuthoringForm.setTitle(richTextTitle); @@ -1858,20 +1314,10 @@ sessionMap.put(VoteAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); voteGeneralAuthoringDTO.setMapNominationContent(mapNominationContent); - VoteMonitoringAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); - - VoteMonitoringAction.logger.debug("voteGeneralAuthoringDTO now: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); - - VoteMonitoringAction.logger.debug("there are no issues with input, continue and submit data"); - VoteContent voteContentTest = voteService.retrieveVote(new Long(strToolContentID)); - VoteMonitoringAction.logger.debug("voteContentTest: " + voteContentTest); - - VoteMonitoringAction.logger.debug("errors: " + errors); if (!errors.isEmpty()) { saveErrors(request, errors); - VoteMonitoringAction.logger.debug("errors saved: " + errors); } repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); @@ -1880,56 +1326,36 @@ VoteContent voteContent = voteContentTest; if (errors.isEmpty()) { - VoteMonitoringAction.logger.debug("errors is empty: " + errors); /* to remove deleted entries in the questions table based on mapNominationContent */ authoringUtil.removeRedundantNominations(mapNominationContent, voteService, voteAuthoringForm, request, strToolContentID); - VoteMonitoringAction.logger.debug("end of removing unused entries... "); voteContent = authoringUtil.saveOrUpdateVoteContent(mapNominationContent, mapFeedback, voteService, voteAuthoringForm, request, voteContentTest, strToolContentID, null); - VoteMonitoringAction.logger.debug("voteContent: " + voteContent); long defaultContentID = 0; - VoteMonitoringAction.logger.debug("attempt retrieving tool with signatute : " - + VoteAppConstants.MY_SIGNATURE); defaultContentID = voteService.getToolDefaultContentIdBySignature(VoteAppConstants.MY_SIGNATURE); - VoteMonitoringAction.logger.debug("retrieved tool default contentId: " + defaultContentID); - if (voteContent != null) { voteGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID).toString()); } - VoteMonitoringAction.logger.debug("updated voteGeneralAuthoringDTO to: " + voteGeneralAuthoringDTO); authoringUtil.reOrganizeDisplayOrder(mapNominationContent, voteService, voteAuthoringForm, voteContent); - VoteMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); VoteUtils.setDefineLater(request, false, strToolContentID, voteService); - VoteMonitoringAction.logger.debug("define later set to false"); // VoteUtils.setFormProperties(request, voteService, // voteAuthoringForm, voteGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, // sessionMap, httpSessionID); voteGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(false).toString()); } else { - VoteMonitoringAction.logger.debug("errors is not empty: " + errors); - if (voteContent != null) { long defaultContentID = 0; - VoteMonitoringAction.logger.debug("attempt retrieving tool with signatute : " - + VoteAppConstants.MY_SIGNATURE); defaultContentID = voteService.getToolDefaultContentIdBySignature(VoteAppConstants.MY_SIGNATURE); - VoteMonitoringAction.logger.debug("retrieved tool default contentId: " + defaultContentID); - if (voteContent != null) { voteGeneralAuthoringDTO.setDefaultContentIdStr(new Long(defaultContentID).toString()); } - // VoteUtils.setFormProperties(request, voteService, - // voteAuthoringForm, voteGeneralAuthoringDTO, strToolContentID, defaultContentIdStr, activeModule, - // sessionMap, httpSessionID); - } voteGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); @@ -1957,14 +1383,11 @@ voteAuthoringForm.setDefaultContentIdStr(defaultContentIdStr); voteAuthoringForm.setCurrentTab("3"); - VoteMonitoringAction.logger.debug("before saving final voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); if (voteService.studentActivityOccurredGlobal(voteContent)) { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); } else { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } @@ -1973,13 +1396,10 @@ voteGeneralMonitoringDTO.setOfflineInstructions(voteContent.getOfflineInstructions()); List attachmentList = voteService.retrieveVoteUploadedFiles(voteContent); - VoteMonitoringAction.logger.debug("attachmentList: " + attachmentList); voteGeneralMonitoringDTO.setAttachmentList(attachmentList); voteGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ - VoteMonitoringAction.logger.debug("end of refreshSummaryData, voteGeneralMonitoringDTO" - + voteGeneralMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); if (voteContent != null) { @@ -1988,7 +1408,6 @@ EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - VoteMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(false).toString()); } @@ -1997,16 +1416,12 @@ /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - VoteMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); - if (notebookEntriesExist) { request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions = voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - VoteMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions); if (userExceptionNoToolSessions.equals("true")) { - VoteMonitoringAction.logger.debug("there are no online student activity but there are reflections : "); request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } } else { @@ -2015,8 +1430,6 @@ /* ... till here */ MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - - VoteMonitoringAction.logger.debug("forwarding to :" + VoteAppConstants.LOAD_MONITORING); return mapping.findForward(VoteAppConstants.LOAD_MONITORING); } @@ -2034,73 +1447,49 @@ public ActionForward saveSingleNomination(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - VoteMonitoringAction.logger.debug("dispathcing saveSingleNomination"); VoteMonitoringForm voteAuthoringForm = (VoteMonitoringForm) form; - IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringAction.logger.debug("voteService: " + voteService); - String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); - SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteMonitoringAction.logger.debug("sessionMap: " + sessionMap); - String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteMonitoringAction.logger.debug("activeModule: " + activeModule); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); String defaultContentIdStr = request.getParameter(VoteAppConstants.DEFAULT_CONTENT_ID_STR); - VoteMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); String editNominationBoxRequest = request.getParameter("editNominationBoxRequest"); - VoteMonitoringAction.logger.debug("editNominationBoxRequest: " + editNominationBoxRequest); VoteContent voteContent = voteService.retrieveVote(new Long(strToolContentID)); - VoteMonitoringAction.logger.debug("voteContent: " + voteContent); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - VoteMonitoringAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); voteGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString()); AuthoringUtil authoringUtil = new AuthoringUtil(); List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); - VoteMonitoringAction.logger.debug("listNominationContentDTO: " + listNominationContentDTO); String newNomination = request.getParameter("newNomination"); - VoteMonitoringAction.logger.debug("newNomination: " + newNomination); String editableNominationIndex = request.getParameter("editableNominationIndex"); - VoteMonitoringAction.logger.debug("editableNominationIndex: " + editableNominationIndex); if (newNomination != null && newNomination.length() > 0) { if (editNominationBoxRequest != null && editNominationBoxRequest.equals("false")) { - VoteMonitoringAction.logger.debug("request for add and save"); boolean duplicates = AuthoringUtil.checkDuplicateNominations(listNominationContentDTO, newNomination); - VoteMonitoringAction.logger.debug("duplicates: " + duplicates); if (!duplicates) { VoteNominationContentDTO voteNominationContentDTO = null; Iterator listIterator = listNominationContentDTO.iterator(); while (listIterator.hasNext()) { voteNominationContentDTO = (VoteNominationContentDTO) listIterator.next(); - VoteMonitoringAction.logger.debug("voteNominationContentDTO:" + voteNominationContentDTO); - VoteMonitoringAction.logger.debug("voteNominationContentDTO question:" - + voteNominationContentDTO.getQuestion()); String question = voteNominationContentDTO.getQuestion(); String displayOrder = voteNominationContentDTO.getDisplayOrder(); - VoteMonitoringAction.logger.debug("displayOrder:" + displayOrder); if (displayOrder != null && !displayOrder.equals("")) { if (displayOrder.equals(editableNominationIndex)) { @@ -2109,32 +1498,23 @@ } } - VoteMonitoringAction.logger.debug("voteNominationContentDTO found:" + voteNominationContentDTO); voteNominationContentDTO.setQuestion(newNomination); voteNominationContentDTO.setDisplayOrder(editableNominationIndex); listNominationContentDTO = AuthoringUtil.reorderUpdateListNominationContentDTO( listNominationContentDTO, voteNominationContentDTO, editableNominationIndex); - VoteMonitoringAction.logger - .debug("post reorderUpdateListNominationContentDTO listNominationContentDTO: " - + listNominationContentDTO); } else { - VoteMonitoringAction.logger.debug("duplicate question entry, not adding"); + //duplicate question entry, not adding } } else { - VoteMonitoringAction.logger.debug("request for edit and save."); VoteNominationContentDTO voteNominationContentDTO = null; Iterator listIterator = listNominationContentDTO.iterator(); while (listIterator.hasNext()) { voteNominationContentDTO = (VoteNominationContentDTO) listIterator.next(); - VoteMonitoringAction.logger.debug("voteNominationContentDTO:" + voteNominationContentDTO); - VoteMonitoringAction.logger.debug("voteNominationContentDTO question:" - + voteNominationContentDTO.getQuestion()); String question = voteNominationContentDTO.getQuestion(); String displayOrder = voteNominationContentDTO.getDisplayOrder(); - VoteMonitoringAction.logger.debug("displayOrder:" + displayOrder); if (displayOrder != null && !displayOrder.equals("")) { if (displayOrder.equals(editableNominationIndex)) { @@ -2143,29 +1523,23 @@ } } - VoteMonitoringAction.logger.debug("voteNominationContentDTO found:" + voteNominationContentDTO); voteNominationContentDTO.setQuestion(newNomination); voteNominationContentDTO.setDisplayOrder(editableNominationIndex); listNominationContentDTO = AuthoringUtil.reorderUpdateListNominationContentDTO( listNominationContentDTO, voteNominationContentDTO, editableNominationIndex); - VoteMonitoringAction.logger.debug("post reorderUpdateListQuestionContentDTO listQuestionContentDTO: " - + listNominationContentDTO); } } else { - VoteMonitoringAction.logger.debug("entry blank, not adding"); + //entry blank, not adding } request.setAttribute(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO, listNominationContentDTO); sessionMap.put(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY, listNominationContentDTO); - VoteMonitoringAction.logger.debug("listNominationContentDTO now: " + listNominationContentDTO); String richTextTitle = request.getParameter(VoteAppConstants.TITLE); String richTextInstructions = request.getParameter(VoteAppConstants.INSTRUCTIONS); - VoteMonitoringAction.logger.debug("richTextTitle: " + richTextTitle); - VoteMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions); voteGeneralAuthoringDTO.setActivityTitle(richTextTitle); voteAuthoringForm.setTitle(richTextTitle); @@ -2174,7 +1548,6 @@ sessionMap.put(VoteAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); sessionMap.put(VoteAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); - VoteMonitoringAction.logger.debug("activeModule: " + activeModule); voteGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString()); request.getSession().setAttribute(httpSessionID, sessionMap); @@ -2198,16 +1571,9 @@ voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); - VoteMonitoringAction.logger.debug("voteGeneralAuthoringDTO now: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); - VoteMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); - VoteMonitoringAction.logger.debug("sessionMap: " + sessionMap); - request.getSession().setAttribute(httpSessionID, sessionMap); - VoteMonitoringAction.logger.debug("voteGeneralAuthoringDTO.getMapNominationContent(); " - + voteGeneralAuthoringDTO.getMapNominationContent()); - request.setAttribute(VoteAppConstants.TOTAL_NOMINATION_COUNT, new Integer(listNominationContentDTO.size())); if (voteContent != null) { @@ -2216,7 +1582,6 @@ EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - VoteMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(false).toString()); } @@ -2227,10 +1592,8 @@ voteGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); if (voteService.studentActivityOccurredGlobal(voteContent)) { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); } else { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } @@ -2239,27 +1602,21 @@ voteGeneralMonitoringDTO.setOfflineInstructions(voteContent.getOfflineInstructions()); List attachmentList = voteService.retrieveVoteUploadedFiles(voteContent); - VoteMonitoringAction.logger.debug("attachmentList: " + attachmentList); voteGeneralMonitoringDTO.setAttachmentList(attachmentList); voteGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ - VoteMonitoringAction.logger.debug("end of refreshSummaryData, voteGeneralMonitoringDTO" - + voteGeneralMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - VoteMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); if (notebookEntriesExist) { request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions = voteGeneralAuthoringDTO.getUserExceptionNoToolSessions(); - VoteMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions); if (userExceptionNoToolSessions.equals("true")) { - VoteMonitoringAction.logger.debug("there are no online student activity but there are reflections : "); request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } } else { @@ -2269,7 +1626,6 @@ MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - VoteMonitoringAction.logger.debug("fwd ing to LOAD_MONITORING: " + VoteAppConstants.LOAD_MONITORING); return mapping.findForward(VoteAppConstants.LOAD_MONITORING); } @@ -2287,68 +1643,48 @@ public ActionForward addSingleNomination(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - VoteMonitoringAction.logger.debug("dispathcing addSingleNomination"); VoteMonitoringForm voteAuthoringForm = (VoteMonitoringForm) form; IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringAction.logger.debug("voteService: " + voteService); String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteMonitoringAction.logger.debug("sessionMap: " + sessionMap); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteMonitoringAction.logger.debug("activeModule: " + activeModule); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); String defaultContentIdStr = request.getParameter(VoteAppConstants.DEFAULT_CONTENT_ID_STR); - VoteMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); VoteContent voteContent = voteService.retrieveVote(new Long(strToolContentID)); - VoteMonitoringAction.logger.debug("voteContent: " + voteContent); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - VoteMonitoringAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); voteGeneralAuthoringDTO.setSbmtSuccess(new Integer(0).toString()); AuthoringUtil authoringUtil = new AuthoringUtil(); List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); - VoteMonitoringAction.logger.debug("listNominationContentDTO: " + listNominationContentDTO); String newNomination = request.getParameter("newNomination"); - VoteMonitoringAction.logger.debug("newNomination: " + newNomination); int listSize = listNominationContentDTO.size(); - VoteMonitoringAction.logger.debug("listSize: " + listSize); if (newNomination != null && newNomination.length() > 0) { boolean duplicates = AuthoringUtil.checkDuplicateNominations(listNominationContentDTO, newNomination); - VoteMonitoringAction.logger.debug("duplicates: " + duplicates); if (!duplicates) { VoteNominationContentDTO voteNominationContentDTO = new VoteNominationContentDTO(); voteNominationContentDTO.setDisplayOrder(new Long(listSize + 1).toString()); voteNominationContentDTO.setNomination(newNomination); listNominationContentDTO.add(voteNominationContentDTO); - VoteMonitoringAction.logger.debug("updated listNominationContentDTO: " + listNominationContentDTO); - } else { - VoteMonitoringAction.logger.debug("entry duplicate, not adding"); - } - } else { - VoteMonitoringAction.logger.debug("entry blank, not adding"); } request.setAttribute(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO, listNominationContentDTO); @@ -2357,8 +1693,6 @@ String richTextTitle = request.getParameter(VoteAppConstants.TITLE); String richTextInstructions = request.getParameter(VoteAppConstants.INSTRUCTIONS); - VoteMonitoringAction.logger.debug("richTextTitle: " + richTextTitle); - VoteMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions); voteGeneralAuthoringDTO.setActivityTitle(richTextTitle); voteAuthoringForm.setTitle(richTextTitle); @@ -2367,8 +1701,6 @@ sessionMap.put(VoteAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); sessionMap.put(VoteAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); - VoteMonitoringAction.logger.debug("activeModule: " + activeModule); - voteGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString()); request.getSession().setAttribute(httpSessionID, sessionMap); @@ -2386,16 +1718,10 @@ voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); - VoteMonitoringAction.logger.debug("voteGeneralAuthoringDTO now: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); - VoteMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); - VoteMonitoringAction.logger.debug("sessionMap: " + sessionMap); - request.getSession().setAttribute(httpSessionID, sessionMap); - VoteMonitoringAction.logger.debug("voteGeneralAuthoringDTO.getMapNominationContent(); " - + voteGeneralAuthoringDTO.getMapNominationContent()); request.setAttribute(VoteAppConstants.TOTAL_NOMINATION_COUNT, new Integer(listNominationContentDTO.size())); if (voteContent != null) { @@ -2407,10 +1733,8 @@ voteGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); if (voteService.studentActivityOccurredGlobal(voteContent)) { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); } else { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } @@ -2419,27 +1743,21 @@ voteGeneralMonitoringDTO.setOfflineInstructions(voteContent.getOfflineInstructions()); List attachmentList = voteService.retrieveVoteUploadedFiles(voteContent); - VoteMonitoringAction.logger.debug("attachmentList: " + attachmentList); voteGeneralMonitoringDTO.setAttachmentList(attachmentList); voteGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ - VoteMonitoringAction.logger.debug("end of refreshSummaryData, voteGeneralMonitoringDTO" - + voteGeneralMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - VoteMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); if (notebookEntriesExist) { request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions = voteGeneralAuthoringDTO.getUserExceptionNoToolSessions(); - VoteMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions); if (userExceptionNoToolSessions.equals("true")) { - VoteMonitoringAction.logger.debug("there are no online student activity but there are reflections : "); request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } } else { @@ -2449,7 +1767,6 @@ MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - VoteMonitoringAction.logger.debug("fwd ing to LOAD_MONITORING: " + VoteAppConstants.LOAD_MONITORING); return mapping.findForward(VoteAppConstants.LOAD_MONITORING); } @@ -2468,58 +1785,42 @@ */ public ActionForward newNominationBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - VoteMonitoringAction.logger.debug("dispathcing newNominationBox"); VoteMonitoringForm voteAuthoringForm = (VoteMonitoringForm) form; IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringAction.logger.debug("voteService: " + voteService); String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteMonitoringAction.logger.debug("sessionMap: " + sessionMap); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteMonitoringAction.logger.debug("activeModule: " + activeModule); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); String defaultContentIdStr = request.getParameter(VoteAppConstants.DEFAULT_CONTENT_ID_STR); - VoteMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); VoteContent voteContent = voteService.retrieveVote(new Long(strToolContentID)); - VoteMonitoringAction.logger.debug("voteContent: " + voteContent); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - VoteMonitoringAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); String richTextTitle = request.getParameter(VoteAppConstants.TITLE); String richTextInstructions = request.getParameter(VoteAppConstants.INSTRUCTIONS); - VoteMonitoringAction.logger.debug("richTextTitle: " + richTextTitle); - VoteMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions); voteGeneralAuthoringDTO.setActivityTitle(richTextTitle); voteAuthoringForm.setTitle(richTextTitle); voteGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); - VoteMonitoringAction.logger.debug("activeModule: " + activeModule); - voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); - VoteMonitoringAction.logger.debug("voteGeneralAuthoringDTO now: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); - VoteMonitoringAction.logger.debug("listNominationContentDTO: " + listNominationContentDTO); request.setAttribute(VoteAppConstants.TOTAL_NOMINATION_COUNT, new Integer(listNominationContentDTO.size())); if (voteContent != null) { @@ -2528,7 +1829,6 @@ EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - VoteMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(false).toString()); } @@ -2539,10 +1839,8 @@ voteGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); if (voteService.studentActivityOccurredGlobal(voteContent)) { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); } else { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } @@ -2551,27 +1849,21 @@ voteGeneralMonitoringDTO.setOfflineInstructions(voteContent.getOfflineInstructions()); List attachmentList = voteService.retrieveVoteUploadedFiles(voteContent); - VoteMonitoringAction.logger.debug("attachmentList: " + attachmentList); voteGeneralMonitoringDTO.setAttachmentList(attachmentList); voteGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ - VoteMonitoringAction.logger.debug("end of refreshSummaryData, voteGeneralMonitoringDTO" - + voteGeneralMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - VoteMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); if (notebookEntriesExist) { request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions = voteGeneralAuthoringDTO.getUserExceptionNoToolSessions(); - VoteMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions); if (userExceptionNoToolSessions.equals("true")) { - VoteMonitoringAction.logger.debug("there are no online student activity but there are reflections : "); request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } } else { @@ -2580,8 +1872,6 @@ /* ... till here */ MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - - VoteMonitoringAction.logger.debug("fwd ing to newNominationBox: "); return mapping.findForward("newNominationBox"); } @@ -2598,72 +1888,52 @@ */ public ActionForward newEditableNominationBox(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - VoteMonitoringAction.logger.debug("dispathcing newEditableNominationBox"); VoteMonitoringForm voteAuthoringForm = (VoteMonitoringForm) form; IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringAction.logger.debug("voteService: " + voteService); - String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteMonitoringAction.logger.debug("sessionMap: " + sessionMap); String questionIndex = request.getParameter("questionIndex"); - VoteMonitoringAction.logger.debug("questionIndex: " + questionIndex); voteAuthoringForm.setEditableNominationIndex(questionIndex); List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); - VoteMonitoringAction.logger.debug("listNominationContentDTO: " + listNominationContentDTO); String editableNomination = ""; Iterator listIterator = listNominationContentDTO.iterator(); while (listIterator.hasNext()) { VoteNominationContentDTO voteNominationContentDTO = (VoteNominationContentDTO) listIterator.next(); - VoteMonitoringAction.logger.debug("voteNominationContentDTO:" + voteNominationContentDTO); - VoteMonitoringAction.logger.debug("voteNominationContentDTO question:" - + voteNominationContentDTO.getNomination()); String question = voteNominationContentDTO.getNomination(); String displayOrder = voteNominationContentDTO.getDisplayOrder(); if (displayOrder != null && !displayOrder.equals("")) { if (displayOrder.equals(questionIndex)) { editableNomination = voteNominationContentDTO.getNomination(); - VoteMonitoringAction.logger.debug("editableNomination found :" + editableNomination); break; } } } - VoteMonitoringAction.logger.debug("editableNomination found :" + editableNomination); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteMonitoringAction.logger.debug("activeModule: " + activeModule); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); String defaultContentIdStr = request.getParameter(VoteAppConstants.DEFAULT_CONTENT_ID_STR); - VoteMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); VoteContent voteContent = voteService.retrieveVote(new Long(strToolContentID)); - VoteMonitoringAction.logger.debug("voteContent: " + voteContent); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - VoteMonitoringAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); String richTextTitle = request.getParameter(VoteAppConstants.TITLE); String richTextInstructions = request.getParameter(VoteAppConstants.INSTRUCTIONS); - VoteMonitoringAction.logger.debug("richTextTitle: " + richTextTitle); - VoteMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions); voteGeneralAuthoringDTO.setActivityTitle(richTextTitle); voteAuthoringForm.setTitle(richTextTitle); @@ -2672,7 +1942,6 @@ voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); - VoteMonitoringAction.logger.debug("voteGeneralAuthoringDTO now: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.TOTAL_NOMINATION_COUNT, new Integer(listNominationContentDTO.size())); @@ -2682,7 +1951,6 @@ EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - VoteMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(false).toString()); } @@ -2693,10 +1961,8 @@ voteGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); if (voteService.studentActivityOccurredGlobal(voteContent)) { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); } else { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } @@ -2705,27 +1971,20 @@ voteGeneralMonitoringDTO.setOfflineInstructions(voteContent.getOfflineInstructions()); List attachmentList = voteService.retrieveVoteUploadedFiles(voteContent); - VoteMonitoringAction.logger.debug("attachmentList: " + attachmentList); voteGeneralMonitoringDTO.setAttachmentList(attachmentList); voteGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ - VoteMonitoringAction.logger.debug("end of refreshSummaryData, voteGeneralMonitoringDTO" - + voteGeneralMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - VoteMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); if (notebookEntriesExist) { request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions = voteGeneralAuthoringDTO.getUserExceptionNoToolSessions(); - VoteMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions); - if (userExceptionNoToolSessions.equals("true")) { - VoteMonitoringAction.logger.debug("there are no online student activity but there are reflections : "); request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } } else { @@ -2734,14 +1993,11 @@ /* ... till here */ MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - - VoteMonitoringAction.logger.debug("fwd ing to editNominationBox: "); return mapping.findForward("editNominationBox"); } /** - * removes a question from the questions map ActionForward removeNomination(ActionMapping mapping, ActionForm form, - * HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException + * removes a question from the questions map * * @param mapping * @param form @@ -2753,35 +2009,24 @@ */ public ActionForward removeNomination(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - VoteMonitoringAction.logger.debug("dispatching removeNomination"); VoteMonitoringForm voteAuthoringForm = (VoteMonitoringForm) form; IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringAction.logger.debug("voteService: " + voteService); - String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteMonitoringAction.logger.debug("sessionMap: " + sessionMap); String questionIndex = request.getParameter("questionIndex"); - VoteMonitoringAction.logger.debug("questionIndex: " + questionIndex); List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); - VoteMonitoringAction.logger.debug("listNominationContentDTO: " + listNominationContentDTO); VoteNominationContentDTO voteNominationContentDTO = null; Iterator listIterator = listNominationContentDTO.iterator(); while (listIterator.hasNext()) { voteNominationContentDTO = (VoteNominationContentDTO) listIterator.next(); - VoteMonitoringAction.logger.debug("voteNominationContentDTO:" + voteNominationContentDTO); - VoteMonitoringAction.logger.debug("voteNominationContentDTO question:" - + voteNominationContentDTO.getNomination()); String question = voteNominationContentDTO.getNomination(); String displayOrder = voteNominationContentDTO.getDisplayOrder(); - VoteMonitoringAction.logger.debug("displayOrder:" + displayOrder); if (displayOrder != null && !displayOrder.equals("")) { if (displayOrder.equals(questionIndex)) { @@ -2791,50 +2036,36 @@ } } - VoteMonitoringAction.logger.debug("voteNominationContentDTO found:" + voteNominationContentDTO); voteNominationContentDTO.setNomination(""); - VoteMonitoringAction.logger.debug("listNominationContentDTO after remove:" + listNominationContentDTO); listNominationContentDTO = AuthoringUtil.reorderListNominationContentDTO(listNominationContentDTO, questionIndex); - VoteMonitoringAction.logger.debug("listNominationContentDTO reordered:" + listNominationContentDTO); sessionMap.put(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY, listNominationContentDTO); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteMonitoringAction.logger.debug("activeModule: " + activeModule); String richTextTitle = request.getParameter(VoteAppConstants.TITLE); - VoteMonitoringAction.logger.debug("richTextTitle: " + richTextTitle); String richTextInstructions = request.getParameter(VoteAppConstants.INSTRUCTIONS); - VoteMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions); sessionMap.put(VoteAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); sessionMap.put(VoteAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); String defaultContentIdStr = request.getParameter(VoteAppConstants.DEFAULT_CONTENT_ID_STR); - VoteMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); VoteContent voteContent = voteService.retrieveVote(new Long(strToolContentID)); - VoteMonitoringAction.logger.debug("voteContent: " + voteContent); if (voteContent == null) { - VoteMonitoringAction.logger.debug("using defaultContentIdStr: " + defaultContentIdStr); voteContent = voteService.retrieveVote(new Long(defaultContentIdStr)); - } - VoteMonitoringAction.logger.debug("final voteContent: " + voteContent); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - VoteMonitoringAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); voteGeneralAuthoringDTO.setActivityTitle(richTextTitle); @@ -2859,13 +2090,10 @@ voteAuthoringForm.setCurrentTab("3"); request.setAttribute(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO, listNominationContentDTO); - VoteMonitoringAction.logger.debug("voteNominationContentDTO now: " + voteNominationContentDTO); - VoteMonitoringAction.logger.debug("listNominationContentDTO now: " + listNominationContentDTO); voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); - VoteMonitoringAction.logger.debug("before saving final voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.TOTAL_NOMINATION_COUNT, new Integer(listNominationContentDTO.size())); @@ -2875,7 +2103,6 @@ EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - VoteMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(false).toString()); } @@ -2884,16 +2111,13 @@ /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - VoteMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); voteGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); if (voteService.studentActivityOccurredGlobal(voteContent)) { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); } else { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } @@ -2902,23 +2126,18 @@ voteGeneralMonitoringDTO.setOfflineInstructions(voteContent.getOfflineInstructions()); List attachmentList = voteService.retrieveVoteUploadedFiles(voteContent); - VoteMonitoringAction.logger.debug("attachmentList: " + attachmentList); voteGeneralMonitoringDTO.setAttachmentList(attachmentList); voteGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ - VoteMonitoringAction.logger.debug("end of refreshSummaryData, voteGeneralMonitoringDTO" - + voteGeneralMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); if (notebookEntriesExist) { request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions = voteGeneralAuthoringDTO.getUserExceptionNoToolSessions(); - VoteMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions); if (userExceptionNoToolSessions.equals("true")) { - VoteMonitoringAction.logger.debug("there are no online student activity but there are reflections : "); request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } } else { @@ -2928,7 +2147,6 @@ MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - VoteMonitoringAction.logger.debug("fwd ing to LOAD_MONITORING: " + VoteAppConstants.LOAD_MONITORING); return mapping.findForward(VoteAppConstants.LOAD_MONITORING); } @@ -2945,59 +2163,43 @@ */ public ActionForward moveNominationDown(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - VoteMonitoringAction.logger.debug("dispatching moveNominationDown"); VoteMonitoringForm voteAuthoringForm = (VoteMonitoringForm) form; IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringAction.logger.debug("voteService: " + voteService); String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteMonitoringAction.logger.debug("sessionMap: " + sessionMap); String questionIndex = request.getParameter("questionIndex"); - VoteMonitoringAction.logger.debug("questionIndex: " + questionIndex); List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); - VoteMonitoringAction.logger.debug("listNominationContentDTO: " + listNominationContentDTO); listNominationContentDTO = AuthoringUtil.swapNodes(listNominationContentDTO, questionIndex, "down"); - VoteMonitoringAction.logger.debug("listNominationContentDTO after swap: " + listNominationContentDTO); listNominationContentDTO = AuthoringUtil.reorderSimpleListNominationContentDTO(listNominationContentDTO); - VoteMonitoringAction.logger.debug("listNominationContentDTO after reordersimple: " + listNominationContentDTO); sessionMap.put(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY, listNominationContentDTO); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteMonitoringAction.logger.debug("activeModule: " + activeModule); String richTextTitle = request.getParameter(VoteAppConstants.TITLE); - VoteMonitoringAction.logger.debug("richTextTitle: " + richTextTitle); String richTextInstructions = request.getParameter(VoteAppConstants.INSTRUCTIONS); - VoteMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions); sessionMap.put(VoteAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); sessionMap.put(VoteAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); String defaultContentIdStr = request.getParameter(VoteAppConstants.DEFAULT_CONTENT_ID_STR); - VoteMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); VoteContent voteContent = voteService.retrieveVote(new Long(strToolContentID)); - VoteMonitoringAction.logger.debug("voteContent: " + voteContent); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - VoteMonitoringAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); voteGeneralAuthoringDTO.setActivityTitle(richTextTitle); @@ -3022,12 +2224,10 @@ voteAuthoringForm.setCurrentTab("3"); request.setAttribute(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO, listNominationContentDTO); - VoteMonitoringAction.logger.debug("listNominationContentDTO now: " + listNominationContentDTO); voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); - VoteMonitoringAction.logger.debug("before saving final voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.TOTAL_NOMINATION_COUNT, new Integer(listNominationContentDTO.size())); @@ -3037,7 +2237,6 @@ EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - VoteMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(false).toString()); } @@ -3046,16 +2245,13 @@ /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - VoteMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); voteGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); if (voteService.studentActivityOccurredGlobal(voteContent)) { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); } else { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } @@ -3064,23 +2260,18 @@ voteGeneralMonitoringDTO.setOfflineInstructions(voteContent.getOfflineInstructions()); List attachmentList = voteService.retrieveVoteUploadedFiles(voteContent); - VoteMonitoringAction.logger.debug("attachmentList: " + attachmentList); voteGeneralMonitoringDTO.setAttachmentList(attachmentList); voteGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ - VoteMonitoringAction.logger.debug("end of refreshSummaryData, voteGeneralMonitoringDTO" - + voteGeneralMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); if (notebookEntriesExist) { request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions = voteGeneralAuthoringDTO.getUserExceptionNoToolSessions(); - VoteMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions); if (userExceptionNoToolSessions.equals("true")) { - VoteMonitoringAction.logger.debug("there are no online student activity but there are reflections : "); request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } } else { @@ -3090,7 +2281,6 @@ MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - VoteMonitoringAction.logger.debug("fwd ing to LOAD_MONITORING: " + VoteAppConstants.LOAD_MONITORING); return mapping.findForward(VoteAppConstants.LOAD_MONITORING); } @@ -3107,59 +2297,43 @@ */ public ActionForward moveNominationUp(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - VoteMonitoringAction.logger.debug("dispatching moveNominationUp"); VoteMonitoringForm voteAuthoringForm = (VoteMonitoringForm) form; IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - VoteMonitoringAction.logger.debug("voteService: " + voteService); String httpSessionID = voteAuthoringForm.getHttpSessionID(); - VoteMonitoringAction.logger.debug("httpSessionID: " + httpSessionID); SessionMap sessionMap = (SessionMap) request.getSession().getAttribute(httpSessionID); - VoteMonitoringAction.logger.debug("sessionMap: " + sessionMap); String questionIndex = request.getParameter("questionIndex"); - VoteMonitoringAction.logger.debug("questionIndex: " + questionIndex); List listNominationContentDTO = (List) sessionMap.get(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY); - VoteMonitoringAction.logger.debug("listNominationContentDTO: " + listNominationContentDTO); listNominationContentDTO = AuthoringUtil.swapNodes(listNominationContentDTO, questionIndex, "up"); - VoteMonitoringAction.logger.debug("listNominationContentDTO after swap: " + listNominationContentDTO); listNominationContentDTO = AuthoringUtil.reorderSimpleListNominationContentDTO(listNominationContentDTO); - VoteMonitoringAction.logger.debug("listNominationContentDTO after reordersimple: " + listNominationContentDTO); sessionMap.put(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY, listNominationContentDTO); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteMonitoringAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); String activeModule = request.getParameter(VoteAppConstants.ACTIVE_MODULE); - VoteMonitoringAction.logger.debug("activeModule: " + activeModule); String richTextTitle = request.getParameter(VoteAppConstants.TITLE); - VoteMonitoringAction.logger.debug("richTextTitle: " + richTextTitle); String richTextInstructions = request.getParameter(VoteAppConstants.INSTRUCTIONS); - VoteMonitoringAction.logger.debug("richTextInstructions: " + richTextInstructions); sessionMap.put(VoteAppConstants.ACTIVITY_TITLE_KEY, richTextTitle); sessionMap.put(VoteAppConstants.ACTIVITY_INSTRUCTIONS_KEY, richTextInstructions); String strToolContentID = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteMonitoringAction.logger.debug("strToolContentID: " + strToolContentID); String defaultContentIdStr = request.getParameter(VoteAppConstants.DEFAULT_CONTENT_ID_STR); - VoteMonitoringAction.logger.debug("defaultContentIdStr: " + defaultContentIdStr); VoteContent voteContent = voteService.retrieveVote(new Long(strToolContentID)); - VoteMonitoringAction.logger.debug("voteContent: " + voteContent); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - VoteMonitoringAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); voteGeneralAuthoringDTO.setActivityTitle(richTextTitle); @@ -3184,12 +2358,10 @@ voteAuthoringForm.setCurrentTab("3"); request.setAttribute(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO, listNominationContentDTO); - VoteMonitoringAction.logger.debug("listNominationContentDTO now: " + listNominationContentDTO); voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); - VoteMonitoringAction.logger.debug("before saving final voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.TOTAL_NOMINATION_COUNT, new Integer(listNominationContentDTO.size())); @@ -3200,7 +2372,6 @@ EditActivityDTO editActivityDTO = new EditActivityDTO(); boolean isContentInUse = VoteUtils.isContentInUse(voteContent); - VoteMonitoringAction.logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(false).toString()); } @@ -3209,16 +2380,12 @@ /* find out if there are any reflection entries, from here */ boolean notebookEntriesExist = MonitoringUtil.notebookEntriesExist(voteService, voteContent); - VoteMonitoringAction.logger.debug("notebookEntriesExist : " + notebookEntriesExist); - VoteGeneralMonitoringDTO voteGeneralMonitoringDTO = new VoteGeneralMonitoringDTO(); voteGeneralMonitoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); if (voteService.studentActivityOccurredGlobal(voteContent)) { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); } else { - VoteMonitoringAction.logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); } @@ -3227,23 +2394,17 @@ voteGeneralMonitoringDTO.setOfflineInstructions(voteContent.getOfflineInstructions()); List attachmentList = voteService.retrieveVoteUploadedFiles(voteContent); - VoteMonitoringAction.logger.debug("attachmentList: " + attachmentList); voteGeneralMonitoringDTO.setAttachmentList(attachmentList); voteGeneralMonitoringDTO.setDeletedAttachmentList(new ArrayList()); /** ...till here * */ - VoteMonitoringAction.logger.debug("end of refreshSummaryData, voteGeneralMonitoringDTO" - + voteGeneralMonitoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); if (notebookEntriesExist) { request.setAttribute(VoteAppConstants.NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions = voteGeneralAuthoringDTO.getUserExceptionNoToolSessions(); - VoteMonitoringAction.logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions); - if (userExceptionNoToolSessions.equals("true")) { - VoteMonitoringAction.logger.debug("there are no online student activity but there are reflections : "); request.setAttribute(VoteAppConstants.NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } } else { @@ -3253,22 +2414,14 @@ MonitoringUtil.buildVoteStatsDTO(request, voteService, voteContent); - VoteMonitoringAction.logger.debug("fwd ing to LOAD_MONITORING: " + VoteAppConstants.LOAD_MONITORING); return mapping.findForward(VoteAppConstants.LOAD_MONITORING); } public void prepareReflectionData(HttpServletRequest request, VoteContent voteContent, IVoteService voteService, String userID, boolean exportMode, String currentSessionId) { - VoteMonitoringAction.logger.debug("starting prepareReflectionData: " + voteContent); - VoteMonitoringAction.logger.debug("currentSessionId: " + currentSessionId); - VoteMonitoringAction.logger.debug("userID: " + userID); - VoteMonitoringAction.logger.debug("exportMode: " + exportMode); - List reflectionsContainerDTO = new LinkedList(); reflectionsContainerDTO = getReflectionList(voteContent, userID, voteService); - - VoteMonitoringAction.logger.debug("reflectionsContainerDTO: " + reflectionsContainerDTO); request.setAttribute(VoteAppConstants.REFLECTIONS_CONTAINER_DTO, reflectionsContainerDTO); if (exportMode) { @@ -3287,25 +2440,18 @@ * @return */ public List getReflectionList(VoteContent voteContent, String userID, IVoteService voteService) { - VoteMonitoringAction.logger.debug("getting reflections for all sessions"); List reflectionsContainerDTO = new LinkedList(); if (userID == null) { - VoteMonitoringAction.logger.debug("all users mode"); for (Iterator sessionIter = voteContent.getVoteSessions().iterator(); sessionIter.hasNext();) { VoteSession voteSession = (VoteSession) sessionIter.next(); - VoteMonitoringAction.logger.debug("voteSession: " + voteSession); - VoteMonitoringAction.logger.debug("voteSession sessionId: " + voteSession.getVoteSessionId()); for (Iterator userIter = voteSession.getVoteQueUsers().iterator(); userIter.hasNext();) { VoteQueUsr user = (VoteQueUsr) userIter.next(); - VoteMonitoringAction.logger.debug("user: " + user); NotebookEntry notebookEntry = voteService.getEntry(voteSession.getVoteSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, VoteAppConstants.MY_SIGNATURE, new Integer(user .getQueUsrId().toString())); - VoteMonitoringAction.logger.debug("notebookEntry: " + notebookEntry); - if (notebookEntry != null) { ReflectionDTO reflectionDTO = new ReflectionDTO(); reflectionDTO.setUserId(user.getQueUsrId().toString()); @@ -3319,22 +2465,15 @@ } } } else { - VoteMonitoringAction.logger.debug("single user mode"); for (Iterator sessionIter = voteContent.getVoteSessions().iterator(); sessionIter.hasNext();) { VoteSession voteSession = (VoteSession) sessionIter.next(); - VoteMonitoringAction.logger.debug("voteSession: " + voteSession); for (Iterator userIter = voteSession.getVoteQueUsers().iterator(); userIter.hasNext();) { VoteQueUsr user = (VoteQueUsr) userIter.next(); - VoteMonitoringAction.logger.debug("user: " + user); - if (user.getQueUsrId().toString().equals(userID)) { - VoteMonitoringAction.logger.debug("getting reflection for user with userID: " + userID); NotebookEntry notebookEntry = voteService.getEntry(voteSession.getVoteSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, VoteAppConstants.MY_SIGNATURE, new Integer(user .getQueUsrId().toString())); - VoteMonitoringAction.logger.debug("notebookEntry: " + notebookEntry); - if (notebookEntry != null) { ReflectionDTO reflectionDTO = new ReflectionDTO(); reflectionDTO.setUserId(user.getQueUsrId().toString()); @@ -3356,9 +2495,6 @@ /** * returns reflection data for a specific session * - * getReflectionListForSession(VoteContent voteContent, String userID, IVoteService voteService, String - * currentSessionId) - * * @param voteContent * @param userID * @param voteService @@ -3367,29 +2503,21 @@ */ public List getReflectionListForSession(VoteContent voteContent, String userID, IVoteService voteService, String currentSessionId) { - VoteMonitoringAction.logger.debug("getting reflections for a specific session"); - VoteMonitoringAction.logger.debug("currentSessionId: " + currentSessionId); List reflectionsContainerDTO = new LinkedList(); if (userID == null) { - VoteMonitoringAction.logger.debug("all users mode"); for (Iterator sessionIter = voteContent.getVoteSessions().iterator(); sessionIter.hasNext();) { VoteSession voteSession = (VoteSession) sessionIter.next(); - VoteMonitoringAction.logger.debug("voteSession: " + voteSession); - VoteMonitoringAction.logger.debug("voteSession sessionId: " + voteSession.getVoteSessionId()); if (currentSessionId.equals(voteSession.getVoteSessionId())) { for (Iterator userIter = voteSession.getVoteQueUsers().iterator(); userIter.hasNext();) { VoteQueUsr user = (VoteQueUsr) userIter.next(); - VoteMonitoringAction.logger.debug("user: " + user); NotebookEntry notebookEntry = voteService.getEntry(voteSession.getVoteSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, VoteAppConstants.MY_SIGNATURE, new Integer(user .getQueUsrId().toString())); - VoteMonitoringAction.logger.debug("notebookEntry: " + notebookEntry); - if (notebookEntry != null) { ReflectionDTO reflectionDTO = new ReflectionDTO(); reflectionDTO.setUserId(user.getQueUsrId().toString()); @@ -3404,24 +2532,18 @@ } } } else { - VoteMonitoringAction.logger.debug("single user mode"); for (Iterator sessionIter = voteContent.getVoteSessions().iterator(); sessionIter.hasNext();) { VoteSession voteSession = (VoteSession) sessionIter.next(); - VoteMonitoringAction.logger.debug("voteSession: " + voteSession); if (currentSessionId.equals(voteSession.getVoteSessionId())) { for (Iterator userIter = voteSession.getVoteQueUsers().iterator(); userIter.hasNext();) { VoteQueUsr user = (VoteQueUsr) userIter.next(); - VoteMonitoringAction.logger.debug("user: " + user); if (user.getQueUsrId().toString().equals(userID)) { - VoteMonitoringAction.logger.debug("getting reflection for user with userID: " + userID); NotebookEntry notebookEntry = voteService.getEntry(voteSession.getVoteSessionId(), CoreNotebookConstants.NOTEBOOK_TOOL, VoteAppConstants.MY_SIGNATURE, new Integer( user.getQueUsrId().toString())); - VoteMonitoringAction.logger.debug("notebookEntry: " + notebookEntry); - if (notebookEntry != null) { ReflectionDTO reflectionDTO = new ReflectionDTO(); reflectionDTO.setUserId(user.getQueUsrId().toString()); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java =================================================================== diff -u -rddc0da3d278fb12ac8374ad59146a8990ea2f3a2 -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision ddc0da3d278fb12ac8374ad59146a8990ea2f3a2) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -64,61 +64,25 @@ *

Starts up the monitoring module

* * @author Ozgur Demirtas - * - - - - - - - - - - - - * */ - public class VoteMonitoringStarterAction extends Action implements VoteAppConstants { static Logger logger = Logger.getLogger(VoteMonitoringStarterAction.class.getName()); public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, VoteApplicationException { - logger.debug("init VoteMonitoringStarterAction..."); VoteUtils.cleanUpSessionAbsolute(request); IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("voteService: " + voteService); MessageService messageService = VoteServiceProxy.getMessageService(getServlet().getServletContext()); VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; - logger.debug("voteMonitoringForm: " + voteMonitoringForm); VoteGeneralAuthoringDTO voteGeneralAuthoringDTO= new VoteGeneralAuthoringDTO(); VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); ActionForward validateParameters=validateParameters(request, mapping, voteMonitoringForm); - logger.debug("validateParamaters: " + validateParameters); if (validateParameters != null) { @@ -127,16 +91,13 @@ boolean initData=initialiseMonitoringData(mapping, form, request, response, voteService, voteGeneralMonitoringDTO); - logger.debug("initData: " + initData); if (initData == false) return (mapping.findForward(ERROR_LIST)); voteMonitoringForm.setCurrentTab("1"); voteGeneralMonitoringDTO.setCurrentTab("1"); - logger.debug("setting current tab to 1: "); String toolContentID=voteMonitoringForm.getToolContentID(); - logger.debug("toolContentID: " + toolContentID); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); //Come back to fix here @@ -145,30 +106,19 @@ VoteMonitoringAction voteMonitoringAction= new VoteMonitoringAction(); - logger.debug("calling initSummaryContent."); voteMonitoringAction.initSummaryContent(toolContentID , request, voteService, voteGeneralMonitoringDTO); - logger.debug("post initSummaryContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); - - logger.debug("calling initInstructionsContent."); - logger.debug("post initInstructionsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); - - logger.debug("calling initStatsContent."); voteMonitoringAction.initStatsContent(toolContentID, request, voteService, voteGeneralMonitoringDTO); - logger.debug("post initStatsContent, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); - logger.debug("voteContent: " + voteContent); /*true means there is at least 1 response*/ if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); - logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); } else { voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); - logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); } voteMonitoringForm.setActiveModule(MONITORING); @@ -184,38 +134,31 @@ voteMonitoringForm.setShowOpenVotesSection(new Boolean(false).toString()); voteGeneralMonitoringDTO.setIsPortfolioExport(new Boolean(false).toString()); - logger.debug("calling submitSession:" + toolContentID); request.setAttribute(VOTE_GENERAL_MONITORING_DTO, voteGeneralMonitoringDTO); /*this section is needed for Edit Activity screen, from here... */ - logger.debug("for copy using voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); voteGeneralAuthoringDTO.setActivityTitle(voteGeneralMonitoringDTO.getActivityTitle()); voteGeneralAuthoringDTO.setActivityInstructions(voteGeneralMonitoringDTO.getActivityInstructions()); voteGeneralAuthoringDTO.setDefaultOptionContent(voteGeneralMonitoringDTO.getDefaultOptionContent()); voteGeneralAuthoringDTO.setMapOptionsContent(voteGeneralMonitoringDTO.getMapOptionsContent()); voteGeneralAuthoringDTO.setActiveModule(MONITORING); Map mapOptionsContent=voteGeneralMonitoringDTO.getMapOptionsContent(); - logger.debug("mapOptionsContent: " + mapOptionsContent); int maxIndex=mapOptionsContent.size(); - logger.debug("maxIndex: " + maxIndex); voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); - logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); /*...till here */ //voteMonitoringAction.prepareReflectionData(request, voteContent, voteService, null, false); - logger.debug("calling submitSession with selectedToolSessionId" + voteMonitoringForm.getSelectedToolSessionId()); return voteMonitoringAction.submitSession(mapping, voteMonitoringForm, request, response, voteService, messageService, voteGeneralMonitoringDTO); } public boolean initialiseMonitoringData(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, IVoteService voteService, VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) { - logger.debug("start initializing monitoring data...voteService: " + voteService); VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; voteMonitoringForm.setSbmtSuccess(new Boolean(false).toString()); @@ -229,10 +172,7 @@ /* we have made sure TOOL_CONTENT_ID is passed */ String toolContentID=voteMonitoringForm.getToolContentID(); - logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); - logger.debug("existing voteContent:" + voteContent); if (voteContent == null) { @@ -243,31 +183,24 @@ boolean isContentInUse=VoteUtils.isContentInUse(voteContent); - logger.debug("isContentInUse:" + isContentInUse); voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(false).toString()); if (isContentInUse == true) { - logger.debug("monitoring url does not allow editActivity since the content is in use."); voteGeneralMonitoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); } voteGeneralMonitoringDTO.setActivityTitle(voteContent.getTitle()); voteGeneralMonitoringDTO.setActivityInstructions(voteContent.getInstructions()); - logger.debug("checking student activity on the standard nominations:" + voteContent); if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { VoteUtils.cleanUpSessionAbsolute(request); - logger.debug("student activity occurred on this content:" + voteContent); voteGeneralMonitoringDTO.setUserExceptionContentInUse(new Boolean(true).toString()); voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); - logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); } else { voteGeneralMonitoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); - logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); - logger.debug("error.noLearnerActivity must be displayed"); } /* @@ -286,19 +219,16 @@ List listNominationContentDTO= new LinkedList(); Map mapOptionsContent= new TreeMap(new VoteComparator()); - logger.debug("setting existing content data from the db"); mapOptionsContent.clear(); Iterator queIterator=voteContent.getVoteQueContents().iterator(); Long mapIndex=new Long(1); - logger.debug("mapOptionsContent: " + mapOptionsContent); while (queIterator.hasNext()) { VoteNominationContentDTO voteNominationContentDTO=new VoteNominationContentDTO(); VoteQueContent voteQueContent=(VoteQueContent) queIterator.next(); if (voteQueContent != null) { - logger.debug("question: " + voteQueContent.getQuestion()); mapOptionsContent.put(mapIndex.toString(),voteQueContent.getQuestion()); voteNominationContentDTO.setQuestion(voteQueContent.getQuestion()); @@ -308,40 +238,26 @@ mapIndex=new Long(mapIndex.longValue()+1); } } - logger.debug("Map initialized with existing contentid to: " + mapOptionsContent); voteGeneralMonitoringDTO.setMapOptionsContent(mapOptionsContent); /* ends here*/ - logger.debug("listNominationContentDTO: " + listNominationContentDTO); request.setAttribute(LIST_NOMINATION_CONTENT_DTO,listNominationContentDTO); sessionMap.put(LIST_NOMINATION_CONTENT_DTO_KEY, listNominationContentDTO); request.setAttribute(TOTAL_NOMINATION_COUNT, new Integer(listNominationContentDTO.size())); VoteMonitoringAction voteMonitoringAction= new VoteMonitoringAction(); - logger.debug("refreshing summary data..."); voteMonitoringAction.refreshSummaryData(request, voteContent, voteService, true, false, null, null, false, null, voteGeneralMonitoringDTO, null); - logger.debug("post refreshSummaryData, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); - logger.debug("refreshing stats data..."); voteMonitoringAction.refreshStatsData(request, voteService, voteGeneralMonitoringDTO); - logger.debug("post refreshStatsData, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); - logger.debug("refreshing instructions data..."); - //voteMonitoringAction.refreshInstructionsData(request, voteContent, voteService, voteGeneralMonitoringDTO); - - logger.debug("end initializing monitoring data..."); voteGeneralMonitoringDTO.setExistsOpenVotes(new Boolean(false).toString()); - logger.debug("post refreshes, voteGeneralMonitoringDTO: " + voteGeneralMonitoringDTO); - - EditActivityDTO editActivityDTO = new EditActivityDTO(); isContentInUse=VoteUtils.isContentInUse(voteContent); - logger.debug("isContentInUse:" + isContentInUse); if (isContentInUse == true) { editActivityDTO.setMonitoredContentInUse(new Boolean(true).toString()); @@ -353,18 +269,15 @@ boolean notebookEntriesExist=MonitoringUtil.notebookEntriesExist(voteService, voteContent); - logger.debug("notebookEntriesExist : " + notebookEntriesExist); if (notebookEntriesExist) { request.setAttribute(NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); String userExceptionNoToolSessions=(String)voteGeneralMonitoringDTO.getUserExceptionNoToolSessions(); - logger.debug("userExceptionNoToolSessions : " + userExceptionNoToolSessions); if (userExceptionNoToolSessions.equals("true")) { - logger.debug("there are no online student activity but there are reflections : "); request.setAttribute(NO_SESSIONS_NOTEBOOK_ENTRIES_EXIST, new Boolean(true).toString()); } @@ -392,10 +305,8 @@ protected ActionForward validateParameters(HttpServletRequest request, ActionMapping mapping, VoteMonitoringForm voteMonitoringForm) { - logger.debug("start validating monitoring parameters..."); String strToolContentId=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - logger.debug("strToolContentId: " + strToolContentId); if ((strToolContentId == null) || (strToolContentId.length() == 0)) { @@ -407,12 +318,11 @@ try { long toolContentID=new Long(strToolContentId).longValue(); - logger.debug("passed TOOL_CONTENT_ID : " + new Long(toolContentID)); voteMonitoringForm.setToolContentID(strToolContentId); } catch(NumberFormatException e) { - logger.debug("add error.numberFormatException to ActionMessages."); + logger.error("add error.numberFormatException to ActionMessages."); VoteUtils.cleanUpSessionAbsolute(request); return (mapping.findForward(ERROR_LIST)); } @@ -430,7 +340,7 @@ { ActionMessages errors= new ActionMessages(); errors.add(Globals.ERROR_KEY, new ActionMessage(message)); - logger.debug("add " + message +" to ActionMessages:"); + logger.error("add " + message +" to ActionMessages:"); saveErrors(request,errors); } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VotePedagogicalPlannerAction.java =================================================================== diff -u -rfd8292deb95c595b3d948e003dd9ff1807f7b569 -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VotePedagogicalPlannerAction.java (.../VotePedagogicalPlannerAction.java) (revision fd8292deb95c595b3d948e003dd9ff1807f7b569) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VotePedagogicalPlannerAction.java (.../VotePedagogicalPlannerAction.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -30,7 +30,6 @@ import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang.StringUtils; -import org.apache.log4j.Logger; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; @@ -48,8 +47,6 @@ public class VotePedagogicalPlannerAction extends LamsDispatchAction { - private static Logger logger = Logger.getLogger(VotePedagogicalPlannerAction.class); - @Override protected ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java =================================================================== diff -u -r25187e73d76504fc9d29a21440750230e35f00fb -r601fd92095193321a6b2286ef55108fbe5f9dfc4 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision 25187e73d76504fc9d29a21440750230e35f00fb) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision 601fd92095193321a6b2286ef55108fbe5f9dfc4) @@ -171,28 +171,23 @@ HttpServletResponse response) throws IOException, ServletException, VoteApplicationException { VoteUtils.cleanUpSessionAbsolute(request); - VoteStarterAction.logger.debug("init authoring mode. removed attributes..."); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); - VoteStarterAction.logger.debug("contentFolderID: " + contentFolderID); voteAuthoringForm.setContentFolderID(contentFolderID); VoteAction voteAction = new VoteAction(); voteAction.repopulateRequestParameters(request, voteAuthoringForm, voteGeneralAuthoringDTO); - VoteStarterAction.logger.debug("getting voteService now: servlet is: " + getServlet()); IVoteService voteService = null; if (getServlet() != null) { voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); } else { voteService = voteAuthoringForm.getVoteService(); } - VoteStarterAction.logger.debug("final voteService: " + voteService); - voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); voteAuthoringForm.setSbmtSuccess(new Boolean(false).toString()); @@ -201,16 +196,14 @@ voteGeneralAuthoringDTO.setContentFolderID(contentFolderID); String servletPath = request.getServletPath(); - VoteStarterAction.logger.debug("getServletPath: " + servletPath); if (servletPath.indexOf("authoringStarter") > 0) { - VoteStarterAction.logger.debug("request is for authoring module"); voteAuthoringForm.setActiveModule(VoteAppConstants.AUTHORING); voteGeneralAuthoringDTO.setActiveModule(VoteAppConstants.AUTHORING); voteAuthoringForm.setDefineLaterInEditMode(new Boolean(true).toString()); voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); } else { - VoteStarterAction.logger.debug("request is for define later module. either direct or by monitoring module"); + //request is for define later module. either direct or by monitoring module voteAuthoringForm.setActiveModule(VoteAppConstants.DEFINE_LATER); voteGeneralAuthoringDTO.setActiveModule(VoteAppConstants.DEFINE_LATER); @@ -234,44 +227,36 @@ */ String sourceVoteStarter = (String) request.getAttribute(VoteAppConstants.SOURCE_VOTE_STARTER); - VoteStarterAction.logger.debug("sourceVoteStarter: " + sourceVoteStarter); voteAuthoringForm.resetRadioBoxes(); voteAuthoringForm.setExceptionMaxNominationInvalid(new Boolean(false).toString()); voteGeneralAuthoringDTO.setExceptionMaxNominationInvalid(new Boolean(false).toString()); ActionForward validateSignature = readSignature(request, mapping, voteService, voteAuthoringForm); - VoteStarterAction.logger.debug("validateSignature: " + validateSignature); if (validateSignature != null) { - VoteStarterAction.logger.debug("validateSignature not null : " + validateSignature); return validateSignature; } else { - VoteStarterAction.logger.debug("no problems getting the default content, will render authoring screen"); + //no problems getting the default content, will render authoring screen String strToolContentId = ""; /* the authoring url must be passed a tool content id */ strToolContentId = request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); - VoteStarterAction.logger.debug("strToolContentId: " + strToolContentId); /* this will be fixed when making changes to Monitoring module */ if (strToolContentId == null) { /* * watch out for a possibility that the original request for authoring module is coming from monitoring * url */ - VoteStarterAction.logger - .debug("we should IDEALLY not arrive here. The TOOL_CONTENT_ID is NOT available."); + //we should IDEALLY not arrive here. The TOOL_CONTENT_ID is NOT available /* use default content instead of giving a warning */ String defaultContentId = voteAuthoringForm.getDefaultContentId(); - VoteStarterAction.logger.debug("using Voting defaultContentId: " + defaultContentId); strToolContentId = defaultContentId; } - VoteStarterAction.logger.debug("final strToolContentId: " + strToolContentId); if (strToolContentId == null || strToolContentId.equals("")) { VoteUtils.cleanUpSessionAbsolute(request); // saveInRequestError(request,"error.contentId.required"); VoteUtils.cleanUpSessionAbsolute(request); - VoteStarterAction.logger.debug("forwarding to: " + VoteAppConstants.ERROR_LIST); return mapping.findForward(VoteAppConstants.ERROR_LIST); } @@ -282,13 +267,12 @@ long toolContentID = 0; try { toolContentID = new Long(strToolContentId).longValue(); - VoteStarterAction.logger.debug("passed TOOL_CONTENT_ID : " + toolContentID); voteAuthoringForm.setToolContentID(new Long(strToolContentId).toString()); voteGeneralAuthoringDTO.setToolContentID(new Long(strToolContentId).toString()); } catch (NumberFormatException e) { VoteUtils.cleanUpSessionAbsolute(request); saveInRequestError(request, "error.numberFormatException"); - VoteStarterAction.logger.debug("forwarding to: " + VoteAppConstants.ERROR_LIST); + VoteStarterAction.logger.error("forwarding to: " + VoteAppConstants.ERROR_LIST); return mapping.findForward(VoteAppConstants.ERROR_LIST); } @@ -300,41 +284,32 @@ * content is in use in this case. It is always unlocked -> not in use since it is the default content. */ Map mapOptionsContent = new TreeMap(new VoteComparator()); - VoteStarterAction.logger.debug("mapOptionsContent: " + mapOptionsContent); - if (!existsContent(toolContentID, request, voteService)) { - VoteStarterAction.logger.debug("getting default content"); /* fetch default content */ String defaultContentIdStr = voteAuthoringForm.getDefaultContentIdStr(); - VoteStarterAction.logger.debug("will get content for defaultContentIdStr:" + defaultContentIdStr); retrieveContent(request, voteService, voteAuthoringForm, voteGeneralAuthoringDTO, mapOptionsContent, new Long(defaultContentIdStr).longValue(), sessionMap); } else { - VoteStarterAction.logger.debug("getting existing content"); /* it is possible that the content is in use by learners. */ VoteContent voteContent = voteService.retrieveVote(new Long(strToolContentId)); - VoteStarterAction.logger.debug("voteContent: " + voteContent); if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { VoteUtils.cleanUpSessionAbsolute(request); - VoteStarterAction.logger.debug("student activity occurred on this content:" + voteContent); saveInRequestError(request, "error.content.inUse"); return mapping.findForward(VoteAppConstants.ERROR_LIST); } if (servletPath.indexOf("authoringStarter") > 0) { boolean isDefineLater = VoteUtils.isDefineLater(voteContent); - VoteStarterAction.logger.debug("isDefineLater:" + isDefineLater); if (isDefineLater == true) { VoteUtils.cleanUpSessionAbsolute(request); - VoteStarterAction.logger.debug("student activity occurred on this content:" + voteContent); + VoteStarterAction.logger.error("student activity occurred on this content:" + voteContent); saveInRequestError(request, "error.content.inUse"); return mapping.findForward(VoteAppConstants.ERROR_LIST); } } - VoteStarterAction.logger.debug("will get content for strToolContentId:" + strToolContentId); retrieveContent(request, voteService, voteAuthoringForm, voteGeneralAuthoringDTO, mapOptionsContent, new Long(strToolContentId).longValue(), sessionMap); } @@ -346,22 +321,15 @@ voteAuthoringForm.setCurrentTab("1"); } - VoteStarterAction.logger.debug("will return to jsp with: " + sourceVoteStarter); String destination = VoteUtils.getDestination(sourceVoteStarter); - VoteStarterAction.logger.debug("destination: " + destination); - VoteStarterAction.logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); - - VoteStarterAction.logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); request.setAttribute(VoteAppConstants.VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); - VoteStarterAction.logger.debug("persisting sessionMap into session: " + sessionMap); request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); return mapping.findForward(destination); } protected void initialiseAttributes(HttpServletRequest request, VoteGeneralAuthoringDTO voteGeneralAuthoringDTO, IVoteService voteService) { - VoteStarterAction.logger.debug("starting initialiseAttributes..."); /* for development: needs to run only once per tool */ /* VoteUtils.configureContentRepository(request, voteService); */ @@ -385,66 +353,50 @@ * other depending content ids are obtained in this method. if all the default content has been setup properly the * method saves DEFAULT_CONTENT_ID in the session. * - * readSignature(HttpServletRequest request, ActionMapping mapping) - * * @param request * @param mapping * @return ActionForward */ public ActionForward readSignature(HttpServletRequest request, ActionMapping mapping, IVoteService voteService, VoteAuthoringForm voteAuthoringForm) { - VoteStarterAction.logger.debug("start reading tool signature: " + voteService); /* * retrieve the default content id based on tool signature */ long defaultContentID = 0; try { - VoteStarterAction.logger.debug("attempt retrieving tool with signatute : " + VoteAppConstants.MY_SIGNATURE); defaultContentID = voteService.getToolDefaultContentIdBySignature(VoteAppConstants.MY_SIGNATURE); - VoteStarterAction.logger.debug("retrieved tool default contentId: " + defaultContentID); if (defaultContentID == 0) { VoteUtils.cleanUpSessionAbsolute(request); - VoteStarterAction.logger.debug("default content id has not been setup"); saveInRequestError(request, "error.defaultContent.notSetup"); return mapping.findForward(VoteAppConstants.ERROR_LIST); } } catch (Exception e) { VoteUtils.cleanUpSessionAbsolute(request); - VoteStarterAction.logger.debug("error getting the default content id: " + e.getMessage()); + VoteStarterAction.logger.error("error getting the default content id: " + e.getMessage()); saveInRequestError(request, "error.defaultContent.notSetup"); - VoteStarterAction.logger.debug("forwarding to: " + VoteAppConstants.ERROR_LIST); return mapping.findForward(VoteAppConstants.ERROR_LIST); } /* retrieve uid of the content based on default content id determined above */ long contentUID = 0; try { - VoteStarterAction.logger.debug("retrieve uid of the content based on default content id determined above: " - + defaultContentID); + //retrieve uid of the content based on default content id determined above defaultContentID VoteContent voteContent = voteService.retrieveVote(new Long(defaultContentID)); - VoteStarterAction.logger.debug("voteContent: " + voteContent); if (voteContent == null) { - VoteStarterAction.logger.debug("voteContent is null: " + voteContent); VoteUtils.cleanUpSessionAbsolute(request); - VoteStarterAction.logger.debug("Exception occured: No default content"); + VoteStarterAction.logger.error("Exception occured: No default content"); saveInRequestError(request, "error.defaultContent.notSetup"); return mapping.findForward(VoteAppConstants.ERROR_LIST); } - VoteStarterAction.logger.debug("using voteContent: " + voteContent); - VoteStarterAction.logger.debug("using mcContent uid: " + voteContent.getUid()); contentUID = voteContent.getUid().longValue(); - VoteStarterAction.logger.debug("contentUID: " + contentUID); } catch (Exception e) { - VoteStarterAction.logger.debug("other problems: " + e); + VoteStarterAction.logger.error("other problems: " + e); VoteUtils.cleanUpSessionAbsolute(request); - VoteStarterAction.logger.debug("Exception occured: No default question content"); + VoteStarterAction.logger.error("Exception occured: No default question content"); saveInRequestError(request, "error.defaultContent.notSetup"); - VoteStarterAction.logger.debug("forwarding to: " + VoteAppConstants.ERROR_LIST); return mapping.findForward(VoteAppConstants.ERROR_LIST); } - VoteStarterAction.logger.debug("Voting tool has the default content id: " + defaultContentID); - voteAuthoringForm.setDefaultContentId(new Long(defaultContentID).toString()); voteAuthoringForm.setDefaultContentIdStr(new Long(defaultContentID).toString()); return null; @@ -453,15 +405,10 @@ protected void retrieveContent(HttpServletRequest request, IVoteService voteService, VoteAuthoringForm voteAuthoringForm, VoteGeneralAuthoringDTO voteGeneralAuthoringDTO, Map mapOptionsContent, long toolContentID, SessionMap sessionMap) { - VoteStarterAction.logger.debug("starting retrieve content for toolContentID: " + toolContentID); - VoteStarterAction.logger.debug("voteService: " + voteService); - VoteStarterAction.logger.debug("getting existing content with id:" + toolContentID); VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); - VoteStarterAction.logger.debug("voteContent: " + voteContent); VoteUtils.readContentValues(request, voteContent, voteAuthoringForm, voteGeneralAuthoringDTO); - VoteStarterAction.logger.debug("form title is: : " + voteAuthoringForm.getTitle()); voteAuthoringForm.setIsDefineLater(new Boolean(voteContent.isDefineLater()).toString()); voteGeneralAuthoringDTO.setIsDefineLater(new Boolean(voteContent.isDefineLater()).toString()); @@ -509,17 +456,14 @@ /* * get the nominations */ - VoteStarterAction.logger.debug("setting existing content data from the db"); mapOptionsContent.clear(); Iterator queIterator = voteContent.getVoteQueContents().iterator(); Long mapIndex = new Long(1); - VoteStarterAction.logger.debug("mapOptionsContent: " + mapOptionsContent); while (queIterator.hasNext()) { VoteNominationContentDTO voteNominationContentDTO = new VoteNominationContentDTO(); VoteQueContent voteQueContent = (VoteQueContent) queIterator.next(); if (voteQueContent != null) { - VoteStarterAction.logger.debug("question: " + voteQueContent.getQuestion()); mapOptionsContent.put(mapIndex.toString(), voteQueContent.getQuestion()); voteNominationContentDTO.setQuestion(voteQueContent.getQuestion()); @@ -531,11 +475,9 @@ } request.setAttribute(VoteAppConstants.TOTAL_NOMINATION_COUNT, new Integer(mapOptionsContent.size())); - VoteStarterAction.logger.debug("listNominationContentDTO: " + listNominationContentDTO); request.setAttribute(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO, listNominationContentDTO); sessionMap.put(VoteAppConstants.LIST_NOMINATION_CONTENT_DTO_KEY, listNominationContentDTO); - VoteStarterAction.logger.debug("Map initialized with existing contentid to: " + mapOptionsContent); voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); sessionMap.put(VoteAppConstants.MAP_OPTIONS_CONTENT_KEY, mapOptionsContent); @@ -582,7 +524,6 @@ public ActionForward executeDefineLater(ActionMapping mapping, VoteAuthoringForm voteAuthoringForm, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, VoteApplicationException { - VoteStarterAction.logger.debug("calling execute..." + voteAuthoringForm); return execute(mapping, voteAuthoringForm, request, response); } @@ -604,7 +545,7 @@ public void saveInRequestError(HttpServletRequest request, String message) { ActionMessages errors = new ActionMessages(); errors.add(Globals.ERROR_KEY, new ActionMessage(message)); - VoteStarterAction.logger.debug("add " + message + " to ActionMessages:"); + VoteStarterAction.logger.error("add " + message + " to ActionMessages:"); saveErrors(request, errors); } }