You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by gm...@apache.org on 2014/08/01 18:18:59 UTC
svn commit: r1615161 - in /roller/trunk/app/src/main:
java/org/apache/roller/weblogger/ui/struts2/editor/
java/org/apache/roller/weblogger/ui/struts2/util/ resources/
webapp/WEB-INF/ webapp/WEB-INF/jsps/editor/
Author: gmazza
Date: Fri Aug 1 16:18:59 2014
New Revision: 1615161
URL: http://svn.apache.org/r1615161
Log:
Removed EntryRemoveViaList.jsp, its functionality now consolidated into EntryRemove.jsp
Removed:
roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/EntryRemoveViaList.jsp
Modified:
roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryRemove.java
roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UISecurityInterceptor.java
roller/trunk/app/src/main/resources/struts.xml
roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/EntryRemove.jsp
roller/trunk/app/src/main/webapp/WEB-INF/tiles.xml
Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryRemove.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryRemove.java?rev=1615161&r1=1615160&r2=1615161&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryRemove.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryRemove.java Fri Aug 1 16:18:59 2014
@@ -117,15 +117,6 @@ public class EntryRemove extends EntryBa
return INPUT;
}
- /**
- * Cancel.
- *
- * @return the string
- */
- public String cancel() {
- return CANCEL;
- }
-
public String getRemoveId() {
return removeId;
}
Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UISecurityInterceptor.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UISecurityInterceptor.java?rev=1615161&r1=1615160&r2=1615161&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UISecurityInterceptor.java (original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UISecurityInterceptor.java Fri Aug 1 16:18:59 2014
@@ -91,8 +91,10 @@ public class UISecurityInterceptor exten
Weblog actionWeblog = ((UIAction) theAction)
.getActionWeblog();
if (actionWeblog == null) {
- if (log.isDebugEnabled()) {
- log.debug("DENIED: required action weblog not found");
+ if (log.isWarnEnabled()) {
+ log.warn("User " + authenticatedUser.getUserName() +
+ " unable to process action \"" + ((UIAction) theAction).getActionName() +
+ "\" because no weblog was defined (Check JSP form provides weblog value.)");
}
return "access-denied";
}
Modified: roller/trunk/app/src/main/resources/struts.xml
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/struts.xml?rev=1615161&r1=1615160&r2=1615161&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/struts.xml (original)
+++ roller/trunk/app/src/main/resources/struts.xml Fri Aug 1 16:18:59 2014
@@ -256,21 +256,12 @@
<result name="error" type="tiles">.MediaFileAddExternalInclude</result>
</action>
- <action name="mediaFileView!*" method="{1}"
+ <action name="mediaFileView!*" method="{1}"
class="org.apache.roller.weblogger.ui.struts2.editor.MediaFileView">
<result name="success" type="tiles">.MediaFileView</result>
<result name="success.json" type="dispatcher">/WEB-INF/jsps/editor/MediaFileViewLight.jsp</result>
</action>
-<!--
- <action name="mediaFileSearch!*" method="{1}"
- class="org.apache.roller.weblogger.ui.struts2.editor.MediaFileSearch">
- <result name="input" type="tiles">.MediaFileSearch</result>
- <result name="error" type="tiles">.MediaFileSearch</result>
- <result name="success" type="tiles">.MediaFileSearch</result>
- </action>
--->
-
<action name="mediaFileImageDim!*" method="{1}"
class="org.apache.roller.weblogger.ui.struts2.editor.MediaFileImageDim">
<result name="success" type="tiles">.MediaFileImageDimension</result>
@@ -296,35 +287,22 @@
<result name="success" type="chain">entryAdd</result>
</action>
- <!-- Below activated by entries.jsp, kept separate from entryRemove!* above
- as return page is different (the list of entries in this case, new blog
- entry in the other.
-
- Also defining an actionName parameter here different from that defined above.
- This actionName, used to determine which menu item to highlight, is configured
- in editor-menu.xml. This value is read by class EntryRemove and used by
- class MenuHelper to highlight the correct menu item. See Struts2
- StaticParametersInterceptor javadoc for more info.
-
- Process flow:
- 1. Delete item on entries.jsp activates this action.
- 2. Tiles.xml is consulted to satisfy the input (here, EntryRemoveViaList.jsp
- 3. EntryRemoveViaList.jsp codes the yes confirmation to return to this action,
- with method "EntryRemove.remove()" activated, a success of which will return
- to the entries page as coded below with the blog entry removed from the table.
- 4. EntryRemoveViaList.jsp codes the no/cancel button to return to the
- entries.jsp page with the blog article still remaining.
+ <!-- Below activated by Entries.jsp and EntryRemove.jsp, kept separate from
+ entryRemove!* above as return pages are different, both in the confirm delete
+ and cancel delete scenarios.
+
+ Note the different actionName parameters. The actionName is used to determine
+ which menu item to highlight as configured in editor-menu.xml (and MenuHelper).
+ It's also used in EntryRemove.jsp to code the confirm delete and cancel buttons
+ to return to the appropriate pages based on the actionName. See Struts2
+ StaticParametersInterceptor javadoc for more info on static parameters.
-->
<action name="entryRemoveViaList!*" method="{1}"
class="org.apache.roller.weblogger.ui.struts2.editor.EntryRemove">
<param name="actionName">entryRemoveViaList</param>
- <result name="input" type="tiles">.EntryRemoveViaList</result>
+ <result name="input" type="tiles">.EntryRemove</result>
<result name="error" type="chain">menu</result>
<result name="success" type="chain">entries</result>
- <result name="cancel" type="redirectAction">
- <param name="actionName">entries</param>
- <param name="weblog">${weblog}</param>
- </result>
</action>
<action name="entries"
@@ -433,13 +411,6 @@
<result name="error" type="chain">bookmarks</result>
</action>
- <!--
- <action name="resources!*" method="{1}"
- class="org.apache.roller.weblogger.ui.struts2.editor.Resources">
- <result name="list" type="tiles">.Resources</result>
- </action>
- -->
-
<action name="weblogConfig!*" method="{1}"
class="org.apache.roller.weblogger.ui.struts2.editor.WeblogConfig">
<result name="input" type="tiles">.WeblogConfig</result>
@@ -528,19 +499,8 @@
class="org.apache.roller.weblogger.ui.struts2.editor.Maintenance">
<result name="success" type="tiles">.Maintenance</result>
</action>
-
- <!--
- <action name="importEntries!*" method="{1}"
- class="org.apache.roller.weblogger.ui.struts2.editor.ImportEntriesAction">
- <result name="importEntries.page">.import-entries</result>
- </action>
-
- <action name="toggleLinkback!*" method="{1}"
- class="org.apache.roller.weblogger.ui.struts2.editor.ToggleLinkbackDisplayAction">
- </action>
- -->
- </package>
+ </package>
<!-- Weblogger Authoring UI - overlay pages-->
@@ -554,7 +514,7 @@
<result name="error" type="tiles">.MediaFileAddInclude</result>
</action>
- <action name="mediaFileImageChooser!*" method="{1}"
+ <action name="mediaFileImageChooser!*" method="{1}"
class="org.apache.roller.weblogger.ui.struts2.editor.MediaFileImageChooser">
<param name="overlayMode">true</param>
<result name="input" type="tiles">.MediaFileImageChooser</result>
@@ -564,38 +524,4 @@
</package>
- <!-- MOBILE BEGIN
-
- <package name="mobile-authoring" namespace="/roller-ui/mobile" extends="weblogger">
-
- <action name="menu!*" method="{1}"
- class="org.apache.roller.weblogger.ui.struts2.core.MainMenu">
- <result name="success">/WEB-INF/jsps/mobile/MainMenu.jsp</result>
- </action>
-
- <action name="entries"
- class="org.apache.roller.weblogger.ui.struts2.editor.Entries">
- <result name="list">/WEB-INF/jsps/mobile/Entries.jsp</result>
- </action>
-
- <action name="comments!*" method="{1}"
- class="org.apache.roller.weblogger.ui.struts2.editor.Comments">
- <result name="list">/WEB-INF/jsps/mobile/Comments.jsp</result>
- </action>
-
- <action name="entryAdd!*" method="{1}"
- class="org.apache.roller.weblogger.ui.struts2.editor.EntryAdd">
- <result name="list">/WEB-INF/jsps/mobile/EntryAdd.jsp</result>
- </action>
-
- <action name="entryEdit!*" method="{1}"
- class="org.apache.roller.weblogger.ui.struts2.editor.EntryEdit">
- <result name="list">/WEB-INF/jsps/mobile/EntryEdit.jsp</result>
- </action>
-
- </package>
-
- MOBILE END -->
-
</struts>
-
Modified: roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/EntryRemove.jsp
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/EntryRemove.jsp?rev=1615161&r1=1615160&r2=1615161&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/EntryRemove.jsp (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/jsps/editor/EntryRemove.jsp Fri Aug 1 16:18:59 2014
@@ -29,21 +29,41 @@
<table>
<tr>
-<td>
- <s:form action="entryRemove!remove">
- <s:hidden name="salt" />
- <s:hidden name="weblog" />
- <s:hidden name="removeId" />
- <s:submit value="%{getText('generic.yes')}" />
- </s:form>
-</td>
-<td>
- <s:form action="entryEdit">
- <s:hidden name="salt" />
- <s:hidden name="weblog" />
- <s:hidden name="bean.id" value="%{removeEntry.id}"/>
- <s:submit value="%{getText('generic.no')}"/>
- </s:form>
-</td>
+ <s:if test="actionName == 'entryRemove'" >
+ <td>
+ <s:form action="entryRemove!remove">
+ <s:hidden name="salt" />
+ <s:hidden name="weblog" />
+ <s:hidden name="removeId" />
+ <s:submit value="%{getText('generic.yes')}" />
+ </s:form>
+ </td>
+ <td>
+ <s:form action="entryEdit">
+ <s:hidden name="salt" />
+ <s:hidden name="weblog" />
+ <s:hidden name="bean.id" value="%{removeEntry.id}"/>
+ <s:submit value="%{getText('generic.no')}"/>
+ </s:form>
+ </td>
+ </s:if>
+ <!%-- actionName == entryRemoveViaList --%>
+ <s:else>
+ <td>
+ <s:form action="entryRemoveViaList!remove">
+ <s:hidden name="salt" />
+ <s:hidden name="weblog" />
+ <s:hidden name="removeId" />
+ <s:submit value="%{getText('generic.yes')}" />
+ </s:form>
+ </td>
+ <td>
+ <s:form action="entries">
+ <s:hidden name="salt" />
+ <s:hidden name="weblog"/>
+ <s:submit value="%{getText('generic.no')}"/>
+ </s:form>
+ </td>
+ </s:else>
</tr>
</table>
Modified: roller/trunk/app/src/main/webapp/WEB-INF/tiles.xml
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/webapp/WEB-INF/tiles.xml?rev=1615161&r1=1615160&r2=1615161&view=diff
==============================================================================
--- roller/trunk/app/src/main/webapp/WEB-INF/tiles.xml (original)
+++ roller/trunk/app/src/main/webapp/WEB-INF/tiles.xml Fri Aug 1 16:18:59 2014
@@ -304,11 +304,6 @@
<put-attribute name="styles" value="/WEB-INF/jsps/tiles/css-nosidebar.jsp" />
</definition>
- <definition name=".EntryRemoveViaList" extends=".tiles-tabbedpage" >
- <put-attribute name="content" value="/WEB-INF/jsps/editor/EntryRemoveViaList.jsp" />
- <put-attribute name="styles" value="/WEB-INF/jsps/tiles/css-nosidebar.jsp" />
- </definition>
-
<definition name=".Entries" extends=".tiles-tabbedpage" >
<put-attribute name="head" value="/WEB-INF/jsps/tiles/head-ajax.jsp" />
<put-attribute name="content" value="/WEB-INF/jsps/editor/Entries.jsp" />