Author: billyxie Date: 2010-03-22 08:55:02 +0100 (Mon, 22 Mar 2010) New Revision: 41549
Modified: CMSContainer/trunk/CMSContainer_Modules/subsite/src/java/com/finalist/cmsc/subsite/forms/PersonalPageCreate.java CMSContainer/trunk/CMSContainer_Modules/subsite/src/java/com/finalist/cmsc/subsite/forms/SubSiteAction.java CMSContainer/trunk/CMSContainer_Modules/subsite/src/java/com/finalist/cmsc/subsite/forms/SubSiteDelete.java CMSContainer/trunk/CMSContainer_Modules/subsite/src/java/com/finalist/cmsc/subsite/forms/SubSiteEdit.java CMSContainer/trunk/CMSContainer_Modules/subsite/src/webapp/editors/subsite/personalpages.jsp CMSContainer/trunk/CMSContainer_Modules/subsite/src/webapp/editors/subsite/subsitedelete.jsp Log: CMSC-1666 - Several problems in the personal page editors. Modified: CMSContainer/trunk/CMSContainer_Modules/subsite/src/java/com/finalist/cmsc/subsite/forms/PersonalPageCreate.java =================================================================== --- CMSContainer/trunk/CMSContainer_Modules/subsite/src/java/com/finalist/cmsc/subsite/forms/PersonalPageCreate.java 2010-03-22 07:48:27 UTC (rev 41548) +++ CMSContainer/trunk/CMSContainer_Modules/subsite/src/java/com/finalist/cmsc/subsite/forms/PersonalPageCreate.java 2010-03-22 07:55:02 UTC (rev 41549) @@ -51,11 +51,11 @@ SubSiteUtil.createPersonalPageContentChannel(newPage); addToRequest(request, "showsubsite", ewnodelastedited); - ActionForward ret = new ActionForward(mapping.findForward(SUCCESS).getPath() + "?from=" + from); + ActionForward ret = new ActionForward(mapping.findForward(SUCCESS).getPath() + "?from=" + from + "&subsite=" + parentpage); return ret; } request.getSession().removeAttribute("parentpage"); - ActionForward ret = new ActionForward(mapping.findForward(CANCEL).getPath() + "?from=" + from); + ActionForward ret = new ActionForward(mapping.findForward(CANCEL).getPath() + "?from=" + from + "&subsite=" + parentpage); return ret; } } Modified: CMSContainer/trunk/CMSContainer_Modules/subsite/src/java/com/finalist/cmsc/subsite/forms/SubSiteAction.java =================================================================== --- CMSContainer/trunk/CMSContainer_Modules/subsite/src/java/com/finalist/cmsc/subsite/forms/SubSiteAction.java 2010-03-22 07:48:27 UTC (rev 41548) +++ CMSContainer/trunk/CMSContainer_Modules/subsite/src/java/com/finalist/cmsc/subsite/forms/SubSiteAction.java 2010-03-22 07:55:02 UTC (rev 41549) @@ -49,12 +49,8 @@ // Initialize SearchForm searchForm = (SearchForm) form; - String subsite = (String) request.getSession().getAttribute("subsite"); - request.getSession().removeAttribute("subsite"); + String subsite = request.getParameter("subsite"); String from = request.getParameter("from"); - if (StringUtils.isBlank(subsite) || !cloud.hasNode(subsite)) { - subsite = request.getParameter("subsite"); - } /* Purpose of this file * - retrieve list of subsites Modified: CMSContainer/trunk/CMSContainer_Modules/subsite/src/java/com/finalist/cmsc/subsite/forms/SubSiteDelete.java =================================================================== --- CMSContainer/trunk/CMSContainer_Modules/subsite/src/java/com/finalist/cmsc/subsite/forms/SubSiteDelete.java 2010-03-22 07:48:27 UTC (rev 41548) +++ CMSContainer/trunk/CMSContainer_Modules/subsite/src/java/com/finalist/cmsc/subsite/forms/SubSiteDelete.java 2010-03-22 07:55:02 UTC (rev 41549) @@ -36,6 +36,7 @@ if (from != null) { request.setAttribute("from", from); } + String subsite = getParameter(request, "subsite"); if (isRemoveAction(request)) { String objectnumber = getParameter(request, "number", true); Node subsiteNode = cloud.getNode(objectnumber); @@ -47,15 +48,15 @@ if (isEditor) { NavigationUtil.deleteItem(subsiteNode); } - return mapping.findForward(SUCCESS); + return new ActionForward(mapping.findForward(SUCCESS).getPath() + "?from=" + from + "&subsite=" + subsite); } if (isCancelAction(request)) { - return new ActionForward(mapping.findForward(SUCCESS).getPath() + "?from=" + from); + return new ActionForward(mapping.findForward(SUCCESS).getPath() + "?from=" + from + "&subsite=" + subsite); } // neither remove or cancel, show confirmation page - return new ActionForward(mapping.findForward("delete").getPath() + "?from=" + from); + return new ActionForward(mapping.findForward("delete").getPath() + "?from=" + from + "&subsite=" + subsite); } Modified: CMSContainer/trunk/CMSContainer_Modules/subsite/src/java/com/finalist/cmsc/subsite/forms/SubSiteEdit.java =================================================================== --- CMSContainer/trunk/CMSContainer_Modules/subsite/src/java/com/finalist/cmsc/subsite/forms/SubSiteEdit.java 2010-03-22 07:48:27 UTC (rev 41548) +++ CMSContainer/trunk/CMSContainer_Modules/subsite/src/java/com/finalist/cmsc/subsite/forms/SubSiteEdit.java 2010-03-22 07:55:02 UTC (rev 41549) @@ -7,6 +7,7 @@ */ package com.finalist.cmsc.subsite.forms; +import java.net.URLEncoder; import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang.StringUtils; @@ -22,14 +23,13 @@ public ActionForward execute(ActionMapping mapping, HttpServletRequest request, Cloud cloud) throws Exception { String action = getParameter(request, "action"); + String subsite = request.getParameter("subsite"); if (StringUtils.isBlank(action)) { String objectnumber = getParameter(request, "number", true); - String subsite = request.getParameter("subsite"); - request.getSession().setAttribute("subsite", subsite); ActionForward ret = new ActionForward(mapping.findForward("openwizard").getPath() + "?objectnumber=" - + objectnumber + "&returnurl=" + mapping.findForward("returnurl").getPath()+"?from=" + request.getParameter("from")); + + objectnumber + "&returnurl=" + mapping.findForward("returnurl").getPath() + URLEncoder.encode("?from=" + request.getParameter("from") + "&subsite=" + subsite)); ret.setRedirect(true); return ret; } else { @@ -38,7 +38,7 @@ if ("site".equalsIgnoreCase(getParameter(request, "from"))) { return mapping.findForward(SUCCESS); } else { - return mapping.findForward("modulesuccess"); + return new ActionForward(mapping.findForward("modulesuccess").getPath() + "?from=" + request.getParameter("from") + "&subsite=" + subsite); } } } Modified: CMSContainer/trunk/CMSContainer_Modules/subsite/src/webapp/editors/subsite/personalpages.jsp =================================================================== --- CMSContainer/trunk/CMSContainer_Modules/subsite/src/webapp/editors/subsite/personalpages.jsp 2010-03-22 07:48:27 UTC (rev 41548) +++ CMSContainer/trunk/CMSContainer_Modules/subsite/src/webapp/editors/subsite/personalpages.jsp 2010-03-22 07:55:02 UTC (rev 41549) @@ -38,7 +38,7 @@ <c:set var="pagerDOToffset"><%=request.getParameter("pager.offset")%></c:set> <mm:import externid="returnurl"/> -<mm:import externid="subsite" from="parameters" /> +<mm:import externid="subsite" jspvar="subsiteold" from="parameters" /> <mm:import externid="from" from="parameters" /> <mm:cloud jspvar="cloud" loginpage="../../editors/login.jsp"> @@ -82,7 +82,7 @@ <tr> <td style="width:105px"><fmt:message key="subsite.name" />:</td> <td> - <cmsc:select var="subsite" default="${subsite}" onchange="document.forms[0].submit();"> + <cmsc:select var="subsite" default="${subsiteold}" onchange="document.forms[0].submit();"> <mm:listnodes type="subsite" orderby="title"> <mm:field name="number" id="subsitenumber" write="false" vartype="String" /> <cmsc:option value="${subsitenumber}" name="${_node.title}" /> @@ -148,7 +148,15 @@ <td style="white-space: nowrap;"> <mm:field name="number" write="false" id="nodenumber"> - <a href="../subsite/SubSiteEdit.do?number=${nodenumber}&from=${from}&subsite=${subsite}" + <c:if test="${not empty subsiteold}" > + <c:set var="editPath" value="../subsite/SubSiteEdit.do?number=${nodenumber}&subsite=${subsiteold}&from=${from}" /> + <c:set var="deletePath" value="../subsite/SubSiteDelete.do?number=${nodenumber}&subsite=${subsiteold}&from=${from}" /> + </c:if> + <c:if test="${empty subsiteold}" > + <c:set var="editPath" value="../subsite/SubSiteEdit.do?number=${nodenumber}&subsite=${subsite}&from=${from}" /> + <c:set var="deletePath" value="../subsite/SubSiteDelete.do?number=${nodenumber}&subsite=${subsite}&from=${from}" /> + </c:if> + <a href="${editPath}" title="<fmt:message key="pp.content.edit" />"><img src="../gfx/icons/edit.png" width="16" height="16" title="<fmt:message key="pp.content.edit" />" alt="<fmt:message key="pp.content.edit" />"/></a> @@ -160,7 +168,7 @@ title="<fmt:message key="pp.content.preview" />" alt="<fmt:message key="pp.content.preview" />"/></a> </c:if> - <a href="../subsite/SubSiteDelete.do?number=${nodenumber}&from=${from}" + <a href="${deletePath}" title="<fmt:message key="pp.content.delete" />"><img src="../gfx/icons/delete.png" width="16" height="16" title="<fmt:message key="pp.content.delete" />" alt="<fmt:message key="pp.content.delete" />"/></a> Modified: CMSContainer/trunk/CMSContainer_Modules/subsite/src/webapp/editors/subsite/subsitedelete.jsp =================================================================== --- CMSContainer/trunk/CMSContainer_Modules/subsite/src/webapp/editors/subsite/subsitedelete.jsp 2010-03-22 07:48:27 UTC (rev 41548) +++ CMSContainer/trunk/CMSContainer_Modules/subsite/src/webapp/editors/subsite/subsitedelete.jsp 2010-03-22 07:55:02 UTC (rev 41549) @@ -12,6 +12,7 @@ <mm:cloud jspvar="cloud" rank="basic user" loginpage="../login.jsp"> <body> <mm:import externid="from" from="parameters" /> +<mm:import externid="subsite" from="parameters" /> <cmscedit:sideblock title="subsitedelete.title" titleClass="side_block_green"> <p> <fmt:message key="subsitedelete.subtitle" /> <mm:node referid="number"><b><mm:field name="title"/></b></mm:node> @@ -22,6 +23,7 @@ <form action="?"> <html:hidden property="number" value="${number}" /> <html:hidden property="from" value="${from}" /> + <html:hidden property="subsite" value="${subsite}" /> <html:submit property="remove"><fmt:message key="subsitedelete.yes"/></html:submit> <html:submit property="cancel"><fmt:message key="subsitedelete.no"/></html:submit> </form> _______________________________________________ Cvs mailing list Cvs@lists.mmbase.org http://lists.mmbase.org/mailman/listinfo/cvs