gatein SVN: r4944 - portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-11-04 10:58:12 -0400 (Thu, 04 Nov 2010)
New Revision: 4944
Modified:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RenderContext.java
Log:
minor javadoc
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RenderContext.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RenderContext.java 2010-11-04 14:56:33 UTC (rev 4943)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RenderContext.java 2010-11-04 14:58:12 UTC (rev 4944)
@@ -33,6 +33,7 @@
* Append a char to the path.
*
* @param c the char to append
+ * @param escape when the char should be escaped
*/
void appendPath(char c, boolean escape);
@@ -40,6 +41,7 @@
* Append a string to the path.
*
* @param s the string to append.
+ * @param escape when the char should be escaped
*/
void appendPath(String s, boolean escape);
14 years, 2 months
gatein SVN: r4943 - portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-11-04 10:56:33 -0400 (Thu, 04 Nov 2010)
New Revision: 4943
Added:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RequestParam.java
Removed:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RequestParamDef.java
Modified:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Route.java
Log:
rename for more consistency
Copied: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RequestParam.java (from rev 4919, portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RequestParamDef.java)
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RequestParam.java (rev 0)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RequestParam.java 2010-11-04 14:56:33 UTC (rev 4943)
@@ -0,0 +1,146 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.web.controller.router;
+
+import org.exoplatform.web.controller.QualifiedName;
+import org.exoplatform.web.controller.metadata.RequestParamDescriptor;
+
+import java.util.regex.Pattern;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+class RequestParam
+{
+
+ /** . */
+ final QualifiedName name;
+
+ /** . */
+ final String matchName;
+
+ /** . */
+ final Pattern matchValue;
+
+ /** . */
+ final boolean required;
+
+ RequestParam(RequestParamDescriptor descriptor)
+ {
+ if (descriptor == null)
+ {
+ throw new NullPointerException("No null descriptor accepted");
+ }
+
+ //
+ Pattern matchValue = null;
+ if (descriptor.getMatchValue() != null)
+ {
+ PatternBuilder matchValueBuilder = new PatternBuilder();
+ matchValueBuilder.expr("^");
+ int level = 0;
+ for (char c : descriptor.getMatchValue().toCharArray())
+ {
+ switch (c)
+ {
+ case '{':
+
+ if (level++ > 0)
+ {
+ matchValueBuilder.expr('{');
+ }
+ break;
+ case '}':
+ if (--level > 0)
+ {
+ matchValueBuilder.expr('}');
+ }
+ break;
+ default:
+ if (level == 0)
+ {
+ matchValueBuilder.litteral(c);
+ }
+ else
+ {
+ matchValueBuilder.expr(c);
+ }
+ break;
+ }
+ }
+ matchValueBuilder.expr("$");
+ matchValue = matchValueBuilder.build();
+ }
+
+ //
+ this.name = descriptor.getName();
+ this.matchName = descriptor.getMatchName();
+ this.matchValue = matchValue;
+ this.required = descriptor.isRequired();
+ }
+
+ RequestParam(QualifiedName name, String matchName, Pattern matchValue, boolean required)
+ {
+ if (name == null)
+ {
+ throw new NullPointerException("No null name accepted");
+ }
+ if (matchName == null)
+ {
+ throw new NullPointerException("No null match name accepted");
+ }
+ if (matchValue == null)
+ {
+ throw new NullPointerException("No null match value accepted");
+ }
+
+ //
+ this.name = name;
+ this.matchName = matchName;
+ this.matchValue = matchValue;
+ this.required = required;
+ }
+
+ public QualifiedName getName()
+ {
+ return name;
+ }
+
+ public String getMatchName()
+ {
+ return matchName;
+ }
+
+ public Pattern getMatchValue()
+ {
+ return matchValue;
+ }
+
+ public boolean matchValue(String value)
+ {
+ return matchValue == null || matchValue.matcher(value).matches();
+ }
+
+ public boolean isRequired()
+ {
+ return required;
+ }
+}
Deleted: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RequestParamDef.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RequestParamDef.java 2010-11-04 14:54:55 UTC (rev 4942)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RequestParamDef.java 2010-11-04 14:56:33 UTC (rev 4943)
@@ -1,146 +0,0 @@
-/*
- * Copyright (C) 2010 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.web.controller.router;
-
-import org.exoplatform.web.controller.QualifiedName;
-import org.exoplatform.web.controller.metadata.RequestParamDescriptor;
-
-import java.util.regex.Pattern;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-class RequestParamDef
-{
-
- /** . */
- final QualifiedName name;
-
- /** . */
- final String matchName;
-
- /** . */
- final Pattern matchValue;
-
- /** . */
- final boolean required;
-
- RequestParamDef(RequestParamDescriptor descriptor)
- {
- if (descriptor == null)
- {
- throw new NullPointerException("No null descriptor accepted");
- }
-
- //
- Pattern matchValue = null;
- if (descriptor.getMatchValue() != null)
- {
- PatternBuilder matchValueBuilder = new PatternBuilder();
- matchValueBuilder.expr("^");
- int level = 0;
- for (char c : descriptor.getMatchValue().toCharArray())
- {
- switch (c)
- {
- case '{':
-
- if (level++ > 0)
- {
- matchValueBuilder.expr('{');
- }
- break;
- case '}':
- if (--level > 0)
- {
- matchValueBuilder.expr('}');
- }
- break;
- default:
- if (level == 0)
- {
- matchValueBuilder.litteral(c);
- }
- else
- {
- matchValueBuilder.expr(c);
- }
- break;
- }
- }
- matchValueBuilder.expr("$");
- matchValue = matchValueBuilder.build();
- }
-
- //
- this.name = descriptor.getName();
- this.matchName = descriptor.getMatchName();
- this.matchValue = matchValue;
- this.required = descriptor.isRequired();
- }
-
- RequestParamDef(QualifiedName name, String matchName, Pattern matchValue, boolean required)
- {
- if (name == null)
- {
- throw new NullPointerException("No null name accepted");
- }
- if (matchName == null)
- {
- throw new NullPointerException("No null match name accepted");
- }
- if (matchValue == null)
- {
- throw new NullPointerException("No null match value accepted");
- }
-
- //
- this.name = name;
- this.matchName = matchName;
- this.matchValue = matchValue;
- this.required = required;
- }
-
- public QualifiedName getName()
- {
- return name;
- }
-
- public String getMatchName()
- {
- return matchName;
- }
-
- public Pattern getMatchValue()
- {
- return matchValue;
- }
-
- public boolean matchValue(String value)
- {
- return matchValue == null || matchValue.matcher(value).matches();
- }
-
- public boolean isRequired()
- {
- return required;
- }
-}
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Route.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Route.java 2010-11-04 14:54:55 UTC (rev 4942)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Route.java 2010-11-04 14:56:33 UTC (rev 4943)
@@ -62,7 +62,7 @@
private final Map<QualifiedName, String> routeParameters;
/** . */
- private final Map<String, RequestParamDef> requestParamDefs;
+ private final Map<String, RequestParam> requestParamDefs;
Route()
{
@@ -71,7 +71,7 @@
this.segments = new LinkedHashMap<String, List<SegmentRoute>>();
this.patterns = new ArrayList<PatternRoute>();
this.routeParameters = new HashMap<QualifiedName, String>();
- this.requestParamDefs = new HashMap<String, RequestParamDef>();
+ this.requestParamDefs = new HashMap<String, RequestParam>();
}
/*
@@ -97,7 +97,7 @@
//
if (requestParamDefs.size() > 0)
{
- for (RequestParamDef requestParamDef : requestParamDefs.values())
+ for (RequestParam requestParamDef : requestParamDefs.values())
{
String s = blah.get(requestParamDef.getName());
if (s != null)
@@ -180,7 +180,7 @@
// Match any request parameter
if (requestParamDefs.size() > 0)
{
- for (RequestParamDef requestParamDef : requestParamDefs.values())
+ for (RequestParam requestParamDef : requestParamDefs.values())
{
String a = blah.get(requestParamDef.name);
if (a != null)
@@ -284,7 +284,7 @@
Map<QualifiedName, String> routeRequestParams = Collections.emptyMap();
if (requestParamDefs.size() > 0)
{
- for (RequestParamDef requestParamDef : requestParamDefs.values())
+ for (RequestParam requestParamDef : requestParamDefs.values())
{
String value = null;
String[] values = requestParams.get(requestParamDef.getMatchName());
@@ -510,7 +510,7 @@
route.routeParameters.putAll(descriptor.getParams());
for (RequestParamDescriptor requestParamDescriptor : descriptor.getRequestParams().values())
{
- RequestParamDef requestParamDef = new RequestParamDef(requestParamDescriptor);
+ RequestParam requestParamDef = new RequestParam(requestParamDescriptor);
route.requestParamDefs.put(requestParamDef.getMatchName(), requestParamDef);
}
14 years, 2 months
gatein SVN: r4942 - in portal/branches/navcontroller/component/web/controller/src: test/java/org/exoplatform/web/controller/router and 1 other directory.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-11-04 10:54:55 -0400 (Thu, 04 Nov 2010)
New Revision: 4942
Added:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternParam.java
Removed:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternParamDef.java
Modified:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternRoute.java
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Route.java
portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestBuildRoute.java
Log:
minor improvement
Copied: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternParam.java (from rev 4941, portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternParamDef.java)
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternParam.java (rev 0)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternParam.java 2010-11-04 14:54:55 UTC (rev 4942)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.web.controller.router;
+
+import org.exoplatform.web.controller.QualifiedName;
+
+import java.util.regex.Pattern;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+class PatternParam
+{
+
+ /** . */
+ final QualifiedName name;
+
+ /** . */
+ final EncodingMode encodingMode;
+
+ /** . */
+ final Pattern pattern;
+
+ PatternParam(QualifiedName name, EncodingMode encodingMode, Pattern pattern)
+ {
+ this.name = name;
+ this.encodingMode = encodingMode;
+ this.pattern = pattern;
+ }
+}
Deleted: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternParamDef.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternParamDef.java 2010-11-04 11:22:09 UTC (rev 4941)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternParamDef.java 2010-11-04 14:54:55 UTC (rev 4942)
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2010 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.web.controller.router;
-
-import java.util.regex.Pattern;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-class PatternParamDef
-{
-
- /** . */
- final EncodingMode encodingMode;
-
- /** . */
- final Pattern pattern;
-
- PatternParamDef(EncodingMode encodingMode, Pattern pattern)
- {
- this.encodingMode = encodingMode;
- this.pattern = pattern;
- }
-}
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternRoute.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternRoute.java 2010-11-04 11:22:09 UTC (rev 4941)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternRoute.java 2010-11-04 14:54:55 UTC (rev 4942)
@@ -19,8 +19,6 @@
package org.exoplatform.web.controller.router;
-import org.exoplatform.web.controller.QualifiedName;
-
import java.util.List;
import java.util.regex.Pattern;
@@ -35,29 +33,24 @@
final Pattern pattern;
/** . */
- final List<QualifiedName> parameterNames;
+ final List<PatternParam> params;
/** . */
- final List<PatternParamDef> parameterPatterns;
-
- /** . */
final List<String> chunks;
PatternRoute(
Pattern pattern,
- List<QualifiedName> parameterNames,
- List<PatternParamDef> parameterPatterns,
+ List<PatternParam> params,
List<String> chunks)
{
- if (chunks.size() != parameterNames.size() + 1)
+ if (chunks.size() != params.size() + 1)
{
- throw new AssertionError("Was expecting chunk size " + chunks.size() + " to be equals to " + parameterNames.size() + 1);
+ throw new AssertionError("Was expecting chunk size " + chunks.size() + " to be equals to " + params.size() + 1);
}
//
this.pattern = pattern;
- this.parameterNames = parameterNames;
- this.parameterPatterns = parameterPatterns;
+ this.params = params;
this.chunks = chunks;
}
}
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Route.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Route.java 2010-11-04 11:22:09 UTC (rev 4941)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Route.java 2010-11-04 14:54:55 UTC (rev 4942)
@@ -119,11 +119,11 @@
PatternRoute pr = (PatternRoute)this;
renderContext.appendPath('/', false);
int i = 0;
- while (i < pr.parameterNames.size())
+ while (i < pr.params.size())
{
renderContext.appendPath(pr.chunks.get(i), true);
- String value = blah.get(pr.parameterNames.get(i));
- PatternParamDef def = pr.parameterPatterns.get(i);
+ PatternParam def = pr.params.get(i);
+ String value = blah.get(def.name);
//
int from = 0;
@@ -203,15 +203,14 @@
if (this instanceof PatternRoute)
{
PatternRoute prt = (PatternRoute)this;
- for (int i = 0;i < prt.parameterNames.size();i++)
+ for (int i = 0;i < prt.params.size();i++)
{
- QualifiedName qd = prt.parameterNames.get(i);
- PatternParamDef ppd = prt.parameterPatterns.get(i);
- String s = blah.get(qd);
+ PatternParam param = prt.params.get(i);
+ String s = blah.get(param.name);
boolean matched = false;
if (s != null)
{
- switch (ppd.encodingMode)
+ switch (param.encodingMode)
{
case DEFAULT_FORM:
@@ -220,10 +219,10 @@
// FIX ME
s = s.replace('/', '~');
- matched = ppd.pattern.matcher(s).matches();
+ matched = param.pattern.matcher(s).matches();
break;
case PRESERVE_PATH:
- matched = ppd.pattern.matcher(s).matches();
+ matched = param.pattern.matcher(s).matches();
break;
default:
throw new AssertionError();
@@ -231,7 +230,7 @@
}
if (matched)
{
- abc.remove(qd);
+ abc.remove(param.name);
}
else
{
@@ -391,15 +390,15 @@
{
// Append parameters
int group = 1;
- for (int i = 0;i < route.parameterNames.size();i++)
+ for (int i = 0;i < route.params.size();i++)
{
- QualifiedName parameterName = route.parameterNames.get(i);
+ PatternParam param = route.params.get(i);
String value = matcher.group(group++);
- if (route.parameterPatterns.get(i).encodingMode == EncodingMode.DEFAULT_FORM)
+ if (param.encodingMode == EncodingMode.DEFAULT_FORM)
{
value = value.replace(slashEscape, '/');
}
- response.put(parameterName, value);
+ response.put(param.name, value);
}
//
@@ -600,7 +599,7 @@
PatternBuilder builder = new PatternBuilder();
builder.expr("^");
List<String> chunks = new ArrayList<String>();
- List<PatternParamDef> parameterPatterns = new ArrayList<PatternParamDef>();
+ List<PatternParam> parameterPatterns = new ArrayList<PatternParam>();
int previous = 0;
for (int i = 0;i < start.size();i++)
{
@@ -625,8 +624,7 @@
builder.expr("(");
builder.expr(regex);
builder.expr(")");
- parameterNames.add(parameterQName);
- parameterPatterns.add(new PatternParamDef(encodingMode, Pattern.compile("^" + regex + "$")));
+ parameterPatterns.add(new PatternParam(parameterQName, encodingMode, Pattern.compile("^" + regex + "$")));
previous = end.get(i) + 1;
}
builder.litteral(path, previous, pos);
@@ -634,7 +632,7 @@
// Julien : should the pattern end with a $ ?????? I don't see that for now
// we need to figure out clearly
Pattern pattern = builder.build();
- PatternRoute route = new PatternRoute(pattern, parameterNames, parameterPatterns, chunks);
+ PatternRoute route = new PatternRoute(pattern, parameterPatterns, chunks);
// Wire
add(route);
Modified: portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestBuildRoute.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestBuildRoute.java 2010-11-04 11:22:09 UTC (rev 4941)
+++ portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestBuildRoute.java 2010-11-04 14:54:55 UTC (rev 4942)
@@ -74,10 +74,10 @@
assertEquals(1, router.root.getPatternSize());
PatternRoute patternRoute = router.root.getPattern(0);
assertEquals("^([^/]+)", patternRoute.pattern.toString());
- assertEquals(Collections.singletonList(new QualifiedName("a")), patternRoute.parameterNames);
- assertEquals(1, patternRoute.parameterPatterns.size());
- assertEquals("^[^/]+$", patternRoute.parameterPatterns.get(0).pattern.toString());
- assertEquals(EncodingMode.DEFAULT_FORM, patternRoute.parameterPatterns.get(0).encodingMode);
+ assertEquals(1, patternRoute.params.size());
+ assertEquals(new QualifiedName("a"), patternRoute.params.get(0).name);
+ assertEquals("^[^/]+$", patternRoute.params.get(0).pattern.toString());
+ assertEquals(EncodingMode.DEFAULT_FORM, patternRoute.params.get(0).encodingMode);
assertEquals(2, patternRoute.chunks.size());
assertEquals("", patternRoute.chunks.get(0));
assertEquals("", patternRoute.chunks.get(1));
@@ -98,10 +98,10 @@
assertEquals(1, router.root.getPatternSize());
PatternRoute patternRoute = router.root.getPattern(0);
assertEquals("^([^/]+)", patternRoute.pattern.toString());
- assertEquals(Collections.singletonList(new QualifiedName("q", "a")), patternRoute.parameterNames);
- assertEquals(1, patternRoute.parameterPatterns.size());
- assertEquals("^[^/]+$", patternRoute.parameterPatterns.get(0).pattern.toString());
- assertEquals(EncodingMode.DEFAULT_FORM, patternRoute.parameterPatterns.get(0).encodingMode);
+ assertEquals(1, patternRoute.params.size());
+ assertEquals(new QualifiedName("q", "a"), patternRoute.params.get(0).name);
+ assertEquals("^[^/]+$", patternRoute.params.get(0).pattern.toString());
+ assertEquals(EncodingMode.DEFAULT_FORM, patternRoute.params.get(0).encodingMode);
assertEquals(2, patternRoute.chunks.size());
assertEquals("", patternRoute.chunks.get(0));
assertEquals("", patternRoute.chunks.get(1));
@@ -122,10 +122,10 @@
assertEquals(1, router.root.getPatternSize());
PatternRoute patternRoute = router.root.getPattern(0);
assertEquals("^(.*)", patternRoute.pattern.toString());
- assertEquals(Collections.singletonList(new QualifiedName("a")), patternRoute.parameterNames);
- assertEquals(1, patternRoute.parameterPatterns.size());
- assertEquals("^.*$", patternRoute.parameterPatterns.get(0).pattern.toString());
- assertEquals(EncodingMode.DEFAULT_FORM, patternRoute.parameterPatterns.get(0).encodingMode);
+ assertEquals(1, patternRoute.params.size());
+ assertEquals(new QualifiedName("a"), patternRoute.params.get(0).name);
+ assertEquals("^.*$", patternRoute.params.get(0).pattern.toString());
+ assertEquals(EncodingMode.DEFAULT_FORM, patternRoute.params.get(0).encodingMode);
assertEquals(2, patternRoute.chunks.size());
assertEquals("", patternRoute.chunks.get(0));
assertEquals("", patternRoute.chunks.get(1));
@@ -169,7 +169,15 @@
if (route instanceof PatternRoute)
{
assertEquals(((PatternRoute)expectedRoute).pattern.toString(), ((PatternRoute)route).pattern.toString());
- assertEquals(((PatternRoute)expectedRoute).parameterNames, ((PatternRoute)route).parameterNames);
+ assertEquals(((PatternRoute)expectedRoute).params.size(), ((PatternRoute)route).params.size());
+ for (int i = 0;i < ((PatternRoute)expectedRoute).params.size();i++)
+ {
+ PatternParam expectedParam = ((PatternRoute)expectedRoute).params.get(i);
+ PatternParam param = ((PatternRoute)route).params.get(i);
+ assertEquals(expectedParam.name, param.name);
+ assertEquals(expectedParam.pattern.toString(), param.pattern.toString());
+ assertEquals(expectedParam.encodingMode, param.encodingMode);
+ }
}
else if (route instanceof SegmentRoute)
{
14 years, 2 months
gatein SVN: r4941 - in portal/branches/navcontroller: component/web/controller/src/main/java/org/exoplatform/web and 10 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-11-04 07:22:09 -0400 (Thu, 04 Nov 2010)
New Revision: 4941
Added:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/PathParamDescriptor.java
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/EncodingMode.java
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternParamDef.java
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURLRenderContext.java
Modified:
portal/branches/navcontroller/component/web/controller/src/main/java/gatein_router_1_0.xsd
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/ControllerContext.java
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/QualifiedName.java
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/DescriptorBuilder.java
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/RouteDescriptor.java
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternRoute.java
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RenderContext.java
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Route.java
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/SimpleRenderContext.java
portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestBuildRoute.java
portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestDescriptorBuilder.java
portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestLegacyPortal.java
portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestMatch.java
portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestPortalConfiguration.java
portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestRender.java
portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/router.xml
portal/branches/navcontroller/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component/UIUserToolBarGroupPortlet.gtmpl
portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/default-router.xml
portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/proto-router-1.xml
portal/branches/navcontroller/web/portal/src/main/webapp/groovy/webui/core/UISitemapTree.gtmpl
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURL.java
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java
Log:
improve encoding of char in request path and url path
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/gatein_router_1_0.xsd
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/gatein_router_1_0.xsd 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/gatein_router_1_0.xsd 2010-11-04 11:22:09 UTC (rev 4941)
@@ -39,6 +39,7 @@
<xs:complexType name="routeType">
<xs:sequence>
<xs:element name="param" type="paramType" minOccurs="0" maxOccurs="unbounded"/>
+ <xs:element name="path-param" type="pathParamType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="request-param" type="requestParamType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="route" type="routeType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
@@ -50,6 +51,19 @@
<xs:attribute name="value" type="xs:string" use="required"/>
</xs:complexType>
+ <xs:complexType name="pathParamType">
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="pattern" type="xs:string" use="optional"/>
+ <xs:attribute name="encoding" use="optional">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="default-form"/>
+ <xs:enumeration value="preserve-path"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+ </xs:complexType>
+
<xs:complexType name="requestParamType">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="matchName" type="xs:string" use="required"/>
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/ControllerContext.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/ControllerContext.java 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/ControllerContext.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -49,6 +49,9 @@
/** . */
private SimpleRenderContext renderContext;
+ /** . */
+ private final String contextName;
+
public ControllerContext(
WebAppController controller,
HttpServletRequest request,
@@ -60,6 +63,7 @@
this.response = response;
this.parameters = parameters;
this.renderContext = null;
+ this.contextName = request.getContextPath().substring(1);
}
public WebAppController getController()
@@ -84,9 +88,12 @@
public void renderURL(Map<QualifiedName, String> parameters, RenderContext renderContext)
{
- renderContext.appendPath(request.getContextPath());
+ renderContext.appendPath('/', false);
//
+ renderContext.appendPath(contextName, true);
+
+ //
controller.router.render(parameters, renderContext);
}
@@ -102,9 +109,12 @@
}
//
- renderContext.appendPath(request.getContextPath());
+ renderContext.appendPath('/', false);
//
+ renderContext.appendPath(contextName, true);
+
+ //
controller.router.render(parameters, renderContext);
//
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/QualifiedName.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/QualifiedName.java 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/QualifiedName.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -33,13 +33,10 @@
{
if (qname.length() > 0)
{
- if (qname.charAt(0) == '{')
+ int index = qname.indexOf(':');
+ if (index > -1)
{
- int index = qname.indexOf('}', 1);
- if (index != -1)
- {
- return new QualifiedName(qname.substring(1, index), qname.substring(index + 1));
- }
+ return new QualifiedName(qname.substring(0, index), qname.substring(index + 1));
}
}
return new QualifiedName(qname);
@@ -101,7 +98,7 @@
}
else
{
- return "{" + qualifier + "}" + name;
+ return qualifier + ":" + name;
}
}
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/DescriptorBuilder.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/DescriptorBuilder.java 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/DescriptorBuilder.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -20,6 +20,7 @@
package org.exoplatform.web.controller.metadata;
import org.exoplatform.web.controller.QualifiedName;
+import org.exoplatform.web.controller.router.EncodingMode;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamConstants;
@@ -43,10 +44,11 @@
/** . */
private static final QName requestParamQN = new QName("http://www.gatein.org/xml/ns/gatein_router_1_0", "request-param");
+ /** . */
+ private static final QName pathParamQN = new QName("http://www.gatein.org/xml/ns/gatein_router_1_0", "path-param");
+
public RouterDescriptor build(XMLStreamReader reader) throws Exception
{
- System.out.println("reader = " + reader);
- System.out.println("reader = " + reader.getClass().getName());
RouterDescriptor routerDesc = new RouterDescriptor();
//
@@ -103,6 +105,14 @@
String optional = reader.getAttributeValue(null, "required");
routeDesc.addRequestParam(QualifiedName.parse(name), matchName, matchValue, "true".equals(optional));
}
+ else if (pathParamQN.equals(reader.getName()))
+ {
+ String name = reader.getAttributeValue(null, "name");
+ String pattern = reader.getAttributeValue(null, "pattern");
+ String encoded = reader.getAttributeValue(null, "encoding");
+ EncodingMode encodingMode = "preserve-path".equals(encoded) ? EncodingMode.PRESERVE_PATH : EncodingMode.DEFAULT_FORM;
+ routeDesc.addPathParam(QualifiedName.parse(name), pattern, encodingMode);
+ }
else if (routeQN.equals(reader.getName()))
{
build(reader, routeDesc.getChildren());
Added: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/PathParamDescriptor.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/PathParamDescriptor.java (rev 0)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/PathParamDescriptor.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.web.controller.metadata;
+
+import org.exoplatform.web.controller.QualifiedName;
+import org.exoplatform.web.controller.router.EncodingMode;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class PathParamDescriptor
+{
+
+ /** . */
+ private final QualifiedName name;
+
+ /** . */
+ private final String pattern;
+
+ /** . */
+ private final EncodingMode encodingMode;
+
+ public PathParamDescriptor(QualifiedName name, String pattern, EncodingMode encodingMode)
+ {
+ if (name == null)
+ {
+ throw new NullPointerException("No null name accepted");
+ }
+ if (pattern == null)
+ {
+ throw new NullPointerException("No null pattern accepted");
+ }
+
+ //
+ this.name = name;
+ this.pattern = pattern;
+ this.encodingMode = encodingMode;
+ }
+
+ public QualifiedName getName()
+ {
+ return name;
+ }
+
+ public String getPattern()
+ {
+ return pattern;
+ }
+
+ public EncodingMode getEncodingMode()
+ {
+ return encodingMode;
+ }
+}
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/RouteDescriptor.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/RouteDescriptor.java 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/RouteDescriptor.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -20,6 +20,7 @@
package org.exoplatform.web.controller.metadata;
import org.exoplatform.web.controller.QualifiedName;
+import org.exoplatform.web.controller.router.EncodingMode;
import java.util.ArrayList;
import java.util.HashMap;
@@ -42,6 +43,9 @@
private final Map<QualifiedName, String> params;
/** . */
+ private final Map<QualifiedName, PathParamDescriptor> pathParams;
+
+ /** . */
private final Map<String, RequestParamDescriptor> requestParams;
/** . */
@@ -51,6 +55,7 @@
{
this.path = path;
this.params = new HashMap<QualifiedName, String>();
+ this.pathParams = new HashMap<QualifiedName, PathParamDescriptor>();
this.requestParams = new HashMap<String, RequestParamDescriptor>();
this.children = new ArrayList<RouteDescriptor>();
}
@@ -87,11 +92,27 @@
return this;
}
+ public RouteDescriptor addPathParam(QualifiedName name, String pattern, EncodingMode encodingMode)
+ {
+ return addRequestParam(new PathParamDescriptor(name, pattern, encodingMode));
+ }
+
+ public RouteDescriptor addRequestParam(PathParamDescriptor requestParam)
+ {
+ pathParams.put(requestParam.getName(), requestParam);
+ return this;
+ }
+
public Map<String, RequestParamDescriptor> getRequestParams()
{
return requestParams;
}
+ public Map<QualifiedName, PathParamDescriptor> getPathParams()
+ {
+ return pathParams;
+ }
+
public RouteDescriptor addRoute(RouteDescriptor child)
{
children.add(child);
Added: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/EncodingMode.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/EncodingMode.java (rev 0)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/EncodingMode.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.web.controller.router;
+
+/**
+ * Specifies how a string value should be encoded in an URL.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public enum EncodingMode
+{
+
+ /**
+ * DEFAULT_FORM encodes the whole string with the <code>x-www-form-urlencoded</code> also known as
+ * <i>default form</i>. For instance the string /a/b is encoded to %2Fa%2Fb.
+ */
+ DEFAULT_FORM,
+
+ /**
+ * PRESERVE_PATH encodes the whole string like the {@link #DEFAULT_FORM} but preserve the path separators. For
+ * instance the string /a b is enocded to /a+b
+ */
+ PRESERVE_PATH
+
+}
Added: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternParamDef.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternParamDef.java (rev 0)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternParamDef.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.web.controller.router;
+
+import java.util.regex.Pattern;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+class PatternParamDef
+{
+
+ /** . */
+ final EncodingMode encodingMode;
+
+ /** . */
+ final Pattern pattern;
+
+ PatternParamDef(EncodingMode encodingMode, Pattern pattern)
+ {
+ this.encodingMode = encodingMode;
+ this.pattern = pattern;
+ }
+}
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternRoute.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternRoute.java 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/PatternRoute.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -38,7 +38,7 @@
final List<QualifiedName> parameterNames;
/** . */
- final List<Pattern> parameterPatterns;
+ final List<PatternParamDef> parameterPatterns;
/** . */
final List<String> chunks;
@@ -46,7 +46,7 @@
PatternRoute(
Pattern pattern,
List<QualifiedName> parameterNames,
- List<Pattern> parameterPatterns,
+ List<PatternParamDef> parameterPatterns,
List<String> chunks)
{
if (chunks.size() != parameterNames.size() + 1)
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RenderContext.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RenderContext.java 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/RenderContext.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -34,14 +34,14 @@
*
* @param c the char to append
*/
- void appendPath(char c);
+ void appendPath(char c, boolean escape);
/**
* Append a string to the path.
*
* @param s the string to append.
*/
- void appendPath(String s);
+ void appendPath(String s, boolean escape);
/**
* Append a query parameter to the parameter set. Note that the query parameters are ordered
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Route.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Route.java 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/Route.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -20,6 +20,7 @@
package org.exoplatform.web.controller.router;
import org.exoplatform.web.controller.QualifiedName;
+import org.exoplatform.web.controller.metadata.PathParamDescriptor;
import org.exoplatform.web.controller.metadata.RequestParamDescriptor;
import org.exoplatform.web.controller.metadata.RouteDescriptor;
@@ -42,6 +43,9 @@
class Route
{
+ /** Julien : make that configurable. */
+ private static final char slashEscape = '~';
+
/** . */
private Route parent;
@@ -107,28 +111,48 @@
if (this instanceof SegmentRoute)
{
SegmentRoute sr = (SegmentRoute)this;
- renderContext.appendPath('/');
- renderContext.appendPath(sr.name);
+ renderContext.appendPath('/', false);
+ renderContext.appendPath(sr.name, true);
}
else if (this instanceof PatternRoute)
{
PatternRoute pr = (PatternRoute)this;
- renderContext.appendPath('/');
+ renderContext.appendPath('/', false);
int i = 0;
while (i < pr.parameterNames.size())
{
- renderContext.appendPath(pr.chunks.get(i));
+ renderContext.appendPath(pr.chunks.get(i), true);
String value = blah.get(pr.parameterNames.get(i));
- renderContext.appendPath(value);
+ PatternParamDef def = pr.parameterPatterns.get(i);
+
+ //
+ int from = 0;
+ while (true)
+ {
+ int to = value.indexOf('/', from);
+ if (to == -1)
+ {
+ break;
+ }
+ else
+ {
+ renderContext.appendPath(value.substring(from, to), true);
+ renderContext.appendPath(def.encodingMode == EncodingMode.PRESERVE_PATH ? '/' : slashEscape, false);
+ from = to +1;
+ }
+ }
+ renderContext.appendPath(value.substring(from), false);
+
+ //
i++;
}
- renderContext.appendPath(pr.chunks.get(i));
+ renderContext.appendPath(pr.chunks.get(i), false);
}
else
{
if (!hasChildren)
{
- renderContext.appendPath("/");
+ renderContext.appendPath('/', false);
}
}
}
@@ -182,9 +206,31 @@
for (int i = 0;i < prt.parameterNames.size();i++)
{
QualifiedName qd = prt.parameterNames.get(i);
+ PatternParamDef ppd = prt.parameterPatterns.get(i);
String s = blah.get(qd);
- if (s != null && prt.parameterPatterns.get(i).matcher(s).matches())
+ boolean matched = false;
+ if (s != null)
{
+ switch (ppd.encodingMode)
+ {
+ case DEFAULT_FORM:
+
+ // JULIEN
+ // TEMPORARY WORD AROUND
+ // FIX ME
+ s = s.replace('/', '~');
+
+ matched = ppd.pattern.matcher(s).matches();
+ break;
+ case PRESERVE_PATH:
+ matched = ppd.pattern.matcher(s).matches();
+ break;
+ default:
+ throw new AssertionError();
+ }
+ }
+ if (matched)
+ {
abc.remove(qd);
}
else
@@ -226,6 +272,7 @@
}
/**
+ *
* @param path the path
* @param requestParams the query parameters
* @return null or the parameters when it matches
@@ -344,9 +391,15 @@
{
// Append parameters
int group = 1;
- for (QualifiedName parameterName : route.parameterNames)
+ for (int i = 0;i < route.parameterNames.size();i++)
{
- response.put(parameterName, matcher.group(group++));
+ QualifiedName parameterName = route.parameterNames.get(i);
+ String value = matcher.group(group++);
+ if (route.parameterPatterns.get(i).encodingMode == EncodingMode.DEFAULT_FORM)
+ {
+ value = value.replace(slashEscape, '/');
+ }
+ response.put(parameterName, value);
}
//
@@ -387,9 +440,6 @@
return ret;
}
- /** . */
- private static final Pattern PARAMETER_REGEX = Pattern.compile("^(?:\\{([^\\}]*)\\})?(.*)$");
-
final <R extends Route> R add(R route)
{
if (route.parent != null)
@@ -454,7 +504,7 @@
final Route append(RouteDescriptor descriptor)
{
- Route route = append(descriptor.getPath());
+ Route route = append(descriptor.getPathParams(), descriptor.getPath());
//
route.terminal = true;
@@ -476,10 +526,11 @@
}
final Route append(
+ Map<QualifiedName, PathParamDescriptor> pathParamDescriptors,
String path,
Map<QualifiedName, String> parameters)
{
- Route route = append(path);
+ Route route = append(pathParamDescriptors, path);
route.terminal = true;
route.routeParameters.putAll(parameters);
return route;
@@ -488,10 +539,11 @@
/**
* Append a path, creates the necessary routes and returns the last route added.
*
+ * @param pathParamDescriptors the path param descriptors
* @param path the path to append
* @return the last route added
*/
- private Route append(String path)
+ private Route append(Map<QualifiedName, PathParamDescriptor> pathParamDescriptors, String path)
{
int pos = path.length();
int level = 0;
@@ -548,48 +600,33 @@
PatternBuilder builder = new PatternBuilder();
builder.expr("^");
List<String> chunks = new ArrayList<String>();
- List<Pattern> parameterPatterns = new ArrayList<Pattern>();
+ List<PatternParamDef> parameterPatterns = new ArrayList<PatternParamDef>();
int previous = 0;
for (int i = 0;i < start.size();i++)
{
builder.litteral(path, previous, start.get(i));
chunks.add(path.substring(previous, start.get(i)));
- String parameterDef = path.substring(start.get(i) + 1, end.get(i));
- int colon = parameterDef.indexOf(':');
- String regex;
- String parameterName;
- if (colon == -1)
- {
- regex = "[^/]+";
- parameterName = parameterDef;
- }
- else
- {
- regex = parameterDef.substring(colon + 1);
- parameterName = parameterDef.substring(0, colon);
- }
+ String parameterName = path.substring(start.get(i) + 1, end.get(i));
//
- QualifiedName parameterQName;
- Matcher parameterMatcher = PARAMETER_REGEX.matcher(parameterName);
- if (parameterMatcher.matches())
+ QualifiedName parameterQName = QualifiedName.parse(parameterName);
+
+ // Now get path param metadata
+ PathParamDescriptor parameterDescriptor = pathParamDescriptors.get(parameterQName);
+ String regex = "[^/]+";
+ EncodingMode encodingMode = EncodingMode.DEFAULT_FORM;
+ if (parameterDescriptor != null)
{
- String qualifier = parameterMatcher.group(1);
- String name = parameterMatcher.group(2);
- parameterQName = new QualifiedName(qualifier == null ? "" : qualifier, name);
+ regex = parameterDescriptor.getPattern();
+ encodingMode = parameterDescriptor.getEncodingMode();
}
- else
- {
- throw new AssertionError();
- }
-
//
builder.expr("(");
builder.expr(regex);
builder.expr(")");
parameterNames.add(parameterQName);
- parameterPatterns.add(Pattern.compile("^" + regex + "$"));
+ parameterPatterns.add(new PatternParamDef(encodingMode, Pattern.compile("^" + regex + "$")));
previous = end.get(i) + 1;
}
builder.litteral(path, previous, pos);
@@ -614,7 +651,7 @@
//
if (pos < path.length())
{
- return next.append(path.substring(pos + 1));
+ return next.append(pathParamDescriptors, path.substring(pos + 1));
}
else
{
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/SimpleRenderContext.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/SimpleRenderContext.java 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/router/SimpleRenderContext.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -19,6 +19,8 @@
package org.exoplatform.web.controller.router;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -72,24 +74,34 @@
}
}
- public void appendPath(char c)
+ public void appendPath(char c, boolean escape)
{
- if (sb == null)
- {
- sb = new StringBuilder();
- }
- sb.append(c);
+ appendPath(String.valueOf(c), escape);
}
- public void appendPath(String s)
+ public void appendPath(String s, boolean escape)
{
+ //To change body of implemented methods use File | Settings | File Templates.
if (sb == null)
{
sb = new StringBuilder();
}
- sb.append(s);
+ if (escape)
+ {
+ try
+ {
+ sb.append(URLEncoder.encode(s, "UTF-8"));
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ throw new AssertionError(e);
+ }
+ }
+ else
+ {
+ sb.append(s);
+ }
}
-
public void appendQueryParameter(String parameterName, String paramaterValue)
{
if (queryParams == EMPTY)
@@ -98,5 +110,4 @@
}
queryParams.put(parameterName, paramaterValue);
}
-
}
Modified: portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestBuildRoute.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestBuildRoute.java 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestBuildRoute.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -76,7 +76,8 @@
assertEquals("^([^/]+)", patternRoute.pattern.toString());
assertEquals(Collections.singletonList(new QualifiedName("a")), patternRoute.parameterNames);
assertEquals(1, patternRoute.parameterPatterns.size());
- assertEquals("^[^/]+$", patternRoute.parameterPatterns.get(0).toString());
+ assertEquals("^[^/]+$", patternRoute.parameterPatterns.get(0).pattern.toString());
+ assertEquals(EncodingMode.DEFAULT_FORM, patternRoute.parameterPatterns.get(0).encodingMode);
assertEquals(2, patternRoute.chunks.size());
assertEquals("", patternRoute.chunks.get(0));
assertEquals("", patternRoute.chunks.get(1));
@@ -85,7 +86,7 @@
public void testQualifiedParameterSegment()
{
- String[] paths = {"/{{q}a}","{{q}a}"};
+ String[] paths = {"/{q:a}","{q:a}"};
for (String path : paths)
{
RouterDescriptor routerMD = new RouterDescriptor();
@@ -99,7 +100,8 @@
assertEquals("^([^/]+)", patternRoute.pattern.toString());
assertEquals(Collections.singletonList(new QualifiedName("q", "a")), patternRoute.parameterNames);
assertEquals(1, patternRoute.parameterPatterns.size());
- assertEquals("^[^/]+$", patternRoute.parameterPatterns.get(0).toString());
+ assertEquals("^[^/]+$", patternRoute.parameterPatterns.get(0).pattern.toString());
+ assertEquals(EncodingMode.DEFAULT_FORM, patternRoute.parameterPatterns.get(0).encodingMode);
assertEquals(2, patternRoute.chunks.size());
assertEquals("", patternRoute.chunks.get(0));
assertEquals("", patternRoute.chunks.get(1));
@@ -108,11 +110,11 @@
public void testPatternSegment()
{
- String[] paths = {"/{a:.*}","{a:.*}"};
+ String[] paths = {"/{a}","{a}"};
for (String path : paths)
{
RouterDescriptor routerMD = new RouterDescriptor();
- routerMD.addRoute(new RouteDescriptor(path));
+ routerMD.addRoute(new RouteDescriptor(path).addPathParam(QualifiedName.parse("a"), ".*", EncodingMode.DEFAULT_FORM));
Router router = new Router(routerMD);
//
@@ -122,7 +124,8 @@
assertEquals("^(.*)", patternRoute.pattern.toString());
assertEquals(Collections.singletonList(new QualifiedName("a")), patternRoute.parameterNames);
assertEquals(1, patternRoute.parameterPatterns.size());
- assertEquals("^.*$", patternRoute.parameterPatterns.get(0).toString());
+ assertEquals("^.*$", patternRoute.parameterPatterns.get(0).pattern.toString());
+ assertEquals(EncodingMode.DEFAULT_FORM, patternRoute.parameterPatterns.get(0).encodingMode);
assertEquals(2, patternRoute.chunks.size());
assertEquals("", patternRoute.chunks.get(0));
assertEquals("", patternRoute.chunks.get(1));
Modified: portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestDescriptorBuilder.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestDescriptorBuilder.java 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestDescriptorBuilder.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -53,14 +53,22 @@
//
assertTrue(i.hasNext());
RouteDescriptor route1 = i.next();
- assertEquals("/public/{{gtn}sitetype}/{{gtn}sitename}{{gtn}path:.*}", route1.getPath());
+ assertEquals("/public/{gtn:sitetype}/{gtn:sitename}{gtn:path}", route1.getPath());
assertEquals(Collections.singletonMap(WebAppController.HANDLER_PARAM, "portal"), route1.getParams());
+ assertEquals(Collections.singleton(QualifiedName.parse("gtn:path")), route1.getPathParams().keySet());
+ assertEquals(QualifiedName.parse("gtn:path"), route1.getPathParams().get(QualifiedName.parse("gtn:path")).getName());
+ assertEquals(".*", route1.getPathParams().get(QualifiedName.parse("gtn:path")).getPattern());
+ assertEquals(EncodingMode.DEFAULT_FORM, route1.getPathParams().get(QualifiedName.parse("gtn:path")).getEncodingMode());
//
assertTrue(i.hasNext());
RouteDescriptor route2 = i.next();
- assertEquals("/private/{{gtn}sitetype}/{{gtn}sitename}{{gtn}path:.*}", route2.getPath());
+ assertEquals("/private/{gtn:sitetype}/{gtn:sitename}{gtn:path}", route2.getPath());
assertEquals(Collections.singletonMap(WebAppController.HANDLER_PARAM, "portal"), route2.getParams());
+ assertEquals(Collections.singleton(QualifiedName.parse("gtn:path")), route2.getPathParams().keySet());
+ assertEquals(QualifiedName.parse("gtn:path"), route2.getPathParams().get(QualifiedName.parse("gtn:path")).getName());
+ assertEquals(".*", route2.getPathParams().get(QualifiedName.parse("gtn:path")).getPattern());
+ assertEquals(EncodingMode.PRESERVE_PATH, route2.getPathParams().get(QualifiedName.parse("gtn:path")).getEncodingMode());
//
assertTrue(i.hasNext());
Modified: portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestLegacyPortal.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestLegacyPortal.java 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestLegacyPortal.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -44,14 +44,14 @@
RouterDescriptor routerMD = new RouterDescriptor();
RouteDescriptor portal = new RouteDescriptor("/").
- addParam(QualifiedName.parse("{gtn}handler"), "portal").
- addRequestParam(QualifiedName.parse("{gtn}componentid"), "portal:componentId", null, false).
- addRequestParam(QualifiedName.parse("{gtn}action"), "portal:action", null, false).
- addRequestParam(QualifiedName.parse("{gtn}objectid"), "portal:objectId", null, false).
- addRoute(new RouteDescriptor("/public/{{gtn}sitename}{{gtn}path:.*}").
- addParam(QualifiedName.parse("{gtn}access"), "public")).
- addRoute(new RouteDescriptor("/private/{{gtn}sitename}{{gtn}path:.*}").
- addParam(QualifiedName.parse("{gtn}access"), "private"));
+ addParam(QualifiedName.parse("gtn:handler"), "portal").
+ addRequestParam(QualifiedName.parse("gtn:componentid"), "portal:componentId", null, false).
+ addRequestParam(QualifiedName.parse("gtn:action"), "portal:action", null, false).
+ addRequestParam(QualifiedName.parse("gtn:objectid"), "portal:objectId", null, false).
+ addRoute(new RouteDescriptor("/public/{gtn:sitename}{gtn:path}").
+ addParam(QualifiedName.parse("gtn:access"), "public")).addPathParam(QualifiedName.parse("gtn:path"), ".*", EncodingMode.PRESERVE_PATH).
+ addRoute(new RouteDescriptor("/private/{gtn:sitename}{gtn:path}").addPathParam(QualifiedName.parse("gtn:path"), ".*", EncodingMode.PRESERVE_PATH).
+ addParam(QualifiedName.parse("gtn:access"), "private"));
//
routerMD.addRoute(portal);
Modified: portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestMatch.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestMatch.java 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestMatch.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -42,14 +42,8 @@
//
assertNull(router.route(""));
-
- //
assertEquals(Collections.<QualifiedName, String>emptyMap(), router.route("/"));
-
- //
assertNull(router.route("/a"));
-
- //
assertNull(router.route("a"));
}
@@ -61,29 +55,13 @@
//
assertEquals(Collections.<QualifiedName, String>emptyMap(), router.route("/a"));
-
- //
assertNull(router.route("a"));
-
- //
assertNull(router.route("a/"));
-
- //
assertEquals(Collections.<QualifiedName, String>emptyMap(), router.route("/a/"));
-
- //
assertNull(router.route(""));
-
- //
assertNull(router.route("/"));
-
- //
assertNull(router.route("/b"));
-
- //
assertNull(router.route("b"));
-
- //
assertNull(router.route("/a/b"));
}
@@ -95,29 +73,13 @@
//
assertNull(router.route("a/b"));
-
- //
assertEquals(Collections.<QualifiedName, String>emptyMap(), router.route("/a/b"));
-
- //
assertEquals(Collections.<QualifiedName, String>emptyMap(), router.route("/a/b/"));
-
- //
assertNull(router.route("a/b/"));
-
- //
assertNull(router.route(""));
-
- //
assertNull(router.route("/"));
-
- //
assertNull(router.route("/b"));
-
- //
assertNull(router.route("b"));
-
- //
assertNull(router.route("/a/b/c"));
}
@@ -126,7 +88,9 @@
RouterDescriptor routerMD = new RouterDescriptor();
routerMD.addRoute(new RouteDescriptor("/{p}"));
Router router = new Router(routerMD);
- assertEquals(Collections.singletonMap(new QualifiedName("p"), "a"), router.route(("/a")));
+
+ //
+ assertEquals(Collections.singletonMap(new QualifiedName("p"), "a"), router.route("/a"));
}
public void testParameterPropagationToDescendants() throws Exception
@@ -135,44 +99,44 @@
routerMD.addRoute(new RouteDescriptor("/").addParam("p", "a"));
routerMD.addRoute(new RouteDescriptor("/a"));
Router router = new Router(routerMD);
- assertEquals(Collections.singletonMap(new QualifiedName("p"), "a"), router.route(("/a")));
+
+ //
+ assertEquals(Collections.singletonMap(new QualifiedName("p"), "a"), router.route("/a"));
}
public void testWildcardPattern() throws Exception
{
RouterDescriptor routerMD = new RouterDescriptor();
- routerMD.addRoute(new RouteDescriptor("/{p:.*}"));
+ routerMD.addRoute(new RouteDescriptor("/{p}").addPathParam(QualifiedName.parse("p"), ".*", EncodingMode.PRESERVE_PATH));
Router router = new Router(routerMD);
//
assertEquals(Collections.singletonMap(new QualifiedName("p"), ""), router.route("/"));
-
- //
assertEquals(Collections.singletonMap(new QualifiedName("p"), "a"), router.route("/a"));
+ assertNull(router.route("a"));
+ assertEquals(Collections.singletonMap(new QualifiedName("p"), "a/b"), router.route("/a/b"));
+ }
- //
- assertNull(router.route(("a")));
+ public void testDefaultForm() throws Exception
+ {
+ RouterDescriptor routerMD = new RouterDescriptor();
+ routerMD.addRoute(new RouteDescriptor("/{p}").addPathParam(QualifiedName.parse("p"), "[^/]+", EncodingMode.DEFAULT_FORM));
+ Router router = new Router(routerMD);
//
- assertEquals(Collections.singletonMap(new QualifiedName("p"), "a/b"), router.route("/a/b"));
+ assertEquals(Collections.singletonMap(new QualifiedName("p"), "/"), router.route("/~"));
}
public void testSimplePattern() throws Exception
{
RouterDescriptor routerMD = new RouterDescriptor();
- routerMD.addRoute(new RouteDescriptor("/{p:a}"));
+ routerMD.addRoute(new RouteDescriptor("/{p}").addPathParam(QualifiedName.parse("p"), "a", EncodingMode.DEFAULT_FORM));
Router router = new Router(routerMD);
//
assertEquals(Collections.singletonMap(new QualifiedName("p"), "a"), router.route("/a"));
-
- //
assertNull(router.route("a"));
-
- //
assertNull(router.route("/ab"));
-
- //
assertNull(router.route("ab"));
}
@@ -180,19 +144,13 @@
{
RouterDescriptor routerMD = new RouterDescriptor();
routerMD.addRoute(new RouteDescriptor("/a"));
- routerMD.addRoute(new RouteDescriptor("/{p:a}/b"));
+ routerMD.addRoute(new RouteDescriptor("/{p}/b").addPathParam(QualifiedName.parse("p"), "a", EncodingMode.DEFAULT_FORM));
Router router = new Router(routerMD);
//
- assertNull(router.route(("a")));
-
- //
+ assertNull(router.route("a"));
assertEquals(Collections.<QualifiedName, String>emptyMap(), router.route("/a"));
-
- //
assertEquals(Collections.<QualifiedName, String>emptyMap(), router.route("/a/"));
-
- //
assertEquals(Collections.singletonMap(new QualifiedName("p"), "a"), router.route("/a/b"));
}
Modified: portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestPortalConfiguration.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestPortalConfiguration.java 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestPortalConfiguration.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -43,24 +43,28 @@
RouterDescriptor routerMD = new RouterDescriptor();
//
- RouteDescriptor portalRouteMD = new RouteDescriptor("/private/{{gtn}sitetype}/{{gtn}sitename}{{gtn}path:.*}");
+ RouteDescriptor portalRouteMD = new RouteDescriptor("/private/{gtn:sitetype}/{gtn:sitename}{gtn:path}");
portalRouteMD.addParam(new QualifiedName("gtn", "controller"), "site");
portalRouteMD.addRequestParam(new QualifiedName("gtn", "componentid"), "portal:componentId", null, false);
+ portalRouteMD.addPathParam(new QualifiedName("gtn", "path"), ".*", EncodingMode.PRESERVE_PATH);
routerMD.addRoute(portalRouteMD);
//
- RouteDescriptor portalRouteMD2 = new RouteDescriptor("/private/{{gtn}sitetype}/{{gtn}sitename}{{gtn}path:.*}");
+ RouteDescriptor portalRouteMD2 = new RouteDescriptor("/private/{gtn:sitetype}/{gtn:sitename}{gtn:path}");
portalRouteMD2.addParam(new QualifiedName("gtn", "controller"), "site");
+ portalRouteMD2.addPathParam(new QualifiedName("gtn", "path"), ".*", EncodingMode.PRESERVE_PATH);
routerMD.addRoute(portalRouteMD2);
//
- RouteDescriptor groupRouteMD = new RouteDescriptor("/groups/{{gtn}sitetype}/{{gtn}sitename}{{gtn}path:.*}");
- portalRouteMD.addParam(new QualifiedName("gtn", "controller"), "site");
+ RouteDescriptor groupRouteMD = new RouteDescriptor("/groups/{gtn:sitetype}/{gtn:sitename}{gtn:path}");
+ groupRouteMD.addParam(new QualifiedName("gtn", "controller"), "site");
+ groupRouteMD.addPathParam(new QualifiedName("gtn", "path"), ".*", EncodingMode.PRESERVE_PATH);
routerMD.addRoute(groupRouteMD);
//
- RouteDescriptor userRouteMD = new RouteDescriptor("/users/{{gtn}sitetype}/{{gtn}sitename}{{gtn}path:.*}");
- portalRouteMD.addParam(new QualifiedName("gtn", "controller"), "site");
+ RouteDescriptor userRouteMD = new RouteDescriptor("/users/{gtn:sitetype}/{gtn:sitename}{gtn:path}");
+ userRouteMD.addParam(new QualifiedName("gtn", "controller"), "site");
+ userRouteMD.addPathParam(new QualifiedName("gtn", "path"), ".*", EncodingMode.PRESERVE_PATH);
routerMD.addRoute(userRouteMD);
//
Modified: portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestRender.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestRender.java 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/TestRender.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -62,7 +62,7 @@
assertEquals("/a/b", router.render(Collections.<QualifiedName, String>emptyMap()));
}
- public void testParameter() throws Exception
+ public void testPathParam() throws Exception
{
RouterDescriptor routerMD = new RouterDescriptor();
routerMD.addRoute(new RouteDescriptor("/{p}"));
@@ -73,40 +73,74 @@
assertNull(router.render(Collections.<QualifiedName, String>emptyMap()));
}
- public void testWildcardPattern() throws Exception
+ public void testSimplePatternPathParam() throws Exception
{
RouterDescriptor routerMD = new RouterDescriptor();
- routerMD.addRoute(new RouteDescriptor("/{p:.*}"));
+ routerMD.addRoute(new RouteDescriptor("/{p}").addPathParam(QualifiedName.parse("p"), "a", EncodingMode.DEFAULT_FORM));
Router router = new Router(routerMD);
//
- assertEquals("/", router.render(Collections.singletonMap(new QualifiedName("p"), "")));
+ assertEquals("/a", router.render(Collections.singletonMap(new QualifiedName("p"), "a")));
+ assertNull(router.render(Collections.singletonMap(new QualifiedName("p"), "ab")));
+ }
+ public void testWildcardPathParam() throws Exception
+ {
+ RouterDescriptor routerMD = new RouterDescriptor();
+ routerMD.addRoute(new RouteDescriptor("/{p}").addPathParam(QualifiedName.parse("p"), ".*", EncodingMode.PRESERVE_PATH));
+ Router router = new Router(routerMD);
+
//
+ assertEquals("/", router.render(Collections.singletonMap(new QualifiedName("p"), "")));
assertEquals("/a", router.render(Collections.singletonMap(new QualifiedName("p"), "a")));
+ assertEquals("/a/b", router.render(Collections.singletonMap(new QualifiedName("p"), "a/b")));
+ }
+ public void testFoo() throws Exception
+ {
+ RouterDescriptor routerMD = new RouterDescriptor();
+ routerMD.addRoute(new RouteDescriptor("/{p}").addPathParam(QualifiedName.parse("p"), "[^/]*", EncodingMode.PRESERVE_PATH));
+ Router router = new Router(routerMD);
+
//
- assertEquals("/a/b", router.render(Collections.singletonMap(new QualifiedName("p"), "a/b")));
+ assertEquals(null, router.render(Collections.singletonMap(new QualifiedName("p"), "/")));
}
- public void testSimplePattern() throws Exception
+ public void testBar() throws Exception
{
RouterDescriptor routerMD = new RouterDescriptor();
- routerMD.addRoute(new RouteDescriptor("/{p:a}"));
+ routerMD.addRoute(new RouteDescriptor("/{p}").addPathParam(QualifiedName.parse("p"), "[^/]*", EncodingMode.DEFAULT_FORM));
Router router = new Router(routerMD);
//
- assertEquals("/a", router.render(Collections.singletonMap(new QualifiedName("p"), "a")));
+ assertEquals("/~", router.render(Collections.singletonMap(new QualifiedName("p"), "/")));
+ }
+ public void testWildcardParamPathPreservePathEncoding() throws Exception
+ {
+ RouterDescriptor routerMD = new RouterDescriptor();
+ routerMD.addRoute(new RouteDescriptor("/{p}").addPathParam(QualifiedName.parse("p"), ".*", EncodingMode.PRESERVE_PATH));
+ Router router = new Router(routerMD);
+
//
- assertNull(router.render(Collections.singletonMap(new QualifiedName("p"), "ab")));
+ assertEquals("//", router.render(Collections.singletonMap(new QualifiedName("p"), "/")));
}
+ public void testWildcardParamPathDefaultFormEncoded() throws Exception
+ {
+ RouterDescriptor routerMD = new RouterDescriptor();
+ routerMD.addRoute(new RouteDescriptor("/{p}").addPathParam(QualifiedName.parse("p"), ".*", EncodingMode.DEFAULT_FORM));
+ Router router = new Router(routerMD);
+
+ //
+ assertEquals("/~", router.render(Collections.singletonMap(new QualifiedName("p"), "/")));
+ }
+
public void testPrecedence() throws Exception
{
RouterDescriptor routerMD = new RouterDescriptor();
routerMD.addRoute(new RouteDescriptor("/a"));
- routerMD.addRoute(new RouteDescriptor("/{p:a}/b"));
+ routerMD.addRoute(new RouteDescriptor("/{p}/b").addPathParam(QualifiedName.parse("p"), "a", EncodingMode.DEFAULT_FORM));
Router router = new Router(routerMD);
//
Modified: portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/router.xml
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/router.xml 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/component/web/controller/src/test/java/org/exoplatform/web/controller/router/router.xml 2010-11-04 11:22:09 UTC (rev 4941)
@@ -3,20 +3,22 @@
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_router_1_0 http://www.gatein.org/xml/ns/gatein_router_1_0"
xmlns="http://www.gatein.org/xml/ns/gatein_router_1_0">
- <route path="/public/{{gtn}sitetype}/{{gtn}sitename}{{gtn}path:.*}">
- <param name="{gtn}handler" value="portal"/>
+ <route path="/public/{gtn:sitetype}/{gtn:sitename}{gtn:path}">
+ <param name="gtn:handler" value="portal"/>
+ <path-param name="gtn:path" pattern=".*"/>
</route>
- <route path="/private/{{gtn}sitetype}/{{gtn}sitename}{{gtn}path:.*}">
- <param name="{gtn}handler" value="portal"/>
+ <route path="/private/{gtn:sitetype}/{gtn:sitename}{gtn:path}">
+ <param name="gtn:handler" value="portal"/>
+ <path-param name="gtn:path" pattern=".*" encoding="preserve-path"/>
</route>
<route path="/upload">
- <param name="{gtn}handler" value="upload"/>
+ <param name="gtn:handler" value="upload"/>
</route>
<route path="/download">
- <param name="{gtn}handler" value="download"/>
+ <param name="gtn:handler" value="download"/>
</route>
<route path="/a">
Modified: portal/branches/navcontroller/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component/UIUserToolBarGroupPortlet.gtmpl
===================================================================
--- portal/branches/navcontroller/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component/UIUserToolBarGroupPortlet.gtmpl 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/portlet/exoadmin/src/main/webapp/groovy/admintoolbar/webui/component/UIUserToolBarGroupPortlet.gtmpl 2010-11-04 11:22:09 UTC (rev 4941)
@@ -48,7 +48,7 @@
boolean hasChild = (node.getChildren() != null && node.getChildren().size() > 0);
String clazz = "";
if(hasChild) clazz = "ArrowIcon";
- String actionLink = nodeURL.setResource(new NavigationResource(navigation.getOwnerType(), navigation.getOwnerId().replaceAll("/", "_"), node)).toString();
+ String actionLink = nodeURL.setResource(new NavigationResource(navigation.getOwnerType(), navigation.getOwnerId(), node)).toString();
String icon = node.getIcon();
if(icon == null) icon = "DefaultPageIcon";
boolean toolong = (node.resolvedLabel.length() > 60);
Modified: portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/default-router.xml
===================================================================
--- portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/default-router.xml 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/default-router.xml 2010-11-04 11:22:09 UTC (rev 4941)
@@ -6,40 +6,42 @@
<route path="/">
<!-- Use the portal handler -->
- <param name="{gtn}handler" value="portal"/>
+ <param name="gtn:handler" value="portal"/>
<!-- Webui parameters -->
- <request-param name="{gtn}componentid" matchName="portal:componentId" required="false"/>
- <request-param name="{gtn}action" matchName="portal:action" required="false"/>
- <request-param name="{gtn}objectid" matchName="objectId" required="false"/>
+ <request-param name="gtn:componentid" matchName="portal:componentId" required="false"/>
+ <request-param name="gtn:action" matchName="portal:action" required="false"/>
+ <request-param name="gtn:objectid" matchName="objectId" required="false"/>
<!-- Map the sitemap navigation on the /foo path -->
<!--
<route path="/foo">
- <param name="{gtn}access" value="public"/>
- <param name="{gtn}sitename" value="classic"/>
- <param name="{gtn}path" value="/sitemap"/>
+ <param name="gtn:access" value="public"/>
+ <param name="gtn:sitename" value="classic"/>
+ <param name="gtn:path" value="/sitemap"/>
</route>
-->
<!-- The public access -->
- <route path="/public/{{gtn}sitetype}/{{gtn}sitename}{{gtn}path:.*}">
- <param name="{gtn}access" value="public"/>
+ <route path="/public/{gtn:sitetype}/{gtn:sitename}{gtn:path}">
+ <param name="gtn:access" value="public"/>
+ <path-param name="gtn:path" pattern=".*" encoding="preserve-path"/>
</route>
<!-- The private access -->
- <route path="/private/{{gtn}sitetype}/{{gtn}sitename}{{gtn}path:.*}">
- <param name="{gtn}access" value="private"/>
+ <route path="/private/{gtn:sitetype}/{gtn:sitename}{gtn:path}">
+ <param name="gtn:access" value="private"/>
+ <path-param name="gtn:path" pattern=".*" encoding="preserve-path"/>
</route>
</route>
<route path="/upload">
- <param name="{gtn}handler" value="upload"/>
+ <param name="gtn:handler" value="upload"/>
</route>
<route path="/download">
- <param name="{gtn}handler" value="download"/>
+ <param name="gtn:handler" value="download"/>
</route>
</router>
\ No newline at end of file
Modified: portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/proto-router-1.xml
===================================================================
--- portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/proto-router-1.xml 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/web/portal/src/main/webapp/WEB-INF/conf/proto-router-1.xml 2010-11-04 11:22:09 UTC (rev 4941)
@@ -8,31 +8,33 @@
<route path="/">
<!-- Use the portal handler -->
- <param name="{gtn}handler" value="portal"/>
+ <param name="gtn:handler" value="portal"/>
<!-- Webui parameters -->
- <request-param name="{gtn}componentid" matchName="portal:componentId" required="false"/>
- <request-param name="{gtn}action" matchName="portal:action" required="false"/>
- <request-param name="{gtn}objectid" matchName="objectId" required="false"/>
+ <request-param name="gtn:componentid" matchName="portal:componentId" required="false"/>
+ <request-param name="gtn:action" matchName="portal:action" required="false"/>
+ <request-param name="gtn:objectid" matchName="objectId" required="false"/>
<!-- The public access -->
- <route path="/public/{{gtn}sitename}{{gtn}path:.*}.html">
- <param name="{gtn}access" value="public"/>
+ <route path="/public/{gtn:sitename}{gtn:path}.html">
+ <param name="gtn:access" value="public"/>
+ <path-param name="gtn:path" pattern=".*" encoding="preserve-path"/>
</route>
<!-- The private access -->
- <route path="/private/{{gtn}sitename}{{gtn}path:.*}.html">
- <param name="{gtn}access" value="private"/>
+ <route path="/private/{gtn:sitename}{gtn:path}.html">
+ <param name="gtn:access" value="private"/>
+ <path-param name="gtn:path" pattern=".*" encoding="preserve-path"/>
</route>
</route>
<route path="/upload">
- <param name="{gtn}handler" value="upload"/>
+ <param name="gtn:handler" value="upload"/>
</route>
<route path="/download">
- <param name="{gtn}handler" value="download"/>
+ <param name="gtn:handler" value="download"/>
</route>
</router>
\ No newline at end of file
Modified: portal/branches/navcontroller/web/portal/src/main/webapp/groovy/webui/core/UISitemapTree.gtmpl
===================================================================
--- portal/branches/navcontroller/web/portal/src/main/webapp/groovy/webui/core/UISitemapTree.gtmpl 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/web/portal/src/main/webapp/groovy/webui/core/UISitemapTree.gtmpl 2010-11-04 11:22:09 UTC (rev 4941)
@@ -37,7 +37,7 @@
actionExpand = uicomponent.event("ExpandNode", nav.getId() + "::" + node.getUri());
def actionCollapse = "ajaxAsyncGetRequest('" + uicomponent.url("CollapseNode",nav.getId() + "::" + node.getUri()) + "', true)";
- String actionLink = nodeURL.setResource(new NavigationResource(nav.getOwnerType(), nav.getOwnerId().replaceAll("/", "_"), node)).toString();
+ String actionLink = nodeURL.setResource(new NavigationResource(nav.getOwnerType(), nav.getOwnerId(), node)).toString();
lastNode = '';
Modified: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -239,7 +239,7 @@
*/
//
this.siteType = requestSiteType;
- this.siteName = requestSiteName.replaceAll("_", "/");
+ this.siteName = requestSiteName;
this.nodePath_ = requestPath;
this.access = access;
@@ -273,7 +273,7 @@
@Override
public <R, L extends ResourceLocator<R>> ControllerURL<R, L> newURL(ResourceType<R, L> resourceType, L locator)
{
- return new PortalURL<R, L>(controllerContext, locator, false, siteType, siteName.replaceAll("/", "_"), access);
+ return new PortalURL<R, L>(controllerContext, locator, false, siteType, siteName, access);
}
public ControllerContext getControllerContext()
Modified: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURL.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURL.java 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURL.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -19,17 +19,13 @@
package org.exoplatform.portal.url;
-import org.exoplatform.Constants;
import org.exoplatform.portal.application.PortalRequestHandler;
import org.exoplatform.web.ControllerContext;
import org.exoplatform.web.WebAppController;
import org.exoplatform.web.controller.QualifiedName;
-import org.exoplatform.web.controller.router.SimpleRenderContext;
import org.exoplatform.web.url.ControllerURL;
-import org.exoplatform.web.url.MimeType;
import org.exoplatform.web.url.ResourceLocator;
-import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map;
@@ -41,15 +37,6 @@
{
/** . */
- private static final Map<MimeType, String> AMP_MAP = new EnumMap<MimeType, String>(MimeType.class);
-
- static
- {
- AMP_MAP.put(MimeType.XHTML, "&");
- AMP_MAP.put(MimeType.PLAIN, "&");
- }
-
- /** . */
private final ControllerContext controllerContext;
/** . */
@@ -62,11 +49,8 @@
private final String siteName;
/** . */
- private StringBuilder buffer;
+ private PortalURLRenderContext renderContext;
- /** . */
- private SimpleRenderContext renderContext;
-
public PortalURL(ControllerContext requestContext, L locator, Boolean ajax, String siteType, String siteName, String access)
{
super(locator, ajax);
@@ -86,11 +70,9 @@
public String toString()
{
- //
if (renderContext == null)
{
- buffer = new StringBuilder();
- renderContext = new SimpleRenderContext(buffer);
+ renderContext = new PortalURLRenderContext(new StringBuilder());
}
else
{
@@ -103,15 +85,20 @@
throw new IllegalStateException("No resource set on portal URL");
}
+ // Configure mime type
+ renderContext.setMimeType(mimeType);
+
//
if (ajax)
{
- buffer.append("javascript:");
+ renderContext.append("javascript:", false);
if (confirm != null && confirm.length() > 0)
{
- buffer.append("if(confirm('").append(confirm.replaceAll("'", "\\\\'")).append("'))");
+ renderContext.append("if(confirm('", false);
+ renderContext.append(confirm.replaceAll("'", "\\\\'"), false);
+ renderContext.append("'))", false);
}
- buffer.append("ajaxGet('");
+ renderContext.append("ajaxGet('", false);
}
else
{
@@ -142,54 +129,32 @@
}
}
- //
+ // Render url via controller
controllerContext.renderURL(parameters, renderContext);
- //
- MimeType mt = mimeType;
- if (mt == null)
- {
- mt = MimeType.XHTML;
- }
- String amp = AMP_MAP.get(mt);
-
- //
- boolean questionMarkDone = false;
- Map<String, String> queryParams = renderContext.getQueryParams();
- if (queryParams.size() > 0)
- {
- for (Map.Entry<String, String> entry : queryParams.entrySet())
- {
- buffer.append(questionMarkDone ? amp : "?");
- buffer.append(entry.getKey());
- buffer.append('=');
- buffer.append(entry.getValue());
- questionMarkDone = true;
- }
- }
-
// Now append generic query parameters
for (Map.Entry<String, String[]> entry : getQueryParameters().entrySet())
{
for (String value : entry.getValue())
{
- buffer.append(questionMarkDone ? amp : "?");
- buffer.append(entry.getKey());
- buffer.append("=");
- buffer.append(value);
- questionMarkDone = true;
+ renderContext.appendQueryParameter(entry.getKey(), value);
}
}
//
if (ajax)
{
- buffer.append(questionMarkDone ? amp : "?");
- buffer.append("ajaxRequest=true");
- buffer.append("')");
+ renderContext.appendQueryParameter("ajaxRequest", "true");
+ renderContext.flush();
+ renderContext.append("')", false);
}
+ else
+ {
+ renderContext.flush();
+ }
//
- return buffer.toString();
+ String s = renderContext.toString();
+ return s;
}
}
Added: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURLRenderContext.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURLRenderContext.java (rev 0)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURLRenderContext.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -0,0 +1,210 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.portal.url;
+
+import org.exoplatform.commons.utils.CharEncoder;
+import org.exoplatform.commons.utils.CharsetCharEncoder;
+import org.exoplatform.web.controller.router.RenderContext;
+import org.exoplatform.web.url.MimeType;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.EnumMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+class PortalURLRenderContext implements RenderContext
+{
+
+ /** . */
+ private static final Map<MimeType, String> AMP_MAP = new EnumMap<MimeType, String>(MimeType.class);
+
+ static
+ {
+ AMP_MAP.put(MimeType.XHTML, "&");
+ AMP_MAP.put(MimeType.PLAIN, "&");
+ }
+
+ /** . */
+ private static final char[] ALPHABET = "0123456789ABCDEF".toCharArray();
+
+ /** . */
+ private static final List<String[]> EMPTY = Collections.emptyList();
+
+ /** . */
+ private static final CharEncoder encoder = CharsetCharEncoder.getUTF8();
+
+ /** . */
+ private StringBuilder buffer;
+
+ /** . */
+ private List<String[]> queryParams;
+
+ /** . */
+ private MimeType mimeType;
+
+
+ PortalURLRenderContext(StringBuilder buffer)
+ {
+ this.buffer = buffer;
+ this.queryParams = EMPTY;
+ }
+
+ public MimeType getMimeType()
+ {
+ return mimeType;
+ }
+
+ public void setMimeType(MimeType mimeType)
+ {
+ this.mimeType = mimeType;
+ }
+
+ public void appendSlash()
+ {
+ append('/', false);
+ }
+
+ public void appendPath(char c)
+ {
+ append(c, true);
+ }
+
+ public void appendPath(String s)
+ {
+ append(s, true);
+ }
+
+ public void appendQueryParameter(String parameterName, String paramaterValue)
+ {
+ if (parameterName == null)
+ {
+ throw new NullPointerException("No null parameter name accepted");
+ }
+ if (paramaterValue == null)
+ {
+ throw new NullPointerException("No null parameter value accepted");
+ }
+
+ //
+ if (queryParams == EMPTY)
+ {
+ queryParams = new ArrayList<String[]>();
+ }
+
+ //
+ queryParams.add(new String[]{parameterName,paramaterValue});
+ }
+
+ void reset()
+ {
+ buffer.setLength(0);
+ queryParams.clear();
+ }
+
+ /**
+ * Finish to write to the buffer.
+ */
+ void flush()
+ {
+ MimeType mt = mimeType;
+ if (mt == null)
+ {
+ mt = MimeType.XHTML;
+ }
+ String amp = AMP_MAP.get(mt);
+
+ //
+ boolean questionMarkDone = false;
+ if (queryParams.size() > 0)
+ {
+ for (String[] pair : queryParams)
+ {
+ append(questionMarkDone ? amp : "?", false);
+ append(pair[0], true);
+ append('=', false);
+ append(pair[1], true);
+ questionMarkDone = true;
+ }
+ }
+ }
+
+ public void appendPath(char c, boolean escape)
+ {
+ append(c, escape);
+ }
+
+ public void appendPath(String s, boolean escape)
+ {
+ append(s, escape);
+ }
+
+ /**
+ * Append a string to the underlying buffer.
+ *
+ * @param s the string to append
+ * @param encode true if the char should be pplication/x-www-form-urlencoded encoded
+ */
+ void append(String s, boolean encode)
+ {
+ for (int i = 0;i < s.length();i++)
+ {
+ append(s.charAt(i), encode);
+ }
+ }
+
+ /**
+ * Append a char to the underlying buffer.
+ *
+ * @param c the char to append
+ * @param encode true if the char should be pplication/x-www-form-urlencoded encoded
+ */
+ void append(char c, boolean encode)
+ {
+ if (!encode || c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '0' && c <= '9' || c == '.' || c == '-' || c == '*' || c == '_')
+ {
+ buffer.append(c);
+ }
+ else if (c == ' ')
+ {
+ buffer.append('+');
+ }
+ else
+ {
+ byte[] bytes = encoder.encode(c);
+ buffer.append('%');
+ for (byte b : bytes)
+ {
+ buffer.append(ALPHABET[(b & 0xF0) >> 4]);
+ buffer.append(ALPHABET[b & 0xF]);
+ }
+ }
+ }
+
+ @Override
+ public String toString()
+ {
+ return buffer.toString();
+ }
+}
Modified: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java 2010-11-04 09:19:18 UTC (rev 4940)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java 2010-11-04 11:22:09 UTC (rev 4941)
@@ -544,7 +544,7 @@
ControllerURL<NavigationResource, NavigationLocator> nodeURL =
pcontext.createURL(org.exoplatform.portal.url.navigation.NavigationLocator.TYPE);
nodeURL.setResource(new NavigationResource(getCurrentSite().getOwnerType(), getCurrentSite()
- .getOwner().replaceAll("/", "_"), getCurrentSite().getSelectedNode()));
+ .getOwner(), getCurrentSite().getSelectedNode()));
pcontext.sendRedirect(nodeURL.toString());
return;
}
14 years, 2 months
gatein SVN: r4940 - in portal/branches/branch-GTNPORTAL-1592/web: portal/src/main/webapp/WEB-INF/classes/locale/portal and 1 other directories.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2010-11-04 05:19:18 -0400 (Thu, 04 Nov 2010)
New Revision: 4940
Added:
portal/branches/branch-GTNPORTAL-1592/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/background/ArrowDown.gif
Modified:
portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties
portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl
portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl
Log:
GTNPORTAL-1040 Add images and some resource bundles for France and Vietnamese in UITableColumnContainer
Added: portal/branches/branch-GTNPORTAL-1592/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/background/ArrowDown.gif
===================================================================
(Binary files differ)
Property changes on: portal/branches/branch-GTNPORTAL-1592/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/background/ArrowDown.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
--- portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2010-11-04 09:11:19 UTC (rev 4939)
+++ portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2010-11-04 09:19:18 UTC (rev 4940)
@@ -974,6 +974,30 @@
UIContainer.tooltip.drag=Drag Container here
############################################################################
+ # org.exoplatform.portal.webui.container.UIColumnContainer #
+ ############################################################################
+
+UIColumnContainer.title.Container=Column
+UIColumnContainer.title.DragControlArea=Hold this area to drag this column to other place
+UIColumnContainer.deleteColumnContainer=Are you sure you want to delete this column ?
+UIColumnContainer.tooltip.insertLeft=Insert column left
+UIColumnContainer.tooltip.insertRight=Insert column right
+UIColumnContainer.tooltip.insertColumn=Insert new column
+UIColumnContainer.tooltip.closeContainer=Delete Column
+UIColumnContainer.tooltip.editContainer=Edit Column
+UIColumnContainer.label.insertLeft=Insert left
+UIColumnContainer.label.insertRight=Insert right
+
+ ############################################################################
+ # org.exoplatform.portal.webui.container.UITableColumnContainer#
+ ############################################################################
+
+UITableColumnContainer.title.Container=Table container
+UITableColumnContainer.title.DragControlArea=Hold this area to drag this table
+UITableColumnContainer.tooltip.closeContainer=Delete Table
+UITableColumnContainer.tooltip.editContainer=Edit Table
+
+ ############################################################################
# org.exoplatform.portal.component.view.UIPage #
############################################################################
Modified: portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
===================================================================
--- portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2010-11-04 09:11:19 UTC (rev 4939)
+++ portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2010-11-04 09:19:18 UTC (rev 4940)
@@ -926,6 +926,28 @@
UIContainer.tooltip.drag=Glisser le conteneur ici
############################################################################
+ # org.exoplatform.portal.webui.container.UIColumnContainer #
+ ############################################################################
+
+UIColumnContainer.title.Container=Colonne
+UIColumnContainer.title.DragControlArea=Cliquer cette partie sans relâcher le bouton pour faire glisser cete colonne à d'autre place
+UIColumnContainer.deleteColumnContainer=Are you sure you want to delete this column ?
+UIColumnContainer.tooltip.insertLeft=Insérer une colonne à gauche
+UIColumnContainer.tooltip.insertRight=Insérer une colonne à droit
+UIColumnContainer.tooltip.insertColumn=Insérer une nouvelle colonne
+UIColumnContainer.tooltip.closeContainer=Supprimer cette colonne
+UIColumnContainer.tooltip.editContainer=Editer cette colonne
+
+ ############################################################################
+ # org.exoplatform.portal.webui.container.UITableColumnContainer#
+ ############################################################################
+
+UITableColumnContainer.title.Container=Conteneur de navigation
+UITableColumnContainer.title.DragControlArea=Cliquer cette partie sans relâcher le bouton pour faire glisser ce tableau
+UITableColumnContainer.tooltip.closeContainer=Supprimer ce tableau
+UITableColumnContainer.tooltip.editContainer=Editer ce tableau
+
+ ############################################################################
# org.exoplatform.portal.component.view.UIPage #
############################################################################
Modified: portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties
===================================================================
--- portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties 2010-11-04 09:11:19 UTC (rev 4939)
+++ portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties 2010-11-04 09:19:18 UTC (rev 4940)
@@ -930,6 +930,30 @@
UIContainer.tooltip.drag=Vùng kéo Container.
############################################################################
+ # org.exoplatform.portal.webui.container.UIColumnContainer #
+ ############################################################################
+
+UIColumnContainer.title.Container=Cột
+UIColumnContainer.title.DragControlArea=Giữ vùng này để kéo cột
+UIColumnContainer.deleteColumnContainer=Bạn có chắc chắn muốn xóa cột này không ?
+UIColumnContainer.tooltip.insertLeft=Chèn cột mới vào bên trái
+UIColumnContainer.tooltip.insertRight=Chèn cột mới vào bên phải
+UIColumnContainer.tooltip.insertColumn=Chèn thêm cột mới
+UIColumnContainer.tooltip.closeContainer=Xóa cột
+UIColumnContainer.tooltip.editContainer=Sửa thuộc tính của cột
+UIColumnContainer.label.insertLeft=Chèn cột vào bên trái
+UIColumnContainer.label.insertRight=Chèn cột vào bên phải
+
+ ############################################################################
+ # org.exoplatform.portal.webui.container.UITableColumnContainer#
+ ############################################################################
+
+UITableColumnContainer.title.Container=Bảng
+UITableColumnContainer.title.DragControlArea=Giữ vùng này để kéo bảng
+UITableColumnContainer.tooltip.closeContainer=Xóa bảng
+UITableColumnContainer.tooltip.editContainer=Sửa thuộc tính của bảng
+
+ ############################################################################
# org.exoplatform.portal.component.view.UIPage #
############################################################################
Modified: portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl
===================================================================
--- portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl 2010-11-04 09:11:19 UTC (rev 4939)
+++ portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl 2010-11-04 09:19:18 UTC (rev 4940)
@@ -64,16 +64,16 @@
<div class="RightBar">
<div class="MiddleBar">
<div class="FixHeight ClearFix">
- <div class="DragControlArea" title="<%=_ctx.appRes("UIContainer.title.DragControlArea")%>" onmousedown="eXo.portal.PortalDragDrop.init.call(this,event);"><span></span></div>
+ <div class="DragControlArea" title="<%=_ctx.appRes("UIColumnContainer.title.DragControlArea")%>" onmousedown="eXo.portal.PortalDragDrop.init.call(this,event);"><span></span></div>
<%
String showCategory = "eXo.webui.UIPopupSelectCategory.show(this, event)";
String strTitle = uicomponent.getTitle() != null ?
ExpressionUtil.getExpressionValue(res, uicomponent.getTitle()) :
- _ctx.appRes("UIContainer.title.Container");
+ _ctx.appRes("UIColumnContainer.title.Container");
%>
<div class="ContainerIcon"><%=hasPermission ? strTitle : _ctx.appRes("UIPortlet.label.protectedContent")%></div>
<%if(hasPermission) {%>
- <div class="ControlIcon ArrowDownIcon" onclick="$showCategory" title="<%= _ctx.appRes("UIColumnContainer.tootip.insertColumn") %>">
+ <div class="ControlIcon ArrowDownIcon" onclick="$showCategory" title="<%= _ctx.appRes("UIColumnContainer.tooltip.insertColumn") %>">
<% /*Begin Popup Menu*/ %>
<div style="position: relative; width: 100%">
<div class="UIPopupCategory" style="display: none;">
@@ -105,8 +105,8 @@
</div>
<% /*End Popup Menu*/ %>
</div>
- <a href="<%=uicomponent.event("EditContainer")%>;eXo.portal.UIPortal.changeComposerSaveButton()" class="EditContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.editContainer")%>"><span></span></a>
- <a href="<%=uicomponent.event("DeleteComponent")%>" class="DeleteContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.closeContainer")%>"><span></span></a>
+ <a href="<%=uicomponent.event("EditContainer")%>;eXo.portal.UIPortal.changeComposerSaveButton()" class="EditContainerIcon" title="<%=_ctx.appRes("UIColumnContainer.tooltip.editContainer")%>"><span></span></a>
+ <a href="<%=uicomponent.event("DeleteComponent")%>" class="DeleteContainerIcon" title="<%=_ctx.appRes("UIColumnContainer.tooltip.closeContainer")%>"><span></span></a>
<%}%>
Modified: portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl
===================================================================
--- portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl 2010-11-04 09:11:19 UTC (rev 4939)
+++ portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl 2010-11-04 09:19:18 UTC (rev 4940)
@@ -65,16 +65,16 @@
<div class="RightBar">
<div class="MiddleBar">
<div class="FixHeight ClearFix">
- <div class="DragControlArea" title="<%=_ctx.appRes("UIContainer.tooltip.drag")%>" onmousedown="eXo.portal.PortalDragDrop.init.call(this,event);"><span></span></div>
+ <div class="DragControlArea" title="<%=_ctx.appRes("UITableColumnContainer.title.DragControlArea")%>" onmousedown="eXo.portal.PortalDragDrop.init.call(this,event);"><span></span></div>
<%
String strTitle = uicomponent.getTitle() != null ?
ExpressionUtil.getExpressionValue(res, uicomponent.getTitle()) :
- _ctx.appRes("UIContainer.title.Container");
+ _ctx.appRes("UITableColumnContainer.title.Container");
%>
<div class="ContainerIcon DefaultContainer16x16Icon"><%=hasPermission ? strTitle : _ctx.appRes("UIPortlet.label.protectedContent")%></div>
<%if(hasPermission) {%>
- <a href="<%=uicomponent.event("EditContainer","$uicomponent.id")%>" class="EditContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.editContainer")%>"><span></span></a>
- <a href="<%=uicomponent.event("DeleteComponent","$uicomponent.id")%>" class="DeleteContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.closeContainer")%>"><span></span></a>
+ <a href="<%=uicomponent.event("EditContainer","$uicomponent.id")%>" class="EditContainerIcon" title="<%=_ctx.appRes("UITableColumnContainer.tooltip.editContainer")%>"><span></span></a>
+ <a href="<%=uicomponent.event("DeleteComponent","$uicomponent.id")%>" class="DeleteContainerIcon" title="<%=_ctx.appRes("UITableColumnContainer.tooltip.closeContainer")%>"><span></span></a>
<%}%>
</div>
</div>
14 years, 2 months
gatein SVN: r4939 - portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-11-04 05:11:19 -0400 (Thu, 04 Nov 2010)
New Revision: 4939
Modified:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_001_CreateNewAccountWithValidValues.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_002_CreateNewAccoutWithUserNameStartWithNumber.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_003_CreateNewAccountSameAsExistingButDifferentByLowerUpperCase.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_004_CreateNewAccountWithBlankRequireFields.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_005_CreateNewAccountWithUserNameIncludesSpecialCharacers.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_006_CreateNewAccountWithUserNameContainsAlphaDigitUndersoceDotDashInTheMiddle.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_007_CreateNewAccountWithUserNameStartsWithDigitUnderscoreDotDash.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_008_CreateNewAccountWithUserNameTheSameWithExisting.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_009_CreateNewAccountWithUserNameLessOverMinMaxLength.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_010_CheckExistingUserNameFunctionWhenAddNewAccout.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_011_CreateNewAccountWithPasswordandConfirmpasswordAreNotTheSame.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_012_CreateNewAccountWhenCopyFromPasswordAndPasteToConfirmPassword.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_014_CreateNewAccountWithPasswordAndConfirmPasswordOver30Characters.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_015_CreateNewAccountWithFirstNameExisting.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_016_CreateNewAccountWithLastNameExisting.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_017_CreateNewAccountWhenFirstNameStartsWithNumber.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_018_CreateNewAccountWhenLastNameStartWithNumber.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_019_CreateNewAccoutFirstNameStartsWithUnderscoreDashDot.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_020_CreateNewAccoutFirstNameStartsWithUnderscoreDashDot.html
Log:
TestVN-356:Clean and Improve existing Selenium for GateIn
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_001_CreateNewAccountWithValidValues.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_001_CreateNewAccountWithValidValues.html 2010-11-04 08:09:36 UTC (rev 4938)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_001_CreateNewAccountWithValidValues.html 2010-11-04 09:11:19 UTC (rev 4939)
@@ -17,6 +17,11 @@
<td></td>
</tr>
<tr>
+ <td>windowMaximize</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
<td>click</td>
<td>link=Sign in</td>
<td></td>
@@ -42,6 +47,11 @@
<td></td>
</tr>
<tr>
+ <td>waitForElementPresent</td>
+ <td>link=New Staff</td>
+ <td></td>
+</tr>
+<tr>
<td>clickAndWait</td>
<td>link=New Staff</td>
<td></td>
@@ -132,6 +142,11 @@
<td></td>
</tr>
<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
<td>click</td>
<td>link=Sign in</td>
<td></td>
@@ -162,6 +177,11 @@
<td></td>
</tr>
<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
<td>click</td>
<td>link=Sign in</td>
<td></td>
@@ -227,21 +247,6 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td>No result found.</td>
-</tr>
-<tr>
- <td>verifyText</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td>No result found.</td>
-</tr>
-<tr>
- <td>click</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
<td>clickAndWait</td>
<td>link=Sign out</td>
<td></td>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_002_CreateNewAccoutWithUserNameStartWithNumber.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_002_CreateNewAccoutWithUserNameStartWithNumber.html 2010-11-04 08:09:36 UTC (rev 4938)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_002_CreateNewAccoutWithUserNameStartWithNumber.html 2010-11-04 09:11:19 UTC (rev 4939)
@@ -112,23 +112,23 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[2]/div[2]/div/div/div/div/div[2]</td>
+ <td>waitForTextPresent</td>
+ <td>The "User Name:" field must start with a character.</td>
<td></td>
</tr>
<tr>
- <td>verifyText</td>
- <td>//div[2]/div[2]/div/div/div/div/div[2]</td>
+ <td>verifyTextPresent</td>
<td>The "User Name:" field must start with a character.</td>
+ <td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_003_CreateNewAccountSameAsExistingButDifferentByLowerUpperCase.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_003_CreateNewAccountSameAsExistingButDifferentByLowerUpperCase.html 2010-11-04 08:09:36 UTC (rev 4938)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_003_CreateNewAccountSameAsExistingButDifferentByLowerUpperCase.html 2010-11-04 09:11:19 UTC (rev 4939)
@@ -132,23 +132,23 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
+ <td>waitForTextPresent</td>
+ <td>You have registered a new account.</td>
<td></td>
</tr>
<tr>
- <td>waitForText</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
+ <td>verifyTextPresent</td>
<td>You have registered a new account.</td>
+ <td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
@@ -242,26 +242,31 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
+ <td>waitForTextPresent</td>
+ <td>You have registered a new account.</td>
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
+ <td>verifyTextPresent</td>
<td>You have registered a new account.</td>
+ <td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+<tr>
<td>clickAndWait</td>
<td>link=Sign out</td>
<td></td>
@@ -452,26 +457,6 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td>No result found.</td>
-</tr>
-<tr>
- <td>verifyText</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td>No result found.</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
- <td></td>
-</tr>
-<tr>
<td>echo</td>
<td>--Delete user is lower case--</td>
<td></td>
@@ -512,26 +497,6 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td>No result found.</td>
-</tr>
-<tr>
- <td>verifyText</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td>No result found.</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
<td>clickAndWait</td>
<td>link=Sign out</td>
<td></td>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_004_CreateNewAccountWithBlankRequireFields.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_004_CreateNewAccountWithBlankRequireFields.html 2010-11-04 08:09:36 UTC (rev 4938)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_004_CreateNewAccountWithBlankRequireFields.html 2010-11-04 09:11:19 UTC (rev 4939)
@@ -132,23 +132,23 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//html/body/div/div[2]/div/div/div/div/div/div/div/div/div[2]/div/div/div/div/div/div/div/div[3]/div/div/div/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[2]/div[2]/div/div/div/div[3]/div[2]</td>
+ <td>waitForTextPresent</td>
+ <td>The field "Email Address:" is required.</td>
<td></td>
</tr>
<tr>
- <td>verifyText</td>
- <td>//html/body/div/div[2]/div/div/div/div/div/div/div/div/div[2]/div/div/div/div/div/div/div/div[3]/div/div/div/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[2]/div[2]/div/div/div/div[3]/div[2]</td>
+ <td>verifyTextPresent</td>
<td>The field "Email Address:" is required.</td>
+ <td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_005_CreateNewAccountWithUserNameIncludesSpecialCharacers.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_005_CreateNewAccountWithUserNameIncludesSpecialCharacers.html 2010-11-04 08:09:36 UTC (rev 4938)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_005_CreateNewAccountWithUserNameIncludesSpecialCharacers.html 2010-11-04 09:11:19 UTC (rev 4939)
@@ -127,26 +127,31 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[2]/div[2]/div/div/div/div/div[2]</td>
+ <td>waitForTextPresent</td>
+ <td>Only alpha, digit, underscore, dash and dot characters allowed for the field "User Name:".</td>
<td></td>
</tr>
<tr>
- <td>verifyText</td>
- <td>//div[2]/div[2]/div/div/div/div/div[2]</td>
+ <td>verifyTextPresent</td>
<td>Only alpha, digit, underscore, dash and dot characters allowed for the field "User Name:".</td>
+ <td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+<tr>
<td>clickAndWait</td>
<td>link=Sign out</td>
<td></td>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_006_CreateNewAccountWithUserNameContainsAlphaDigitUndersoceDotDashInTheMiddle.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_006_CreateNewAccountWithUserNameContainsAlphaDigitUndersoceDotDashInTheMiddle.html 2010-11-04 08:09:36 UTC (rev 4938)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_006_CreateNewAccountWithUserNameContainsAlphaDigitUndersoceDotDashInTheMiddle.html 2010-11-04 09:11:19 UTC (rev 4939)
@@ -132,23 +132,23 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
+ <td>waitForTextPresent</td>
+ <td>You have registered a new account.</td>
<td></td>
</tr>
<tr>
- <td>verifyText</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
+ <td>verifyTextPresent</td>
<td>You have registered a new account.</td>
+ <td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
@@ -308,25 +308,10 @@
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
+ <td>link=Sign out</td>
<td></td>
</tr>
<tr>
- <td>verifyText</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td>No result found.</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
<td>clickAndWait</td>
<td>link=Sign out</td>
<td></td>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_007_CreateNewAccountWithUserNameStartsWithDigitUnderscoreDotDash.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_007_CreateNewAccountWithUserNameStartsWithDigitUnderscoreDotDash.html 2010-11-04 08:09:36 UTC (rev 4938)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_007_CreateNewAccountWithUserNameStartsWithDigitUnderscoreDotDash.html 2010-11-04 09:11:19 UTC (rev 4939)
@@ -132,23 +132,23 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[2]/div[2]/div/div/div/div/div[2]</td>
+ <td>waitForTextPresent</td>
<td>The "User Name:" field must start with a character.</td>
+ <td></td>
</tr>
<tr>
- <td>verifyText</td>
- <td>//div[2]/div[2]/div/div/div/div/div[2]</td>
+ <td>verifyTextPresent</td>
<td>The "User Name:" field must start with a character.</td>
+ <td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_008_CreateNewAccountWithUserNameTheSameWithExisting.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_008_CreateNewAccountWithUserNameTheSameWithExisting.html 2010-11-04 08:09:36 UTC (rev 4938)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_008_CreateNewAccountWithUserNameTheSameWithExisting.html 2010-11-04 09:11:19 UTC (rev 4939)
@@ -112,28 +112,23 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
+ <td>waitForTextPresent</td>
+ <td>You have registered a new account.</td>
<td></td>
</tr>
<tr>
- <td>verifyText</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
+ <td>verifyTextPresent</td>
<td>You have registered a new account.</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
@@ -142,6 +137,11 @@
<td></td>
</tr>
<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIAccountPortlet']/div[1]/div/div/div/div/div/div/div/div/div[1]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
<td>click</td>
<td>//div[@id='UIAccountPortlet']/div[1]/div/div/div/div/div/div/div/div/div[1]/div/div/div/div</td>
<td></td>
@@ -202,23 +202,23 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[2]/div/div/div/div/div/div[2]/div[1]/div/div/div/div/div[2]</td>
+ <td>waitForTextPresent</td>
+ <td>This user name already exists, please enter a different name.</td>
<td></td>
</tr>
<tr>
- <td>verifyText</td>
- <td>//div[2]/div/div/div/div/div/div[2]/div[1]/div/div/div/div/div[2]</td>
+ <td>verifyTextPresent</td>
<td>This user name already exists, please enter a different name.</td>
+ <td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
@@ -227,11 +227,16 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>link=Sign in</td>
+ <td>echo</td>
+ <td>-- Login with new user --</td>
<td></td>
</tr>
<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
<td>click</td>
<td>link=Sign in</td>
<td></td>
@@ -262,6 +267,11 @@
<td></td>
</tr>
<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
<td>click</td>
<td>link=Sign in</td>
<td></td>
@@ -322,16 +332,6 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
<td>clickAndWait</td>
<td>link=Sign out</td>
<td></td>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_009_CreateNewAccountWithUserNameLessOverMinMaxLength.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_009_CreateNewAccountWithUserNameLessOverMinMaxLength.html 2010-11-04 08:09:36 UTC (rev 4938)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_009_CreateNewAccountWithUserNameLessOverMinMaxLength.html 2010-11-04 09:11:19 UTC (rev 4939)
@@ -117,23 +117,23 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[2]/div[2]/div/div/div/div/div[2]</td>
+ <td>waitForTextPresent</td>
+ <td>The length of the text in field "User Name:" must be between "3" and "30" characters.</td>
<td></td>
</tr>
<tr>
- <td>verifyText</td>
- <td>//div[2]/div[2]/div/div/div/div/div[2]</td>
+ <td>verifyTextPresent</td>
<td>The length of the text in field "User Name:" must be between "3" and "30" characters.</td>
+ <td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
@@ -227,23 +227,23 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[2]/div[2]/div/div/div/div/div[2]</td>
+ <td>waitForTextPresent</td>
+ <td>The length of the text in field "User Name:" must be between "3" and "30" characters.</td>
<td></td>
</tr>
<tr>
- <td>verifyText</td>
- <td>//div[2]/div[2]/div/div/div/div/div[2]</td>
+ <td>verifyTextPresent</td>
<td>The length of the text in field "User Name:" must be between "3" and "30" characters.</td>
+ <td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_010_CheckExistingUserNameFunctionWhenAddNewAccout.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_010_CheckExistingUserNameFunctionWhenAddNewAccout.html 2010-11-04 08:09:36 UTC (rev 4938)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_010_CheckExistingUserNameFunctionWhenAddNewAccout.html 2010-11-04 09:11:19 UTC (rev 4939)
@@ -122,23 +122,23 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>waitForTextPresent</td>
+ <td>You have registered a new account.</td>
<td></td>
</tr>
<tr>
- <td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>verifyTextPresent</td>
+ <td>You have registered a new account.</td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//form[@id='UIAccountForm']/div[3]/div[2]/table/tbody/tr/td/div[2]/div/div/div</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//form[@id='UIAccountForm']/div[3]/div[2]/table/tbody/tr/td/div[2]/div/div/div</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
@@ -167,19 +167,24 @@
<td>Test_PRL_01_010</td>
</tr>
<tr>
+ <td>waitForElementPresent</td>
+ <td>//img[@title='Check Availability']</td>
+ <td></td>
+</tr>
+<tr>
<td>click</td>
<td>//img[@title='Check Availability']</td>
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[2]/div[2]/div/div/div/div/div[2]</td>
+ <td>waitForTextPresent</td>
<td>This user name already exists, please enter a different name.</td>
+ <td></td>
</tr>
<tr>
- <td>verifyText</td>
- <td>//div[2]/div[2]/div/div/div/div/div[2]</td>
+ <td>verifyTextPresent</td>
<td>This user name already exists, please enter a different name.</td>
+ <td></td>
</tr>
<tr>
<td>echo</td>
@@ -188,12 +193,12 @@
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
@@ -222,14 +227,14 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[2]/div[2]/div/div/div/div/div[2]</td>
+ <td>waitForTextPresent</td>
+ <td>This user name is available.</td>
<td></td>
</tr>
<tr>
- <td>verifyText</td>
- <td>//div[2]/div[2]/div/div/div/div/div[2]</td>
+ <td>verifyTextPresent</td>
<td>This user name is available.</td>
+ <td></td>
</tr>
<tr>
<td>echo</td>
@@ -238,12 +243,12 @@
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
@@ -302,37 +307,12 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td></td>
-</tr>
-<tr>
- <td>verifyText</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td>No result found.</td>
-</tr>
-<tr>
<td>echo</td>
- <td>-- Close message--</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
- <td>echo</td>
<td>-- Go to New Staff--</td>
<td></td>
</tr>
<tr>
- <td>click</td>
+ <td>waitForElementPresent</td>
<td>link=New Staff</td>
<td></td>
</tr>
@@ -367,23 +347,23 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[2]/div[2]/div/div/div/div/div[2]</td>
+ <td>waitForTextPresent</td>
+ <td>This user name is available.</td>
<td></td>
</tr>
<tr>
- <td>verifyText</td>
- <td>//div[2]/div[2]/div/div/div/div/div[2]</td>
+ <td>verifyTextPresent</td>
<td>This user name is available.</td>
+ <td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
@@ -412,23 +392,23 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[2]/div[2]/div/div/div/div/div[2]</td>
+ <td>waitForTextPresent</td>
+ <td>The user name cannot be empty.</td>
<td></td>
</tr>
<tr>
- <td>verifyText</td>
- <td>//div[2]/div[2]/div/div/div/div/div[2]</td>
+ <td>verifyTextPresent</td>
<td>The user name cannot be empty.</td>
+ <td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_011_CreateNewAccountWithPasswordandConfirmpasswordAreNotTheSame.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_011_CreateNewAccountWithPasswordandConfirmpasswordAreNotTheSame.html 2010-11-04 08:09:36 UTC (rev 4938)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_011_CreateNewAccountWithPasswordandConfirmpasswordAreNotTheSame.html 2010-11-04 09:11:19 UTC (rev 4939)
@@ -128,18 +128,18 @@
</tr>
<tr>
<td>echo</td>
- <td>-- Shoe message alert --</td>
+ <td>-- Show message alert --</td>
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[2]/div/div/div/div/div/div[2]/div[1]/div/div/div/div/div[2]</td>
+ <td>waitForTextPresent</td>
+ <td>Password and Confirm Password must be the same.</td>
<td></td>
</tr>
<tr>
- <td>verifyText</td>
- <td>//div[2]/div/div/div/div/div/div[2]/div[1]/div/div/div/div/div[2]</td>
+ <td>verifyTextPresent</td>
<td>Password and Confirm Password must be the same.</td>
+ <td></td>
</tr>
<tr>
<td>echo</td>
@@ -148,12 +148,12 @@
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
@@ -161,11 +161,6 @@
<td>link=Sign out</td>
<td></td>
</tr>
-<tr>
- <td>close</td>
- <td></td>
- <td></td>
-</tr>
</tbody></table>
</body>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_012_CreateNewAccountWhenCopyFromPasswordAndPasteToConfirmPassword.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_012_CreateNewAccountWhenCopyFromPasswordAndPasteToConfirmPassword.html 2010-11-04 08:09:36 UTC (rev 4938)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_012_CreateNewAccountWhenCopyFromPasswordAndPasteToConfirmPassword.html 2010-11-04 09:11:19 UTC (rev 4939)
@@ -122,14 +122,14 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[2]/div/div/div/div/div/div[2]/div[1]/div/div/div/div/div[2]</td>
+ <td>waitForTextPresent</td>
+ <td>Password and Confirm Password must be the same.</td>
<td></td>
</tr>
<tr>
- <td>verifyText</td>
- <td>//div[2]/div/div/div/div/div/div[2]/div[1]/div/div/div/div/div[2]</td>
+ <td>verifyTextPresent</td>
<td>Password and Confirm Password must be the same.</td>
+ <td></td>
</tr>
<tr>
<td>echo</td>
@@ -138,12 +138,12 @@
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
@@ -151,11 +151,6 @@
<td>link=Sign out</td>
<td></td>
</tr>
-<tr>
- <td>close</td>
- <td></td>
- <td></td>
-</tr>
</tbody></table>
</body>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_014_CreateNewAccountWithPasswordAndConfirmPasswordOver30Characters.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_014_CreateNewAccountWithPasswordAndConfirmPasswordOver30Characters.html 2010-11-04 08:09:36 UTC (rev 4938)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_014_CreateNewAccountWithPasswordAndConfirmPasswordOver30Characters.html 2010-11-04 09:11:19 UTC (rev 4939)
@@ -4,12 +4,12 @@
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="" />
-<title>Test_PRL_01_013_CreateNewAccountWithPasswordAndConfirmPasswordOver30Characters</title>
+<title>Test_PRL_01_014_CreateNewAccountWithPasswordAndConfirmPasswordOver30Characters</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
-<tr><td rowspan="1" colspan="3">Test_PRL_01_013_CreateNewAccountWithPasswordAndConfirmPasswordOver30Characters</td></tr>
+<tr><td rowspan="1" colspan="3">Test_PRL_01_014_CreateNewAccountWithPasswordAndConfirmPasswordOver30Characters</td></tr>
</thead><tbody>
<tr>
<td>open</td>
@@ -148,12 +148,12 @@
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
@@ -161,11 +161,6 @@
<td>link=Sign out</td>
<td></td>
</tr>
-<tr>
- <td>close</td>
- <td></td>
- <td></td>
-</tr>
</tbody></table>
</body>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_015_CreateNewAccountWithFirstNameExisting.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_015_CreateNewAccountWithFirstNameExisting.html 2010-11-04 08:09:36 UTC (rev 4938)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_015_CreateNewAccountWithFirstNameExisting.html 2010-11-04 09:11:19 UTC (rev 4939)
@@ -132,23 +132,23 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
+ <td>waitForTextPresent</td>
+ <td>You have registered a new account.</td>
<td></td>
</tr>
<tr>
- <td>verifyText</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
+ <td>verifyTextPresent</td>
<td>You have registered a new account.</td>
+ <td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
@@ -192,7 +192,7 @@
<td>Test_PRL_01_015</td>
</tr>
<tr>
- <td>click</td>
+ <td>clickAndWait</td>
<td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
<td></td>
</tr>
@@ -252,7 +252,7 @@
<td>gtn</td>
</tr>
<tr>
- <td>click</td>
+ <td>clickAndWait</td>
<td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
<td></td>
</tr>
@@ -313,26 +313,6 @@
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td></td>
-</tr>
-<tr>
- <td>verifyText</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td>No result found.</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
<td>link=Sign out</td>
<td></td>
</tr>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_016_CreateNewAccountWithLastNameExisting.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_016_CreateNewAccountWithLastNameExisting.html 2010-11-04 08:09:36 UTC (rev 4938)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_016_CreateNewAccountWithLastNameExisting.html 2010-11-04 09:11:19 UTC (rev 4939)
@@ -143,12 +143,12 @@
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
@@ -192,7 +192,7 @@
<td>Test_PRL_01_016</td>
</tr>
<tr>
- <td>click</td>
+ <td>clickAndWait</td>
<td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
<td></td>
</tr>
@@ -252,7 +252,7 @@
<td>gtn</td>
</tr>
<tr>
- <td>click</td>
+ <td>clickAndWait</td>
<td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
<td></td>
</tr>
@@ -313,26 +313,6 @@
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td></td>
-</tr>
-<tr>
- <td>verifyText</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td>No result found.</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
<td>link=Sign out</td>
<td></td>
</tr>
@@ -341,11 +321,6 @@
<td>link=Sign out</td>
<td></td>
</tr>
-<tr>
- <td>close</td>
- <td></td>
- <td></td>
-</tr>
</tbody></table>
</body>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_017_CreateNewAccountWhenFirstNameStartsWithNumber.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_017_CreateNewAccountWhenFirstNameStartsWithNumber.html 2010-11-04 08:09:36 UTC (rev 4938)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_017_CreateNewAccountWhenFirstNameStartsWithNumber.html 2010-11-04 09:11:19 UTC (rev 4939)
@@ -143,15 +143,20 @@
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+<tr>
<td>clickAndWait</td>
<td>link=Sign out</td>
<td></td>
@@ -308,31 +313,6 @@
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td>No result found.</td>
-</tr>
-<tr>
- <td>verifyText</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td>No result found.</td>
-</tr>
-<tr>
- <td>echo</td>
- <td>-- Close message--</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
<td>link=Sign out</td>
<td></td>
</tr>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_018_CreateNewAccountWhenLastNameStartWithNumber.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_018_CreateNewAccountWhenLastNameStartWithNumber.html 2010-11-04 08:09:36 UTC (rev 4938)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_018_CreateNewAccountWhenLastNameStartWithNumber.html 2010-11-04 09:11:19 UTC (rev 4939)
@@ -143,15 +143,20 @@
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+<tr>
<td>clickAndWait</td>
<td>link=Sign out</td>
<td></td>
@@ -308,31 +313,6 @@
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td>No result found.</td>
-</tr>
-<tr>
- <td>verifyText</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td>No result found.</td>
-</tr>
-<tr>
- <td>echo</td>
- <td>-- Close message--</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
<td>link=Sign out</td>
<td></td>
</tr>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_019_CreateNewAccoutFirstNameStartsWithUnderscoreDashDot.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_019_CreateNewAccoutFirstNameStartsWithUnderscoreDashDot.html 2010-11-04 08:09:36 UTC (rev 4938)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_019_CreateNewAccoutFirstNameStartsWithUnderscoreDashDot.html 2010-11-04 09:11:19 UTC (rev 4939)
@@ -143,12 +143,12 @@
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
@@ -303,26 +303,6 @@
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td></td>
-</tr>
-<tr>
- <td>verifyText</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td>No result found.</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
<td>link=Sign out</td>
<td></td>
</tr>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_020_CreateNewAccoutFirstNameStartsWithUnderscoreDashDot.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_020_CreateNewAccoutFirstNameStartsWithUnderscoreDashDot.html 2010-11-04 08:09:36 UTC (rev 4938)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_020_CreateNewAccoutFirstNameStartsWithUnderscoreDashDot.html 2010-11-04 09:11:19 UTC (rev 4939)
@@ -138,15 +138,20 @@
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+<tr>
<td>clickAndWait</td>
<td>link=Sign out</td>
<td></td>
@@ -297,26 +302,6 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td></td>
-</tr>
-<tr>
- <td>verifyText</td>
- <td>//div[3]/div/div/div/div/div[2]</td>
- <td>No result found.</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>//div[4]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
- <td></td>
-</tr>
-<tr>
<td>clickAndWait</td>
<td>link=Sign out</td>
<td></td>
14 years, 2 months
gatein SVN: r4938 - portal/branches/branch-GTNPORTAL-1592/webui/portal/src/main/java/org/exoplatform/portal/webui/page.
by do-not-reply@jboss.org
Author: kien_nguyen
Date: 2010-11-04 04:09:36 -0400 (Thu, 04 Nov 2010)
New Revision: 4938
Modified:
portal/branches/branch-GTNPORTAL-1592/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java
Log:
GTNPORTAL-633 update permission for listing portal
Modified: portal/branches/branch-GTNPORTAL-1592/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1592/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java 2010-11-04 07:14:25 UTC (rev 4937)
+++ portal/branches/branch-GTNPORTAL-1592/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java 2010-11-04 08:09:36 UTC (rev 4938)
@@ -148,27 +148,26 @@
//TODO: This following line is fixed for bug PORTAL-2127
uiListPermissionSelector.getChild(UIFormPopupWindow.class).setId("UIPageFormPopupGroupMembershipSelector");
- UserPortalConfig userPortalConfig =
- configService.getUserPortalConfig(pcontext.getPortalOwner(), pcontext.getRemoteUser());
+ List<String> portals = configService.getAllPortalNames();
+ Collections.sort(portals);
+ List<SelectItemOption<String>> portalsItem = new ArrayList<SelectItemOption<String>>();
ExoContainer container = ExoContainerContext.getCurrentContainer();
UserACL acl = (UserACL)container.getComponentInstanceOfType(UserACL.class);
- if (acl.hasEditPermission(userPortalConfig.getPortalConfig()))
+ for (String p : portals)
{
- ownerTypes.add(new SelectItemOption<String>(PortalConfig.PORTAL_TYPE));
- List<String> portals = configService.getAllPortalNames();
- if (portals.size() > 0)
+ UserPortalConfig userPortalConfig = configService.getUserPortalConfig(p, pcontext.getRemoteUser());
+ if (acl.hasEditPermission(userPortalConfig.getPortalConfig()))
{
- Collections.sort(portals);
- List<SelectItemOption<String>> portalsItem = new ArrayList<SelectItemOption<String>>();
- for (String p : portals)
- {
- portalsItem.add(new SelectItemOption<String>(p));
- }
- portalIdSelectBox = new UIFormSelectBox(OWNER_ID, OWNER_ID, portalsItem);
- portalIdSelectBox.setOnChange("ChangeOwnerId");
- portalIdSelectBox.setParent(uiSettingSet);
+ portalsItem.add(new SelectItemOption<String>(p));
}
}
+ if(portalsItem.size() > 0)
+ {
+ ownerTypes.add(new SelectItemOption<String>(PortalConfig.PORTAL_TYPE));
+ portalIdSelectBox = new UIFormSelectBox(OWNER_ID, OWNER_ID, portalsItem);
+ portalIdSelectBox.setOnChange("ChangeOwnerId");
+ portalIdSelectBox.setParent(uiSettingSet);
+ }
List<String> groups = configService.getMakableNavigations(pcontext.getRemoteUser(), true);
if (groups.size() > 0)
14 years, 2 months
gatein SVN: r4937 - portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-11-04 03:14:25 -0400 (Thu, 04 Nov 2010)
New Revision: 4937
Added:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_03_04_006_CheckCreatingPageForDeletedGroup.html
Log:
TESTVN-1006: Create new GateIn Selenium scripts
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_03_04_006_CheckCreatingPageForDeletedGroup.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_03_04_006_CheckCreatingPageForDeletedGroup.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_03_04_006_CheckCreatingPageForDeletedGroup.html 2010-11-04 07:14:25 UTC (rev 4937)
@@ -0,0 +1,762 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>Test_PRL_03_04_006_CheckCreatingPageForDeletedGroup</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Test_PRL_03_04_006_CheckCreatingPageForDeletedGroup</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>windowMaximize</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>root</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>gtn</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new user --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=New Staff</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>Test_PLT_03_04_006</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>Test_PLT_03_04_006</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>Confirmpassword</td>
+ <td>Test_PLT_03_04_006</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>firstName</td>
+ <td>Test_PLT_03_04_006</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>lastName</td>
+ <td>Test_PLT_03_04_006</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>email</td>
+ <td>Test_PLT_03_04_006(a)gmail.com</td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose User Profile --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIAccountPortlet']/div[1]/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIAccountPortlet']/div[1]/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>user.language</td>
+ <td></td>
+</tr>
+<tr>
+ <td>select</td>
+ <td>user.language</td>
+ <td>label=English</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Go to Users and group management --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Users and groups management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new group --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[1]/div/div/div/div/div/div/a[2]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[1]/div/div/div/div/div/div/a[2]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[3]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[3]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>groupName</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>groupName</td>
+ <td>Test_PLT_03_04_006</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>label</td>
+ <td>Test_PLT_03_04_006</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>description</td>
+ <td>Test_PLT_03_04_006</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Assign user A in new added group with manager role --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>Test_PLT_03_04_006</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>membership</td>
+ <td>label=manager</td>
+</tr>
+<tr>
+ <td>select</td>
+ <td>membership</td>
+ <td>label=manager</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new group navigation --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Group</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIGroupNavigationManagement']/div[2]/table/tbody/tr/td/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIGroupNavigationManagement']/div[2]/table/tbody/tr/td/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIAddGroupNavigationGrid']/table[10]/tbody/tr/td[2]/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIAddGroupNavigationGrid']/table[10]/tbody/tr/td[2]/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Cancel</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Cancel</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Test_PLT_03_04_006</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Test_PLT_03_04_006</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new node for group navigation --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Edit Navigation</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Edit Navigation</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Add Node</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Add Node</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>name</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>name</td>
+ <td>Test_PLT_03_04_006</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>label</td>
+ <td>Test_PLT_03_04_006</td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Go to Page Selector --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[2]/div/div/div/div/div/div[1]/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[2]/div/div/div/div/div/div[1]/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Search and Select Page</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Search and Select Page</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIRepeater']/table/tbody/tr[2]/td[5]/div/img</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIRepeater']/table/tbody/tr[2]/td[5]/div/img</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Save</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UINavigationManagement']/div[3]/table/tbody/tr/td[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UINavigationManagement']/div[3]/table/tbody/tr/td[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Login by new user --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>Test_PLT_03_04_006</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>Test_PLT_03_04_006</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Group</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Test_PLT_03_04_006</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new page --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Add New Page</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Add New Page</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIPageNodeSelector']/div/div/div[2]/div/div/div/div[1]/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIPageNodeSelector']/div/div/div[2]/div/div/div/div[1]/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>pageName</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>pageName</td>
+ <td>PLT_03_04_006</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>pageDisplayName</td>
+ <td>PLT_03_04_006</td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Click Next to move step 2 --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIPageCreationWizard']/div/div[3]/div/div/div/div[2]/div/table/tbody/tr/td/div[2]/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIPageCreationWizard']/div/div[3]/div/div/div/div[2]/div/table/tbody/tr/td/div[2]/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Click Next to move step 3 --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIPageCreationWizard']/div/div[3]/div/div/div/div[2]/div/table/tbody/tr/td/div[2]/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIPageCreationWizard']/div/div[3]/div/div/div/div[2]/div/table/tbody/tr/td/div[2]/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIPageEditor']/div[1]/div/div/div/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIPageEditor']/div[1]/div/div/div/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>root</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>gtn</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Go to User and group management --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Users and groups management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Users and groups management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Go to Group Management --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Group Management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Group Management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Delete new group --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[2]/div/div/div/div[2]/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[2]/div/div/div/div[2]/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIOrganizationPortlet']/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/a[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Are you sure you want to delete this group?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>Test_PLT_03_04_006</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>Test_PLT_03_04_006</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Group</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Group</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Deleted group's nav disappears in list, can not select t-o create page for deleted group -</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>Group Navigation</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>Group Navigation</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>root</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>gtn</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>//div[@id='UIPortalLoginFormAction']/div/div/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Go to user and group management --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Users and groups management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Users and groups management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>searchTerm</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>searchTerm</td>
+ <td>Test_PLT_03_04_006</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//form[@id='UISearchForm']/div[2]/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//form[@id='UISearchForm']/div[2]/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Delete user --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//img[@alt='DeleteUser']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//img[@alt='DeleteUser']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Are you sure you want to delete Test_PLT_03_04_006 user?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
14 years, 2 months
gatein SVN: r4936 - portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-11-04 03:06:58 -0400 (Thu, 04 Nov 2010)
New Revision: 4936
Modified:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_001_CreateNewAccountWithValidValues.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_013_CreateNewAccountWithPasswordAndConfirmPasswordLessThan6Characters.html
Log:
TestVN-356:Clean and Improve existing Selenium for GateIn
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_001_CreateNewAccountWithValidValues.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_001_CreateNewAccountWithValidValues.html 2010-11-04 06:36:29 UTC (rev 4935)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_001_CreateNewAccountWithValidValues.html 2010-11-04 07:06:58 UTC (rev 4936)
@@ -102,8 +102,23 @@
<td></td>
</tr>
<tr>
+ <td>waitForTextPresent</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>You have registered a new account.</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div</td>
<td></td>
</tr>
<tr>
@@ -227,7 +242,7 @@
<td></td>
</tr>
<tr>
- <td>click</td>
+ <td>clickAndWait</td>
<td>link=Sign out</td>
<td></td>
</tr>
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_013_CreateNewAccountWithPasswordAndConfirmPasswordLessThan6Characters.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_013_CreateNewAccountWithPasswordAndConfirmPasswordLessThan6Characters.html 2010-11-04 06:36:29 UTC (rev 4935)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_01_013_CreateNewAccountWithPasswordAndConfirmPasswordLessThan6Characters.html 2010-11-04 07:06:58 UTC (rev 4936)
@@ -132,33 +132,23 @@
<td></td>
</tr>
<tr>
- <td>waitForElementPresent</td>
- <td>//div[2]/div[2]/div/div/div/div[1]/div[2]</td>
+ <td>verifyTextPresent</td>
<td>The length of the text in field "Password:" must be between "6" and "30" characters.</td>
+ <td></td>
</tr>
<tr>
- <td>verifyText</td>
- <td>//div[2]/div[2]/div/div/div/div[1]/div[2]</td>
+ <td>verifyTextPresent</td>
<td>The length of the text in field "Password:" must be between "6" and "30" characters.</td>
+ <td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
- <td>//div[2]/div/div/div/div[2]/div[2]</td>
- <td>The length of the text in field "Confirm Password:" must be between "6" and "30" characters.</td>
-</tr>
-<tr>
- <td>verifyText</td>
- <td>//div[2]/div/div/div/div[2]/div[2]</td>
- <td>The length of the text in field "Confirm Password:" must be between "6" and "30" characters.</td>
-</tr>
-<tr>
- <td>waitForElementPresent</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
<td>click</td>
- <td>//div[3]/div/div/div[1]/div/div/div/div/div/div/div/div[2]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
+ <td>//div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a</td>
<td></td>
</tr>
<tr>
@@ -166,11 +156,6 @@
<td>link=Sign out</td>
<td></td>
</tr>
-<tr>
- <td>close</td>
- <td></td>
- <td></td>
-</tr>
</tbody></table>
</body>
14 years, 2 months
gatein SVN: r4935 - portal/trunk/packaging/pkg/src/main/assembly.
by do-not-reply@jboss.org
Author: trong.tran
Date: 2010-11-04 02:36:29 -0400 (Thu, 04 Nov 2010)
New Revision: 4935
Removed:
portal/trunk/packaging/pkg/src/main/assembly/tomcat-zip.xml
Log:
GTNPORTAL-1632 Missing in last commit
Deleted: portal/trunk/packaging/pkg/src/main/assembly/tomcat-zip.xml
===================================================================
--- portal/trunk/packaging/pkg/src/main/assembly/tomcat-zip.xml 2010-11-04 05:04:09 UTC (rev 4934)
+++ portal/trunk/packaging/pkg/src/main/assembly/tomcat-zip.xml 2010-11-04 06:36:29 UTC (rev 4935)
@@ -1,49 +0,0 @@
-<!--
-
- Copyright (C) 2009 eXo Platform SAS.
-
- This is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
--->
-
-<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1 http://maven.apache.org/xsd/assembly-1.1.1.xsd">
- <id>tomcat</id>
- <formats>
- <format>zip</format>
- <format>tar.gz</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <fileSets>
- <fileSet>
- <directory>target/tomcat</directory>
- <outputDirectory>${project.build.finalName}</outputDirectory>
- <useDefaultExcludes>true</useDefaultExcludes>
- <excludes>
- <exclude>**/*.sh</exclude>
- </excludes>
- </fileSet>
- <fileSet>
- <directory>target/tomcat</directory>
- <outputDirectory>${project.build.finalName}</outputDirectory>
- <useDefaultExcludes>true</useDefaultExcludes>
- <includes>
- <include>**/*.sh</include>
- </includes>
- <fileMode>755</fileMode>
- </fileSet>
- </fileSets>
-</assembly>
\ No newline at end of file
14 years, 2 months