gatein SVN: r4221 - portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-09-16 03:12:48 -0400 (Thu, 16 Sep 2010)
New Revision: 4221
Modified:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_43_ChangeApplicationWhenEditLayoutForGroupPage.html
Log:
TestVN-356:Clean and Improve existing Selenium for GateIn
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_43_ChangeApplicationWhenEditLayoutForGroupPage.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_43_ChangeApplicationWhenEditLayoutForGroupPage.html 2010-09-16 03:55:10 UTC (rev 4220)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_43_ChangeApplicationWhenEditLayoutForGroupPage.html 2010-09-16 07:12:48 UTC (rev 4221)
@@ -507,6 +507,11 @@
<td></td>
</tr>
<tr>
+ <td>waitForElementPresent</td>
+ <td>//a[@class='NodeIcon DefaultPageIcon' and @title='Test_SNF_PRL_43']</td>
+ <td></td>
+</tr>
+<tr>
<td>mouseDownRight</td>
<td>//a[@class='NodeIcon DefaultPageIcon' and @title='Test_SNF_PRL_43']</td>
<td></td>
14 years, 3 months
gatein SVN: r4220 - portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-09-15 23:55:10 -0400 (Wed, 15 Sep 2010)
New Revision: 4220
Modified:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_38_EditPropertiesForGroup.html
Log:
TestVN-356:Clean and Improve existing Selenium for GateIn
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_38_EditPropertiesForGroup.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_38_EditPropertiesForGroup.html 2010-09-15 21:08:22 UTC (rev 4219)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_38_EditPropertiesForGroup.html 2010-09-16 03:55:10 UTC (rev 4220)
@@ -72,6 +72,16 @@
<td></td>
</tr>
<tr>
+ <td>clickAndWait</td>
+ <td>link=Group</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Edit Properties</td>
+ <td></td>
+</tr>
+<tr>
<td>click</td>
<td>link=Edit Properties</td>
<td></td>
14 years, 3 months
gatein SVN: r4219 - in portal/branches/navcontroller/webui: portal/src/main/java/org/exoplatform/portal/application and 1 other directory.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-09-15 17:08:22 -0400 (Wed, 15 Sep 2010)
New Revision: 4219
Removed:
portal/branches/navcontroller/webui/framework/src/main/java/org/exoplatform/webui/application/UIComponentURLBuilder.java
Modified:
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalURLBuilder.java
Log:
cleanup
Deleted: portal/branches/navcontroller/webui/framework/src/main/java/org/exoplatform/webui/application/UIComponentURLBuilder.java
===================================================================
--- portal/branches/navcontroller/webui/framework/src/main/java/org/exoplatform/webui/application/UIComponentURLBuilder.java 2010-09-15 20:55:27 UTC (rev 4218)
+++ portal/branches/navcontroller/webui/framework/src/main/java/org/exoplatform/webui/application/UIComponentURLBuilder.java 2010-09-15 21:08:22 UTC (rev 4219)
@@ -1,83 +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.webui.application;
-
-import org.exoplatform.web.application.Parameter;
-import org.exoplatform.web.application.URLBuilder;
-import org.exoplatform.web.url.ResourceURL;
-import org.exoplatform.webui.core.UIComponent;
-import org.exoplatform.webui.url.ComponentLocator;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public abstract class UIComponentURLBuilder extends URLBuilder<UIComponent>
-{
-
- /** . */
- private final ResourceURL<UIComponent, ComponentLocator> url;
-
- private final ComponentLocator locator;
-
- public UIComponentURLBuilder(ResourceURL<UIComponent, ComponentLocator> url)
- {
- this.url = url;
- this.locator = url.getResourceLocator();
- }
-
- @Override
- public String createAjaxURL(UIComponent targetComponent, String action, String confirm, String targetBeanId, Parameter[] params)
- {
- return createURL(true, targetComponent, action, confirm, targetBeanId, params);
- }
-
- @Override
- public String createURL(UIComponent targetComponent, String action, String confirm, String targetBeanId, Parameter[] params)
- {
- return createURL(false, targetComponent, action, confirm, targetBeanId, params);
- }
-
- private String createURL(boolean ajax, UIComponent targetComponent, String action, String confirm, String targetBeanId, Parameter[] params)
- {
- url.getQueryParameters().clear();
-
- //
- url.setAjax(ajax);
- url.setConfirm(confirm);
- url.setResource(targetComponent);
-
- //
- locator.setAction(action);
- locator.setTargetBeanId(targetBeanId);
-
- //
- if (params != null)
- {
- for (Parameter param : params)
- {
- url.setQueryParameterValue(param.getName(), param.getValue());
- }
- }
-
- //
- return url.toString();
- }
-}
Modified: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalURLBuilder.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalURLBuilder.java 2010-09-15 20:55:27 UTC (rev 4218)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalURLBuilder.java 2010-09-15 21:08:22 UTC (rev 4219)
@@ -20,35 +20,72 @@
package org.exoplatform.portal.application;
import org.exoplatform.web.application.Parameter;
+import org.exoplatform.web.application.URLBuilder;
import org.exoplatform.web.url.ResourceURL;
-import org.exoplatform.webui.application.UIComponentURLBuilder;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.url.ComponentLocator;
-import java.net.URLEncoder;
-
/**
* Created by The eXo Platform SAS
* Apr 3, 2007
*/
-public class PortalURLBuilder extends UIComponentURLBuilder
+public class PortalURLBuilder extends URLBuilder<UIComponent>
{
+ /** . */
+ private final ResourceURL<UIComponent, ComponentLocator> url;
+
+ /** . */
+ private final ComponentLocator locator;
+
public PortalURLBuilder(PortalRequestContext ctx, ResourceURL<UIComponent, ComponentLocator> url)
{
- super(configure(ctx, url));
+ String path = ctx.getNodePath();
+ url.getResourceLocator().setPath(path);
+
+ //
+ this.url = url;
+ this.locator = url.getResourceLocator();
}
- /*
- * This is a hack.
- */
- private static ResourceURL<UIComponent, ComponentLocator> configure(PortalRequestContext prc, ResourceURL<UIComponent, ComponentLocator> url)
+ @Override
+ public String createAjaxURL(UIComponent targetComponent, String action, String confirm, String targetBeanId, Parameter[] params)
{
- String path = prc.getNodePath();
- url.getResourceLocator().setPath(path);
- return url;
+ return createURL(true, targetComponent, action, confirm, targetBeanId, params);
}
+ @Override
+ public String createURL(UIComponent targetComponent, String action, String confirm, String targetBeanId, Parameter[] params)
+ {
+ return createURL(false, targetComponent, action, confirm, targetBeanId, params);
+ }
+
+ private String createURL(boolean ajax, UIComponent targetComponent, String action, String confirm, String targetBeanId, Parameter[] params)
+ {
+ url.getQueryParameters().clear();
+
+ //
+ url.setAjax(ajax);
+ url.setConfirm(confirm);
+ url.setResource(targetComponent);
+
+ //
+ locator.setAction(action);
+ locator.setTargetBeanId(targetBeanId);
+
+ //
+ if (params != null)
+ {
+ for (Parameter param : params)
+ {
+ url.setQueryParameterValue(param.getName(), param.getValue());
+ }
+ }
+
+ //
+ return url.toString();
+ }
+
// I keept that as reminder for the various encodings
/*
14 years, 3 months
gatein SVN: r4217 - in portal/branches/navcontroller/webui: framework/src/main/java/org/exoplatform/webui/url and 4 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-09-15 16:52:23 -0400 (Wed, 15 Sep 2010)
New Revision: 4217
Removed:
portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/portal/url/PortletResourceURL.java
Modified:
portal/branches/navcontroller/webui/framework/src/main/java/org/exoplatform/webui/application/UIComponentURLBuilder.java
portal/branches/navcontroller/webui/framework/src/main/java/org/exoplatform/webui/url/ComponentLocator.java
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalURLBuilder.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/application/ExoPortletInvocationContext.java
Log:
cleanup
Modified: portal/branches/navcontroller/webui/framework/src/main/java/org/exoplatform/webui/application/UIComponentURLBuilder.java
===================================================================
--- portal/branches/navcontroller/webui/framework/src/main/java/org/exoplatform/webui/application/UIComponentURLBuilder.java 2010-09-15 19:25:48 UTC (rev 4216)
+++ portal/branches/navcontroller/webui/framework/src/main/java/org/exoplatform/webui/application/UIComponentURLBuilder.java 2010-09-15 20:52:23 UTC (rev 4217)
@@ -35,9 +35,12 @@
/** . */
private final ResourceURL<UIComponent, ComponentLocator> url;
+ private final ComponentLocator locator;
+
public UIComponentURLBuilder(ResourceURL<UIComponent, ComponentLocator> url)
{
this.url = url;
+ this.locator = url.getResourceLocator();
}
@Override
@@ -54,14 +57,14 @@
private String createURL(boolean ajax, UIComponent targetComponent, String action, String confirm, String targetBeanId, Parameter[] params)
{
+ url.getQueryParameters().clear();
+
+ //
url.setAjax(ajax);
url.setConfirm(confirm);
url.setResource(targetComponent);
//
- ComponentLocator locator = url.getResourceLocator();
-
- //
locator.setAction(action);
locator.setTargetBeanId(targetBeanId);
@@ -70,7 +73,7 @@
{
for (Parameter param : params)
{
- locator.addParameter(param);
+ url.setQueryParameterValue(param.getName(), param.getValue());
}
}
Modified: portal/branches/navcontroller/webui/framework/src/main/java/org/exoplatform/webui/url/ComponentLocator.java
===================================================================
--- portal/branches/navcontroller/webui/framework/src/main/java/org/exoplatform/webui/url/ComponentLocator.java 2010-09-15 19:25:48 UTC (rev 4216)
+++ portal/branches/navcontroller/webui/framework/src/main/java/org/exoplatform/webui/url/ComponentLocator.java 2010-09-15 20:52:23 UTC (rev 4217)
@@ -19,12 +19,13 @@
package org.exoplatform.webui.url;
-import org.exoplatform.web.application.Parameter;
import org.exoplatform.web.controller.QualifiedName;
import org.exoplatform.web.url.ResourceLocator;
import org.exoplatform.web.url.ResourceType;
import org.exoplatform.webui.core.UIComponent;
+import org.gatein.common.util.Tools;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
@@ -49,14 +50,28 @@
public static final QualifiedName TARGET = new QualifiedName("gtn", "objectid");
/** . */
+ public static final QualifiedName PATH = new QualifiedName("gtn", "path");
+
+ /** . */
+ private static final Set<QualifiedName> NAMES = Collections.unmodifiableSet(Tools.toSet(COMPONENT, ACTION, TARGET, PATH));
+
+ /** . */
private UIComponent resource;
/** . */
- private Map<QualifiedName, String> parameters;
+ private String action;
+ /** . */
+ private String targetBeanId;
+
+ /** . */
+ private String path;
+
+ private Map<QualifiedName, String> entries;
+
public ComponentLocator()
{
- this.parameters = new HashMap<QualifiedName, String>();
+ this.entries = new HashMap<QualifiedName, String>();
}
public UIComponent getResource()
@@ -66,56 +81,65 @@
public void setResource(UIComponent resource)
{
- setParameterValue(COMPONENT, resource != null ? resource.getId() : null);
-
- //
this.resource = resource;
}
- public String getAction()
+ public Set<QualifiedName> getParameterNames()
{
- return parameters.get(ACTION);
+ return NAMES;
}
- public void setAction(String action)
+ public String getParameterValue(QualifiedName parameterName)
{
- setParameterValue(ACTION, action);
+ if (COMPONENT.equals(parameterName))
+ {
+ return resource != null ? resource.getId() : null;
+ }
+ else if (ACTION.equals(parameterName))
+ {
+ return action;
+ }
+ else if (TARGET.equals(parameterName))
+ {
+ return targetBeanId;
+ }
+ else if (PATH.equals(parameterName))
+ {
+ return path;
+ }
+ else
+ {
+ return null;
+ }
}
- public String getTargetBeanId()
+ public String getAction()
{
- return parameters.get(TARGET);
+ return action;
}
- public void setTargetBeanId(String targetBeanId)
+ public void setAction(String action)
{
- setParameterValue(TARGET, targetBeanId);
+ this.action = action;
}
- public void addParameter(Parameter param)
+ public String getTargetBeanId()
{
- throw new UnsupportedOperationException("is it really used?");
+ return targetBeanId;
}
- public Set<QualifiedName> getParameterNames()
+ public void setTargetBeanId(String targetBeanId)
{
- return parameters.keySet();
+ this.targetBeanId = targetBeanId;
}
- public String getParameterValue(QualifiedName parameterName)
+ public String getPath()
{
- return parameters.get(parameterName);
+ return path;
}
- public void setParameterValue(QualifiedName parameterName, String parameterValue)
+ public void setPath(String path)
{
- if (parameterValue == null)
- {
- parameters.remove(parameterName);
- }
- else
- {
- parameters.put(parameterName, parameterValue);
- }
+ this.path = path;
}
}
Modified: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalURLBuilder.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalURLBuilder.java 2010-09-15 19:25:48 UTC (rev 4216)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalURLBuilder.java 2010-09-15 20:52:23 UTC (rev 4217)
@@ -45,10 +45,14 @@
private static ResourceURL<UIComponent, ComponentLocator> configure(PortalRequestContext prc, ResourceURL<UIComponent, ComponentLocator> url)
{
String path = prc.getNodePath();
- url.getResourceLocator().setParameterValue(PortalRequestHandler.REQUEST_PATH, path);
+ url.getResourceLocator().setPath(path);
return url;
}
+ // I keept that as reminder for the various encodings
+/*
+
+
protected void createURL(StringBuilder builder, UIComponent targetComponent, String action, String targetBeanId,
Parameter[] params)
{
@@ -80,5 +84,6 @@
}
}
+*/
}
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-09-15 19:25:48 UTC (rev 4216)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURL.java 2010-09-15 20:52:23 UTC (rev 4217)
@@ -124,7 +124,10 @@
for (QualifiedName parameterName : locator.getParameterNames())
{
String parameterValue = locator.getParameterValue(parameterName);
- parameters.put(parameterName, parameterValue);
+ if (parameterValue != null)
+ {
+ parameters.put(parameterName, parameterValue);
+ }
}
//
Modified: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java 2010-09-15 19:25:48 UTC (rev 4216)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java 2010-09-15 20:52:23 UTC (rev 4217)
@@ -70,7 +70,7 @@
//
org.exoplatform.web.url.ResourceURL<UIComponent,ComponentLocator> url = portalRequestContext.createURL(ComponentLocator.TYPE, portlet);
String path = portalRequestContext.getNodePath();
- url.getResourceLocator().setParameterValue(PortalRequestHandler.REQUEST_PATH, path);
+ url.getResourceLocator().setPath(path);
//
this.request = portalRequestContext.getRequest();
@@ -245,9 +245,6 @@
}
//
- String s = url.toString();
-
- //
- return s;
+ return url.toString();
}
}
Deleted: portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/portal/url/PortletResourceURL.java
===================================================================
--- portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/portal/url/PortletResourceURL.java 2010-09-15 19:25:48 UTC (rev 4216)
+++ portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/portal/url/PortletResourceURL.java 2010-09-15 20:52:23 UTC (rev 4217)
@@ -1,71 +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.portal.url;
-
-import org.exoplatform.web.controller.QualifiedName;
-import org.exoplatform.web.url.ResourceLocator;
-import org.exoplatform.web.url.ResourceURL;
-
-import javax.portlet.MimeResponse;
-import javax.portlet.PortletURL;
-
-/**
- * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
- * @version $Revision$
- */
-public class PortletResourceURL<R, L extends ResourceLocator<R>> extends ResourceURL<R, L>
-{
-
- /** . */
- public static final QualifiedName CONFIRM = new QualifiedName("gtn", "confirm");
-
- /** . */
- private PortletURL url;
-
- private final MimeResponse response;
-
-
- public PortletResourceURL(MimeResponse response, L locator, Boolean ajax) throws NullPointerException
- {
- super(locator, ajax);
-
- //
- this.response = response;
- }
-
- @Override
- public String toString()
- {
- if (url == null)
- {
- url = response.createActionURL();
- }
-
- //
- for (QualifiedName parameterName : locator.getParameterNames())
- {
- String parameterValue = locator.getParameterValue(parameterName);
- url.setParameter(parameterName.getValue(), parameterValue);
- }
-
- //
- return url.toString();
- }
-}
14 years, 3 months
gatein SVN: r4216 - in portal/branches/navcontroller: webui/portal/src/main/java/org/exoplatform/portal/application and 1 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-09-15 15:25:48 -0400 (Wed, 15 Sep 2010)
New Revision: 4216
Modified:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/application/URLBuilder.java
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalURLBuilder.java
portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java
Log:
URLBuilder cleanup
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/application/URLBuilder.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/application/URLBuilder.java 2010-09-15 16:16:09 UTC (rev 4215)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/application/URLBuilder.java 2010-09-15 19:25:48 UTC (rev 4216)
@@ -19,8 +19,6 @@
package org.exoplatform.web.application;
-import java.net.URLEncoder;
-
/**
* Created by The eXo Platform SAS
* Mar 29, 2007
@@ -28,85 +26,42 @@
abstract public class URLBuilder<T>
{
- public String createURL(String action)
+ public final String createURL(String action)
{
- return createURL(action, (Parameter[])null);
+ throw new UnsupportedOperationException("don't use me");
}
- abstract public String createURL(String action, Parameter[] params);
-
- public String createURL(String action, String objectId)
+ public final String createURL(String action, Parameter[] params)
{
- return createURL(action, objectId, (Parameter[])null);
+ throw new UnsupportedOperationException("don't use me");
}
- abstract public String createURL(String action, String objectId, Parameter[] params);
-
- public String createURL(T targetComponent, String action, String targetBeanId)
+ public final String createURL(String action, String objectId)
{
- return createURL(targetComponent, action, null, targetBeanId, (Parameter[])null);
+ throw new UnsupportedOperationException("don't use me");
}
- public String createAjaxURL(T targetComponent, String action, String targetBeanId)
+ public final String createURL(String action, String objectId, Parameter[] params)
{
- return createAjaxURL(targetComponent, action, null, targetBeanId, (Parameter[])null);
+ throw new UnsupportedOperationException("don't use me");
}
- public String createAjaxURL(T targetComponent, String action, String confirm, String targetBeanId)
+ public final String createURL(T targetComponent, String action, String targetBeanId)
{
- return createAjaxURL(targetComponent, action, confirm, targetBeanId, (Parameter[])null);
+ return createURL(targetComponent, action, null, targetBeanId, (Parameter[])null);
}
- public String createAjaxURL(T targetComponent, String action, String confirm, String targetBeanId, Parameter[] params)
+ public final String createAjaxURL(T targetComponent, String action, String targetBeanId)
{
- StringBuilder builder = new StringBuilder("javascript:");
- if (confirm != null && confirm.length() > 0)
- {
- builder.append("if(confirm('").append(confirm.replaceAll("'", "\\\\'")).append("'))");
- }
- builder.append("ajaxGet('");
- if (targetBeanId != null)
- {
- try
- {
- targetBeanId = URLEncoder.encode(targetBeanId, "utf-8");
- }
- catch (Exception e)
- {
- System.err.println(e.toString());
- }
- }
- createURL(builder, targetComponent, action, targetBeanId, params);
- builder.append("&ajaxRequest=true')");
- return builder.toString();
+ return createAjaxURL(targetComponent, action, null, targetBeanId, (Parameter[])null);
}
- public String createURL(T targetComponent, String action, String confirm, String targetBeanId, Parameter[] params)
+ public final String createAjaxURL(T targetComponent, String action, String confirm, String targetBeanId)
{
- StringBuilder builder = new StringBuilder();
- boolean hasConfirm = confirm != null && confirm.length() > 0;
- if (hasConfirm)
- {
- builder.append("javascript:if(confirm('").append(confirm.replaceAll("'", "\\\\'")).append("'))");
- builder.append("window.location=\'");
- }
- if (targetBeanId != null)
- {
- try
- {
- targetBeanId = URLEncoder.encode(targetBeanId, "utf-8");
- }
- catch (Exception e)
- {
- System.err.println(e.toString());
- }
- }
- createURL(builder, targetComponent, action, targetBeanId, params);
- if (hasConfirm)
- builder.append("\';");
- return builder.toString();
+ return createAjaxURL(targetComponent, action, confirm, targetBeanId, (Parameter[])null);
}
- abstract protected void createURL(StringBuilder builder, T targetComponent, String action, String targetBeanId,
- Parameter[] params);
+ public abstract String createAjaxURL(T targetComponent, String action, String confirm, String targetBeanId, Parameter[] params);
+
+ public abstract String createURL(T targetComponent, String action, String confirm, String targetBeanId, Parameter[] params);
}
Modified: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalURLBuilder.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalURLBuilder.java 2010-09-15 16:16:09 UTC (rev 4215)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalURLBuilder.java 2010-09-15 19:25:48 UTC (rev 4216)
@@ -49,18 +49,6 @@
return url;
}
- @SuppressWarnings("unused")
- public String createURL(String action, Parameter[] params)
- {
- return null;
- }
-
- @SuppressWarnings("unused")
- public String createURL(String action, String objectId, Parameter[] params)
- {
- return null;
- }
-
protected void createURL(StringBuilder builder, UIComponent targetComponent, String action, String targetBeanId,
Parameter[] params)
{
Modified: portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java
===================================================================
--- portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java 2010-09-15 16:16:09 UTC (rev 4215)
+++ portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java 2010-09-15 19:25:48 UTC (rev 4216)
@@ -25,6 +25,7 @@
import org.exoplatform.webui.core.UIComponent;
import javax.portlet.PortletURL;
+import java.net.URLEncoder;
/**
* julien todo : use PortletURL parameter instead of appending them to the url returned by the PortletURL
@@ -43,17 +44,57 @@
this.url = url;
}
- public String createURL(String action, Parameter[] params)
+ public String createAjaxURL(UIComponent targetComponent, String action, String confirm, String targetBeanId, Parameter[] params)
{
- return null;
+ StringBuilder builder = new StringBuilder("javascript:");
+ if (confirm != null && confirm.length() > 0)
+ {
+ builder.append("if(confirm('").append(confirm.replaceAll("'", "\\\\'")).append("'))");
+ }
+ builder.append("ajaxGet('");
+ if (targetBeanId != null)
+ {
+ try
+ {
+ targetBeanId = URLEncoder.encode(targetBeanId, "utf-8");
+ }
+ catch (Exception e)
+ {
+ System.err.println(e.toString());
+ }
+ }
+ createURL(builder, targetComponent, action, targetBeanId, params);
+ builder.append("&ajaxRequest=true')");
+ return builder.toString();
}
- public String createURL(String action, String objectId, Parameter[] params)
+ public String createURL(UIComponent targetComponent, String action, String confirm, String targetBeanId, Parameter[] params)
{
- return null;
+ StringBuilder builder = new StringBuilder();
+ boolean hasConfirm = confirm != null && confirm.length() > 0;
+ if (hasConfirm)
+ {
+ builder.append("javascript:if(confirm('").append(confirm.replaceAll("'", "\\\\'")).append("'))");
+ builder.append("window.location=\'");
+ }
+ if (targetBeanId != null)
+ {
+ try
+ {
+ targetBeanId = URLEncoder.encode(targetBeanId, "utf-8");
+ }
+ catch (Exception e)
+ {
+ System.err.println(e.toString());
+ }
+ }
+ createURL(builder, targetComponent, action, targetBeanId, params);
+ if (hasConfirm)
+ builder.append("\';");
+ return builder.toString();
}
- protected void createURL(StringBuilder builder, UIComponent targetComponent, String action, String targetBeanId,
+ private void createURL(StringBuilder builder, UIComponent targetComponent, String action, String targetBeanId,
Parameter[] params)
{
// Clear URL
14 years, 3 months
gatein SVN: r4215 - in portal/branches/navcontroller: component/web/controller/src/main/java/org/exoplatform/web/url and 5 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-09-15 12:16:09 -0400 (Wed, 15 Sep 2010)
New Revision: 4215
Modified:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/application/RequestContext.java
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/application/URLBuilder.java
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/ResourceURL.java
portal/branches/navcontroller/webui/framework/src/main/java/org/exoplatform/webui/application/UIComponentURLBuilder.java
portal/branches/navcontroller/webui/framework/src/main/java/org/exoplatform/webui/application/WebuiRequestContext.java
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalURLBuilder.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/application/ExoPortletInvocationContext.java
portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletApplication.java
portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletRequestContext.java
portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java
Log:
- rewrote PortletURLBuilder to use PortletURL
- rewrote UIPortlet url generation to use PortalURL instead
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/application/RequestContext.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/application/RequestContext.java 2010-09-15 11:16:29 UTC (rev 4214)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/application/RequestContext.java 2010-09-15 16:16:09 UTC (rev 4215)
@@ -53,15 +53,22 @@
private Application app_;
- protected RequestContext parentAppRequestContext_;
+ protected final RequestContext parentAppRequestContext_;
private Map<String, Object> attributes;
public RequestContext(Application app)
{
- app_ = app;
+ this.app_ = app;
+ this.parentAppRequestContext_ = null;
}
+ protected RequestContext(RequestContext parentAppRequestContext, Application app_)
+ {
+ this.parentAppRequestContext_ = parentAppRequestContext;
+ this.app_ = app_;
+ }
+
public Application getApplication()
{
return app_;
@@ -194,11 +201,6 @@
return parentAppRequestContext_;
}
- public void setParentAppRequestContext(RequestContext context)
- {
- parentAppRequestContext_ = context;
- }
-
@SuppressWarnings("unchecked")
public static <T extends RequestContext> T getCurrentInstance()
{
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/application/URLBuilder.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/application/URLBuilder.java 2010-09-15 11:16:29 UTC (rev 4214)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/application/URLBuilder.java 2010-09-15 16:16:09 UTC (rev 4215)
@@ -28,23 +28,6 @@
abstract public class URLBuilder<T>
{
- protected String baseURL_;
-
- public URLBuilder(String baseURL)
- {
- baseURL_ = baseURL;
- }
-
- public String getBaseURL()
- {
- return baseURL_;
- }
-
- public void setBaseURL(String url)
- {
- baseURL_ = url;
- }
-
public String createURL(String action)
{
return createURL(action, (Parameter[])null);
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/ResourceURL.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/ResourceURL.java 2010-09-15 11:16:29 UTC (rev 4214)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/url/ResourceURL.java 2010-09-15 16:16:09 UTC (rev 4215)
@@ -19,6 +19,10 @@
package org.exoplatform.web.url;
+import org.gatein.common.util.ParameterMap;
+
+import java.util.Map;
+
/**
* An URL for a resource.
*
@@ -29,6 +33,9 @@
{
/** . */
+ private static final ParameterMap.AccessMode ACCES_MODE = ParameterMap.AccessMode.get(false, false);
+
+ /** . */
protected final L locator;
/** . */
@@ -37,6 +44,9 @@
/** . */
protected String confirm;
+ /** . */
+ protected ParameterMap queryParams;
+
/**
* Create a resource URL instance.
*
@@ -55,6 +65,7 @@
this.locator = locator;
this.ajax = ajax;
this.confirm = null;
+ this.queryParams = null;
}
/**
@@ -103,10 +114,12 @@
* Updates the confirm message.
*
* @param confirm the new confirm message
+ * @return this object
*/
- public void setConfirm(String confirm)
+ public final ResourceURL setConfirm(String confirm)
{
this.confirm = confirm;
+ return this;
}
/**
@@ -123,6 +136,7 @@
* Set a new resource on this URL.
*
* @param resource the new resource
+ * @return this object
*/
public final ResourceURL setResource(R resource)
{
@@ -130,6 +144,67 @@
return this;
}
+ public Map<String, String[]> getQueryParameters()
+ {
+ if (queryParams == null)
+ {
+ queryParams = new ParameterMap(ACCES_MODE);
+ }
+ return queryParams;
+ }
+
+ public String getQueryParameterValue(String parameterName)
+ {
+ if (parameterName == null)
+ {
+ throw new NullPointerException("");
+ }
+ else if (queryParams == null)
+ {
+ return null;
+ }
+ else
+ {
+ String[] parameterValues = queryParams.get(parameterName);
+ return parameterValues != null ? parameterValues[0] : null;
+ }
+ }
+
+ public void setQueryParameterValue(String parameterName, String parameterValue)
+ {
+ if (parameterName == null)
+ {
+ throw new NullPointerException("No null parameter name");
+ }
+ if (queryParams == null)
+ {
+ queryParams = new ParameterMap(ACCES_MODE);
+ }
+ queryParams.setValue(parameterName, parameterValue);
+ }
+
+ public String[] getQueryParameterValues(String parameterName)
+ {
+ if (parameterName == null)
+ {
+ throw new NullPointerException("No null parameter name");
+ }
+ return queryParams != null ? queryParams.getValues(parameterName) : null;
+ }
+
+ public void setQueryParameterValues(String parameterName, String[] parameterValues)
+ {
+ if (parameterName == null)
+ {
+ throw new NullPointerException("No null parameter name");
+ }
+ if (queryParams == null)
+ {
+ queryParams = new ParameterMap(ACCES_MODE);
+ }
+ queryParams.setValues(parameterName, parameterValues);
+ }
+
/**
* Generates the URL value.
*
Modified: portal/branches/navcontroller/webui/framework/src/main/java/org/exoplatform/webui/application/UIComponentURLBuilder.java
===================================================================
--- portal/branches/navcontroller/webui/framework/src/main/java/org/exoplatform/webui/application/UIComponentURLBuilder.java 2010-09-15 11:16:29 UTC (rev 4214)
+++ portal/branches/navcontroller/webui/framework/src/main/java/org/exoplatform/webui/application/UIComponentURLBuilder.java 2010-09-15 16:16:09 UTC (rev 4215)
@@ -37,9 +37,6 @@
public UIComponentURLBuilder(ResourceURL<UIComponent, ComponentLocator> url)
{
- super("foo");
-
- //
this.url = url;
}
Modified: portal/branches/navcontroller/webui/framework/src/main/java/org/exoplatform/webui/application/WebuiRequestContext.java
===================================================================
--- portal/branches/navcontroller/webui/framework/src/main/java/org/exoplatform/webui/application/WebuiRequestContext.java 2010-09-15 11:16:29 UTC (rev 4214)
+++ portal/branches/navcontroller/webui/framework/src/main/java/org/exoplatform/webui/application/WebuiRequestContext.java 2010-09-15 16:16:09 UTC (rev 4215)
@@ -69,6 +69,11 @@
super(app);
}
+ protected WebuiRequestContext(RequestContext parentAppRequestContext, Application app_)
+ {
+ super(parentAppRequestContext, app_);
+ }
+
public String getSessionId()
{
return sessionId_;
Modified: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalURLBuilder.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalURLBuilder.java 2010-09-15 11:16:29 UTC (rev 4214)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/application/PortalURLBuilder.java 2010-09-15 16:16:09 UTC (rev 4215)
@@ -64,7 +64,7 @@
protected void createURL(StringBuilder builder, UIComponent targetComponent, String action, String targetBeanId,
Parameter[] params)
{
- builder.append(getBaseURL()).append("?").append(PortalRequestContext.UI_COMPONENT_ID).append('=').append(
+ builder.append("baseurl").append("?").append(PortalRequestContext.UI_COMPONENT_ID).append('=').append(
targetComponent.getId());
if (action != null && action.trim().length() > 0)
{
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-09-15 11:16:29 UTC (rev 4214)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/url/PortalURL.java 2010-09-15 16:16:09 UTC (rev 4215)
@@ -133,7 +133,6 @@
//
boolean questionMarkDone = false;
Map<String, String> queryParams = renderContext.getQueryParams();
- System.out.println("queryParams = " + queryParams);
if (queryParams.size() > 0)
{
for (Map.Entry<String, String> entry : queryParams.entrySet())
@@ -146,6 +145,19 @@
}
}
+ // Now append generic query parameters
+ for (Map.Entry<String, String[]> entry : getQueryParameters().entrySet())
+ {
+ for (String value : entry.getValue())
+ {
+ buffer.append(questionMarkDone ? "&" : "?");
+ buffer.append(entry.getKey());
+ buffer.append("=");
+ buffer.append(value);
+ questionMarkDone = true;
+ }
+ }
+
//
if (ajax)
{
Modified: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java 2010-09-15 11:16:29 UTC (rev 4214)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java 2010-09-15 16:16:09 UTC (rev 4215)
@@ -21,6 +21,10 @@
import org.exoplatform.Constants;
import org.exoplatform.portal.application.PortalRequestContext;
+import org.exoplatform.portal.application.PortalRequestHandler;
+import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.core.UIComponent;
+import org.exoplatform.webui.url.ComponentLocator;
import org.gatein.common.net.media.MediaType;
import org.gatein.common.util.MarkupInfo;
import org.gatein.common.util.ParameterValidation;
@@ -46,26 +50,32 @@
class ExoPortletInvocationContext extends AbstractPortletInvocationContext
{
- private HttpServletResponse response;
+ static final String INTERACTION_STATE_PARAM_NAME = "interactionstate";
+ static final String NAVIGATIONAL_STATE_PARAM_NAME = "navigationalstate";
+ static final String RESOURCE_STATE_PARAM_NAME = "resourcestate";
- private HttpServletRequest request;
+ /** . */
+ private final HttpServletResponse response;
- private String portalRequestURI;
+ /** . */
+ private final HttpServletRequest request;
- private String portletId;
+ /** . */
+ private final org.exoplatform.web.url.ResourceURL<UIComponent, ComponentLocator> url;
- static final String INTERACTION_STATE_PARAM_NAME = "interactionstate";
- static final String NAVIGATIONAL_STATE_PARAM_NAME = "navigationalstate";
- static final String RESOURCE_STATE_PARAM_NAME = "resourcestate";
-
public ExoPortletInvocationContext(PortalRequestContext portalRequestContext, UIPortlet portlet)
{
super(new MarkupInfo(MediaType.create("text/html"), "UTF-8"));
+ //
+ org.exoplatform.web.url.ResourceURL<UIComponent,ComponentLocator> url = portalRequestContext.createURL(ComponentLocator.TYPE, portlet);
+ String path = portalRequestContext.getNodePath();
+ url.getResourceLocator().setParameterValue(PortalRequestHandler.REQUEST_PATH, path);
+
+ //
this.request = portalRequestContext.getRequest();
this.response = portalRequestContext.getResponse();
- this.portalRequestURI = portalRequestContext.getRequestURI();
- this.portletId = portlet.getId();
+ this.url = url;
}
@Override
@@ -92,9 +102,12 @@
public String renderURL(ContainerURL containerURL, URLFormat format)
{
+
+/*
// todo: shouldn't we be using URLFormat to decide on the path to use at the beginning of the URL?
StringBuilder baseURL = new StringBuilder(this.portalRequestURI).append("?")
.append(PortalRequestContext.UI_COMPONENT_ID).append("=").append(this.portletId);
+*/
String type;
if (containerURL instanceof RenderURL)
@@ -116,12 +129,12 @@
if (!type.equals(Constants.PORTAL_RENDER))
{
- appendParameter(baseURL, Constants.TYPE_PARAMETER, type);
+ url.setQueryParameterValue(Constants.TYPE_PARAMETER, type);
}
if (format != null && format.getWantSecure() != null)
{
- appendParameter(baseURL, Constants.SECURE_PARAMETER, format.getWantSecure().toString());
+ url.setQueryParameterValue(Constants.SECURE_PARAMETER, format.getWantSecure().toString());
}
if (containerURL instanceof ActionURL)
@@ -131,61 +144,61 @@
StateString state = actionURL.getInteractionState();
if (state != null && !state.getStringValue().equals(StateString.JBPNS_PREFIX))
{
- appendParameter(baseURL, INTERACTION_STATE_PARAM_NAME, state.getStringValue());
+ url.setQueryParameterValue(INTERACTION_STATE_PARAM_NAME, state.getStringValue());
}
state = actionURL.getNavigationalState();
if (state != null && !state.getStringValue().equals(StateString.JBPNS_PREFIX))
{
- appendParameter(baseURL, NAVIGATIONAL_STATE_PARAM_NAME, state.getStringValue());
+ url.setQueryParameterValue(NAVIGATIONAL_STATE_PARAM_NAME, state.getStringValue());
}
WindowState windowState = actionURL.getWindowState();
if (windowState != null)
{
- appendParameter(baseURL, Constants.WINDOW_STATE_PARAMETER, windowState.toString());
+ url.setQueryParameterValue(Constants.WINDOW_STATE_PARAMETER, windowState.toString());
}
Mode mode = actionURL.getMode();
if (mode != null)
{
- appendParameter(baseURL, Constants.PORTLET_MODE_PARAMETER, mode.toString());
+ url.setQueryParameterValue(Constants.PORTLET_MODE_PARAMETER, mode.toString());
}
}
else if (containerURL instanceof ResourceURL)
{
ResourceURL resourceURL = (ResourceURL)containerURL;
- appendParameter(baseURL, Constants.RESOURCE_ID_PARAMETER, resourceURL.getResourceId());
+ url.setQueryParameterValue(Constants.RESOURCE_ID_PARAMETER, resourceURL.getResourceId());
CacheLevel cachability = resourceURL.getCacheability();
if (cachability != null)
{
- appendParameter(baseURL, Constants.CACHELEVEL_PARAMETER, cachability.name());
+ url.setQueryParameterValue(Constants.CACHELEVEL_PARAMETER, cachability.name());
}
StateString resourceState = resourceURL.getResourceState();
if (resourceState != null && !resourceState.getStringValue().equals(StateString.JBPNS_PREFIX))
{
- appendParameter(baseURL, RESOURCE_STATE_PARAM_NAME, resourceState.getStringValue());
+ url.setQueryParameterValue(RESOURCE_STATE_PARAM_NAME, resourceState.getStringValue());
}
resourceState = resourceURL.getNavigationalState();
if (resourceState != null && !resourceState.getStringValue().equals(StateString.JBPNS_PREFIX))
{
- appendParameter(baseURL, NAVIGATIONAL_STATE_PARAM_NAME, resourceState.getStringValue());
+ url.setQueryParameterValue(NAVIGATIONAL_STATE_PARAM_NAME, resourceState.getStringValue());
}
WindowState windowState = resourceURL.getWindowState();
if (windowState != null)
{
- appendParameter(baseURL, Constants.WINDOW_STATE_PARAMETER, windowState.toString());
+ url.setQueryParameterValue(Constants.WINDOW_STATE_PARAMETER, windowState.toString());
}
Mode mode = resourceURL.getMode();
if (mode != null)
{
- appendParameter(baseURL, Constants.PORTLET_MODE_PARAMETER, mode.toString());
+ url.setQueryParameterValue(Constants.PORTLET_MODE_PARAMETER, mode.toString());
}
}
else
@@ -195,13 +208,13 @@
WindowState windowState = renderURL.getWindowState();
if (windowState != null)//&& !windowState.equals(WindowState.NORMAL))
{
- appendParameter(baseURL, Constants.WINDOW_STATE_PARAMETER, windowState.toString());
+ url.setQueryParameterValue(Constants.WINDOW_STATE_PARAMETER, windowState.toString());
}
Mode mode = renderURL.getMode();
if (mode != null)
{
- appendParameter(baseURL, Constants.PORTLET_MODE_PARAMETER, mode.toString());
+ url.setQueryParameterValue(Constants.PORTLET_MODE_PARAMETER, mode.toString());
}
Map<String, String[]> publicNSChanges = renderURL.getPublicNavigationalStateChanges();
@@ -214,12 +227,12 @@
{
for (String value : values)
{
- appendParameter(baseURL, key, value);
+ url.setQueryParameterValue(key, value);
}
}
else
{
- appendParameter(baseURL, "removePP", key);
+ url.setQueryParameterValue("removePP", key);
}
}
}
@@ -227,18 +240,14 @@
StateString state = renderURL.getNavigationalState();
if (state != null && !state.getStringValue().equals(StateString.JBPNS_PREFIX))
{
- appendParameter(baseURL, NAVIGATIONAL_STATE_PARAM_NAME, state.getStringValue());
+ url.setQueryParameterValue(NAVIGATIONAL_STATE_PARAM_NAME, state.getStringValue());
}
}
- return baseURL.toString();
- }
+ //
+ String s = url.toString();
- private void appendParameter(StringBuilder builder, String name, String value)
- {
- if (value != null)
- {
- builder.append("&").append(name).append("=").append(value);
- }
+ //
+ return s;
}
}
Modified: portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletApplication.java
===================================================================
--- portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletApplication.java 2010-09-15 11:16:29 UTC (rev 4214)
+++ portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletApplication.java 2010-09-15 16:16:09 UTC (rev 4215)
@@ -307,10 +307,9 @@
}
else
{
- context = new PortletRequestContext(this, w, req, res);
+ context = new PortletRequestContext(parentAppRequestContext, this, w, req, res);
parentAppRequestContext.setAttribute(attributeName, context);
}
- context.setParentAppRequestContext(parentAppRequestContext);
return context;
}
Modified: portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletRequestContext.java
===================================================================
--- portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletRequestContext.java 2010-09-15 11:16:29 UTC (rev 4214)
+++ portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletRequestContext.java 2010-09-15 16:16:09 UTC (rev 4215)
@@ -21,6 +21,7 @@
import org.exoplatform.commons.utils.WriterPrinter;
import org.exoplatform.services.resources.Orientation;
+import org.exoplatform.web.application.RequestContext;
import org.exoplatform.web.application.URLBuilder;
import org.exoplatform.web.url.LocatorProvider;
import org.exoplatform.web.url.ResourceLocator;
@@ -34,14 +35,17 @@
import java.io.Writer;
import javax.portlet.ActionResponse;
+import javax.portlet.MimeResponse;
import javax.portlet.PortletMode;
import javax.portlet.PortletModeException;
import javax.portlet.PortletRequest;
import javax.portlet.PortletResponse;
-import javax.portlet.RenderResponse;
import javax.portlet.StateAwareResponse;
/**
+ * todo (julien) : there is an issue here (small) as the PRC seems to be stored in http session
+ * and keep a pointer on request and response object.
+ *
* The request context of a portlet
*
*/
@@ -66,15 +70,14 @@
private boolean hasProcessAction_ = false;
- private final PortletURLBuilder urlBuilder;
+ /** . */
+ private PortletURLBuilder urlBuilder;
- public PortletRequestContext(WebuiApplication app, Writer writer, PortletRequest req, PortletResponse res)
+ public PortletRequestContext(RequestContext parentAppRequestContext, WebuiApplication app, Writer writer, PortletRequest req, PortletResponse res)
{
- super(app);
+ super(parentAppRequestContext, app);
init(writer, req, res);
setSessionId(req.getPortletSession(true).getId());
-
- urlBuilder = new PortletURLBuilder();
}
@Override
@@ -89,6 +92,16 @@
response_ = res;
writer_ = new WriterPrinter(writer);
windowId_ = req.getWindowID();
+
+ //
+ if (res instanceof MimeResponse)
+ {
+ this.urlBuilder = new PortletURLBuilder(((MimeResponse)res).createActionURL());
+ }
+ else
+ {
+ this.urlBuilder = null;
+ }
}
public void setUIApplication(UIApplication uiApplication) throws Exception
@@ -211,8 +224,10 @@
public URLBuilder<UIComponent> getURLBuilder()
{
- RenderResponse renderRes = (RenderResponse)response_;
- urlBuilder.setBaseURL(renderRes.createActionURL().toString());
+ if (urlBuilder == null)
+ {
+ throw new IllegalStateException("Cannot create portlet URL during action/event phase");
+ }
return urlBuilder;
}
Modified: portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java
===================================================================
--- portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java 2010-09-15 11:16:29 UTC (rev 4214)
+++ portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java 2010-09-15 16:16:09 UTC (rev 4215)
@@ -24,6 +24,8 @@
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.core.UIComponent;
+import javax.portlet.PortletURL;
+
/**
* julien todo : use PortletURL parameter instead of appending them to the url returned by the PortletURL
*
@@ -32,17 +34,13 @@
*/
public class PortletURLBuilder extends URLBuilder<UIComponent>
{
- private static final String AMP = "&";
- private static final char EQUALS = '=';
- public PortletURLBuilder()
- {
- super(null);
- }
+ /** . */
+ private final PortletURL url;
- public PortletURLBuilder(String baseURL)
+ public PortletURLBuilder(PortletURL url)
{
- super(baseURL);
+ this.url = url;
}
public String createURL(String action, Parameter[] params)
@@ -58,27 +56,34 @@
protected void createURL(StringBuilder builder, UIComponent targetComponent, String action, String targetBeanId,
Parameter[] params)
{
- String baseUrl = getBaseURL().replaceAll("&", AMP);
- builder.append(baseUrl).append(AMP).append(UIComponent.UICOMPONENT).append(EQUALS).append(
- targetComponent.getId());
+ // Clear URL
+ url.getParameterMap().clear();
+ //
+ url.setParameter(UIComponent.UICOMPONENT, targetComponent.getId());
+
+ //
if (action != null && action.trim().length() > 0)
{
- builder.append(AMP).append(WebuiRequestContext.ACTION).append(EQUALS).append(action);
+ url.setParameter(WebuiRequestContext.ACTION, action);
}
+ //
if (targetBeanId != null && targetBeanId.trim().length() > 0)
{
- builder.append(AMP).append(UIComponent.OBJECTID).append(EQUALS).append(targetBeanId);
+ url.setParameter(UIComponent.OBJECTID, targetBeanId);
}
- if (params == null || params.length < 1)
- return;
- for (Parameter param : params)
+ //
+ if (params != null && params.length > 0)
{
- builder.append(AMP).append(param.getName()).append(EQUALS).append(param.getValue());
+ for (Parameter param : params)
+ {
+ url.setParameter(param.getName(), param.getValue());
+ }
}
+ //
+ builder.append(url.toString());
}
-
}
14 years, 3 months
gatein SVN: r4214 - portal/trunk/testsuite/testdefinitions.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-09-15 07:16:29 -0400 (Wed, 15 Sep 2010)
New Revision: 4214
Modified:
portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_BasicPortlets_TestDefinition.ods
portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_MainFunctions_TestDefinition.ods
Log:
Update GateIn_v3.1.0_MainFunctions_TestDefinition.ods and GateIn_v3.1.0_BasicPortlets_TestDefinition.ods
Modified: portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_BasicPortlets_TestDefinition.ods
===================================================================
(Binary files differ)
Modified: portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_MainFunctions_TestDefinition.ods
===================================================================
(Binary files differ)
14 years, 3 months
gatein SVN: r4213 - portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-09-15 07:01:14 -0400 (Wed, 15 Sep 2010)
New Revision: 4213
Added:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_05_01_011_AddNewCategoryWithDisplayNameLessThan3OrOver30Chars.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_05_01_012_AddNewCategoryWithBlankDescription.html
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_05_01_013_AddNewCategoryWithDescriptionOverMaxLength.html
Log:
TESTVN-1006: Create new GateIn Selenium scripts
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_05_01_011_AddNewCategoryWithDisplayNameLessThan3OrOver30Chars.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_05_01_011_AddNewCategoryWithDisplayNameLessThan3OrOver30Chars.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_05_01_011_AddNewCategoryWithDisplayNameLessThan3OrOver30Chars.html 2010-09-15 11:01:14 UTC (rev 4213)
@@ -0,0 +1,312 @@
+<?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_05_01_011_AddNewCategoryWithDisplayNameLessThan3OrOver30Chars</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Test_PRL_05_01_011_AddNewCategoryWithDisplayNameLessThan3OrOver30Chars</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new category with Display Name less than 3 or over 30 characters --</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>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>clickAndWait</td>
+ <td>link=Application Registry</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new category with Display name less than 3 characters --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[1]/div/div/div/div/div/div/div/div[2]/div[2]/div[1]/div[1]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[1]/div/div/div/div/div/div/div/div[2]/div[2]/div[1]/div[1]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>name</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>name</td>
+ <td>Test_PLT_05_01_011</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>displayName</td>
+ <td>PL</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>description</td>
+ <td>Test_PLT_05_01_011</td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Permission Setting --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[2]/div[2]/div/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[2]/div/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Add Permission</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Add Permission</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Partners</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Partners</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=exact:*</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=exact:*</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>waitForTextPresent</td>
+ <td>The length of the text in field "Display Name: " must be between "3" and "30" characters.</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>The length of the text in field "Display Name: " must be between "3" and "30" characters.</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[2]/div[2]/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[2]/div[2]/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=Cancel</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Cancel</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new category with Display name over 30 characters --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[1]/div/div/div/div/div/div/div/div[2]/div[2]/div[1]/div[1]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[1]/div/div/div/div/div/div/div/div[2]/div[2]/div[1]/div[1]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>name</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>name</td>
+ <td>Test_PLT_05_01_011</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>displayName</td>
+ <td>Test_PLT_05_01_011 Test_PLT_05_01_011Test_PLT_05_01_011Test_PLT_05_01_011Test_PLT_05_01_011Test_PLT_05_01_011</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>description</td>
+ <td>Test_PLT_05_01_011</td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Permission Setting --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[2]/div[2]/div/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[2]/div/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Add Permission</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Add Permission</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Add Permission</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Customers</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Customers</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=member</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=member</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>waitForTextPresent</td>
+ <td>The length of the text in field "Display Name: " must be between "3" and "30" characters.</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>The length of the text in field "Display Name: " must be between "3" and "30" characters.</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[2]/div[2]/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[2]/div[2]/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=Cancel</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Cancel</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_05_01_012_AddNewCategoryWithBlankDescription.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_05_01_012_AddNewCategoryWithBlankDescription.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_05_01_012_AddNewCategoryWithBlankDescription.html 2010-09-15 11:01:14 UTC (rev 4213)
@@ -0,0 +1,212 @@
+<?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_05_01_012_AddNewCategoryWithBlankDescription</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Test_PRL_05_01_012_AddNewCategoryWithBlankDescription</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new category with blank Description --</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>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>clickAndWait</td>
+ <td>link=Application Registry</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[1]/div/div/div/div/div/div/div/div[2]/div[2]/div[1]/div[1]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[1]/div/div/div/div/div/div/div/div[2]/div[2]/div[1]/div[1]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>name</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>name</td>
+ <td>Test_PLT_05_01_012</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>displayName</td>
+ <td>Test_PLT_05_01_012</td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Choose Permisison Setting --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[2]/div[2]/div/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[2]/div/div/div/div/div/div/div/div/div/div[2]/div/div/div/div</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Add Permission</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Add Permission</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='ListPermissionSelector']/div/div[2]/div/div[2]/div/div/div[3]/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='ListPermissionSelector']/div/div[2]/div/div[2]/div/div/div[3]/div/a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=manager</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=manager</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>echo</td>
+ <td>-- Check after adding new category with blank Description successfully --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[4]/div[1]/div/div/div/a[4]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[@id='UIApplicationOrganizer']/div[2]/div[1]/div/div/div[2]/div/div[4]/div[1]/div/div/div/a[4]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>description</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>echo</td>
+ <td>-- Delete category --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Test_PLT_05_01_012</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Test_PLT_05_01_012</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[4]/div[1]/div/div/div/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[4]/div[1]/div/div/div/a[2]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForConfirmationPresent</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Are you sure to delete this category and all applications on it?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_05_01_013_AddNewCategoryWithDescriptionOverMaxLength.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_05_01_013_AddNewCategoryWithDescriptionOverMaxLength.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_05_01_013_AddNewCategoryWithDescriptionOverMaxLength.html 2010-09-15 11:01:14 UTC (rev 4213)
@@ -0,0 +1,142 @@
+<?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_05_01_013_AddNewCategoryWithDescriptionOverMaxLength</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Test_PRL_05_01_013_AddNewCategoryWithDescriptionOverMaxLength</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Add new category with Description over max length --</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>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>clickAndWait</td>
+ <td>link=Application Registry</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Click Add category icon --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[1]/div/div/div/div/div/div/div/div[2]/div[2]/div[1]/div[1]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//div[1]/div/div/div/div/div/div/div/div[2]/div[2]/div[1]/div[1]/div[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>name</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>name</td>
+ <td>Test_PLT_05_01_013</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>displayName</td>
+ <td>Test_PLT_05_01_013</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>description</td>
+ <td>Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013 Test_PLT_05_01_013</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>waitForTextPresent</td>
+ <td>The length of the text in field "Description: " must be between "0" and "255" characters.</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>The length of the text in field "Description: " must be between "0" and "255" characters.</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>//div[2]/div[2]/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[2]/div[2]/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=Cancel</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Cancel</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
14 years, 3 months
gatein SVN: r4212 - portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-09-15 06:59:28 -0400 (Wed, 15 Sep 2010)
New Revision: 4212
Added:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_03_07_002_RemoveUserFromExistingGroupWithoutConfirmation.html
Log:
TESTVN-1006: Create new GateIn Selenium scripts
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_03_07_002_RemoveUserFromExistingGroupWithoutConfirmation.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_03_07_002_RemoveUserFromExistingGroupWithoutConfirmation.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_PRL_03_07_002_RemoveUserFromExistingGroupWithoutConfirmation.html 2010-09-15 10:59:28 UTC (rev 4212)
@@ -0,0 +1,227 @@
+<?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_07_002_RemoveUserFromExistingGroupWithoutConfirmation</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Test_PRL_03_07_002_RemoveUserFromExistingGroupWithoutConfirmation</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- Remove user from existing group without confirmation -- </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>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>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>link=Group Management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=Group Management</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_07_002</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>label</td>
+ <td>Test_PLT_03_07_002</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>description</td>
+ <td>Test_PLT_03_07_002</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 existing user in a specific group --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>john</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>membership</td>
+ <td></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>-- Click Delete icon corresponding to user you want to delete --</td>
+ <td></td>
+</tr>
+<tr>
+ <td>chooseCancelOnNextConfirmation</td>
+ <td></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>waitForConfirmationPresent</td>
+ <td>Are you sure you want to delete user john from group Test_PLT_03_07_002?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertConfirmation</td>
+ <td>Are you sure you want to delete user john from group Test_PLT_03_07_002?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>john</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>john</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>root</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>root</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-- delete group --</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>
+
+</tbody></table>
+</body>
+</html>
14 years, 3 months