Author: ppalaga
Date: 2012-06-29 08:10:35 -0400 (Fri, 29 Jun 2012)
New Revision: 8758
Modified:
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/WEB-INF/classes/locale/portlet/dashboard/TabbedDashboardPortlet_cs.properties
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/WEB-INF/classes/locale/portlet/dashboard/TabbedDashboardPortlet_de.properties
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/WEB-INF/classes/locale/portlet/dashboard/TabbedDashboardPortlet_en.properties
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/WEB-INF/classes/locale/portlet/dashboard/TabbedDashboardPortlet_fr.properties
Log:
Bug 805527 - message when adding dashboard page with invalid name
Modified:
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java 2012-06-29
11:13:50 UTC (rev 8757)
+++
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java 2012-06-29
12:10:35 UTC (rev 8758)
@@ -35,7 +35,6 @@
import org.exoplatform.portal.webui.page.UIPageBody;
import org.exoplatform.portal.webui.portal.UIPortal;
import org.exoplatform.portal.webui.util.Util;
-import org.exoplatform.portal.webui.workspace.UIPortalApplication;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.web.application.ApplicationMessage;
@@ -264,7 +263,7 @@
return null;
}
- String uniqueNodeName = nodeLabel.toLowerCase().replace(' ',
'_');
+ String uniqueNodeName = buildName(nodeLabel);
SiteKey siteKey = userNav.getKey();
Page page =
@@ -304,16 +303,23 @@
{
return false;
}
+ return true;
+ }
+
+ private String buildName(String label)
+ {
+ StringBuffer nodeName = new StringBuffer();
for (int i = 0; i < label.length(); i++)
{
char c = label.charAt(i);
- if (Character.isLetter(c) || Character.isDigit(c) || c == '_' || c ==
'-' || Character.isSpaceChar(c))
+ if (Character.isLetter(c) || Character.isDigit(c) || c == '_' || c ==
'-')
{
+ nodeName.append(c);
continue;
}
- return false;
+ nodeName.append("_");
}
- return true;
+ return nodeName.toString();
}
public UserNode renamePageNode(String nodeName, String newNodeLabel)
@@ -328,7 +334,7 @@
UserNode renamedNode = parentNode.getChild(nodeName);
renamedNode.setLabel(newNodeLabel);
- String newNodeName = newNodeLabel.toLowerCase().replace(' ',
'_');
+ String newNodeName = buildName(newNodeLabel);
if (parentNode.getChild(newNodeName) != null)
{
newNodeName = newNodeName + "_" + System.currentTimeMillis();
Modified:
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/WEB-INF/classes/locale/portlet/dashboard/TabbedDashboardPortlet_cs.properties
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/WEB-INF/classes/locale/portlet/dashboard/TabbedDashboardPortlet_cs.properties 2012-06-29
11:13:50 UTC (rev 8757)
+++
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/WEB-INF/classes/locale/portlet/dashboard/TabbedDashboardPortlet_cs.properties 2012-06-29
12:10:35 UTC (rev 8758)
@@ -18,11 +18,11 @@
# 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
#
-UITabPaneDashboard.action.addNewDashboard=P\u0159idat n\u00E1st\u011Bnku
-UITabPaneDashboard.action.switchShowRange=Zm\u011Bnit rozsah
-UITabPaneDashboard.msg.cannotDeleteLastTab=Nemohu smazat posledn\u00ED
z\u00E1lo\u017Eku.
-UITabPaneDashboard.msg.deleteTab=Opravdu chcete smazat tuto n\u00E1st\u011Bnku?
-UITabPaneDashboard.msg.wrongTabName={0}: je nespr\u00E1vn\u00E1; pouze p\u00EDsmena,
\u010D\u00EDslice, podtr\u017E\u00EDtko, poml\u010Dka a mezera jsou povoleny.
+UITabPaneDashboard.action.addNewDashboard=P\u0159idat n\u00e1st\u011bnku
+UITabPaneDashboard.action.switchShowRange=Zm\u011bnit rozsah
+UITabPaneDashboard.msg.cannotDeleteLastTab=Nemohu smazat posledn\u00ed
z\u00e1lo\u017eku.
+UITabPaneDashboard.msg.deleteTab=Opravdu chcete smazat tuto n\u00e1st\u011bnku?
+UITabPaneDashboard.msg.wrongTabName=Jm\u00e9no mus\u00ed b\u00fdt vypln\u011bno a
mus\u00ed za\u010d\u00ednat p\u00edsmenem.
# Copyright (C) 2009 eXo Platform SAS.
#
# This is free software; you can redistribute it and/or modify it
@@ -45,4 +45,4 @@
UITabPaneDashboard.action.switchShowRange=Zm\u011bnit rozsah
UITabPaneDashboard.msg.cannotDeleteLastTab=Nemohu smazat posledn\u00ed
z\u00e1lo\u017eku.
UITabPaneDashboard.msg.deleteTab=Opravdu chcete smazat tuto n\u00e1st\u011bnku?
-UITabPaneDashboard.msg.wrongTabName={0}: je nespr\u00e1vn\u00e1; pouze p\u00edsmena,
\u010d\u00edslice, podtr\u017e\u00edtko, poml\u010dka a mezera jsou povoleny.
+UITabPaneDashboard.msg.wrongTabName=Jm\u00e9no mus\u00ed b\u00fdt vypln\u011bno a
mus\u00ed za\u010d\u00ednat p\u00edsmenem.
Modified:
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/WEB-INF/classes/locale/portlet/dashboard/TabbedDashboardPortlet_de.properties
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/WEB-INF/classes/locale/portlet/dashboard/TabbedDashboardPortlet_de.properties 2012-06-29
11:13:50 UTC (rev 8757)
+++
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/WEB-INF/classes/locale/portlet/dashboard/TabbedDashboardPortlet_de.properties 2012-06-29
12:10:35 UTC (rev 8758)
@@ -21,4 +21,4 @@
UITabPaneDashboard.action.switchShowRange=Switch Range
UITabPaneDashboard.msg.deleteTab=M\u00f6chten Sie wirklich dieses Dashboard entfernen?
UITabPaneDashboard.msg.cannotDeleteLastTab=Die letzte Registerkarte kann nicht
gel\u00f6scht werden.
-UITabPaneDashboard.msg.wrongTabName=Es sind nur Buchstaben und Zahlen sowie Unterstrich,
Freizeichen und Bindestrich erlaubt.
\ No newline at end of file
+UITabPaneDashboard.msg.wrongTabName=Der Name muss ausgef\u00fcllt werden und es muss mit
einem Buchtaben anfangen.
\ No newline at end of file
Modified:
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/WEB-INF/classes/locale/portlet/dashboard/TabbedDashboardPortlet_en.properties
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/WEB-INF/classes/locale/portlet/dashboard/TabbedDashboardPortlet_en.properties 2012-06-29
11:13:50 UTC (rev 8757)
+++
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/WEB-INF/classes/locale/portlet/dashboard/TabbedDashboardPortlet_en.properties 2012-06-29
12:10:35 UTC (rev 8758)
@@ -21,4 +21,4 @@
UITabPaneDashboard.action.switchShowRange=Switch Range
UITabPaneDashboard.msg.deleteTab=Really want to remove this dashboard?
UITabPaneDashboard.msg.cannotDeleteLastTab=Can not delete the last tab.
-UITabPaneDashboard.msg.wrongTabName={0}: is invalid; only alpha, digit, underscore, dash
and space characters allowed.
\ No newline at end of file
+UITabPaneDashboard.msg.wrongTabName=Name cannot be empty and must start with a character
\ No newline at end of file
Modified:
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/WEB-INF/classes/locale/portlet/dashboard/TabbedDashboardPortlet_fr.properties
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/WEB-INF/classes/locale/portlet/dashboard/TabbedDashboardPortlet_fr.properties 2012-06-29
11:13:50 UTC (rev 8757)
+++
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/webapp/WEB-INF/classes/locale/portlet/dashboard/TabbedDashboardPortlet_fr.properties 2012-06-29
12:10:35 UTC (rev 8758)
@@ -20,5 +20,5 @@
UITabPaneDashboard.action.addNewDashboard =Ajoute Dashboard
UITabPaneDashboard.action.switchShowRange =Decale
UITabPaneDashboard.msg.deleteTab=Really want to remove this dashboard?
-UITabPaneDashboard.msg.cannotDeleteLastTab=Can not delete the last tab.
-UITabPaneDashboard.msg.wrongTabName={0}: is invalid; only alpha, digit, underscore, dash
and space characters allowed.
\ No newline at end of file
+UITabPaneDashboard.msg.cannotDeleteLastTab=Impossible de supprimer le dernier onglet
+UITabPaneDashboard.msg.wrongTabName=Nom ne peut pas \u00eatre vide et doit commencer par
un caract\u00e8re
\ No newline at end of file