You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by wo...@apache.org on 2007/10/04 09:02:41 UTC
svn commit: r581786 - in /portals/jetspeed-2/trunk:
applications/demo/src/webapp/WEB-INF/view/
components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/
Author: woonsan
Date: Thu Oct 4 00:02:41 2007
New Revision: 581786
URL: http://svn.apache.org/viewvc?rev=581786&view=rev
Log:
[JS2-634] edit_defaults custom portlet mode
Fixed a bug of auto-dispatching option. The problem was that a portlet can show edit_defaults icon when it does not even EDIT mode.
DecoratorValve now checks if a portlet supports edit mode in auto-dispatching option.
Also, two edit pages for bookmark portlets are updated because the edit pages can be used for both edit and edit_defaults mode now.
Modified:
portals/jetspeed-2/trunk/applications/demo/src/webapp/WEB-INF/view/bookmark-edit-xhtmlbasic.jsp
portals/jetspeed-2/trunk/applications/demo/src/webapp/WEB-INF/view/bookmark-edit.jsp
portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationValve.java
Modified: portals/jetspeed-2/trunk/applications/demo/src/webapp/WEB-INF/view/bookmark-edit-xhtmlbasic.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/demo/src/webapp/WEB-INF/view/bookmark-edit-xhtmlbasic.jsp?rev=581786&r1=581785&r2=581786&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/demo/src/webapp/WEB-INF/view/bookmark-edit-xhtmlbasic.jsp (original)
+++ portals/jetspeed-2/trunk/applications/demo/src/webapp/WEB-INF/view/bookmark-edit-xhtmlbasic.jsp Thu Oct 4 00:02:41 2007
@@ -18,7 +18,7 @@
<%@ page import="javax.portlet.*"%>
<%@ page import="java.util.*"%>
<%@ taglib uri='/WEB-INF/portlet.tld' prefix='portlet'%>
-<portlet:actionURL portletMode="edit" var="myAction">
+<portlet:actionURL var="myAction">
<portlet:param name="add" value="add"/>
</portlet:actionURL>
<portlet:actionURL portletMode="view" var="myCancel"/>
Modified: portals/jetspeed-2/trunk/applications/demo/src/webapp/WEB-INF/view/bookmark-edit.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/demo/src/webapp/WEB-INF/view/bookmark-edit.jsp?rev=581786&r1=581785&r2=581786&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/demo/src/webapp/WEB-INF/view/bookmark-edit.jsp (original)
+++ portals/jetspeed-2/trunk/applications/demo/src/webapp/WEB-INF/view/bookmark-edit.jsp Thu Oct 4 00:02:41 2007
@@ -19,7 +19,7 @@
<%@ page import="java.util.*"%>
<%@ taglib uri='/WEB-INF/portlet.tld' prefix='portlet'%>
-<portlet:actionURL portletMode="edit" var="myAction">
+<portlet:actionURL var="myAction">
<portlet:param name="add" value="add"/>
</portlet:actionURL>
Modified: portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationValve.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationValve.java?rev=581786&r1=581785&r2=581786&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationValve.java (original)
+++ portals/jetspeed-2/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationValve.java Thu Oct 4 00:02:41 2007
@@ -366,7 +366,8 @@
DecoratorActionsFactory actionsAdapter = getDecoratorActionsAdapter(decoration);
- Iterator iter = actionsAdapter.getSupportedActions(requestContext, pa, window, currentMappedMode, currentMappedState, decoration).iterator();
+ List supportedActions = actionsAdapter.getSupportedActions(requestContext, pa, window, currentMappedMode, currentMappedState, decoration);
+ Iterator iter = supportedActions.iterator();
String currentModeAction = null;
String currentStateAction = null;
@@ -388,7 +389,7 @@
}
if ( ! equalsCurrentMode || isAjaxRequest )
{
- if ( (content.supportsPortletMode(customMode) || isAutoSwitchableCustomMode(customMode))
+ if ( (content.supportsPortletMode(customMode) || isAutoSwitchableCustomMode(content, customMode))
&& (!PortletMode.EDIT.equals(customMode) || pageActionAccess.isEditAllowed())
&& pageActionAccess.checkPortletMode(fragmentId, portletName, mappedMode)
)
@@ -646,11 +647,11 @@
return this.autoSwitchingToEditDefaultsModes;
}
- private boolean isAutoSwitchableCustomMode(PortletMode customMode)
+ private boolean isAutoSwitchableCustomMode(ContentTypeSet content, PortletMode customMode)
{
if (this.autoSwitchingToEditDefaultsModes)
{
- if (JetspeedActions.EDIT_DEFAULTS_MODE.equals(customMode))
+ if (content.supportsPortletMode(PortletMode.EDIT) && JetspeedActions.EDIT_DEFAULTS_MODE.equals(customMode))
{
return true;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org