roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r430114 - in /incubator/roller/branches/roller_3.0: src/org/apache/roller/ui/authoring/struts/actions/WeblogTemplateFormAction.java web/WEB-INF/jsps/authoring/edit-page.jsp
Date Wed, 09 Aug 2006 18:51:21 GMT
Author: snoopdave
Date: Wed Aug  9 11:51:20 2006
New Revision: 430114

URL: http://svn.apache.org/viewvc?rev=430114&view=rev
Log:
Fixed bug that was allowing edits to properties of required templates

Modified:
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogTemplateFormAction.java
    incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/authoring/edit-page.jsp

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogTemplateFormAction.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogTemplateFormAction.java?rev=430114&r1=430113&r2=430114&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogTemplateFormAction.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/WeblogTemplateFormAction.java
Wed Aug  9 11:51:20 2006
@@ -20,8 +20,6 @@
 
 import java.io.IOException;
 import java.util.Date;
-import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 
 import javax.servlet.ServletException;
@@ -36,6 +34,7 @@
 import org.apache.roller.RollerPermissionsException;
 import org.apache.roller.model.RollerFactory;
 import org.apache.roller.model.UserManager;
+import org.apache.roller.pojos.Template;
 import org.apache.roller.pojos.UserData;
 import org.apache.roller.pojos.WeblogTemplate;
 import org.apache.roller.pojos.WebsiteData;
@@ -111,7 +110,7 @@
                 
                 actionForm.reset(mapping,request);
                 
-                addModelObjects(request, response, mapping, website);
+                addModelObjects(request, response, mapping, website, data);
             } else {
                 forward = mapping.findForward("access-denied");
             }
@@ -144,7 +143,7 @@
                 WeblogTemplateForm pf = (WeblogTemplateForm)actionForm;
                 pf.copyFrom(pd, request.getLocale());
                 
-                addModelObjects(request, response, mapping, pd.getWebsite());
+                addModelObjects(request, response, mapping, pd.getWebsite(), pd);
             } else {
                 forward = mapping.findForward("access-denied");
             }
@@ -178,7 +177,7 @@
             }
             
             if ( rses.isUserAuthorizedToAdmin(website)) {
-                addModelObjects(request, response, mapping, website);
+                addModelObjects(request, response, mapping, website, null);
             } else {
                 forward = mapping.findForward("access-denied");
             }
@@ -221,7 +220,7 @@
                 }
                 
                 addModelObjects(
-                        request, response, mapping, template.getWebsite());
+                   request, response, mapping, template.getWebsite(), template);
                 actionForm.reset(mapping, request);
             } else {
                 forward = mapping.findForward("access-denied");
@@ -256,7 +255,7 @@
                 WeblogTemplateForm form = (WeblogTemplateForm)actionForm;
                 form.copyFrom(page, request.getLocale());
                 
-                addModelObjects(request, response, mapping, page.getWebsite());
+                addModelObjects(request, response, mapping, page.getWebsite(), page);
                 
                 BasePageModel pageModel = new BasePageModel(
                         "editPages.title.removeOK", request, response, mapping);
@@ -311,10 +310,13 @@
                 
                 CacheManager.invalidate(data);
                 
+                addModelObjects(request, response, mapping, data.getWebsite(), data);
+
                 BasePageModel pageModel = new BasePageModel(
                         "pageForm.title", request, response, mapping);
                 pageModel.setWebsite(website);
                 request.setAttribute("model", pageModel);
+                
             } else {
                 forward = mapping.findForward("access-denied");
             }
@@ -377,7 +379,8 @@
             HttpServletRequest  request,
             HttpServletResponse response,
             ActionMapping mapping,
-            WebsiteData website)
+            WebsiteData website,
+            WeblogTemplate page)
             throws RollerException {
         UserManager mgr = RollerFactory.getRoller().getUserManager();
         RollerSession rses = RollerSession.getRollerSession(request);
@@ -392,7 +395,7 @@
         List pages = mgr.getPages(website);
         request.setAttribute("pages", pages);
         
-        request.setAttribute("page", rreq.getPage());
+        if (page != null) request.setAttribute("page", page);
     }
 }
 

Modified: incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/authoring/edit-page.jsp
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/authoring/edit-page.jsp?rev=430114&r1=430113&r2=430114&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/authoring/edit-page.jsp (original)
+++ incubator/roller/branches/roller_3.0/web/WEB-INF/jsps/authoring/edit-page.jsp Wed Aug
 9 11:51:20 2006
@@ -33,7 +33,6 @@
         <fmt:message key="pageForm.editPage" />:
         <bean:write name="weblogTemplateForm" property="name" />
 	</p>
-	
     <table cellspacing="5">
         <tr>
             <td class="label"><fmt:message key="pageForm.name" />&nbsp;</td>
@@ -114,6 +113,7 @@
     <html:hidden property="name"/>
     <html:hidden property="templateLanguage" />
     <html:hidden property="decoratorName" />
+    <html:hidden property="required" />
     
     <input type="hidden" name="method" value="update" />
     <input type="hidden" name="weblog" value='<c:out value="${model.website.handle}"
/>' />



Mime
View raw message