Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java,v
diff -u -r1.6 -r1.7
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java 14 Apr 2006 12:52:08 -0000 1.6
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java 19 Apr 2006 12:37:00 -0000 1.7
@@ -39,6 +39,7 @@
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException;
+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;
@@ -643,6 +644,67 @@
}
+ public ActionForward editActivityQuestions(ActionMapping mapping,
+ ActionForm form,
+ HttpServletRequest request,
+ HttpServletResponse response) throws IOException,
+ ServletException,
+ ToolException
+ {
+ logger.debug("dispatching editActivityQuestions...");
+
+ VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form;
+ logger.debug("voteAuthoringForm: " + voteAuthoringForm);
+
+ IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE);
+ logger.debug("voteService: " + voteService);
+ if (voteService == null)
+ {
+ logger.debug("will retrieve voteService");
+ voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext());
+ logger.debug("retrieving voteService from session: " + voteService);
+ }
+
+ /* determine whether the request is from Monitoring url Edit Activity*/
+ String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER);
+ logger.debug("sourceVoteStarter: " + sourceVoteStarter);
+ String destination=VoteUtils.getDestination(sourceVoteStarter);
+ logger.debug("destination: " + destination);
+
+ request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(true));
+ request.getSession().setAttribute(SHOW_AUTHORING_TABS,new Boolean(false).toString());
+
+ String toolContentId=voteAuthoringForm.getToolContentId();
+ logger.debug("toolContentId: " + toolContentId);
+ if ((toolContentId== null) || toolContentId.equals(""))
+ {
+ logger.debug("getting toolContentId from session.");
+ Long longToolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID);
+ toolContentId=longToolContentId.toString();
+ logger.debug("toolContentId: " + toolContentId);
+ }
+
+ VoteContent voteContent=voteService.retrieveVote(new Long(toolContentId));
+ logger.debug("existing voteContent:" + voteContent);
+
+ boolean isContentInUse=VoteUtils.isContentInUse(voteContent);
+ logger.debug("isContentInUse:" + isContentInUse);
+
+ request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString());
+ if (isContentInUse == true)
+ {
+ logger.debug("monitoring url does not allow editActivity since the content is in use.");
+ persistError(request,"error.content.inUse");
+ request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(true).toString());
+ }
+
+ VoteUtils.setDefineLater(request, true);
+
+ logger.debug("forwarding to : " + destination);
+ return mapping.findForward(destination);
+ }
+
+
/**
* persists error messages to request scope
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteDLStarterAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/Attic/VoteDLStarterAction.java,v
diff -u -r1.2 -r1.3
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteDLStarterAction.java 13 Apr 2006 18:30:39 -0000 1.2
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteDLStarterAction.java 19 Apr 2006 12:37:00 -0000 1.3
@@ -41,8 +41,10 @@
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.lamsfoundation.lams.tool.vote.VoteAppConstants;
-import org.lamsfoundation.lams.tool.vote.VoteUtils;
import org.lamsfoundation.lams.tool.vote.VoteApplicationException;
+import org.lamsfoundation.lams.tool.vote.VoteUtils;
+import org.lamsfoundation.lams.tool.vote.service.IVoteService;
+import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy;
public class VoteDLStarterAction extends Action implements VoteAppConstants {
@@ -51,6 +53,12 @@
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException, VoteApplicationException {
VoteUtils.cleanUpSessionAbsolute(request);
- return null;
+ logger.debug("init defineLater mode. removed attributes...");
+
+ IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext());
+ request.getSession().setAttribute(TOOL_SERVICE, voteService);
+
+ VoteStarterAction voteStarterAction= new VoteStarterAction();
+ return voteStarterAction.executeDefineLater(mapping, form, request, response, voteService);
}
}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java,v
diff -u -r1.9 -r1.10
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java 19 Apr 2006 11:00:48 -0000 1.9
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java 19 Apr 2006 12:37:00 -0000 1.10
@@ -612,6 +612,16 @@
*/
voteAuthoringForm.resetUserAction();
}
+
+ public ActionForward executeDefineLater(ActionMapping mapping, ActionForm form,
+ HttpServletRequest request, HttpServletResponse response, IVoteService voteService)
+ throws IOException, ServletException, VoteApplicationException {
+ logger.debug("passed voteService: " + voteService);
+ request.getSession().setAttribute(TOOL_SERVICE, voteService);
+ logger.debug("calling execute...");
+ return execute(mapping, form, request, response);
+ }
+
protected boolean existsContent(long toolContentId, HttpServletRequest request)
{
Index: lams_tool_vote/web/WEB-INF/struts-config.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_vote/web/WEB-INF/struts-config.xml,v
diff -u -r1.4 -r1.5
--- lams_tool_vote/web/WEB-INF/struts-config.xml 12 Apr 2006 09:55:03 -0000 1.4
+++ lams_tool_vote/web/WEB-INF/struts-config.xml 19 Apr 2006 12:37:00 -0000 1.5
@@ -171,8 +171,14 @@
handler="org.lamsfoundation.lams.tool.vote.web.CustomStrutsExceptionHandler"
path="/VoteErrorBox.jsp"
scope="request"
- />
+ />
+
+
@@ -169,16 +165,28 @@
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+