Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java =================================================================== diff -u -ra135b38b088c2fe771f10b3d87705efc5b877412 -rf9e3bb1e954f24078531d9a9114952f84cad4bb2 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java (.../VoteAction.java) (revision a135b38b088c2fe771f10b3d87705efc5b877412) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java (.../VoteAction.java) (revision f9e3bb1e954f24078531d9a9114952f84cad4bb2) @@ -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 =================================================================== diff -u -r6cfdabe63a1d792f3135529031f9a969768a6b10 -rf9e3bb1e954f24078531d9a9114952f84cad4bb2 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteDLStarterAction.java (.../VoteDLStarterAction.java) (revision 6cfdabe63a1d792f3135529031f9a969768a6b10) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteDLStarterAction.java (.../VoteDLStarterAction.java) (revision f9e3bb1e954f24078531d9a9114952f84cad4bb2) @@ -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 =================================================================== diff -u -rc5172424555b18ee103dd5609fd36e2d886d035a -rf9e3bb1e954f24078531d9a9114952f84cad4bb2 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision c5172424555b18ee103dd5609fd36e2d886d035a) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision f9e3bb1e954f24078531d9a9114952f84cad4bb2) @@ -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 =================================================================== diff -u -r4355528fd4c5808b9b4d0eba2cbe68238560214e -rf9e3bb1e954f24078531d9a9114952f84cad4bb2 --- lams_tool_vote/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 4355528fd4c5808b9b4d0eba2cbe68238560214e) +++ lams_tool_vote/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision f9e3bb1e954f24078531d9a9114952f84cad4bb2) @@ -171,8 +171,14 @@ handler="org.lamsfoundation.lams.tool.vote.web.CustomStrutsExceptionHandler" path="/VoteErrorBox.jsp" scope="request" - /> + /> + + @@ -169,16 +165,28 @@ - + +
- + + + + +
+ + + + + + + Index: lams_tool_vote/web/authoring/BasicContent.jsp =================================================================== diff -u -rc5172424555b18ee103dd5609fd36e2d886d035a -rf9e3bb1e954f24078531d9a9114952f84cad4bb2 --- lams_tool_vote/web/authoring/BasicContent.jsp (.../BasicContent.jsp) (revision c5172424555b18ee103dd5609fd36e2d886d035a) +++ lams_tool_vote/web/authoring/BasicContent.jsp (.../BasicContent.jsp) (revision f9e3bb1e954f24078531d9a9114952f84cad4bb2) @@ -64,7 +64,7 @@ - Nomination 1: + : Index: lams_tool_vote/web/authoring/BasicContentViewOnly.jsp =================================================================== diff -u --- lams_tool_vote/web/authoring/BasicContentViewOnly.jsp (revision 0) +++ lams_tool_vote/web/authoring/BasicContentViewOnly.jsp (revision f9e3bb1e954f24078531d9a9114952f84cad4bb2) @@ -0,0 +1,92 @@ +<%-- +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) +License Information: http://lamsfoundation.org/licensing/lams/2.0/ + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA + + http://www.gnu.org/licenses/gpl.txt +--%> + + +<%@ taglib uri="tags-bean" prefix="bean"%> +<%@ taglib uri="tags-html" prefix="html"%> +<%@ taglib uri="tags-logic" prefix="logic" %> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="fck-editor" prefix="FCK" %> +<%@ taglib uri="tags-lams" prefix="lams" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
: + + + +
: + + + +
+ : + + + + +
: + +
+ + + +
+ + + + + \ No newline at end of file