Author: thomas.heute(a)jboss.com
Date: 2008-10-29 12:01:06 -0400 (Wed, 29 Oct 2008)
New Revision: 12211
Modified:
tags/JBoss_Portal_2_6_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
tags/JBoss_Portal_2_6_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
Log:
JBPORTAL-2222: Moving a folder into itself in CMS raise an exception
Modified:
tags/JBoss_Portal_2_6_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
---
tags/JBoss_Portal_2_6_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2008-10-29
15:57:15 UTC (rev 12210)
+++
tags/JBoss_Portal_2_6_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2008-10-29
16:01:06 UTC (rev 12211)
@@ -1158,7 +1158,25 @@
String sTo = aReq.getParameter("destination");
String sFrom = aReq.getParameter("source");
String sType = aReq.getParameter("type");
+
+ if (sTo.startsWith(sFrom))
+ {
+ List messages = new ArrayList();
+
messages.add(this.resources.getObject("CMS_CANT_MOVE_SAME_DESTINATION"));
+ aReq.getPortletSession().setAttribute("messages", messages);
+ try
+ {
+ String sParentPath = NodeUtil.getParentPath(sFrom);
+ aRes.setRenderParameter("path", sParentPath);
+ }
+ catch (Exception e)
+ {
+ }
+ return;
+ }
+
+
if (!"".equals(sTo) && !"".equals(sFrom)
&& !"".equals(sType))
{
String sNodeName = sFrom.substring(sFrom.lastIndexOf("/") + 1,
sFrom.length());
Modified:
tags/JBoss_Portal_2_6_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
===================================================================
---
tags/JBoss_Portal_2_6_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2008-10-29
15:57:15 UTC (rev 12210)
+++
tags/JBoss_Portal_2_6_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2008-10-29
16:01:06 UTC (rev 12211)
@@ -145,6 +145,7 @@
CMS_FOLDERNAME_INVALID=Folder Name is invalid. It may not contain illegal characters such
as '.', '/', ':', '[', ']', '*',
''', '"', '|' or any whitespace character.
CMS_MSG_DESTINATION_ALREADY_EXISTS=The command was not performed, because the destination
already exists.
+CMS_CANT_MOVE_SAME_DESTINATION=You cannot move a folder to the same location
CMS_DATE_PATTERN=MM/dd/yy HH:mm