JBoss Portal SVN: r13425 - in branches/Enterprise_Portal_Platform_4_3: core/src/main/org/jboss/portal/core/identity/cache and 16 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-05-29 19:04:54 -0400 (Fri, 29 May 2009)
New Revision: 13425
Added:
branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/BaseRoleAction.java
branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UserAttributeValidator.java
Removed:
branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/RoleValidator.java
Modified:
branches/Enterprise_Portal_Platform_4_3/build/build-thirdparty.xml
branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java
branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java
branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java
branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBeanContainer.java
branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CreateInstanceAction.java
branches/Enterprise_Portal_Platform_4_3/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties
branches/Enterprise_Portal_Platform_4_3/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource_de.properties
branches/Enterprise_Portal_Platform_4_3/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource_it.properties
branches/Enterprise_Portal_Platform_4_3/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource_pt_BR.properties
branches/Enterprise_Portal_Platform_4_3/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
branches/Enterprise_Portal_Platform_4_3/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminConstants.java
branches/Enterprise_Portal_Platform_4_3/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_fr.properties
branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp
branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp
branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp
branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp
branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java
branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateRoleAction.java
branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java
branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditRoleAction.java
branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UsernameValidator.java
branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity.properties
branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_fr.properties
branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_it.properties
branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_ja.properties
branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_pt_BR.properties
branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_ru.properties
branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml
branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-war/jsf/admin/roles/createRole.xhtml
branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-war/jsf/admin/roles/editRole.xhtml
branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-war/jsf/common/editProfileInfo.xhtml
branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource.properties
branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource_fr.properties
branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource_it.properties
branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource_pt_BR.properties
branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/identity/cache/CachedLDAPRoleModuleWrapper.java
branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/identity/cache/IdentityCacheService.java
branches/Enterprise_Portal_Platform_4_3/faces/src/main/org/jboss/portal/faces/gui/BeanContext.java
branches/Enterprise_Portal_Platform_4_3/faces/src/main/org/jboss/portal/faces/gui/JSFBeanContext.java
branches/Enterprise_Portal_Platform_4_3/faces/src/main/org/jboss/portal/faces/gui/ManagedBean.java
Log:
- Merged work on XSS from 2.7 branch: JBPORTAL-2390, JBPORTAL-2391, JBEPP-84, JBEPP-83, JBPORTAL-2393, JBEPP-86, JBEPP-90.
- We will need to cut a new version of the identity module for this (currently using snapshot).
Modified: branches/Enterprise_Portal_Platform_4_3/build/build-thirdparty.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/build/build-thirdparty.xml 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/build/build-thirdparty.xml 2009-05-29 23:04:54 UTC (rev 13425)
@@ -45,7 +45,7 @@
<componentref name="jboss-portal/modules/web" version="1.2.3"/>
<componentref name="jboss-portal/modules/test" version="1.0.4"/>
<componentref name="jboss-portal/modules/portlet" version="trunk-SNAPSHOT"/>
- <componentref name="jboss-portal/modules/identity" version="1.0.8"/>
+ <componentref name="jboss-portal/modules/identity" version="trunk-SNAPSHOT"/>
<componentref name="jboss-portal/modules/cms" version="1.2.5"/>
<componentref name="antlr" version="2.7.6-brew"/>
<componentref name="apache-ant" version="1.6.5"/>
Modified: branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/identity/cache/CachedLDAPRoleModuleWrapper.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/identity/cache/CachedLDAPRoleModuleWrapper.java 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/identity/cache/CachedLDAPRoleModuleWrapper.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -1,38 +1,39 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* 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.
-*/
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.jboss.portal.core.identity.cache;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.Role;
+import org.jboss.portal.identity.RoleModule;
+import org.jboss.portal.identity.ldap.LDAPRoleImpl;
import org.jboss.portal.identity.ldap.LDAPRoleModule;
-import org.jboss.portal.identity.ldap.LDAPRoleImpl;
-import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.identity.Role;
-import org.jboss.portal.identity.IdentityException;
import javax.naming.NamingException;
import javax.naming.directory.Attributes;
+import java.util.HashSet;
+import java.util.List;
import java.util.Set;
-import java.util.List;
-import java.util.HashSet;
/**
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
@@ -62,6 +63,18 @@
return ldapRoleModule.findRoleByName(name);
}
+ public Role findRoleByDisplayName(String displayName) throws IdentityException, IllegalArgumentException
+ {
+ Role role = cacheService.findRoleByDisplayName(displayName);
+
+ if (role != null)
+ {
+ return role;
+ }
+
+ return ldapRoleModule.findRoleByDisplayName(displayName);
+ }
+
public Set findRolesByNames(String[] names) throws IdentityException, IllegalArgumentException
{
Modified: branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/identity/cache/IdentityCacheService.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/identity/cache/IdentityCacheService.java 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/identity/cache/IdentityCacheService.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -1,24 +1,25 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* 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.
-*/
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.jboss.portal.core.identity.cache;
@@ -46,6 +47,8 @@
protected ThreadLocal<Map<String, Role>> roleNameCache = new ThreadLocal<Map<String, Role>>();
+ protected ThreadLocal<Map<String, Role>> roleDisplayNameCache = new ThreadLocal<Map<String, Role>>();
+
protected ThreadLocal<Map<Object, Role>> roleIdCache = new ThreadLocal<Map<Object, Role>>();
@@ -55,6 +58,7 @@
userIdCache.set(null);
profileCache.set(null);
roleNameCache.set(null);
+ roleDisplayNameCache.set(null);
roleIdCache.set(null);
log.debug("Identity cache invalidated");
@@ -96,6 +100,15 @@
return roleNameCache.get();
}
+ private Map<String, Role> getRoleDisplayNameCache()
+ {
+ if (roleDisplayNameCache.get() == null)
+ {
+ roleDisplayNameCache.set(new HashMap<String, Role>());
+ }
+ return roleDisplayNameCache.get();
+ }
+
private Map<Object, Role> getRoleIdCache()
{
if (roleIdCache.get() == null)
@@ -171,10 +184,11 @@
{
getRoleIdCache().put(role.getId(), role);
getRoleNameCache().put(role.getName(), role);
+ getRoleDisplayNameCache().put(role.getDisplayName(), role);
if (log.isDebugEnabled())
{
- log.debug("Role cached for id=" + role.getId() + "; name=" + role.getName());
+ log.debug("Role cached for id=" + role.getId() + "; name=" + role.getName() + "; display name=" + role.getDisplayName());
}
}
}
@@ -186,10 +200,11 @@
{
getRoleIdCache().put(role.getId(), null);
getRoleNameCache().put(role.getName(), null);
+ getRoleDisplayNameCache().put(role.getDisplayName(), null);
if (log.isDebugEnabled())
{
- log.debug("Role invalidated in cache for id=" + role.getId() + "; name=" + role.getName());
+ log.debug("Role invalidated in cache for id=" + role.getId() + "; name=" + role.getName() + "; display name=" + role.getDisplayName());
}
}
}
@@ -242,6 +257,18 @@
return role;
}
+ public Role findRoleByDisplayName(String displayName)
+ {
+ Role role = getRoleDisplayNameCache().get(displayName);
+
+ if (role != null && log.isDebugEnabled())
+ {
+ log.debug("Role retrieved from cache for display name=" + role.getDisplayName());
+ }
+
+ return role;
+ }
+
public Role findRoleById(Object id)
{
Role role = getRoleIdCache().get(id);
Modified: branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -1,24 +1,25 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* 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.
-*/
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.jboss.portal.core.admin.ui;
@@ -32,7 +33,6 @@
import javax.faces.model.SelectItem;
import javax.portlet.PortletConfig;
import javax.portlet.PortletRequest;
-
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
@@ -65,7 +65,7 @@
public ControlPropertiesBean(PortalObjectManagerBean pomgr)
{
this.pomgr = pomgr;
-
+
ResourceBundleManager rbm = new ResourceBundleManager(null, new SimpleResourceBundleFactory(BUNDLE_BASE_NAME, PropertiesInfoBuilder.class.getClassLoader()));
// Load all supported locales
@@ -74,11 +74,11 @@
while (locales.hasMoreElements())
{
Locale locale = locales.nextElement();
- rbm.getResourceBundle(locale);
+ rbm.getResourceBundle(locale);
}
DISPLAY_THE_DEFAULT_ERROR_MESSAGE = rbm.getLocalizedValue("DISPLAY_THE_DEFAULT_ERROR_MESSAGE", "Display the default error message");
- REDIRECT_TO_THE_SPECIFIED_RESOURCE = rbm.getLocalizedValue("REDIRECT_TO_THE_SPECIFIED_RESOURCE", "Redirect to the specified resource");
- REMOVE_THE_RESOURCE_FROM_PAGE = rbm.getLocalizedValue("REMOVE_THE_RESOURCE_FROM_PAGE", "Remove the resource from page");
+ REDIRECT_TO_THE_SPECIFIED_RESOURCE = rbm.getLocalizedValue("REDIRECT_TO_THE_SPECIFIED_RESOURCE", "Redirect to the specified resource");
+ REMOVE_THE_RESOURCE_FROM_PAGE = rbm.getLocalizedValue("REMOVE_THE_RESOURCE_FROM_PAGE", "Remove the resource from page");
portalSelectItems = new HashMap<Locale, List<SelectItem>>();
pageSelectItems = new HashMap<Locale, List<SelectItem>>();
}
@@ -132,7 +132,9 @@
boolean inheritable = object.getType() != PortalObject.TYPE_CONTEXT;
boolean inherited = !object.getDeclaredProperties().containsKey(name);
String value = object.getProperty(name);
- return new ControlPropertyBean(this, info.getPropertyInfo(name), inherited, inheritable, value);
+ ControlPropertyBean bean = new ControlPropertyBean(this, info.getPropertyInfo(name), inherited, inheritable, value);
+ bean.setBeanContext(getBeanContext()); // propagate bean context to chilren beans
+ return bean;
}
public ControlPropertyBean getPageControlAccessDenied()
Modified: branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -1,28 +1,31 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* 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.
-*/
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.jboss.portal.core.admin.ui;
import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.common.util.ParameterValidation;
+import org.jboss.portal.faces.gui.ManagedBean;
import javax.faces.event.ValueChangeEvent;
@@ -43,6 +46,20 @@
super(container, info, inherited, inheritable, value);
//
this.container = container;
+ setValidator(new DefaultPropertyValidator()
+ {
+ @Override
+ public String doSimpleChecks(String name)
+ {
+ return name; // no-op as we want to allow / and . in paths
+ }
+
+ @Override
+ public ParameterValidation.ValidationErrorHandler getValidationErrorHandler(String name, String targetForErrorMessage)
+ {
+ return new MessageValidationHandler(null, targetForErrorMessage, name, getObjectTypeName(), ManagedBean.INVALID_PATH);
+ }
+ });
}
public void setInherited(boolean inherited)
@@ -69,7 +86,9 @@
public void setValue(Object value)
{
- if (!inherited)
+ // it's currently quite difficult to retrieve the correct target for error messages, send them to "status"
+ String propertyValue = checkNameValidity(value.toString(), null);
+ if (propertyValue != null && !inherited)
{
this.value = value.toString();
Modified: branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -45,7 +45,7 @@
import org.jboss.portal.core.model.portal.PortalObjectPermission;
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.faces.component.portlet.PortletEventEvent;
-import org.jboss.portal.faces.gui.JSFBeanContext;
+import org.jboss.portal.faces.gui.BeanContext;
import org.jboss.portal.identity.RoleModule;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvoker;
@@ -168,6 +168,8 @@
/** . */
private transient Boolean maximizedStateExists;
+ private transient BeanContext beanContext;
+
// Wired services
public String getNamespace()
@@ -180,6 +182,16 @@
this.namespace = namespace;
}
+ public BeanContext getBeanContext()
+ {
+ return beanContext;
+ }
+
+ public void setBeanContext(BeanContext beanContext)
+ {
+ this.beanContext = beanContext;
+ }
+
public List getAvailableContentTypes()
{
LinkedList<SelectItem> types = new LinkedList<SelectItem>();
@@ -655,20 +667,20 @@
{
if (pageManager == null)
{
- // it'd be better if propertyAction was injected in faces-config.xml so that we can also inject the shared beanContext
pageManager = new PageManagerBean(layoutService, portletDefinitionInvoker);
- pageManager.setBeanContext(new JSFBeanContext());
+ pageManager.setBeanContext(beanContext);
}
pageManager.page = (Page)selectedObject;
}
//
selectedProperties = new PropertiesBean(this);
+ selectedProperties.setBeanContext(beanContext);
controlProperties = new ControlPropertiesBean(this);
+ controlProperties.setBeanContext(beanContext);
- // it'd be better if propertyAction was injected in faces-config.xml so that we can also inject the shared beanContext
propertyAction = new PropertyAction(this);
- propertyAction.setBeanContext(new JSFBeanContext());
+ propertyAction.setBeanContext(beanContext);
//
theme = new ThemeBean(selectedObject);
Modified: branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -22,17 +22,18 @@
******************************************************************************/
package org.jboss.portal.core.admin.ui;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.faces.gui.ManagedBean;
+
import javax.faces.context.FacesContext;
-import org.jboss.portal.core.model.portal.PortalObject;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot com">Boleslaw Dawidowicz</a>
* @version $Revision$
*/
-public class PropertyBean implements Comparable
+public class PropertyBean extends ManagedBean implements Comparable
{
/** . */
@@ -103,23 +104,28 @@
public void setValue(Object value)
{
- this.value = value.toString();
+ // it's currently quite difficult to retrieve the correct target for error messages, send them to "status"
+ String propertyValue = checkNameValidity(value.toString(), null);
+ if (propertyValue != null)
+ {
+ this.value = propertyValue;
- // Need to use the container as it will contain the refreshed object
- PortalObject portalObject = container.getRelatedObject();
+ // Need to use the container as it will contain the refreshed object
+ PortalObject portalObject = container.getRelatedObject();
- //if value is inherited check if updated value is the same - if yes, don't update to keep inheritance
- if (isInherited())
- {
- String parentValue = portalObject.getProperty(getName());
- if (value.equals(parentValue))
+ //if value is inherited check if updated value is the same - if yes, don't update to keep inheritance
+ if (isInherited())
{
- return;
+ String parentValue = portalObject.getProperty(getName());
+ if (value.equals(parentValue))
+ {
+ return;
+ }
}
+
+ //
+ portalObject.setDeclaredProperty(getName(), propertyValue);
}
-
- //
- portalObject.setDeclaredProperty(getName(), value.toString());
}
public int compareTo(Object o)
@@ -142,4 +148,14 @@
{
return "PropertyBean[name=" + info.getName() + ",value=" + value + "]";
}
+
+ protected String getObjectTypeName()
+ {
+ return "PROPERTY_TYPE";
+ }
+
+ public boolean isAlreadyExisting(String objectName)
+ {
+ return false; // no need to check for duplicates here
+ }
}
Modified: branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBeanContainer.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBeanContainer.java 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBeanContainer.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -23,6 +23,7 @@
package org.jboss.portal.core.admin.ui;
import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.faces.gui.BeanContext;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -30,7 +31,18 @@
*/
public abstract class PropertyBeanContainer
{
+ private BeanContext beanContext;
+ public BeanContext getBeanContext()
+ {
+ return beanContext;
+ }
+
+ public void setBeanContext(BeanContext beanContext)
+ {
+ this.beanContext = beanContext;
+ }
+
public abstract PortalObject getRelatedObject();
}
Modified: branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CreateInstanceAction.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CreateInstanceAction.java 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CreateInstanceAction.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -42,15 +42,12 @@
*/
public class CreateInstanceAction extends ManagedBean
{
-
- /** . */
private String instanceId;
- /** . */
private PortletManagerBean portletMgr;
- /** . */
private InstanceManagerBean instanceMgr;
+
private static final String MESSAGE_TARGET = "add_instance_form:instanceId";
protected static final String INSTANCE_TYPE = "INSTANCE_TYPE";
Modified: branches/Enterprise_Portal_Platform_4_3/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties 2009-05-29 23:04:54 UTC (rev 13425)
@@ -325,7 +325,8 @@
COORDINATION_PARAMETER=parameter binding
COORDINATION_ALIAS=alias binding
-INVALID_NAME_ERROR=''{0}'' is an invalid {1} name: Cannot be null, empty or contain '\\', '<', '>', '(', ')', '=' or '%5c'
+INVALID_NAME_ERROR=''{0}'' is an invalid {1} name: Cannot be null, empty or contain '/', '.', '\\', '<', '>', '(', ')', '=' or '%5c'
+INVALID_PATH_ERROR=''{0}'' is an invalid {1} path: Cannot be null, empty or contain '\\', '<', '>', '(', ')', '=' or '%5c'
NO_SELECTED_PORTLET_ERROR=No portlet was selected!
DUPLICATE_ERROR=A {1} named ''{0}'' already exists!
bean_support_unexpected_error=Unexpected error:
Modified: branches/Enterprise_Portal_Platform_4_3/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource_de.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource_de.properties 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource_de.properties 2009-05-29 23:04:54 UTC (rev 13425)
@@ -70,7 +70,6 @@
DESCRIPTION=Beschreibung
REMOTE=Remote
REMOTABLE=Remote-f\u00e4hig
-ACTIONS=Aktionen
CREATE_INSTANCE=Instanz erstellen
PORTLET_DEFINITIONS=Portlet-Definitionen
DETAILS=Details
Modified: branches/Enterprise_Portal_Platform_4_3/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource_it.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource_it.properties 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource_it.properties 2009-05-29 23:04:54 UTC (rev 13425)
@@ -325,7 +325,7 @@
COORDINATION_PARAMETER=collegamento al parametro
COORDINATION_ALIAS=collegamento all'alias
-INVALID_NAME_ERROR=''{0}'' non \u00e8 un nome valido per {1}: Non pu\u00f2 essere null, vuoto o contenere '\\', '<', '>', '(', ')', '=' o '%5c'
+INVALID_NAME_ERROR=''{0}'' non \u00e8 un nome valido per {1}: Non pu\u00f2 essere null, vuoto o contenere '/', '.', '\\', '<', '>', '(', ')', '=' o '%5c'
NO_SELECTED_PORTLET_ERROR=Non \u00e8 stata selezionata nessuna portlet!
DUPLICATE_ERROR=Esiste gi\u00e0 un {1} chiamato ''{0}''!
bean_support_unexpected_error=Errore inatteso:
Modified: branches/Enterprise_Portal_Platform_4_3/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource_pt_BR.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource_pt_BR.properties 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource_pt_BR.properties 2009-05-29 23:04:54 UTC (rev 13425)
@@ -325,7 +325,7 @@
COORDINATION_PARAMETER=parameter binding
COORDINATION_ALIAS=alias binding
-INVALID_NAME_ERROR=''{0}'' \u00e9 um nome de {1} inv\u00e1lido\: N\u00e3o pode ser nulo, vazio, ou que contenha '\\', '<', '>', '(', ')', '=' ou '%5c'
+INVALID_NAME_ERROR=''{0}'' \u00e9 um nome de {1} inv\u00e1lido\: N\u00e3o pode ser nulo, vazio, ou que contenha '/', '.', '\\', '<', '>', '(', ')', '=' ou '%5c'
NO_SELECTED_PORTLET_ERROR=Nenhum portlet foi selecionado!
DUPLICATE_ERROR=O {1} denominado ''{0}'' j\u00e1 existe\!
bean_support_unexpected_error=Erro inesperado:
Modified: branches/Enterprise_Portal_Platform_4_3/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2009-05-29 23:04:54 UTC (rev 13425)
@@ -103,6 +103,11 @@
<property-name>coordinationService</property-name>
<value>#{applicationScope.CoordinationService}</value>
</managed-property>
+ <managed-property>
+ <property-name>beanContext</property-name>
+ <property-class>org.jboss.portal.faces.gui.BeanContext</property-class>
+ <value>#{beanContext}</value>
+ </managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>portalAction</managed-bean-name>
@@ -128,7 +133,7 @@
</managed-property>
<managed-property>
<property-name>messageTarget</property-name>
- <value>addPageForm:pageName</value>
+ <value>create-page-form:pageName</value>
</managed-property>
<managed-property>
<property-name>listener</property-name>
@@ -182,6 +187,11 @@
<property-name>domainConfigurator</property-name>
<value>#{applicationScope.AuthorizationDomainRegistry.portalobject.configurator}</value>
</managed-property>
+ <managed-property>
+ <property-name>beanContext</property-name>
+ <property-class>org.jboss.portal.faces.gui.BeanContext</property-class>
+ <value>#{beanContext}</value>
+ </managed-property>
</managed-bean>
<!-- The instance manager managed bean -->
Modified: branches/Enterprise_Portal_Platform_4_3/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminConstants.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminConstants.java 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminConstants.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -121,4 +121,6 @@
public static final String CMS_DATE_PATTERN = "CMS_DATE_PATTERN";
public static final String DATE_FORMAT = "dateFormat";
+
+ public static final String CMS_INVALID_PARAMETER = "CMS_INVALID_PARAMETER";
}
Modified: branches/Enterprise_Portal_Platform_4_3/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -48,7 +48,6 @@
import org.jboss.portal.cms.workflow.CMSWorkflowUtil;
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.core.cms.command.StreamContentCommand;
-import org.jboss.portal.core.cms.ui.Util;
import org.jboss.portal.core.controller.ControllerContext;
import org.jboss.portal.identity.AnonymousRole;
import org.jboss.portal.identity.IdentityException;
@@ -62,7 +61,6 @@
import org.jboss.portal.search.impl.jcr.JCRQuery;
import org.jboss.portal.search.impl.jcr.JCRQueryConverter;
import org.jboss.portal.security.PortalPermission;
-import org.jboss.portal.server.ParameterSanitizer;
import org.jboss.portal.server.request.URLContext;
import org.jboss.portal.server.request.URLFormat;
import org.jboss.portal.workflow.WorkflowException;
@@ -108,8 +106,13 @@
private ApprovePublish approvePublish;
private AuthorizationManager authorizationManager;
private ResourceBundle resources = null;
- private static final Pattern CHECK_FOR_XSS_PATTERN = Pattern.compile("[^<>\\(\\)=]*");
+
+ private static final Pattern CHECK_FOR_XSS_PATTERN = ParameterValidation.XSS_CHECK;
private static final String SLASH = "/";
+ private static final String INVALID_TITLE = "__INVALID_TITLE__";
+ private static final String INVALID_DESCRIPTION = "__INVALID_DESCRIPTION__";
+ private static final String INVALID_LANG = "__INVALID_LANG__";
+ private static final String ERROR_MESSAGE = "error:message";
public void init() throws PortletException
@@ -238,13 +241,13 @@
String sPath = rReq.getParameter("path");
if (sPath != null)
{
- sPath = ParameterSanitizer.sanitizeFromPattern(sPath, CHECK_FOR_XSS_PATTERN, SLASH);
+ sPath = ParameterValidation.sanitizeFromPattern(sPath, CHECK_FOR_XSS_PATTERN, SLASH);
}
String sNavPath = rReq.getParameter("navpath");
if (sNavPath != null)
{
- sNavPath = ParameterSanitizer.sanitizeFromPattern(sNavPath, CHECK_FOR_XSS_PATTERN, SLASH);
+ sNavPath = ParameterValidation.sanitizeFromPattern(sNavPath, CHECK_FOR_XSS_PATTERN, SLASH);
}
if (op == null)
@@ -333,10 +336,10 @@
rRes.setContentType("text/html");
rReq.setAttribute("createpath", sPath);
- String parameter = rReq.getParameter("error:message");
+ String parameter = rReq.getParameter(ERROR_MESSAGE);
if (parameter != null)
{
- rReq.setAttribute("error:message", parameter);
+ rReq.setAttribute(ERROR_MESSAGE, parameter);
}
parameter = rReq.getParameter("error:newcollectionname");
if (parameter != null)
@@ -553,7 +556,7 @@
rRes.setContentType("text/html");
rReq.setAttribute("currpath", sPath);
String language = rReq.getParameter("language");
- ParameterSanitizer.sanitizeFromPattern(language, CHECK_FOR_XSS_PATTERN, "en");
+ ParameterValidation.sanitizeFromPattern(language, CHECK_FOR_XSS_PATTERN, "en");
rReq.setAttribute("language", language);
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/editbinary.jsp");
prd.include(rReq, rRes);
@@ -614,10 +617,10 @@
{
rReq.setAttribute("error:filename", parameter);
}
- parameter = rReq.getParameter("error:message");
+ parameter = rReq.getParameter(ERROR_MESSAGE);
if (parameter != null)
{
- rReq.setAttribute("error:message", parameter);
+ rReq.setAttribute(ERROR_MESSAGE, parameter);
}
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/create.jsp");
@@ -626,7 +629,7 @@
else if (CMSAdminConstants.OP_EDIT.equals(op))
{
String sLanguage = rReq.getParameter("language");
- ParameterSanitizer.sanitizeFromPattern(sLanguage, CHECK_FOR_XSS_PATTERN, "en");
+ ParameterValidation.sanitizeFromPattern(sLanguage, CHECK_FOR_XSS_PATTERN, "en");
String sVersion = rReq.getParameter("version");
@@ -677,6 +680,7 @@
rReq.setAttribute("language", sLanguage);
rReq.setAttribute("title", file.getContent().getTitle());
rReq.setAttribute("description", file.getContent().getDescription());
+ rReq.setAttribute(ERROR_MESSAGE, rReq.getParameter(ERROR_MESSAGE));
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/edit.jsp");
prd.include(rReq, rRes);
@@ -708,7 +712,7 @@
else if (CMSAdminConstants.OP_EXPORTARCHIVE_PICKUP.equals(op))
{
String sPickupFile = rReq.getParameter("filepath");
- ParameterSanitizer.sanitizeFromPattern(sPickupFile, CHECK_FOR_XSS_PATTERN, SLASH);
+ ParameterValidation.sanitizeFromPattern(sPickupFile, CHECK_FOR_XSS_PATTERN, SLASH);
rRes.setContentType("text/html");
PortletRequestDispatcher prd = null;
@@ -940,7 +944,7 @@
aRes.setRenderParameter("path", aReq.getParameter("destination"));
//used to remember the data already submitted by the user
- aRes.setRenderParameter("error:message", CMSAdminConstants.CMS_FOLDERNAME_INVALID);
+ aRes.setRenderParameter(ERROR_MESSAGE, CMSAdminConstants.CMS_FOLDERNAME_INVALID);
aRes.setRenderParameter("error:newcollectionname", aReq.getParameter("newcollectionname"));
aRes.setRenderParameter("error:newcollectiondescription", aReq.getParameter("newcollectiondescription"));
@@ -962,7 +966,7 @@
aRes.setRenderParameter("path", aReq.getParameter("destination"));
//used to remember the data already submitted by the user
- aRes.setRenderParameter("error:message", CMSAdminConstants.CMS_FOLDERNAME_INVALID);
+ aRes.setRenderParameter(ERROR_MESSAGE, CMSAdminConstants.CMS_FOLDERNAME_INVALID);
aRes.setRenderParameter("error:newcollectionname", aReq.getParameter("newcollectionname"));
aRes.setRenderParameter("error:newcollectiondescription", aReq.getParameter("newcollectiondescription"));
}
@@ -978,16 +982,15 @@
String sTitle = "";
String sLanguage = "";
List fileItems = upload.parseRequest(aReq);
- Iterator itr = fileItems.iterator();
- while (itr.hasNext())
+ for (Object fileItem : fileItems)
{
- FileItem item = (FileItem)itr.next();
+ FileItem item = (FileItem)fileItem;
// check if the current item is a form field or an uploaded file
if (!item.isFormField())
{
String sFilename = item.getName();
- sFilename = ParameterSanitizer.sanitizeFromPattern(sFilename, CHECK_FOR_XSS_PATTERN, "");
+ sFilename = ParameterValidation.sanitizeFromPattern(sFilename, CHECK_FOR_XSS_PATTERN, "");
if (!"".equals(sFilename))
{
@@ -1019,8 +1022,12 @@
String sBasePath = FileUtil.cleanDoubleSlashes(sPath + SLASH + sFilename);
file.setBasePath(sBasePath);
+ sTitle = ParameterValidation.sanitizeFromPattern(sTitle, CHECK_FOR_XSS_PATTERN, "");
content.setTitle(sTitle);
+
+ sDescription = ParameterValidation.sanitizeFromPattern(sDescription, CHECK_FOR_XSS_PATTERN, "");
content.setDescription(sDescription);
+
content.setBasePath(sBasePath + SLASH + new Locale(sLanguage));
content.setBytes(item.get());
file.setContent(new Locale(sLanguage), content);
@@ -1051,7 +1058,7 @@
{
String fieldName = item.getFieldName();
String itemValue = item.getString(aReq.getCharacterEncoding());
- itemValue = ParameterSanitizer.sanitizeFromPattern(itemValue, CHECK_FOR_XSS_PATTERN, "");
+ itemValue = ParameterValidation.sanitizeFromPattern(itemValue, CHECK_FOR_XSS_PATTERN, "");
if ("destination".equals(fieldName))
{
sPath = itemValue;
@@ -1079,7 +1086,8 @@
}
else if (CMSAdminConstants.OP_DOSEARCH.equals(op))
{
- String search = (String)aReq.getParameter("search");
+ String search = aReq.getParameter("search");
+ search = ParameterValidation.sanitizeFromPattern(search, CHECK_FOR_XSS_PATTERN, "");
aRes.setRenderParameter("search", search);
aRes.setRenderParameter("op", CMSAdminConstants.OP_VIEWSEARCHRESULTS);
@@ -1319,6 +1327,10 @@
{
content.setMimeType("");
}
+
+ sTitle = ParameterValidation.sanitizeFromPattern(sTitle, CHECK_FOR_XSS_PATTERN, "");
+ sDescription = ParameterValidation.sanitizeFromPattern(sDescription, CHECK_FOR_XSS_PATTERN, "");
+
content.setTitle(sTitle);
content.setDescription(sDescription);
content.setBasePath(sBasePath + SLASH + sLanguage);
@@ -1375,8 +1387,14 @@
String sDescription = aReq.getParameter("description");
String sLanguage = aReq.getParameter("language");
+ sFileName = ParameterValidation.sanitizeFromPattern(sFileName, CHECK_FOR_XSS_PATTERN, "");
+ sDirectory = ParameterValidation.sanitizeFromPattern(sDirectory, CHECK_FOR_XSS_PATTERN, SLASH);
+ sTitle = ParameterValidation.sanitizeFromPattern(sTitle, CHECK_FOR_XSS_PATTERN, INVALID_TITLE);
+ sDescription = ParameterValidation.sanitizeFromPattern(sDescription, CHECK_FOR_XSS_PATTERN, INVALID_DESCRIPTION);
+ sLanguage = ParameterValidation.sanitizeFromPattern(sLanguage, CHECK_FOR_XSS_PATTERN, "en");
+
//Perform server side data validation
- if (sFileName == null || sFileName.trim().length() == 0)
+ if (sFileName == null || INVALID_TITLE.equals(sTitle) || INVALID_DESCRIPTION.equals(sDescription) || sFileName.trim().length() == 0)
{
//Validation Error occurred
//FileName should not be empty
@@ -1386,6 +1404,7 @@
aRes.setRenderParameter("path", sDirectory);
//used to remember the data already submitted by the user
+ aRes.setRenderParameter(ERROR_MESSAGE, CMSAdminConstants.CMS_INVALID_PARAMETER);
aRes.setRenderParameter("error:content", aReq.getParameter("elm1"));
aRes.setRenderParameter("error:description", aReq.getParameter("description"));
aRes.setRenderParameter("error:title", aReq.getParameter("title"));
@@ -1429,11 +1448,11 @@
Boolean bExists = null;
try
{
- if (!CHECK_FOR_XSS_PATTERN.matcher(content.getBasePath()).matches())
- {
- throw new CMSException(content.getBasePath() + " is not a legal path element");
- }
- bExists = (Boolean)CMSService.execute(existsCMD);
+ if (!CHECK_FOR_XSS_PATTERN.matcher(content.getBasePath()).matches())
+ {
+ throw new CMSException(content.getBasePath() + " is not a legal path element");
+ }
+ bExists = (Boolean)CMSService.execute(existsCMD);
}
catch (CMSException cme)
{
@@ -1447,7 +1466,7 @@
aRes.setRenderParameter("path", sDirectory);
//used to remember the data already submitted by the user
- aRes.setRenderParameter("error:message", CMSAdminConstants.CMS_FILENAME_INVALID);
+ aRes.setRenderParameter(ERROR_MESSAGE, CMSAdminConstants.CMS_FILENAME_INVALID);
aRes.setRenderParameter("error:filename", aReq.getParameter("filename"));
aRes.setRenderParameter("error:content", aReq.getParameter("elm1"));
aRes.setRenderParameter("error:description", aReq.getParameter("description"));
@@ -1480,17 +1499,45 @@
else if (CMSAdminConstants.OP_SAVETEXT.equals(op))
{
String sFilePath = aReq.getParameter("savetopath");
- String sTitle = aReq.getParameter("title");
- String sDescription = aReq.getParameter("description");
- String sLanguage = aReq.getParameter("language");
- String sMakeLive = "off";
- if (aReq.getParameterValues("makelive") != null)
+ if (!"".equals(sFilePath) && CHECK_FOR_XSS_PATTERN.matcher(sFilePath).matches())
{
- sMakeLive = "on";
- }
+ String sTitle = aReq.getParameter("title");
+ String sDescription = aReq.getParameter("description");
+ String sLanguage = aReq.getParameter("language");
- if (!"".equals(sFilePath) && CHECK_FOR_XSS_PATTERN.matcher(sFilePath).matches())
- {
+ // check title and description for XSS injection... If one found, re-display page with old values
+ sTitle = ParameterValidation.sanitizeFromPattern(sTitle, CHECK_FOR_XSS_PATTERN, INVALID_TITLE);
+ boolean invalidTitle = INVALID_TITLE.equals(sTitle);
+
+ sDescription = ParameterValidation.sanitizeFromPattern(sDescription, CHECK_FOR_XSS_PATTERN, INVALID_DESCRIPTION);
+ boolean invalidDesc = INVALID_DESCRIPTION.equals(sDescription);
+
+ sLanguage = ParameterValidation.sanitizeFromPattern(sLanguage, CHECK_FOR_XSS_PATTERN, INVALID_LANG);
+ boolean invalidLang = INVALID_LANG.equals(sLanguage);
+ if(invalidLang)
+
+ if (invalidTitle || invalidDesc || invalidLang)
+ {
+ aRes.setRenderParameter("op", CMSAdminConstants.OP_EDIT);
+
+ // output error message
+ aRes.setRenderParameter(ERROR_MESSAGE, CMSAdminConstants.CMS_INVALID_PARAMETER);
+
+ aRes.setRenderParameter("path", aReq.getParameter("savetopath"));
+ aRes.setRenderParameter("language", aReq.getParameter("language"));
+
+ return;
+ }
+
+ Locale locale = new Locale(sLanguage);
+
+ String sMakeLive = "off";
+ if (aReq.getParameterValues("makelive") != null)
+ {
+ sMakeLive = "on";
+ }
+
+
String sContent = aReq.getParameter("elm1");
File file = new FileImpl();
@@ -1511,9 +1558,9 @@
content.setTitle(sTitle);
content.setDescription(sDescription);
- content.setBasePath(sFilePath + SLASH + new Locale(sLanguage).getLanguage());
+ content.setBasePath(sFilePath + SLASH + locale.getLanguage());
content.setBytes(sContent.getBytes());
- file.setContent(new Locale(sLanguage), content);
+ file.setContent(locale, content);
boolean bMakeLive = false;
if ("on".equalsIgnoreCase(sMakeLive))
@@ -1542,6 +1589,7 @@
{
String sTarget = aReq.getParameter("destination");
String sLanguage = aReq.getParameter("language");
+ sLanguage = ParameterValidation.sanitizeFromPattern(sLanguage, CHECK_FOR_XSS_PATTERN, "en");
if (sTarget != null)
{
@@ -1721,6 +1769,7 @@
{
String path = aReq.getParameter("path");
String language = aReq.getParameter("language");
+ language = ParameterValidation.sanitizeFromPattern(language, CHECK_FOR_XSS_PATTERN, "en");
String version = aReq.getParameter("version");
//Perform the change in live version here
Modified: branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2009-05-29 23:04:54 UTC (rev 13425)
@@ -143,6 +143,7 @@
CMS_FILENAME_INVALID=File Name is invalid. It may not contain illegal characters such as '.', '/', ':', '[', ']', '*', ''', '"', '>', ,'<', '(', ')', '|' or any whitespace character.
CMS_FOLDERNAME_INVALID=Folder Name is invalid. It may not contain illegal characters such as '.', '/', ':', '[', ']', '*', ''', '"', '>', ,'<', '(', ')', '|' or any whitespace character.
+CMS_INVALID_PARAMETER=A value below is invalid. It may not contain illegal characters such as '\\', '<', '>', '(', ')', '=' or '%5c'.
CMS_MSG_DESTINATION_ALREADY_EXISTS=The command was not performed, because the destination already exists.
CMS_CANT_MOVE_SAME_DESTINATION=You cannot move a folder to the same location
Modified: branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_fr.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_fr.properties 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_fr.properties 2009-05-29 23:04:54 UTC (rev 13425)
@@ -32,23 +32,23 @@
CMS_CANCEL = Annuler
-CMS_CONTENT_DIR = R\u00E9pertoire de contenu
+CMS_CONTENT_DIR = R\u00e9pertoire de contenu
-CMS_CONTENT_DIR_USE = Utilisez l'arborescence des dossiers afin de parcourir la structure du r\u00E9pertoire.
+CMS_CONTENT_DIR_USE = Utilisez l'arborescence des dossiers afin de parcourir la structure du r\u00e9pertoire.
CMS_COPY = Copier
-CMS_CREATE = Cr\u00E9er
+CMS_CREATE = Cr\u00e9er
-CMS_CREATED = Cr\u00E9\u00E9
+CMS_CREATED = Cr\u00e9\u00e9
-CMS_CREATED_BY = Cr\u00E9\u00E9 par
+CMS_CREATED_BY = Cr\u00e9\u00e9 par
-CMS_CREATEFILE = Cr\u00E9er un fichier
+CMS_CREATEFILE = Cr\u00e9er un fichier
-CMS_CREATEFILEINDIR = Cr\u00E9er un fichier dans le dossier
+CMS_CREATEFILEINDIR = Cr\u00e9er un fichier dans le dossier
-CMS_CREATEFOLDER = Cr\u00E9er un dossier
+CMS_CREATEFOLDER = Cr\u00e9er un dossier
CMS_DELETE = Supprimer
@@ -56,7 +56,7 @@
CMS_DELETEWARN1 = ATTENTION ! Vous ne pourrez pas annuler cette action.
-CMS_DELETEWARN2 = \u00CAtes vous certain de vouloir supprimer cette ressource ?
+CMS_DELETEWARN2 = \u00cates vous certain de vouloir supprimer cette ressource ?
CMS_DENY = Refuser
@@ -78,35 +78,35 @@
CMS_LANGUAGE = Langue
-CMS_LIVE = Diffusion imm\u00E9diate
+CMS_LIVE = Diffusion imm\u00e9diate
CMS_LIVEVERSION = Version en ligne
-CMS_MAIN_USE = Utilisez le portlet d'administration du CMS afin de modifier le contenu de votre r\u00E9pertoire.
+CMS_MAIN_USE = Utilisez le portlet d'administration du CMS afin de modifier le contenu de votre r\u00e9pertoire.
-CMS_MANAGE = G\u00E9rer le contenu
+CMS_MANAGE = G\u00e9rer le contenu
CMS_MENU = Menu action
-CMS_MODIFIED = Derni\u00E8re modification
+CMS_MODIFIED = Derni\u00e8re modification
CMS_MODIFY = Modifier
-CMS_MOVE = D\u00E9placer
+CMS_MOVE = D\u00e9placer
CMS_NAME = Nom
CMS_PATH = Emplacement
-CMS_PREVIEW = Pr\u00E9visualiser
+CMS_PREVIEW = Pr\u00e9visualiser
-CMS_RESET = R\u00E9initialiser
+CMS_RESET = R\u00e9initialiser
CMS_SEARCH = Rechercher
-CMS_SEARCHNORESULT = Aucun r\u00E9sultat pour cette recherche
+CMS_SEARCHNORESULT = Aucun r\u00e9sultat pour cette recherche
-CMS_SECURE = S\u00E9curiser
+CMS_SECURE = S\u00e9curiser
CMS_SIZE = Taille
@@ -118,23 +118,23 @@
CMS_TYPE = Type
-CMS_UPLOAD = T\u00E9l\u00E9d\u00E9verser
+CMS_UPLOAD = T\u00e9l\u00e9d\u00e9verser
-CMS_UPLOADARCHIVE = T\u00E9l\u00E9d\u00E9verser une archive
+CMS_UPLOADARCHIVE = T\u00e9l\u00e9d\u00e9verser une archive
CMS_VERSION = Version
CMS_VIEW = Visualiser
-CMS_WYSIWYG = \u00C9diteur visuel WYSIWYG
+CMS_WYSIWYG = \u00c9diteur visuel WYSIWYG
TITLE_BROWSE = Navigateur de dossiers
TITLE_COPYCONFIRM = Confirmer la copie
-TITLE_CREATE = Cr\u00E9er un fichier
+TITLE_CREATE = Cr\u00e9er un fichier
-TITLE_CREATECOLLCONFIRM = Confirmer la cr\u00E9ation d'un r\u00E9pertoire
+TITLE_CREATECOLLCONFIRM = Confirmer la cr\u00e9ation d'un r\u00e9pertoire
TITLE_DELETECONFIRM = Confirmer la suppression
@@ -145,17 +145,19 @@
## CMS ADMIN PORTLET
TITLE_HEAD = Administration du CMS
-TITLE_MOVECONFIRM = Confirmer le d\u00E9placement
+TITLE_MOVECONFIRM = Confirmer le d\u00e9placement
-TITLE_SECURECONFIRM = S\u00E9curiser le noeud
+TITLE_SECURECONFIRM = S\u00e9curiser le noeud
-TITLE_UPLOAD = T\u00E9l\u00E9d\u00E9verser un fichier
+TITLE_UPLOAD = T\u00e9l\u00e9d\u00e9verser un fichier
-TITLE_VIEWFILE = Propri\u00E9t\u00E9s du fichier
+TITLE_VIEWFILE = Propri\u00e9t\u00e9s du fichier
-CMS_ACCESS_DENIED=Acc\u00E9s interdit
-CMS_ACCESS_DENIED_DESCRIPTION=Vous n'\u00eates pas autoris\u00E9 \u00e0 acc\u00e9der a ce document
-CMS_ACCESS_DENIED_DESCRIPTION_PATH=Vous n'\u00eates pas autoris\u00E9 \u00e0 acc\u00e9der au document
+CMS_ACCESS_DENIED=Acc\u00e9s interdit
+CMS_ACCESS_DENIED_DESCRIPTION=Vous n'\u00eates pas autoris\u00e9 \u00e0 acc\u00e9der a ce document
+CMS_ACCESS_DENIED_DESCRIPTION_PATH=Vous n'\u00eates pas autoris\u00e9 \u00e0 acc\u00e9der au document
-CMS_MISSING_DOCUMENT=404 - Page non trouv\u00E9e
-CMS_MISSING_DOCUMENT_DESCRIPTION=Le document auquel vous avez tent\u00E9 d'acc\u00E9der est introuvable
+CMS_MISSING_DOCUMENT=404 - Page non trouv\u00e9e
+CMS_MISSING_DOCUMENT_DESCRIPTION=Le document auquel vous avez tent\u00e9 d'acc\u00e9der est introuvable
+
+CMS_INVALID_PARAMETER=Une valeur ci-dessous est invalide car elle contient des caract\u00e8rs invalides '\\', '<', '>', '(', ')', '=' ou '%5c'.
\ No newline at end of file
Modified: branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp 2009-05-29 23:04:54 UTC (rev 13425)
@@ -116,9 +116,7 @@
<%if(errorMessage != null){%>
<tr>
- <td colspan="2">
- <font color="red">${n:i18n("CMS_FILENAME_INVALID")}</font>
- </td>
+ <td><span style="color: red">${n:i18n("CMS_INVALID_PARAMETER")}></span></td>
</tr>
<%}%>
Modified: branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp 2009-05-29 23:04:54 UTC (rev 13425)
@@ -21,6 +21,9 @@
String sVersion = (String)request.getAttribute("version");
String sTitle = (String)request.getAttribute("title");
String sDescription = (String)request.getAttribute("description");
+
+ // for error handling
+ String errorMessage = (String)request.getAttribute("error:message");
%>
<!-- tinyMCE -->
@@ -74,8 +77,20 @@
<tr>
<td height="10"></td>
</tr>
+
+ <%
+ if(errorMessage != null)
+ {
+ %>
+ <tr>
+ <td><span style="color: red">${n:i18n("CMS_INVALID_PARAMETER")}></span></td>
+ </tr>
+ <%
+ }
+ %>
<tr>
- <td>
+ <td></td>
+</tr>
<tr>
<td>
<table>
Modified: branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp 2009-05-29 23:04:54 UTC (rev 13425)
@@ -75,7 +75,7 @@
if (parser.hasMoreTokens())
{
%>
- <li class="pathSeperator"><img src="/portal-admin/img/pathSeparator.png" alt=">"></li>
+ <li class="pathSeparator"><img src="/portal-admin/img/pathSeparator.png" alt=">"></li>
<li class="pathItem"><a href="
<portlet:renderURL>
<portlet:param name="op" value="<%= CMSAdminConstants.OP_MAIN %>"/>
@@ -89,7 +89,7 @@
else
{
%>
- <li class="pathSeperator"><img src="/portal-admin/img/pathSeparator.png" alt=">"></li>
+ <li class="pathSeparator"><img src="/portal-admin/img/pathSeparator.png" alt=">"></li>
<li class="selected"><%= EntityEncoder.FULL.encode(sPathChunk) %>
</li>
<%
Modified: branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/pending_items.jsp 2009-05-29 23:04:54 UTC (rev 13425)
@@ -43,7 +43,7 @@
if (parser.hasMoreTokens())
{
%>
- <li class="pathSeperator"><img src="/portal-admin/img/pathSeparator.png" alt=">"></li>
+ <li class="pathSeparator"><img src="/portal-admin/img/pathSeparator.png" alt=">"></li>
<li class="pathItem"><a href="
<portlet:renderURL>
<portlet:param name="op" value="<%= CMSAdminConstants.OP_MAIN %>"/>
@@ -57,7 +57,7 @@
else
{
%>
- <li class="pathSeperator"><img src="/portal-admin/img/pathSeparator.png" alt=">"></li>
+ <li class="pathSeparator"><img src="/portal-admin/img/pathSeparator.png" alt=">"></li>
<li class="selected"><%= sPathChunk %>
</li>
<%
Modified: branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/viewfile.jsp 2009-05-29 23:04:54 UTC (rev 13425)
@@ -72,7 +72,7 @@
if (parser.hasMoreTokens())
{
%>
- <li class="pathSeperator"><img src="/portal-admin/img/pathSeparator.png" alt=">"></li>
+ <li class="pathSeparator"><img src="/portal-admin/img/pathSeparator.png" alt=">"></li>
<li class="pathItem"><a href="
<portlet:renderURL>
<portlet:param name="op" value="<%= CMSAdminConstants.OP_MAIN %>"/>
@@ -86,7 +86,7 @@
else
{
%>
- <li class="pathSeperator"><img src="/portal-admin/img/pathSeparator.png" alt=">"></li>
+ <li class="pathSeparator"><img src="/portal-admin/img/pathSeparator.png" alt=">"></li>
<li class="selected"><%= EntityEncoder.FULL.encode(sPathChunk) %>
</li>
<%
Modified: branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -22,14 +22,13 @@
******************************************************************************/
package org.jboss.portal.core.identity.ui;
-import java.util.HashMap;
-
-import javax.faces.context.FacesContext;
-
import org.jboss.portal.core.identity.ui.common.IdentityUserBean;
import org.jboss.portal.faces.el.PropertyValue;
import org.jboss.portal.faces.el.dynamic.DynamicBean;
+import javax.faces.context.FacesContext;
+import java.util.HashMap;
+
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
@@ -42,16 +41,16 @@
/** The managed user bean */
private IdentityUserBean identityUserBean;
-
+
/** The hash map contains all the user attributes */
private HashMap map;
-
+
public DynamicUserAttribute()
{
this.map = new HashMap();
FacesContext ctx = FacesContext.getCurrentInstance();
- this.identityUserBean = (IdentityUserBean) ctx.getApplication().createValueBinding(("#{identityusermgr}"))
- .getValue(ctx);
+ this.identityUserBean = (IdentityUserBean)ctx.getApplication().createValueBinding(("#{identityusermgr}"))
+ .getValue(ctx);
}
public DynamicUserAttribute(String username)
@@ -64,7 +63,7 @@
{
try
{
- return identityUserBean.getPropertyType((String) propertyName);
+ return identityUserBean.getPropertyType((String)propertyName);
}
catch (Exception e)
{
@@ -75,30 +74,34 @@
public PropertyValue getValue(Object propertyName)
{
- Object propertyValue = map.get((String) propertyName);
+ Object propertyValue = map.get(propertyName);
// Trying to fetch user property
if (propertyValue == null)
{
try
{
- propertyValue = identityUserBean.getUserProperty(this.username, (String) propertyName);
+ propertyValue = identityUserBean.getUserProperty(this.username, (String)propertyName);
}
catch (Exception e)
{
// ok on user register
}
}
-
+
return new PropertyValue(identityUserBean.getLocalizedValue((String)propertyName, propertyValue));
}
public boolean setValue(Object propertyName, Object value) throws IllegalArgumentException
{
if (value != null && value instanceof String && ((String)value).trim().length() == 0)
- map.put((String) propertyName, null);
+ {
+ map.put(propertyName, null);
+ }
else
- map.put((String)propertyName, value);
+ {
+ map.put(propertyName, value);
+ }
return true;
}
Copied: branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/BaseRoleAction.java (from rev 13376, branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/BaseRoleAction.java)
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/BaseRoleAction.java (rev 0)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/BaseRoleAction.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -0,0 +1,119 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.jboss.portal.core.identity.ui.actions;
+
+import org.jboss.portal.core.identity.ui.UIRole;
+import org.jboss.portal.core.identity.ui.common.IdentityRoleBean;
+import org.jboss.portal.faces.gui.ManagedBean;
+import org.jboss.portal.identity.IdentityException;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class BaseRoleAction extends ManagedBean
+{
+ /** . */
+ protected UIRole uiRole;
+ /** . */
+ protected IdentityRoleBean identityRoleBean;
+
+ protected final PropertyValidator displayNameValidator = new DisplayNameValidator();
+ private static final String ROLE_DISPLAY_TYPE = "ROLE_DISPLAY_TYPE";
+ private static final String ROLE_TYPE = "ROLE_TYPE";
+
+ protected String getObjectTypeName()
+ {
+ return ROLE_TYPE;
+ }
+
+ public boolean isAlreadyExisting(String objectName)
+ {
+ return isAlreadyExisting(objectName, false);
+ }
+
+ protected boolean isAlreadyExisting(String objectName, boolean isDisplay)
+ {
+ try
+ {
+ if (isDisplay)
+ {
+ return identityRoleBean.getRoleModule().findRoleByDisplayName(objectName) != null;
+ }
+ else
+ {
+ return identityRoleBean.getRoleModule().findRoleByName(objectName) != null;
+ }
+ }
+ catch (IdentityException e)
+ {
+ // due to current design of identity module, findRoleByName throws an exception if the role is not found
+ // instead of returning null as would be traditionally expected... Pb is IdentityException is also used to
+ // wrap HibernateExceptions...
+ if (e.getMessage().contains("No such role"))
+ {
+ // ignore
+ }
+ else
+ {
+ log.error("Error validation rolename", e);
+ beanContext.createErrorMessageFrom(e);
+ }
+ return false;
+ }
+ }
+
+ private class DisplayNameValidator extends DefaultPropertyValidator
+ {
+ public String getObjectTypeName()
+ {
+ return ROLE_DISPLAY_TYPE;
+ }
+
+ public boolean isAlreadyExisting(String propertyName)
+ {
+ return BaseRoleAction.this.isAlreadyExisting(propertyName, true);
+ }
+ }
+
+ public UIRole getUiRole()
+ {
+ return uiRole;
+ }
+
+ public void setUiRole(UIRole uiRole)
+ {
+ this.uiRole = uiRole;
+ }
+
+ public IdentityRoleBean getIdentityRoleBean()
+ {
+ return identityRoleBean;
+ }
+
+ public void setIdentityRoleBean(IdentityRoleBean identityRoleBean)
+ {
+ this.identityRoleBean = identityRoleBean;
+ }
+}
Modified: branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateRoleAction.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateRoleAction.java 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateRoleAction.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -23,52 +23,41 @@
package org.jboss.portal.core.identity.ui.actions;
import org.jboss.portal.core.identity.ui.UIRole;
-import org.jboss.portal.core.identity.ui.common.IdentityRoleBean;
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
*/
-public class CreateRoleAction
+public class CreateRoleAction extends BaseRoleAction
{
-
- /** .*/
- private UIRole uiRole = new UIRole();
-
- /** .*/
- private IdentityRoleBean identityRoleBean;
-
- public UIRole getUiRole()
+ public CreateRoleAction()
{
- return uiRole;
+ uiRole = new UIRole();
}
- public void setUiRole(UIRole uiRole)
+ public String createRole()
{
- this.uiRole = uiRole;
- }
+ String name = this.uiRole.getName();
+ String displayName = this.uiRole.getDisplayName();
+ name = checkNameValidity(name, "create-role-form:rolename");
- public IdentityRoleBean getIdentityRoleBean()
- {
- return identityRoleBean;
- }
+ // check display name validity for XSS injection but check duplicate separately due to limitation to how ManagedBean works
+ displayName = checkNameValidity(displayName, "create-role-form:roledisplayname", displayNameValidator);
- public void setIdentityRoleBean(IdentityRoleBean identityRoleBean)
- {
- this.identityRoleBean = identityRoleBean;
- }
-
- public String createRole()
- {
- try
+ if (name != null && displayName != null)
{
- identityRoleBean.getRoleModule().createRole(this.uiRole.getName(), this.uiRole.getDisplayName());
+ try
+ {
+ identityRoleBean.getRoleModule().createRole(name, displayName);
+ return "roleAdmin";
+ }
+ catch (Exception e)
+ {
+ log.error("An error occurred during role creation", e);
+ beanContext.createErrorMessageFrom(e);
+ }
}
- catch (Exception e)
- {
- e.printStackTrace();
- }
- return "roleAdmin";
- }
+ return null;
+ }
}
Modified: branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/CreateUserAction.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -22,18 +22,6 @@
******************************************************************************/
package org.jboss.portal.core.identity.ui.actions;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.ResourceBundle;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.faces.event.ActionEvent;
-
import org.jboss.logging.Logger;
import org.jboss.portal.api.node.PortalNode;
import org.jboss.portal.api.node.PortalNodeURL;
@@ -48,6 +36,17 @@
import org.jboss.portlet.JBossActionRequest;
import org.jboss.portlet.JBossActionResponse;
+import javax.faces.application.FacesMessage;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.ResourceBundle;
+
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
@@ -57,7 +56,7 @@
/** . */
private List roles = new ArrayList();
-
+
/** . */
private List defaultRoles = null;
@@ -131,7 +130,7 @@
{
this.metaDataService = metaDataService;
}
-
+
public String cancelRegistration()
{
this.uiUser = new IdentityUIUser();
@@ -143,9 +142,11 @@
{
String registrationStatus = "failed";
FacesContext ctx = FacesContext.getCurrentInstance();
- String adminSubscription = (String) ev.getComponent().getId();
+ String adminSubscription = ev.getComponent().getId();
ResourceBundle bundle = ResourceBundle.getBundle("conf.bundles.Identity", ctx.getViewRoot().getLocale());
- if (uiUser.getUsername() != null && uiUser.getPassword() != null)
+ String wUsername = uiUser.getUsername();
+ String wPassword = uiUser.getPassword();
+ if (wUsername != null && wPassword != null)
{
try
{
@@ -162,12 +163,10 @@
else
{
log.warn(User.INFO_USER_REGISTRATION_DATE + " property is mapped in not supported type: "
- + registrationDateClass.toString());
+ + registrationDateClass.toString());
}
// Variables for RegisterService
- String wUsername = uiUser.getUsername();
- String wPassword = uiUser.getPassword();
List wRoles = roles;
Map wProfileMap = this.identityUserBean.getProfileMap(uiUser.getAttribute().getProfileAttributes());
Locale wLocale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
@@ -177,16 +176,16 @@
if (adminSubscription != null && adminSubscription.equals("admin"))
{
registrationStatus = this.registrationService.registerUser(wURL, wUsername, wPassword, wProfileMap, wRoles,
- wLocale, true);
+ wLocale, true);
}
else
{
registrationStatus = this.registrationService.registerUser(wURL, wUsername, wPassword, wProfileMap, wRoles,
- wLocale, false);
+ wLocale, false);
}
}
- catch(CoreIdentityConfigurationException e)
+ catch (CoreIdentityConfigurationException e)
{
registrationStatus = IdentityConstants.REGISTRATION_FAILED;
log.error("", e);
@@ -195,32 +194,32 @@
// cleaning up the user
this.uiUser = new IdentityUIUser();
-
+
if (IdentityConstants.REGISTRATION_PENDING.equals(registrationStatus) && !adminSubscription.equals("admin"))
{
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(bundle.getString("IDENTITY_REGISTER_PENDING_TITLE")));
}
else if (IdentityConstants.REGISTRATION_REGISTERED.equals(registrationStatus) && !adminSubscription.equals("admin"))
{
- FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(bundle.getString("IDENTITY_REGISTER_SUCCESS_TITLE")));
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(bundle.getString("IDENTITY_REGISTER_SUCCESS_TITLE")));
}
- else if (adminSubscription.equals("admin") && ! IdentityConstants.REGISTRATION_FAILED.equals(registrationStatus))
+ else if (adminSubscription.equals("admin") && !IdentityConstants.REGISTRATION_FAILED.equals(registrationStatus))
{
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(bundle.getString("IDENTITY_MANAGEMENT_CREATE_USER_CREATED")));
}
else
{
FacesContext.getCurrentInstance().addMessage("status", new FacesMessage(FacesMessage.SEVERITY_ERROR,
- bundle.getString("IDENTITY_VALIDATION_ERROR_REGISTRATION"),
- bundle.getString("IDENTITY_VALIDATION_ERROR_REGISTRATION")));
+ bundle.getString("IDENTITY_VALIDATION_ERROR_REGISTRATION"),
+ bundle.getString("IDENTITY_VALIDATION_ERROR_REGISTRATION")));
}
}
private String getPortalURL()
{
ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
- JBossActionRequest request = (JBossActionRequest) ectx.getRequest();
- JBossActionResponse response = (JBossActionResponse) ectx.getResponse();
+ JBossActionRequest request = (JBossActionRequest)ectx.getRequest();
+ JBossActionResponse response = (JBossActionResponse)ectx.getResponse();
ServerInvocationContext invocationContext = request.getControllerContext().getServerInvocation().getServerContext();
PortalNode n = request.getPortalNode();
PortalNodeURL url = response.createRenderURL(n);
Modified: branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditRoleAction.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditRoleAction.java 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditRoleAction.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -22,83 +22,70 @@
******************************************************************************/
package org.jboss.portal.core.identity.ui.actions;
-import java.util.Map;
-
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-
import org.jboss.portal.common.text.FastURLDecoder;
import org.jboss.portal.core.identity.ui.UIRole;
-import org.jboss.portal.core.identity.ui.common.IdentityRoleBean;
+import org.jboss.portal.identity.IdentityException;
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
*/
-public class EditRoleAction
+public class EditRoleAction extends BaseRoleAction
{
- /** .*/
- private String currentRole;
-
- /** .*/
- private UIRole uiRole;
-
- /** .*/
- private IdentityRoleBean identityRoleBean;
-
/** . */
private static final FastURLDecoder decoder = FastURLDecoder.getUTF8Instance();
- public UIRole getUiRole()
- {
- return uiRole;
- }
-
- public void setUiRole(UIRole uiRole)
- {
- this.uiRole = uiRole;
- }
-
- public IdentityRoleBean getIdentityRoleBean()
- {
- return identityRoleBean;
- }
-
- public void setIdentityRoleBean(IdentityRoleBean identityRoleBean)
- {
- this.identityRoleBean = identityRoleBean;
- }
-
public String editRole()
{
- FacesContext ctx = FacesContext.getCurrentInstance();
- ExternalContext ectx = ctx.getExternalContext();
- Map params = ectx.getRequestParameterMap();
- this.currentRole = params.get("currentRole") != null ? decoder.encode((String) params.get("currentRole")) : null;
+ String currentRole = beanContext.getParameter("currentRole");
+ currentRole = (currentRole != null ? decoder.encode(currentRole) : null);
try
{
- this.uiRole = identityRoleBean.getUIRole(this.currentRole);
+ this.uiRole = identityRoleBean.getUIRole(currentRole);
return "editRole";
}
catch (Exception e)
{
- e.printStackTrace();
+ log.error("Couldn't edit role " + currentRole, e);
+ beanContext.createErrorMessageFrom(e);
}
return "roleAdmin";
}
public String updateRole()
{
+ String roleDisplayName = this.uiRole.getDisplayName();
+
+ // Check that the new role is different from the old one
try
{
- identityRoleBean.updateRoleDisplayName(this.uiRole.getName(), this.uiRole.getDisplayName());
+ String roleName = uiRole.getName();
+ UIRole current = identityRoleBean.getUIRole(roleName);
+ if (!isOldAndNewDifferent(current.getDisplayName(), roleDisplayName))
+ {
+ // if the new and old display names are the same, just return
+ return "roleAdmin";
+ }
}
- catch (Exception e)
+ catch (IdentityException e)
{
- e.printStackTrace();
+ log.error("Couldn't get current role " + roleDisplayName);
}
- return "roleAdmin";
- }
+ roleDisplayName = checkNameValidity(roleDisplayName, "edit-role-link:display-name", displayNameValidator); // display names are unique as well
+ if (roleDisplayName != null)
+ {
+ try
+ {
+ identityRoleBean.updateRoleDisplayName(this.uiRole.getName(), roleDisplayName);
+ return "roleAdmin";
+ }
+ catch (Exception e)
+ {
+ beanContext.createErrorMessageFrom(e);
+ }
+ }
+ return null;
+ }
}
Deleted: branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/RoleValidator.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/RoleValidator.java 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/RoleValidator.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -1,88 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * 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.jboss.portal.core.identity.ui.validators;
-
-import java.util.ResourceBundle;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.validator.Validator;
-import javax.faces.validator.ValidatorException;
-import javax.portlet.PortletContext;
-
-import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.identity.Role;
-import org.jboss.portal.identity.RoleModule;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-
-public class RoleValidator implements Validator
-{
- /** The role module */
- private RoleModule roleModule;
-
- /** The logger */
- private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(RoleValidator.class);
-
- public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
- {
- String rolename = (String) value;
- ResourceBundle bundle = ResourceBundle.getBundle("conf.bundles.Identity", context.getViewRoot().getLocale());
- PortletContext portletContext = (PortletContext) context.getExternalContext().getContext();
- roleModule = (RoleModule) portletContext.getAttribute("RoleModule");
-
- try
- {
- @SuppressWarnings("unused")
- Role u = roleModule.findRoleByName(rolename);
- throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,
- bundle.getString("IDENTITY_VALIDATION_ERROR_ROLENAME_TAKEN"),
- bundle.getString("IDENTITY_VALIDATION_ERROR_ROLENAME_TAKEN")));
- }
- catch (IllegalArgumentException e)
- {
- throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,
- bundle.getString("IDENTITY_VALIDATION_ERROR_ROLENAME_ERROR"),
- bundle.getString("IDENTITY_VALIDATION_ERROR_ROLENAME_ERROR")));
- }
- catch (IdentityException e)
- {
- // TODO: Throw a catchable error
- if (e.getMessage().contains("No such role"))
- {
- // ignore
- }
- else
- {
- log.error("Error validation rolename", e);
- throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,
- bundle.getString("IDENTITY_VALIDATION_ERROR_ROLENAME_ERROR"),
- bundle.getString("IDENTITY_VALIDATION_ERROR_ROLENAME_ERROR")));
- }
- }
- }
-}
Copied: branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UserAttributeValidator.java (from rev 13413, branches/JBoss_Portal_Branch_2_7/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UserAttributeValidator.java)
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UserAttributeValidator.java (rev 0)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UserAttributeValidator.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * 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.jboss.portal.core.identity.ui.validators;
+
+import org.jboss.portal.common.util.ParameterValidation;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class UserAttributeValidator implements Validator
+{
+ public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
+ {
+ ResourceBundle bundle = ResourceBundle.getBundle("conf.bundles.Identity", context.getViewRoot().getLocale());
+ ParameterValidation.sanitizeFromPatternWithHandler((String)value, ParameterValidation.XSS_CHECK,
+ new ValidatorExceptionErrorHandler("", bundle));
+ }
+
+ private class ValidatorExceptionErrorHandler extends ParameterValidation.ValidationErrorHandler
+ {
+ private ResourceBundle bundle;
+
+ ValidatorExceptionErrorHandler(String defaultValue, ResourceBundle bundle)
+ {
+ super(defaultValue);
+ this.bundle = bundle;
+ }
+
+ protected String internalValidationErrorHandling(String value)
+ {
+ String message = bundle.getString("INVALID_VALUE_ERROR");
+ message = MessageFormat.format(message, value);
+ throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, message, message));
+ }
+ }
+}
Modified: branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UsernameValidator.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UsernameValidator.java 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/UsernameValidator.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -22,21 +22,24 @@
******************************************************************************/
package org.jboss.portal.core.identity.ui.validators;
-import java.util.ResourceBundle;
+import org.jboss.portal.common.util.ParameterValidation;
+import org.jboss.portal.core.identity.services.metadata.CoreIdentityConfigurationException;
+import org.jboss.portal.core.identity.services.workflow.RegistrationService;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.NoSuchUserException;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.identity.UserModule;
+
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
import javax.portlet.PortletContext;
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+import java.util.regex.Pattern;
-import org.jboss.portal.core.identity.services.metadata.CoreIdentityConfigurationException;
-import org.jboss.portal.core.identity.services.workflow.RegistrationService;
-import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.identity.NoSuchUserException;
-import org.jboss.portal.identity.User;
-import org.jboss.portal.identity.UserModule;
-
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
@@ -46,7 +49,7 @@
{
/** The username regex */
// private static final String NICKNAME_VALIDATION = "^[a-zA-Z]([a-zA-Z0-9]+(([\\.\\-\\_]?[a-zA-Z0-9]+)+)?)";
-
+
/** The user module */
private UserModule userModule;
@@ -56,14 +59,20 @@
/** The logger */
private static final org.jboss.logging.Logger log = org.jboss.logging.Logger.getLogger(UsernameValidator.class);
+ // same as ParameterValidation.XSS_CHECK but with \ allowed for directory access...
+ private final Pattern USER_NAME_XSS_CHECK = Pattern.compile("([^<>(\\)=\\\\](?<!%5C))*", Pattern.CASE_INSENSITIVE);
+
public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
{
- String username = (String) value;
ResourceBundle bundle = ResourceBundle.getBundle("conf.bundles.Identity", context.getViewRoot().getLocale());
- PortletContext portletContext = (PortletContext) context.getExternalContext().getContext();
- userModule = (UserModule) portletContext.getAttribute("UserModule");
- registrationService = (RegistrationService) portletContext.getAttribute("RegistrationService");
+ String username = ParameterValidation.sanitizeFromPatternWithHandler((String)value, USER_NAME_XSS_CHECK,
+ new ValidatorExceptionErrorHandler("", bundle));
+ PortletContext portletContext = (PortletContext)context.getExternalContext().getContext();
+ userModule = (UserModule)portletContext.getAttribute("UserModule");
+ registrationService = (RegistrationService)portletContext.getAttribute("RegistrationService");
+
+
// if (username.length() >= 5 && (Pattern.matches(NICKNAME_VALIDATION, username)))
if (username.contains("<") || username.contains(">") || username.contains("\"") || username.contains("\'"))
{
@@ -77,15 +86,15 @@
if (registrationService.checkUsername(username))
{
throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,
- bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN"),
- bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN")));
+ bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN"),
+ bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN")));
}
User u = userModule.findUserByUserName(username);
// User found so this nickname is already taken
throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,
- bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN"),
- bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN")));
+ bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN"),
+ bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN")));
}
catch (NoSuchUserException e)
{
@@ -94,22 +103,41 @@
catch (IllegalArgumentException e)
{
throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,
- bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR"),
- bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR")));
+ bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR"),
+ bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR")));
}
catch (IdentityException e)
{
log.error("Error validation username", e);
throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,
- bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR"),
- bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR")));
+ bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR"),
+ bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR")));
}
catch (CoreIdentityConfigurationException e)
{
log.error("Error validation username", e);
throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR,
- bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR"),
- bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR")));
+ bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR"),
+ bundle.getString("IDENTITY_VALIDATION_ERROR_USERNAME_ERROR")));
}
}
+
+ private class ValidatorExceptionErrorHandler extends ParameterValidation.ValidationErrorHandler
+ {
+ private ResourceBundle bundle;
+
+ ValidatorExceptionErrorHandler(String defaultValue, ResourceBundle bundle)
+ {
+ super(defaultValue);
+ this.bundle = bundle;
+ }
+
+ protected String internalValidationErrorHandling(String s)
+ {
+ String message = bundle.getString("IDENTITY_VALIDATION_ERROR_INVALID_USERNAME");
+ message = MessageFormat.format(message, s);
+ throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, message, message));
+ }
+ }
+
}
Modified: branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity.properties 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity.properties 2009-05-29 23:04:54 UTC (rev 13425)
@@ -116,7 +116,6 @@
IDENTITY_MANAGEMENT_ROLE_ASSIGNED=Assigned roles
IDENTITY_MANAGEMENT_CREATE_ROLE=Create new role
IDENTITY_MANAGEMENT_EDIT_ROLE=Edit role
-IDENTITY_MANAGEMENT_CREATE_ROLE=Create role
IDENTITY_MANAGEMENT_DISABLE=Disable
IDENTITY_MANAGEMENT_DISABLE_USER_DISABLED=User disabled
IDENTITY_MANAGEMENT_ENABLE=Enable
@@ -171,14 +170,19 @@
IDENTITY_VALIDATION_ERROR_REGISTRATION=Failed to register user.
IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN=This username is already taken.
IDENTITY_VALIDATION_ERROR_USERNAME_ERROR=Error while validating the username.
-IDENTITY_VALIDATION_ERROR_ROLENAME_TAKEN=This role name is already taken.
-IDENTITY_VALIDATION_ERROR_ROLENAME_ERROR=Error while validating the role name.
+IDENTITY_VALIDATION_ERROR_INVALID_USERNAME=''{0}'' is an invalid username: Cannot be null, empty or contain '<', '>', '(', ')', '=' or '%5c'
IDENTITY_VALIDATION_ERROR_PASSWORD_DOESNT_MATCH=The passwords doesn't match.
IDENTITY_VALIDATION_ERROR_PASSWORD_ERROR=Error while validating password.
IDENTITY_VALIDATION_ERROR_INVALID_EMAIL=Invalid E-Mail address.
IDENTITY_VALIDATION_ERROR_INVALID_PASSWORD=Invalid password
IDENTITY_VALIDATION_ERROR_CAPTCHA_INCORRECT=Captcha incorrect
+ROLE_TYPE=role
+ROLE_DISPLAY_TYPE=role display
+INVALID_NAME_ERROR=''{0}'' is an invalid {1} name: Cannot be null, empty or contain '/', '.', '\\', '<', '>', '(', ')', '=' or '%5c'
+INVALID_VALUE_ERROR=''{0}'' is an invalid value: Cannot be null, empty or contain '\\', '<', '>', '(', ')', '=' or '%5c'
+DUPLICATE_ERROR=A {1} named ''{0}'' already exists!
+
# Example usage for dynamic values
IDENTITY_DYNAMIC_VALUE_TEST=test label
IDENTITY_DYNAMIC_VALUE_TEST2=test label2
Modified: branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_fr.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_fr.properties 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_fr.properties 2009-05-29 23:04:54 UTC (rev 13425)
@@ -24,7 +24,7 @@
IDENTITY_AIM = Identifiant AIM
-IDENTITY_APPLICATION_NOT_AVAILABLE = Portlet non disponible. V\u00E9rifiez votre configuration et les journaux syst\u00E8me pour plus d'information.
+IDENTITY_APPLICATION_NOT_AVAILABLE = Portlet non disponible. V\u00e9rifiez votre configuration et les journaux syst\u00e8me pour plus d'information.
IDENTITY_BUTTON_CANCEL = Annuler
@@ -32,19 +32,19 @@
IDENTITY_BUTTON_SUBMIT = Soumettre
-IDENTITY_CATEGORY_ADDITIONAL = Information compl\u00E9mentaire
+IDENTITY_CATEGORY_ADDITIONAL = Information compl\u00e9mentaire
-IDENTITY_CATEGORY_ADDITIONAL_EXTRA = (255 caract\u00E8res max.)
+IDENTITY_CATEGORY_ADDITIONAL_EXTRA = (255 caract\u00e8res max.)
-IDENTITY_CATEGORY_ADDITIONAL_SIGNATURE = (Signature de 255 caract\u00E8res max)
+IDENTITY_CATEGORY_ADDITIONAL_SIGNATURE = (Signature de 255 caract\u00e8res max)
-IDENTITY_CATEGORY_GENERAL = Pr\u00E9f\u00E9rences g\u00E9n\u00E9rales
+IDENTITY_CATEGORY_GENERAL = Pr\u00e9f\u00e9rences g\u00e9n\u00e9rales
-IDENTITY_CATEGORY_INSTANT = Comptes de messagerie instantan\u00E9e
+IDENTITY_CATEGORY_INSTANT = Comptes de messagerie instantan\u00e9e
IDENTITY_CATEGORY_PERSONAL = Informations personnelles
-IDENTITY_CREATE_ACCOUNT = Vous pouvez cr\u00E9er un compte.
+IDENTITY_CREATE_ACCOUNT = Vous pouvez cr\u00e9er un compte.
# Example usage for dynamic values
IDENTITY_DYNAMIC_VALUE_TEST = test label
@@ -55,15 +55,15 @@
IDENTITY_EDIT_CHANGE_EMAIL_ERROR = Impossible de changer l'adresse de courriel.
-IDENTITY_EDIT_CHANGE_EMAIL_STATUS_CHANGED = Votre adresse de courriel a \u00E9t\u00E9 mise \u00E0 jour.
+IDENTITY_EDIT_CHANGE_EMAIL_STATUS_CHANGED = Votre adresse de courriel a \u00e9t\u00e9 mise \u00e0 jour.
-IDENTITY_EDIT_CHANGE_EMAIL_STATUS_PENDING = Un courriel a \u00E9t\u00E9 envoy\u00E9 \u00E0 l'adresse indiqu\u00E9e afin d'en confirmer la validit\u00E9.
+IDENTITY_EDIT_CHANGE_EMAIL_STATUS_PENDING = Un courriel a \u00e9t\u00e9 envoy\u00e9 \u00e0 l'adresse indiqu\u00e9e afin d'en confirmer la validit\u00e9.
IDENTITY_EDIT_CHANGE_PASSWORD = Changer mon mot de passe
IDENTITY_EDIT_CHANGE_PASSWORD_ERROR = Impossible de changer votre mot de passe.
-IDENTITY_EDIT_CHANGE_PASSWOR_STATUS = Votre mot de passe a \u00E9t\u00E9 modifi\u00E9.
+IDENTITY_EDIT_CHANGE_PASSWOR_STATUS = Votre mot de passe a \u00e9t\u00e9 modifi\u00e9.
IDENTITY_EDIT_EMAIL_NEW = Nouvelle adresse courriel
@@ -73,39 +73,39 @@
IDENTITY_EDIT_PASSWORD_TITLE = Changer mon mot de passe
-IDENTITY_EDIT_PROFILE_ERROR = Erreur lors de la mise \u00E0 jour de votre profil.
+IDENTITY_EDIT_PROFILE_ERROR = Erreur lors de la mise \u00e0 jour de votre profil.
IDENTITY_EDIT_PROFILE_TITLE = Modifier mon profil
IDENTITY_EMAIL = Courriel
-IDENTITY_ENABLED = Activ\u00E9
+IDENTITY_ENABLED = Activ\u00e9
IDENTITY_EXTRA = Extra
IDENTITY_FAMILYNAME = Nom
-IDENTITY_GIVENNAME = Pr\u00E9nom
+IDENTITY_GIVENNAME = Pr\u00e9nom
IDENTITY_HOMEPAGE = Page web
-IDENTITY_ICQ = Num\u00E9ro Icq
+IDENTITY_ICQ = Num\u00e9ro Icq
-IDENTITY_INTERESTS = Centres d'int\u00E9r\u00EAts
+IDENTITY_INTERESTS = Centres d'int\u00e9r\u00eats
-IDENTITY_LAST_LOGIN = Derni\u00E8re visite
+IDENTITY_LAST_LOGIN = Derni\u00e8re visite
IDENTITY_LOCALE = Langue
-IDENTITY_LOCATION = Lieu de r\u00E9sidence
+IDENTITY_LOCATION = Lieu de r\u00e9sidence
IDENTITY_LOST_PASSWORD = Mot de passe perdu
-IDENTITY_LOST_PASSWORD_DESCRIPTION = Veuillez entrer votre identifiant afin de r\u00E9initialiser votre mot de passe.
+IDENTITY_LOST_PASSWORD_DESCRIPTION = Veuillez entrer votre identifiant afin de r\u00e9initialiser votre mot de passe.
-IDENTITY_LOST_PASSWORD_ERROR = \u00C9chec de r\u00E9initialisation de votre mot de passe.
+IDENTITY_LOST_PASSWORD_ERROR = \u00c9chec de r\u00e9initialisation de votre mot de passe.
-IDENTITY_LOST_PASSWORD_STATUS_404 = Aucun compte trouv\u00E9.
+IDENTITY_LOST_PASSWORD_STATUS_404 = Aucun compte trouv\u00e9.
IDENTITY_LOST_PASSWORD_STATUS_SUCCESSFUL = Vous receverez sous peu via courriel votre nouveau mot de passe.
@@ -115,7 +115,7 @@
IDENTITY_MAIL_SUBJECT_CHANGE_EMAIL = Confirmer l'adresse de courriel
-IDENTITY_MAIL_SUBJECT_LOST_PASSWORD = R\u00E9initialiser mon mot de passe
+IDENTITY_MAIL_SUBJECT_LOST_PASSWORD = R\u00e9initialiser mon mot de passe
IDENTITY_MAIL_SUBJECT_REGISTER = Confirmer mon enregistrement
@@ -125,39 +125,39 @@
IDENTITY_MANAGEMENT_ACTION_EDIT_PROFILE = Modifier
-IDENTITY_MANAGEMENT_ACTION_ROLES = R\u00F4les
+IDENTITY_MANAGEMENT_ACTION_ROLES = R\u00f4les
-IDENTITY_MANAGEMENT_APPROVE_ALL = Approuver la s\u00E9lection
+IDENTITY_MANAGEMENT_APPROVE_ALL = Approuver la s\u00e9lection
-IDENTITY_MANAGEMENT_ASSIGN_ROLES = Assigner un r\u00F4le
+IDENTITY_MANAGEMENT_ASSIGN_ROLES = Assigner un r\u00f4le
IDENTITY_MANAGEMENT_COUNT_PENDING_USERS = Comptes en attente d'approbation
-IDENTITY_MANAGEMENT_COUNT_REGISTERED_USERS = Utilisateurs enregistr\u00E9s
+IDENTITY_MANAGEMENT_COUNT_REGISTERED_USERS = Utilisateurs enregistr\u00e9s
-IDENTITY_MANAGEMENT_CREATE_ROLE = Cr\u00E9er un nouveau r\u00F4le
+IDENTITY_MANAGEMENT_CREATE_ROLE = Cr\u00e9er un nouveau r\u00f4le
-IDENTITY_MANAGEMENT_CREATE_USER = Cr\u00E9er un nouveau compte utilisateur
+IDENTITY_MANAGEMENT_CREATE_USER = Cr\u00e9er un nouveau compte utilisateur
-IDENTITY_MANAGEMENT_CREATE_USER_CREATED = Compte cr\u00E9\u00E9
+IDENTITY_MANAGEMENT_CREATE_USER_CREATED = Compte cr\u00e9\u00e9
IDENTITY_MANAGEMENT_DESCRIPTION_SUBSCRIPTION_AUTOMATIC = Automatique - pas de validation par courriel et pas d'approbation
-IDENTITY_MANAGEMENT_DESCRIPTION_SUBSCRIPTION_CUSTOM = Mode d'abonnement personnalis\u00E9
+IDENTITY_MANAGEMENT_DESCRIPTION_SUBSCRIPTION_CUSTOM = Mode d'abonnement personnalis\u00e9
IDENTITY_MANAGEMENT_DESCRIPTION_SUBSCRIPTION_EMAIL = Validation par courriel et pas d'approbation
IDENTITY_MANAGEMENT_DESCRIPTION_SUBSCRIPTION_EMAIL_ADMIN = Validation par courriel et approbation par un administrateur
-IDENTITY_MANAGEMENT_DISABLE = D\u00E9sactiver
+IDENTITY_MANAGEMENT_DISABLE = D\u00e9sactiver
-IDENTITY_MANAGEMENT_EDIT_ROLE = Modifier le r\u00F4le
+IDENTITY_MANAGEMENT_EDIT_ROLE = Modifier le r\u00f4le
IDENTITY_MANAGEMENT_ENABLE = Activer
-IDENTITY_MANAGEMENT_ERROR_ACTION_ROLE = Impossible d'effectuer l'op\u00E9ration demand\u00E9e sur ce r\u00F4le. Consultez le journal syst\u00E8me pour plus de d\u00E9tails.
+IDENTITY_MANAGEMENT_ERROR_ACTION_ROLE = Impossible d'effectuer l'op\u00e9ration demand\u00e9e sur ce r\u00f4le. Consultez le journal syst\u00e8me pour plus de d\u00e9tails.
-IDENTITY_MANAGEMENT_ERROR_ACTION_USER = Impossible d'effectuer l'op\u00E9ration demand\u00E9e sur ce compte. Consultez le journal syst\u00E8me pour plus de d\u00E9tails.
+IDENTITY_MANAGEMENT_ERROR_ACTION_USER = Impossible d'effectuer l'op\u00e9ration demand\u00e9e sur ce compte. Consultez le journal syst\u00e8me pour plus de d\u00e9tails.
IDENTITY_MANAGEMENT_MATRIX = Matrice
@@ -169,27 +169,27 @@
IDENTITY_MANAGEMENT_PENDING_REJECT = rejeter
-IDENTITY_MANAGEMENT_REJECT_ALL = Rejeter la s\u00E9lection
+IDENTITY_MANAGEMENT_REJECT_ALL = Rejeter la s\u00e9lection
-IDENTITY_MANAGEMENT_RESET_PASSWORD = R\u00E9initialiser le mot de passe
+IDENTITY_MANAGEMENT_RESET_PASSWORD = R\u00e9initialiser le mot de passe
-IDENTITY_MANAGEMENT_RESET_PASSWORD_DESCRIPTION = L'utilisateur recevera un nouveau mot de passe al\u00E9atoire envoy\u00E9 via courriel.
+IDENTITY_MANAGEMENT_RESET_PASSWORD_DESCRIPTION = L'utilisateur recevera un nouveau mot de passe al\u00e9atoire envoy\u00e9 via courriel.
-IDENTITY_MANAGEMENT_RESET_PASSWORD_FOR_USER = R\u00E9initialiser le mot de passe pour l'usager
+IDENTITY_MANAGEMENT_RESET_PASSWORD_FOR_USER = R\u00e9initialiser le mot de passe pour l'usager
-IDENTITY_MANAGEMENT_ROLE = R\u00F4le
+IDENTITY_MANAGEMENT_ROLE = R\u00f4le
-IDENTITY_MANAGEMENT_ROLE_ASSIGNED = R\u00F4les assign\u00E9s
+IDENTITY_MANAGEMENT_ROLE_ASSIGNED = R\u00f4les assign\u00e9s
IDENTITY_MANAGEMENT_ROLE_DISPLAY = Nom courant
-IDENTITY_MANAGEMENT_ROLE_MANAGEMENT = Gestion des r\u00F4les
+IDENTITY_MANAGEMENT_ROLE_MANAGEMENT = Gestion des r\u00f4les
IDENTITY_MANAGEMENT_ROLE_MEMBERS = Membres
IDENTITY_MANAGEMENT_SEARCH_USER = Rechercher
-IDENTITY_MANAGEMENT_SELECT_ALL = Tout s\u00E9lectionner
+IDENTITY_MANAGEMENT_SELECT_ALL = Tout s\u00e9lectionner
IDENTITY_MANAGEMENT_SUBSCRIPTION_ADMIN_MODE = Administrer les modes d'abonnement
@@ -197,17 +197,17 @@
IDENTITY_MANAGEMENT_SUBSCRIPTION_MODES = Modes d'abonnement
-IDENTITY_MANAGEMENT_UNSELECT_ALL = Tout d\u00E9s\u00E9lectionner
+IDENTITY_MANAGEMENT_UNSELECT_ALL = Tout d\u00e9s\u00e9lectionner
-IDENTITY_MANAGEMENT_USER_DELETED = Compte supprim\u00E9
+IDENTITY_MANAGEMENT_USER_DELETED = Compte supprim\u00e9
IDENTITY_MANAGEMENT_USER_MANAGEMENT = Gestion des utilisateurs
IDENTITY_MSNM = Identifiant MSN
-IDENTITY_NOT_LOGGED_IN = Vous n'\u00EAtes pas connect\u00E9.
+IDENTITY_NOT_LOGGED_IN = Vous n'\u00eates pas connect\u00e9.
-IDENTITY_OCCUPATION = M\u00E9tier
+IDENTITY_OCCUPATION = M\u00e9tier
IDENTITY_PASSWORD = Mot de passe
@@ -217,33 +217,33 @@
IDENTITY_REGISTER_PASSWORD_CONFIRM = Confirmation de mot de passe
-IDENTITY_REGISTER_PENDING_TITLE = Un courriel a \u00E9t\u00E9 envoy\u00E9 \u00E0 l'adresse indiqu\u00E9e afin de confirmer votre enregistrement.
+IDENTITY_REGISTER_PENDING_TITLE = Un courriel a \u00e9t\u00e9 envoy\u00e9 \u00e0 l'adresse indiqu\u00e9e afin de confirmer votre enregistrement.
IDENTITY_REGISTER_REQUIRED_INFORMATION = indique un champ obligatoire
IDENTITY_REGISTER_STATUS_TITLE = Statut d'enregistrement
-IDENTITY_REGISTER_SUCCESS_TITLE = Votre compte a \u00E9t\u00E9 cr\u00E9\u00E9 avec succ\u00E8s. Vous pouvez vous connecter.
+IDENTITY_REGISTER_SUCCESS_TITLE = Votre compte a \u00e9t\u00e9 cr\u00e9\u00e9 avec succ\u00e8s. Vous pouvez vous connecter.
-IDENTITY_REGISTER_TITLE = Informations g\u00E9n\u00E9rales
+IDENTITY_REGISTER_TITLE = Informations g\u00e9n\u00e9rales
IDENTITY_REGISTER_TITLE_CONFIRM = Confirmation
IDENTITY_REGISTER_TITLE_CONFIRM_DELETE = Confirmation : supprimer
-IDENTITY_REGISTER_VERIFY_CAPTCHA = V\u00E9rification visuelle
+IDENTITY_REGISTER_VERIFY_CAPTCHA = V\u00e9rification visuelle
-IDENTITY_REGISTRATION_DATE = Enregistr\u00E9 le
+IDENTITY_REGISTRATION_DATE = Enregistr\u00e9 le
-IDENTITY_SECURITY_ANSWER = R\u00E9ponse \u00E0 votre question de s\u00E9curit\u00E9
+IDENTITY_SECURITY_ANSWER = R\u00e9ponse \u00e0 votre question de s\u00e9curit\u00e9
-IDENTITY_SECURITY_QUESTION = Question de s\u00E9curit\u00E9
+IDENTITY_SECURITY_QUESTION = Question de s\u00e9curit\u00e9
IDENTITY_SIGNATURE = Signature
-IDENTITY_SKYPE = Num\u00E9ro Skype
+IDENTITY_SKYPE = Num\u00e9ro Skype
-IDENTITY_THEME = Th\u00E8me
+IDENTITY_THEME = Th\u00e8me
IDENTITY_TIMEZONE = Fuseau horaire
@@ -253,7 +253,7 @@
IDENTITY_VALIDATION_ERROR_INVALID_EMAIL = Adresse de courriel invalide.
-IDENTITY_VALIDATION_ERROR_INVALID_PASSWORD = Mot de passe erron\u00E9.
+IDENTITY_VALIDATION_ERROR_INVALID_PASSWORD = Mot de passe erron\u00e9.
IDENTITY_VALIDATION_ERROR_PASSWORD_DOESNT_MATCH = Vos mots de passe ne correspondent pas.
@@ -262,8 +262,9 @@
IDENTITY_VALIDATION_ERROR_REGISTRATION = Erreur lors de l'enregistrement du compte.
IDENTITY_VALIDATION_ERROR_USERNAME_ERROR = Erreur lors de la validation du nom d'utilisateur.
+IDENTITY_VALIDATION_ERROR_INVALID_USERNAME=''{0}'' est un nom d'utilisateur invalide : Ne peut pas \u00eatre null, vide ou contenir '<', '>', '(', ')', '=' ou '%5c'
-IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN = Ce nom d'utilisateur est d\u00E9j\u00E0 utilis\u00E9.
+IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN = Ce nom d'utilisateur est d\u00e9j\u00e0 utilis\u00e9.
IDENTITY_VERIFICATION_LOGIN = Connexion
@@ -273,17 +274,17 @@
IDENTITY_VERIFICATION_STATUS_FAILED = Impossible de valider cette adresse de courriel.
-IDENTITY_VERIFICATION_STATUS_REGISTER_APPROVAL = Votre adresse de courriel a \u00E9t\u00E9 v\u00E9rifi\u00E9e, mais votre compte doit \u00EAtre approuv\u00E9 par un administrateur.
+IDENTITY_VERIFICATION_STATUS_REGISTER_APPROVAL = Votre adresse de courriel a \u00e9t\u00e9 v\u00e9rifi\u00e9e, mais votre compte doit \u00eatre approuv\u00e9 par un administrateur.
-IDENTITY_VERIFICATION_STATUS_REGISTER_CUSTOM = Votre compte a \u00E9t\u00E9 activ\u00E9. Vous pouvez vous connecter.
+IDENTITY_VERIFICATION_STATUS_REGISTER_CUSTOM = Votre compte a \u00e9t\u00e9 activ\u00e9. Vous pouvez vous connecter.
-IDENTITY_VERIFICATION_STATUS_REGISTER_SUCCESS = Votre compte a \u00E9t\u00E9 activ\u00E9. Vous pouvez vous connecter.
+IDENTITY_VERIFICATION_STATUS_REGISTER_SUCCESS = Votre compte a \u00e9t\u00e9 activ\u00e9. Vous pouvez vous connecter.
-IDENTITY_VERIFICATION_STATUS_VALIDATED = Adresse de courriel valid\u00E9e.
+IDENTITY_VERIFICATION_STATUS_VALIDATED = Adresse de courriel valid\u00e9e.
IDENTITY_VIEW_PROFILE_TITLE = Voir mon profil
-IDENTITY_WARNING_CONFIRM_DELETE_ROLE = Attention ! Vous allez supprimer le r\u00F4le
+IDENTITY_WARNING_CONFIRM_DELETE_ROLE = Attention ! Vous allez supprimer le r\u00f4le
IDENTITY_WARNING_CONFIRM_DELETE_USER = Attention ! Vous allez supprimer le compte
@@ -295,3 +296,9 @@
javax.portlet.title=Utilisateur
javax.faces.component.UIInput.REQUIRED=Valeur requise
+
+ROLE_TYPE=r\u00f4le
+ROLE_DISPLAY_TYPE=affichage r\u00f4le
+DUPLICATE_ERROR=Un {1} nomm\u00e9 ''{0}'' existe d\u00e9j\u00e0!
+INVALID_NAME_ERROR=''{0}'' est un nom invalide pour un {1} : Ne peut pas \u00eatre null, vide ou contenir '/', '.', '\\', '<', '>', '(', ')', '=' ou '%5c'
+INVALID_VALUE_ERROR=''{0}'' est une valeut invalide : Ne peut pas \u00eatre null, vide ou contenir '\\', '<', '>', '(', ')', '=' ou '%5c'
Modified: branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_it.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_it.properties 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_it.properties 2009-05-29 23:04:54 UTC (rev 13425)
@@ -116,7 +116,6 @@
IDENTITY_MANAGEMENT_ROLE_ASSIGNED=Ruoli assegnati
IDENTITY_MANAGEMENT_CREATE_ROLE=Crea un nuovo ruolo
IDENTITY_MANAGEMENT_EDIT_ROLE=Modifica il ruolo
-IDENTITY_MANAGEMENT_CREATE_ROLE=Crea il ruolo
IDENTITY_MANAGEMENT_DISABLE=Disabilita
IDENTITY_MANAGEMENT_DISABLE_USER_DISABLED=Utente disabilitato
IDENTITY_MANAGEMENT_ENABLE=Abilita
@@ -171,8 +170,7 @@
IDENTITY_VALIDATION_ERROR_REGISTRATION=Fallita la registrazione dell'utente.
IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN=Il nome utente esiste gi\u00e0.
IDENTITY_VALIDATION_ERROR_USERNAME_ERROR=Errore durante la validazione del nome utente.
-IDENTITY_VALIDATION_ERROR_ROLENAME_TAKEN=Il nome del ruolo esiste gi\u00e0.
-IDENTITY_VALIDATION_ERROR_ROLENAME_ERROR=Errore durante la validazione del nome del ruolo.
+IDENTITY_VALIDATION_ERROR_INVALID_USERNAME=''{0}'' non \u00e8 un nome utente valido : Non \u00f2 essere null, vuoto o contenere '<', '>', '(', ')', '=' o '%5c'
IDENTITY_VALIDATION_ERROR_PASSWORD_DOESNT_MATCH=Le passwords non coincidono.
IDENTITY_VALIDATION_ERROR_PASSWORD_ERROR=Errore durante la validazione della password.
IDENTITY_VALIDATION_ERROR_INVALID_EMAIL=Indirizzo e-mail non valido.
@@ -187,3 +185,8 @@
javax.portlet.keywords=amministrazione,utente
javax.faces.component.UIInput.REQUIRED=Il valore \u00e8 richiesto
+
+ROLE_TYPE=ruolo
+INVALID_NAME_ERROR=''{0}'' non \u00e8 un nome valido di {1} : Non \u00f2 essere null, vuoto o contenere '/', '.', '\\', '<', '>', '(', ')', '=' o '%5c'
+INVALID_VALUE_ERROR=''{0}'' non \u00e8 un nome valido : Non \u00f2 essere null, vuoto o contenere '\\', '<', '>', '(', ')', '=' o '%5c'
+DUPLICATE_ERROR=Un valore {1} con nome ''{0}'' esiste gi\u00e0!
\ No newline at end of file
Modified: branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_ja.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_ja.properties 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_ja.properties 2009-05-29 23:04:54 UTC (rev 13425)
@@ -114,7 +114,6 @@
IDENTITY_MANAGEMENT_ROLE_ASSIGNED=\u30a2\u30b5\u30a4\u30f3\u30ed\u30fc\u30eb
IDENTITY_MANAGEMENT_CREATE_ROLE=\u65b0\u3057\u3044\u30ed\u30fc\u30eb\u306e\u4f5c\u6210
IDENTITY_MANAGEMENT_EDIT_ROLE=\u30ed\u30fc\u30eb\u306e\u7de8\u96c6
-IDENTITY_MANAGEMENT_CREATE_ROLE=\u30ed\u30fc\u30eb\u306e\u4f5c\u6210
IDENTITY_MANAGEMENT_DISABLE=\u7121\u52b9
IDENTITY_MANAGEMENT_DISABLE_USER_DISABLED=\u7121\u52b9\u306b\u306a\u3063\u305f\u30e6\u30fc\u30b6
IDENTITY_MANAGEMENT_ENABLE=\u6709\u52b9
@@ -169,8 +168,6 @@
IDENTITY_VALIDATION_ERROR_REGISTRATION=\u30e6\u30fc\u30b6\u306e\u767b\u9332\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002
IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN=\u3053\u306e\u30e6\u30fc\u30b6\u540d\u306f\u65e2\u306b\u4f7f\u308f\u308c\u3066\u3044\u307e\u3059\u3002
IDENTITY_VALIDATION_ERROR_USERNAME_ERROR=\u30e6\u30fc\u30b6\u540d\u306e\u30a8\u30e9\u30fc\u3002
-IDENTITY_VALIDATION_ERROR_ROLENAME_TAKEN=\u3053\u306e\u30ed\u30fc\u30eb\u540d\u306f\u65e2\u306b\u4f7f\u308f\u308c\u3066\u3044\u307e\u3059.
-IDENTITY_VALIDATION_ERROR_ROLENAME_ERROR=\u30ed\u30fc\u30eb\u59ea\u306e\u30a8\u30e9\u30fc\u3002
IDENTITY_VALIDATION_ERROR_PASSWORD_DOESNT_MATCH=\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u4e00\u81f4\u3057\u307e\u305b\u3093\u3002
IDENTITY_VALIDATION_ERROR_PASSWORD_ERROR=\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u30a8\u30e9\u30fc\u3002
IDENTITY_VALIDATION_ERROR_INVALID_EMAIL=\u7121\u52b9\u306aE\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3067\u3059\u3002
@@ -185,3 +182,6 @@
javax.portlet.keywords=\u7ba1\u7406,\u30e6\u30fc\u30b6
javax.faces.component.UIInput.REQUIRED=\u5fc5\u9808\u5024\u3067\u3059
+
+ROLE_TYPE=\u30ed\u30fc\u30eb\u306e
+INVALID_VALUE_ERROR=''{0}'' is an invalid value: Cannot be null, empty or contain '\\', '<', '>', '(', ')', '=' or '%5c'
\ No newline at end of file
Modified: branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_pt_BR.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_pt_BR.properties 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_pt_BR.properties 2009-05-29 23:04:54 UTC (rev 13425)
@@ -21,31 +21,31 @@
# 02110-1301 USA, or see the FSF site: http://www.fsf.org. #
################################################################################
-javax.faces.validator.LengthValidator.MINIMUM= Entrada \u00E9 muito curta (m\u00EDnimo de {0} caracteres).
+javax.faces.validator.LengthValidator.MINIMUM= Entrada \u00e9 muito curta (m\u00ednimo de {0} caracteres).
-IDENTITY_APPLICATION_NOT_AVAILABLE=Porlet n\u00E3o dispon\u00EDvel. Verifique sua configura\u00E7\u00E3o e log de erro para mais informa\u00E7\u00F5es.
+IDENTITY_APPLICATION_NOT_AVAILABLE=Porlet n\u00e3o dispon\u00edvel. Verifique sua configura\u00e7\u00e3o e log de erro para mais informa\u00e7\u00f5es.
IDENTITY_WELCOME=Bem-vindo
IDENTITY_REGISTER=Registrar-se
IDENTITY_LOST_PASSWORD=Esqueceu Senha
-IDENTITY_NOT_LOGGED_IN=Voc\u00EA n\u00E3o est\u00E1 autenticado no portal.
-IDENTITY_CREATE_ACCOUNT=Voc\u00EA pode criar uma conta.
+IDENTITY_NOT_LOGGED_IN=Voc\u00ea n\u00e3o est\u00e1 autenticado no portal.
+IDENTITY_CREATE_ACCOUNT=Voc\u00ea pode criar uma conta.
IDENTITY_BUTTON_SUBMIT=Enviar
IDENTITY_BUTTON_EDIT=Editar
IDENTITY_BUTTON_CANCEL=Cancelar
-IDENTITY_REGISTER_TITLE=Informa\u00E7\u00F5es b\u00E1sicas do usu\u00E1rio
-IDENTITY_REGISTER_TITLE_CONFIRM=Confirma\u00E7\u00E3o
+IDENTITY_REGISTER_TITLE=Informa\u00e7\u00f5es b\u00e1sicas do usu\u00e1rio
+IDENTITY_REGISTER_TITLE_CONFIRM=Confirma\u00e7\u00e3o
IDENTITY_REGISTER_PASSWORD_CONFIRM=Confirme a Senha
IDENTITY_REGISTER_STATUS_TITLE=Status do registro
-IDENTITY_REGISTER_SUCCESS_TITLE=Sua conta foi criada com \u00EAxito. Voc\u00EA pode autenticar-se agora.
-IDENTITY_REGISTER_PENDING_TITLE=Um e-mail foi enviado ao seu endere\u00E7o de e-mail para confirmar o seu registro.
-IDENTITY_REGISTER_REQUIRED_INFORMATION=indica um campo obrigat\u00F3rio.
+IDENTITY_REGISTER_SUCCESS_TITLE=Sua conta foi criada com \u00eaxito. Voc\u00ea pode autenticar-se agora.
+IDENTITY_REGISTER_PENDING_TITLE=Um e-mail foi enviado ao seu endere\u00e7o de e-mail para confirmar o seu registro.
+IDENTITY_REGISTER_REQUIRED_INFORMATION=indica um campo obrigat\u00f3rio.
IDENTITY_LOST_PASSWORD_TITLE=Esqueceu seu dados de login?
-IDENTITY_LOST_PASSWORD_DESCRIPTION=Digite seu usu\u00E1rio para redefinir sua senha.
-IDENTITY_LOST_PASSWORD_ERROR=Falha na redefini\u00E7\u00E3o de senha.
-IDENTITY_LOST_PASSWORD_STATUS_SUCCESSFUL=Voc\u00EA receber\u00E1 um e-mail com sua nova senha.
+IDENTITY_LOST_PASSWORD_DESCRIPTION=Digite seu usu\u00e1rio para redefinir sua senha.
+IDENTITY_LOST_PASSWORD_ERROR=Falha na redefini\u00e7\u00e3o de senha.
+IDENTITY_LOST_PASSWORD_STATUS_SUCCESSFUL=Voc\u00ea receber\u00e1 um e-mail com sua nova senha.
IDENTITY_LOST_PASSWORD_STATUS_404=Nenhuma conta encontrada.
IDENTITY_LOST_PASSWORD_STATUS_TITLE=Esqueceu senha
@@ -53,27 +53,27 @@
IDENTITY_EDIT_PASSWORD_TITLE=Altere a sua senha
IDENTITY_EDIT_PASSWORD_CURRENT=Senha atual
IDENTITY_EDIT_CHANGE_PASSWORD=Alterar senha
-IDENTITY_EDIT_CHANGE_PASSWORD_ERROR=N\u00E3o foi poss\u00EDvel alterar a senha.
+IDENTITY_EDIT_CHANGE_PASSWORD_ERROR=N\u00e3o foi poss\u00edvel alterar a senha.
IDENTITY_EDIT_CHANGE_PASSWOR_STATUS=A senha foi atualizada.
-IDENTITY_EDIT_EMAIL_TITLE=Alterar o seu endere\u00E7o de e-mail
-IDENTITY_EDIT_EMAIL_NEW=Novo endere\u00E7o de e-mail
+IDENTITY_EDIT_EMAIL_TITLE=Alterar o seu endere\u00e7o de e-mail
+IDENTITY_EDIT_EMAIL_NEW=Novo endere\u00e7o de e-mail
IDENTITY_EDIT_CHANGE_EMAIL=Alterar e-mail
-IDENTITY_EDIT_CHANGE_EMAIL_ERROR=N\u00E3o foi poss\u00EDvel alterar o endere\u00E7o de e-mail
-IDENTITY_EDIT_CHANGE_EMAIL_STATUS_PENDING=Uma valida\u00E7\u00E3o de e-mail foi enviada ao seu endere\u00E7o.
-IDENTITY_EDIT_CHANGE_EMAIL_STATUS_CHANGED=Seu endere\u00E7o de e-mail foi alterado.
+IDENTITY_EDIT_CHANGE_EMAIL_ERROR=N\u00e3o foi poss\u00edvel alterar o endere\u00e7o de e-mail
+IDENTITY_EDIT_CHANGE_EMAIL_STATUS_PENDING=Uma valida\u00e7\u00e3o de e-mail foi enviada ao seu endere\u00e7o.
+IDENTITY_EDIT_CHANGE_EMAIL_STATUS_CHANGED=Seu endere\u00e7o de e-mail foi alterado.
IDENTITY_EDIT_PROFILE_TITLE=Editar perfil
IDENTITY_VIEW_PROFILE_TITLE=Visualizar perfil
-IDENTITY_USERNAME=Usu\u00E1rio
+IDENTITY_USERNAME=Usu\u00e1rio
IDENTITY_PASSWORD=Senha
IDENTITY_EMAIL=E-Mail
IDENTITY_GIVENNAME=Primeiro nome
-IDENTITY_FAMILYNAME=\u00DAltimo nome
+IDENTITY_FAMILYNAME=\u00daltimo nome
IDENTITY_SKYPE=Identificador Skype
IDENTITY_LOCATION=Local
-IDENTITY_OCCUPATION=Ocupa\u00E7\u00E3o
+IDENTITY_OCCUPATION=Ocupa\u00e7\u00e3o
IDENTITY_EXTRA=Adicional
IDENTITY_SIGNATURE=Assinatura
IDENTITY_INTERESTS=Interesses
@@ -83,49 +83,49 @@
IDENTITY_MSNM=Identificador MSN messenger
IDENTITY_YIM=Identificador Yahoo
IDENTITY_XMMP=Identificador Xmmp
-IDENTITY_HOMEPAGE=P\u00E1gina inicial
-IDENTITY_TIMEZONE=Fuso hor\u00E1rio
+IDENTITY_HOMEPAGE=P\u00e1gina inicial
+IDENTITY_TIMEZONE=Fuso hor\u00e1rio
IDENTITY_THEME=Tema
-IDENTITY_SECURITY_QUESTION=Pergunta de seguran\u00E7a
-IDENTITY_SECURITY_ANSWER=Resposta de seguran\u00E7a
-IDENTITY_LAST_LOGIN=\u00DAltimo acesso
+IDENTITY_SECURITY_QUESTION=Pergunta de seguran\u00e7a
+IDENTITY_SECURITY_ANSWER=Resposta de seguran\u00e7a
+IDENTITY_LAST_LOGIN=\u00daltimo acesso
IDENTITY_REIGSTRATION_DATE=Data de Registro
IDENTITY_ENABLED=Ativado
-IDENTITY_CATEGORY_GENERAL=Prefer\u00EAncias Gerais
-IDENTITY_CATEGORY_PERSONAL=Informa\u00E7\u00F5es Pessoais
-IDENTITY_CATEGORY_INSTANT=Identidades de Mensagens Instant\u00E2neas
-IDENTITY_CATEGORY_ADDITIONAL=Informa\u00E7\u00F5es Adicionais
+IDENTITY_CATEGORY_GENERAL=Prefer\u00eancias Gerais
+IDENTITY_CATEGORY_PERSONAL=Informa\u00e7\u00f5es Pessoais
+IDENTITY_CATEGORY_INSTANT=Identidades de Mensagens Instant\u00e2neas
+IDENTITY_CATEGORY_ADDITIONAL=Informa\u00e7\u00f5es Adicionais
-IDENTITY_CATEGORY_ADDITIONAL_SIGNATURE=(Assinatura de ,no m\u00E1ximo, 255 caracteres)
-IDENTITY_CATEGORY_ADDITIONAL_EXTRA=(m\u00E1ximo de 255 caracteres)
+IDENTITY_CATEGORY_ADDITIONAL_SIGNATURE=(Assinatura de ,no m\u00e1ximo, 255 caracteres)
+IDENTITY_CATEGORY_ADDITIONAL_EXTRA=(m\u00e1ximo de 255 caracteres)
-IDENTITY_MANAGEMENT_ACTION=A\u00E7\u00F5es
-IDENTITY_MANAGEMENT_ACTION_EDIT_PROFILE=Editar usu\u00E1rio
+IDENTITY_MANAGEMENT_ACTION=A\u00e7\u00f5es
+IDENTITY_MANAGEMENT_ACTION_EDIT_PROFILE=Editar usu\u00e1rio
IDENTITY_MANAGEMENT_ACTION_ROLES=Perfis
IDENTITY_MANAGEMENT_ACTION_DELETE=Excluir
-IDENTITY_MANAGEMENT_USER_MANAGEMENT=Gerenciamento de usu\u00E1rios
+IDENTITY_MANAGEMENT_USER_MANAGEMENT=Gerenciamento de usu\u00e1rios
IDENTITY_MANAGEMENT_ROLE_MANAGEMENT=Gerenciamento de perfis
-IDENTITY_MANAGEMENT_SEARCH_USER=Pesquisar usu\u00E1rios
-IDENTITY_MANAGEMENT_CREATE_USER=Criar uma nova conta de usu\u00E1rio
-IDENTITY_MANAGEMENT_CREATE_USER_CREATED=Usu\u00E1rio criado
-IDENTITY_MANAGEMENT_USER_DELETED=Usu\u00E1rio exclu\u00EDdo
+IDENTITY_MANAGEMENT_SEARCH_USER=Pesquisar usu\u00e1rios
+IDENTITY_MANAGEMENT_CREATE_USER=Criar uma nova conta de usu\u00e1rio
+IDENTITY_MANAGEMENT_CREATE_USER_CREATED=Usu\u00e1rio criado
+IDENTITY_MANAGEMENT_USER_DELETED=Usu\u00e1rio exclu\u00eddo
IDENTITY_MANAGEMENT_ROLE=Perfil
-IDENTITY_MANAGEMENT_ROLE_DISPLAY=Nome de exibi\u00E7\u00E3o
-IDENTITY_MANAGEMENT_ROLE_MEMBERS=Usu\u00E1rios
-IDENTITY_MANAGEMENT_ROLE_ASSIGNED=Perfis atribu\u00EDdos
+IDENTITY_MANAGEMENT_ROLE_DISPLAY=Nome de exibi\u00e7\u00e3o
+IDENTITY_MANAGEMENT_ROLE_MEMBERS=Usu\u00e1rios
+IDENTITY_MANAGEMENT_ROLE_ASSIGNED=Perfis atribu\u00eddos
IDENTITY_MANAGEMENT_CREATE_ROLE=Criar perfil
IDENTITY_MANAGEMENT_EDIT_ROLE=Editar perfil
IDENTITY_MANAGEMENT_DISABLE=Desabilitar
IDENTITY_MANAGEMENT_DISABLE_USER_DISABLED=Usua\u0155io desabilitado
IDENTITY_MANAGEMENT_ENABLE=Habilitar
-IDENTITY_MANAGEMENT_ENABLE_USER_ENABLED=Usu\u00E1rio habilitado
+IDENTITY_MANAGEMENT_ENABLE_USER_ENABLED=Usu\u00e1rio habilitado
IDENTITY_MANAGEMENT_RESET_PASSWORD=Redefinir senha
-IDENTITY_MANAGEMENT_RESET_PASSWORD_FOR_USER=Redefinir senha para o usu\u00E1rio
-IDENTITY_MANAGEMENT_RESET_PASSWORD_DESCRIPTION=O usu\u00E1rio receber\u00E1 uma senha aleat\u00F3ria enviada ao seu endere\u00E7o de e-mail.
+IDENTITY_MANAGEMENT_RESET_PASSWORD_FOR_USER=Redefinir senha para o usu\u00e1rio
+IDENTITY_MANAGEMENT_RESET_PASSWORD_DESCRIPTION=O usu\u00e1rio receber\u00e1 uma senha aleat\u00f3ria enviada ao seu endere\u00e7o de e-mail.
IDENTITY_MANAGEMENT_ASSIGN_ROLES=Atribuir perfis
-IDENTITY_MANAGEMENT_COUNT_PENDING_USERS=Usu\u00E1rios pendentes
-IDENTITY_MANAGEMENT_COUNT_REGISTERED_USERS=Usu\u00E1rios registrados
+IDENTITY_MANAGEMENT_COUNT_PENDING_USERS=Usu\u00e1rios pendentes
+IDENTITY_MANAGEMENT_COUNT_REGISTERED_USERS=Usu\u00e1rios registrados
IDENTITY_MANAGEMENT_APPROVE_ALL=Aprovar selecionados
IDENTITY_MANAGEMENT_REJECT_ALL=Rejeitar selecionados
IDENTITY_MANAGEMENT_SELECT_ALL=Selecionar todos
@@ -141,48 +141,52 @@
IDENTITY_MANAGEMENT_SUBSCRIPTION_MODE=Modo de assinatura
IDENTITY_MANAGEMENT_SUBSCRIPTION_ADMIN_MODE=Administrador Modo de assinatura
IDENTITY_MANAGEMENT_DESCRIPTION_SUBSCRIPTION_CUSTOM=Modo de assinatura personalizado.
-IDENTITY_MANAGEMENT_DESCRIPTION_SUBSCRIPTION_AUTOMATIC=Autom\u00E1tica - nenhuma valida\u00E7\u00E3o de e-mail, nenhuma aprova\u00E7\u00E3o do administrador.
-IDENTITY_MANAGEMENT_DESCRIPTION_SUBSCRIPTION_EMAIL=Valida\u00E7\u00E3o de e-mail, nenhuma aprova\u00E7\u00E3o do administrador.
-IDENTITY_MANAGEMENT_DESCRIPTION_SUBSCRIPTION_EMAIL_ADMIN=Valida\u00E7\u00E3o de e-mail, e aprova\u00E7\u00E3o do administrador.
+IDENTITY_MANAGEMENT_DESCRIPTION_SUBSCRIPTION_AUTOMATIC=Autom\u00e1tica - nenhuma valida\u00e7\u00e3o de e-mail, nenhuma aprova\u00e7\u00e3o do administrador.
+IDENTITY_MANAGEMENT_DESCRIPTION_SUBSCRIPTION_EMAIL=Valida\u00e7\u00e3o de e-mail, nenhuma aprova\u00e7\u00e3o do administrador.
+IDENTITY_MANAGEMENT_DESCRIPTION_SUBSCRIPTION_EMAIL_ADMIN=Valida\u00e7\u00e3o de e-mail, e aprova\u00e7\u00e3o do administrador.
-IDENTITY_REGISTER_VERIFY_CAPTCHA=Digite a imagem de seguran\u00E7a
-IDENTITY_REGISTER_TITLE_CONFIRM_DELETE=Confirma\u00E7\u00E3o\: Excluir
-IDENTITY_WARNING_CONFIRM_DELETE_USER=Aten\u00E7\u00E3o\! Deseja excluir o usu\u00E1rio
-IDENTITY_WARNING_CONFIRM_DELETE_ROLE=Aten\u00E7\u00E3o\! Deseja excluir o perfil
-IDENTITY_REGISTER_CONFIRMATIONEMAIL=Confirme a sua inscri\u00E7\u00E3o
+IDENTITY_REGISTER_VERIFY_CAPTCHA=Digite a imagem de seguran\u00e7a
+IDENTITY_REGISTER_TITLE_CONFIRM_DELETE=Confirma\u00e7\u00e3o\: Excluir
+IDENTITY_WARNING_CONFIRM_DELETE_USER=Aten\u00e7\u00e3o\! Deseja excluir o usu\u00e1rio
+IDENTITY_WARNING_CONFIRM_DELETE_ROLE=Aten\u00e7\u00e3o\! Deseja excluir o perfil
+IDENTITY_REGISTER_CONFIRMATIONEMAIL=Confirme a sua inscri\u00e7\u00e3o
IDENTITY_MAIL_SUBJECT_LOST_PASSWORD=Redefinir a sua senha
-IDENTITY_MAIL_SUBJECT_REGISTER=Confirmar inscri\u00E7\u00E3o
-IDENTITY_MAIL_SUBJECT_CHANGE_EMAIL=Confirmar endere\u00E7o de e-mail
+IDENTITY_MAIL_SUBJECT_REGISTER=Confirmar inscri\u00e7\u00e3o
+IDENTITY_MAIL_SUBJECT_CHANGE_EMAIL=Confirmar endere\u00e7o de e-mail
-IDENTITY_MANAGEMENT_ERROR_ACTION_ROLE=N\u00E3o foi poss\u00EDvel executar a a\u00E7\u00E3o nesse perfil. Por favor, verifique o arquivo de log para mais informa\u00E7\u00F5es.
-IDENTITY_MANAGEMENT_ERROR_ACTION_USER=N\u00E3o foi poss\u00EDvel executar a a\u00E7\u00E3o nesse usu\u00E1rio. Por favor, verifique o arquivo de log para mais informa\u00E7\u00F5es.
+IDENTITY_MANAGEMENT_ERROR_ACTION_ROLE=N\u00e3o foi poss\u00edvel executar a a\u00e7\u00e3o nesse perfil. Por favor, verifique o arquivo de log para mais informa\u00e7\u00f5es.
+IDENTITY_MANAGEMENT_ERROR_ACTION_USER=N\u00e3o foi poss\u00edvel executar a a\u00e7\u00e3o nesse usu\u00e1rio. Por favor, verifique o arquivo de log para mais informa\u00e7\u00f5es.
IDENTITY_VERIFICATION_RETURN=Voltar ao portal
IDENTITY_VERIFICATION_LOGIN=Entrar
-IDENTITY_VERIFICATION_STATUS_EROOR=Erro durante a valida\u00E7\u00E3o de endere\u00E7o de e-mail.
-IDENTITY_VERIFICATION_STATUS_FAILED=N\u00E3o \u00E9 poss\u00EDvel validar o endere\u00E7o de e-mail.
+IDENTITY_VERIFICATION_STATUS_EROOR=Erro durante a valida\u00e7\u00e3o de endere\u00e7o de e-mail.
+IDENTITY_VERIFICATION_STATUS_FAILED=N\u00e3o \u00e9 poss\u00edvel validar o endere\u00e7o de e-mail.
IDENTITY_VERIFICATION_STATUS_VALIDATED=E-mail validado.
-IDENTITY_VERIFICATION_STATUS_REGISTER_SUCCESS=Sua conta foi ativada. Voc\u00EA poder\u00E1 entrar agora.
-IDENTITY_VERIFICATION_STATUS_REGISTER_APPROVAL=Seu endere\u00E7o de e-mail foi validado, mas sua conta precisa ser aprovada pelo administrador.
-IDENTITY_VERIFICATION_STATUS_REGISTER_CUSTOM=Sua conta foi ativada. Voc\u00EA poder\u00E1 entrar agora.
+IDENTITY_VERIFICATION_STATUS_REGISTER_SUCCESS=Sua conta foi ativada. Voc\u00ea poder\u00e1 entrar agora.
+IDENTITY_VERIFICATION_STATUS_REGISTER_APPROVAL=Seu endere\u00e7o de e-mail foi validado, mas sua conta precisa ser aprovada pelo administrador.
+IDENTITY_VERIFICATION_STATUS_REGISTER_CUSTOM=Sua conta foi ativada. Voc\u00ea poder\u00e1 entrar agora.
-IDENTITY_VALIDATION_ERROR_REGISTRATION=Falha no registro do usu\u00E1rio.
-IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN=Esse usu\u00E1rio j\u00E1 est\u00E1 em uso.
-IDENTITY_VALIDATION_ERROR_USERNAME_ERROR=Erro ao validar o usu\u00E1rio.
-IDENTITY_VALIDATION_ERROR_ROLENAME_TAKEN=Esse perfil j\u00E1 est\u00E1 em uso.
-IDENTITY_VALIDATION_ERROR_ROLENAME_ERROR=Erro ao validar o nome do perfil.
-IDENTITY_VALIDATION_ERROR_PASSWORD_DOESNT_MATCH=As senhas n\u00E3o conferem.
-IDENTITY_VALIDATION_ERROR_PASSWORD_ERROR=Erro durante a valida\u00E7\u00E3o de senha.
-IDENTITY_VALIDATION_ERROR_INVALID_EMAIL=E-mail inv\u00E1lido.
-IDENTITY_VALIDATION_ERROR_INVALID_PASSWORD=Senha inv\u00E1lida
-IDENTITY_VALIDATION_ERROR_CAPTCHA_INCORRECT=Imagem de seguran\u00E7a inv\u00E1lida
+IDENTITY_VALIDATION_ERROR_REGISTRATION=Falha no registro do usu\u00e1rio.
+IDENTITY_VALIDATION_ERROR_USERNAME_TAKEN=Esse usu\u00e1rio j\u00e1 est\u00e1 em uso.
+IDENTITY_VALIDATION_ERROR_USERNAME_ERROR=Erro ao validar o usu\u00e1rio.
+IDENTITY_VALIDATION_ERROR_INVALID_USERNAME=''{0}'' \u00e9 um nome do usu\u00e1rio inv\u00e1lido\: n\u00e3o deve ser nulo, vazio ou conter os caracteres '<', '>', '(', ')', '=' ou '%5c'
+IDENTITY_VALIDATION_ERROR_PASSWORD_DOESNT_MATCH=As senhas n\u00e3o conferem.
+IDENTITY_VALIDATION_ERROR_PASSWORD_ERROR=Erro durante a valida\u00e7\u00e3o de senha.
+IDENTITY_VALIDATION_ERROR_INVALID_EMAIL=E-mail inv\u00e1lido.
+IDENTITY_VALIDATION_ERROR_INVALID_PASSWORD=Senha inv\u00e1lida
+IDENTITY_VALIDATION_ERROR_CAPTCHA_INCORRECT=Imagem de seguran\u00e7a inv\u00e1lida
# Example usage for dynamic values
IDENTITY_DYNAMIC_VALUE_TEST=test label
IDENTITY_DYNAMIC_VALUE_TEST2=test label2
-javax.portlet.title=Perfil do Usu\u00E1rio
+javax.portlet.title=Perfil do Usu\u00e1rio
javax.portlet.keywords=management,user
-javax.faces.component.UIInput.REQUIRED=Valor obrigat\u00F3rio
\ No newline at end of file
+javax.faces.component.UIInput.REQUIRED=Valor obrigat\u00f3rio
+
+ROLE_TYPE=perfil
+INVALID_NAME_ERROR=''{0}'' \u00e9 um nome inv\u00e1lido para {1}\: n\u00e3o deve ser nulo, vazio ou conter os caracteres '/', '.', '\\', '<', '>', '(', ')', '=' ou '%5c'
+INVALID_VALUE_ERROR=''{0}'' \u00e9 um nome inv\u00e1lido\: n\u00e3o deve ser nulo, vazio ou conter os caracteres '\\', '<', '>', '(', ')', '=' ou '%5c'
+DUPLICATE_ERROR=Um {1} denominado ''{0}'' j\u00e1 existe\!
\ No newline at end of file
Modified: branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_ru.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_ru.properties 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-sar/conf/bundles/Identity_ru.properties 2009-05-29 23:04:54 UTC (rev 13425)
@@ -114,7 +114,6 @@
IDENTITY_MANAGEMENT_ROLE_ASSIGNED=\u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u0440\u043e\u043b\u0438
IDENTITY_MANAGEMENT_CREATE_ROLE=\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0440\u043e\u043b\u044c
IDENTITY_MANAGEMENT_EDIT_ROLE=\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u043e\u043b\u044c
-IDENTITY_MANAGEMENT_CREATE_ROLE=\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0440\u043e\u043b\u044c
IDENTITY_MANAGEMENT_DISABLE=\u0417\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c
IDENTITY_MANAGEMENT_ENABLE=\u0410\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c
IDENTITY_MANAGEMENT_RESET_PASSWORD=\u0421\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c
@@ -176,3 +175,6 @@
# Example usage for dynamic values
IDENTITY_DYNAMIC_VALUE_TEST=test label
IDENTITY_DYNAMIC_VALUE_TEST2=test label2
+
+ROLE_TYPE=\u0440\u043e\u043b\u044c
+INVALID_VALUE_ERROR=''{0}'' is an invalid value: Cannot be null, empty or contain '\\', '<', '>', '(', ')', '=' or '%5c'
\ No newline at end of file
Modified: branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml 2009-05-29 23:04:54 UTC (rev 13425)
@@ -30,9 +30,9 @@
<application>
<variable-resolver>org.jboss.portal.core.identity.ui.faces.PortletVariableResolver</variable-resolver>
- <property-resolver>org.jboss.portal.core.identity.ui.faces.PortletDelegatingPropertyResolver</property-resolver>
+ <property-resolver>org.jboss.portal.core.identity.ui.faces.PortletDelegatingPropertyResolver</property-resolver>
<view-handler>
- org.jboss.portletbridge.application.PortletViewHandler
+ org.jboss.portletbridge.application.PortletViewHandler
</view-handler>
<state-manager>org.jboss.portletbridge.application.PortletStateManager</state-manager>
<locale-config>
@@ -43,459 +43,480 @@
</locale-config>
<message-bundle>conf.bundles.Identity</message-bundle>
</application>
-
- <managed-bean>
- <managed-bean-name>configurationbean</managed-bean-name>
- <managed-bean-class>org.jboss.portal.core.identity.ui.common.ConfigurationBean</managed-bean-class>
- <managed-bean-scope>application</managed-bean-scope>
- <managed-property>
- <property-name>identityUIConfigurationService</property-name>
- <value>#{applicationScope.IdentityUIConfigurationService}</value>
- </managed-property>
- </managed-bean>
- <managed-bean>
- <managed-bean-name>metadataservice</managed-bean-name>
- <managed-bean-class>org.jboss.portal.core.identity.ui.common.MetaDataServiceBean</managed-bean-class>
- <managed-bean-scope>application</managed-bean-scope>
- </managed-bean>
- <managed-bean>
- <managed-bean-name>identityrolemgr</managed-bean-name>
- <managed-bean-class>org.jboss.portal.core.identity.ui.common.IdentityRoleBean</managed-bean-class>
- <managed-bean-scope>application</managed-bean-scope>
- <managed-property>
- <property-name>roleModule</property-name>
- <value>#{applicationScope.RoleModule}</value>
- </managed-property>
- <managed-property>
- <property-name>membershipModule</property-name>
- <value>#{applicationScope.MembershipModule}</value>
- </managed-property>
- </managed-bean>
- <managed-bean>
- <managed-bean-name>identityusermgr</managed-bean-name>
- <managed-bean-class>org.jboss.portal.core.identity.ui.common.IdentityUserBean</managed-bean-class>
- <managed-bean-scope>application</managed-bean-scope>
- <managed-property>
- <property-name>userModule</property-name>
- <value>#{applicationScope.UserModule}</value>
- </managed-property>
- <managed-property>
- <property-name>userProfileModule</property-name>
- <value>#{applicationScope.UserProfileModule}</value>
- </managed-property>
- <managed-property>
- <property-name>metaDataService</property-name>
- <value>#{metadataservice}</value>
- </managed-property>
- </managed-bean>
- <managed-bean>
- <managed-bean-name>editprofilemgr</managed-bean-name>
- <managed-bean-class>org.jboss.portal.core.identity.ui.actions.EditProfileAction</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- <managed-property>
- <property-name>identityUserBean</property-name>
- <value>#{identityusermgr}</value>
- </managed-property>
- <managed-property>
- <property-name>validateEmailService</property-name>
- <value>#{applicationScope.ValidateEmailService}</value>
- </managed-property>
- </managed-bean>
- <managed-bean>
- <managed-bean-name>userregistermgr</managed-bean-name>
- <managed-bean-class>org.jboss.portal.core.identity.ui.actions.CreateUserAction</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- <managed-property>
- <property-name>identityUserBean</property-name>
- <value>#{identityusermgr}</value>
- </managed-property>
- <managed-property>
- <property-name>defaultRoles</property-name>
- <value>#{configurationbean.configuration.defaultRoles}</value>
- </managed-property>
- <managed-property>
- <property-name>registrationService</property-name>
- <value>#{applicationScope.RegistrationService}</value>
- </managed-property>
- </managed-bean>
- <managed-bean>
- <managed-bean-name>assignrolemgr</managed-bean-name>
- <managed-bean-class>org.jboss.portal.core.identity.ui.actions.AssignRoleAction</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- <managed-property>
- <property-name>identityUserBean</property-name>
- <value>#{identityusermgr}</value>
- </managed-property>
- <managed-property>
- <property-name>identityRoleBean</property-name>
- <value>#{identityrolemgr}</value>
- </managed-property>
- </managed-bean>
- <managed-bean>
- <managed-bean-name>useradministrationbean</managed-bean-name>
- <managed-bean-class>org.jboss.portal.core.identity.ui.admin.UserAdministrationBean</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- <managed-property>
- <property-name>subscriptionMode</property-name>
- <value>#{configurationbean.configuration.subscriptionMode}</value>
- </managed-property>
- <managed-property>
- <property-name>adminSubscriptionMode</property-name>
- <value>#{configurationbean.configuration.adminSubscriptionMode}</value>
- </managed-property>
- <managed-property>
- <property-name>identityUserBean</property-name>
- <value>#{identityusermgr}</value>
- </managed-property>
- <managed-property>
- <property-name>identityRoleBean</property-name>
- <value>#{identityrolemgr}</value>
- </managed-property>
- <managed-property>
- <property-name>registrationService</property-name>
- <value>#{applicationScope.RegistrationService}</value>
- </managed-property>
- </managed-bean>
- <managed-bean>
- <managed-bean-name>rolemanagementbean</managed-bean-name>
- <managed-bean-class>org.jboss.portal.core.identity.ui.admin.RoleManagementBean</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- <managed-property>
- <property-name>identityRoleBean</property-name>
- <value>#{identityrolemgr}</value>
- </managed-property>
- </managed-bean>
- <managed-bean>
- <managed-bean-name>editrolemgr</managed-bean-name>
- <managed-bean-class>org.jboss.portal.core.identity.ui.actions.EditRoleAction</managed-bean-class>
- <managed-bean-scope>session</managed-bean-scope>
- <managed-property>
- <property-name>identityRoleBean</property-name>
- <value>#{identityrolemgr}</value>
- </managed-property>
- </managed-bean>
- <managed-bean>
- <managed-bean-name>lostpasswordmgr</managed-bean-name>
- <managed-bean-class>org.jboss.portal.core.identity.ui.actions.LostPasswordAction</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- <managed-property>
- <property-name>passwordCharacters</property-name>
- <value>#{configurationbean.configuration.passwordGenerationCharacters}</value>
- </managed-property>
- <managed-property>
- <property-name>identityUserBean</property-name>
- <value>#{identityusermgr}</value>
- </managed-property>
- <managed-property>
- <property-name>identityMailService</property-name>
- <value>#{applicationScope.IdentityMailService}</value>
- </managed-property>
- </managed-bean>
- <managed-bean>
- <managed-bean-name>createrolemgr</managed-bean-name>
- <managed-bean-class>org.jboss.portal.core.identity.ui.actions.CreateRoleAction</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- <managed-property>
- <property-name>identityRoleBean</property-name>
- <value>#{identityrolemgr}</value>
- </managed-property>
- </managed-bean>
-
- <validator>
- <validator-id>EmailValidator</validator-id>
- <validator-class>org.jboss.portal.core.identity.ui.validators.EmailValidator</validator-class>
- </validator>
- <validator>
- <validator-id>UsernameValidator</validator-id>
- <validator-class>org.jboss.portal.core.identity.ui.validators.UsernameValidator</validator-class>
- </validator>
+ <!-- bean context for managed beans -->
+ <managed-bean>
+ <managed-bean-name>beanContext</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.faces.gui.JSFBeanContext</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ <managed-property>
+ <property-name>resourceName</property-name>
+ <value>conf.bundles.Identity</value>
+ </managed-property>
+ </managed-bean>
+
+ <managed-bean>
+ <managed-bean-name>configurationbean</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.core.identity.ui.common.ConfigurationBean</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ <managed-property>
+ <property-name>identityUIConfigurationService</property-name>
+ <value>#{applicationScope.IdentityUIConfigurationService}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>metadataservice</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.core.identity.ui.common.MetaDataServiceBean</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>identityrolemgr</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.core.identity.ui.common.IdentityRoleBean</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ <managed-property>
+ <property-name>roleModule</property-name>
+ <value>#{applicationScope.RoleModule}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>membershipModule</property-name>
+ <value>#{applicationScope.MembershipModule}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>identityusermgr</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.core.identity.ui.common.IdentityUserBean</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ <managed-property>
+ <property-name>userModule</property-name>
+ <value>#{applicationScope.UserModule}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>userProfileModule</property-name>
+ <value>#{applicationScope.UserProfileModule}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>metaDataService</property-name>
+ <value>#{metadataservice}</value>
+ </managed-property>
+ </managed-bean>
+
+ <managed-bean>
+ <managed-bean-name>editprofilemgr</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.core.identity.ui.actions.EditProfileAction</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>identityUserBean</property-name>
+ <value>#{identityusermgr}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>validateEmailService</property-name>
+ <value>#{applicationScope.ValidateEmailService}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>userregistermgr</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.core.identity.ui.actions.CreateUserAction</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>identityUserBean</property-name>
+ <value>#{identityusermgr}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>defaultRoles</property-name>
+ <value>#{configurationbean.configuration.defaultRoles}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>registrationService</property-name>
+ <value>#{applicationScope.RegistrationService}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>assignrolemgr</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.core.identity.ui.actions.AssignRoleAction</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>identityUserBean</property-name>
+ <value>#{identityusermgr}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>identityRoleBean</property-name>
+ <value>#{identityrolemgr}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>useradministrationbean</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.core.identity.ui.admin.UserAdministrationBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>subscriptionMode</property-name>
+ <value>#{configurationbean.configuration.subscriptionMode}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>adminSubscriptionMode</property-name>
+ <value>#{configurationbean.configuration.adminSubscriptionMode}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>identityUserBean</property-name>
+ <value>#{identityusermgr}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>identityRoleBean</property-name>
+ <value>#{identityrolemgr}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>registrationService</property-name>
+ <value>#{applicationScope.RegistrationService}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>rolemanagementbean</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.core.identity.ui.admin.RoleManagementBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>identityRoleBean</property-name>
+ <value>#{identityrolemgr}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>editrolemgr</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.core.identity.ui.actions.EditRoleAction</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>identityRoleBean</property-name>
+ <value>#{identityrolemgr}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>beanContext</property-name>
+ <property-class>org.jboss.portal.faces.gui.BeanContext</property-class>
+ <value>#{beanContext}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>lostpasswordmgr</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.core.identity.ui.actions.LostPasswordAction</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ <managed-property>
+ <property-name>passwordCharacters</property-name>
+ <value>#{configurationbean.configuration.passwordGenerationCharacters}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>identityUserBean</property-name>
+ <value>#{identityusermgr}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>identityMailService</property-name>
+ <value>#{applicationScope.IdentityMailService}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>createrolemgr</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.core.identity.ui.actions.CreateRoleAction</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ <managed-property>
+ <property-name>identityRoleBean</property-name>
+ <value>#{identityrolemgr}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>beanContext</property-name>
+ <property-class>org.jboss.portal.faces.gui.BeanContext</property-class>
+ <value>#{beanContext}</value>
+ </managed-property>
+ </managed-bean>
+
<validator>
- <validator-id>RoleValidator</validator-id>
- <validator-class>org.jboss.portal.core.identity.ui.validators.RoleValidator</validator-class>
+ <validator-id>EmailValidator</validator-id>
+ <validator-class>org.jboss.portal.core.identity.ui.validators.EmailValidator</validator-class>
</validator>
- <validator>
- <validator-id>PasswordValidator</validator-id>
- <validator-class>org.jboss.portal.core.identity.ui.validators.PasswordValidator</validator-class>
- </validator>
- <validator>
- <validator-id>CurrentPasswordValidator</validator-id>
- <validator-class>org.jboss.portal.core.identity.ui.validators.CurrentPasswordValidator</validator-class>
- </validator>
- <validator>
- <validator-id>CaptchaValidator</validator-id>
- <validator-class>org.jboss.portal.core.identity.ui.validators.CaptchaValidator</validator-class>
- </validator>
-
- <navigation-rule>
- <navigation-case>
- <from-outcome>start</from-outcome>
- <to-view-id>/jsf/index.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <navigation-case>
- <from-outcome>lostPassword</from-outcome>
- <to-view-id>/jsf/lostPassword/lost.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/lostPassword/lost.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>status</from-outcome>
- <to-view-id>/jsf/lostPassword/status.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <navigation-case>
- <from-outcome>register</from-outcome>
- <to-view-id>/jsf/register/register.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/register/register.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>register</from-outcome>
- <to-view-id>/jsf/register/confirm.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/register/confirm.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>revise</from-outcome>
- <to-view-id>/jsf/register/register.xhtml</to-view-id>
- </navigation-case>
- <navigation-case>
- <from-outcome>registered</from-outcome>
- <to-view-id>/jsf/register/success.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <navigation-case>
- <from-outcome>changePassword</from-outcome>
- <to-view-id>/jsf/profile/changePassword.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/profile/changePassword.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>status</from-outcome>
- <to-view-id>/jsf/profile/viewProfile.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <navigation-case>
- <from-outcome>changeEmail</from-outcome>
- <to-view-id>/jsf/profile/changeEmail.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/profile/changeEmail.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>status</from-outcome>
- <to-view-id>/jsf/profile/viewProfile.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/index.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>editProfile</from-outcome>
- <to-view-id>/jsf/profile/editProfileRedirect.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/profile/*</from-view-id>
- <navigation-case>
- <from-outcome>editProfile</from-outcome>
- <to-view-id>/jsf/profile/editProfileRedirect.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
-
- <navigation-rule>
- <from-view-id>/jsf/admin/*</from-view-id>
- <navigation-case>
- <from-outcome>userAdmin</from-outcome>
- <to-view-id>/jsf/admin/index.xhtml</to-view-id>
- </navigation-case>
- <navigation-case>
- <from-outcome>start</from-outcome>
- <to-view-id>/jsf/admin/index.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/*</from-view-id>
- <navigation-case>
- <from-outcome>roleAdmin</from-outcome>
- <to-view-id>/jsf/admin/roles.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/index.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>createUser</from-outcome>
- <to-view-id>/jsf/admin/user/createUser.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/*</from-view-id>
- <navigation-case>
- <from-outcome>searchUsers</from-outcome>
- <to-view-id>/jsf/admin/user/searchUsers.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/index.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>showPendingUsers</from-outcome>
- <to-view-id>/jsf/admin/user/pendingUsers.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/user/pendingUsers.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>confirmPendingAction</from-outcome>
- <to-view-id>/jsf/admin/user/confirmPendingAction.xhtml</to-view-id>
- </navigation-case>
- <navigation-case>
- <from-outcome>cancel</from-outcome>
- <to-view-id>/jsf/admin/index.xthml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/user/confirmPendingAction.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>revise</from-outcome>
- <to-view-id>/jsf/admin/user/pendingUsers.xhtml</to-view-id>
- </navigation-case>
- <navigation-case>
- <from-outcome>success</from-outcome>
- <to-view-id>/jsf/admin/index.xthml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/user/searchUsers.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>deleteUser</from-outcome>
- <to-view-id>/jsf/admin/user/deleteUser.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/editProfile.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>adminChangePassword</from-outcome>
- <to-view-id>/jsf/admin/user/changePassword.xhtml</to-view-id>
- </navigation-case>
- <navigation-case>
- <from-outcome>start</from-outcome>
- <to-view-id>/jsf/admin/user/searchUsers.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/*</from-view-id>
- <navigation-case>
- <from-outcome>start</from-outcome>
- <to-view-id>/jsf/admin/user/searchUsers.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/*</from-view-id>
- <navigation-case>
- <from-action>#{editprofilemgr.adminEditProfile}</from-action>
- <from-outcome>editProfile</from-outcome>
- <to-view-id>/jsf/admin/editProfile.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/*</from-view-id>
- <navigation-case>
- <from-action>#{assignrolemgr.assignRoles}</from-action>
- <from-outcome>assignRoles</from-outcome>
- <to-view-id>/jsf/admin/assignRoles.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/user/createUser.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>register</from-outcome>
- <to-view-id>/jsf/admin/user/registerRoles.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/user/registerRoles.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>register</from-outcome>
- <to-view-id>/jsf/admin/user/registerConfirm.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/user/registerConfirm.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>revise</from-outcome>
- <to-view-id>/jsf/admin/user/createUser.xhtml</to-view-id>
- </navigation-case>
- <navigation-case>
- <from-outcome>registered</from-outcome>
- <to-view-id>/jsf/admin/index.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/roles.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>createRole</from-outcome>
- <to-view-id>/jsf/admin/roles/createRole.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/roles.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>editRole</from-outcome>
- <to-view-id>/jsf/admin/roles/editRole.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/roles.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>viewMembers</from-outcome>
- <to-view-id>/jsf/admin/roles/roleMembers.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/roles.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>deleteRole</from-outcome>
- <to-view-id>/jsf/admin/roles/deleteRole.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/editProfile.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>resetPassword</from-outcome>
- <to-view-id>/jsf/admin/user/resetPassword.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/user/resetPassword.xhtml</from-view-id>
- <navigation-case>
- <from-action>#{lostpasswordmgr.doomed}</from-action>
- <from-outcome>status</from-outcome>
- <to-view-id>/jsf/admin/user/searchUsers.xhtml</to-view-id>
- </navigation-case>
- <navigation-case>
- <from-action>#{lostpasswordmgr.doomed}</from-action>
- <from-outcome>lostPassword</from-outcome>
- <to-view-id>/jsf/admin/editProfile.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
- <navigation-rule>
- <from-view-id>/jsf/admin/user/changePassword.xhtml</from-view-id>
- <navigation-case>
- <from-outcome>status</from-outcome>
- <to-view-id>/jsf/admin/user/searchUsers.xhtml</to-view-id>
- </navigation-case>
- <navigation-case>
- <from-outcome>searchUsers</from-outcome>
- <to-view-id>/jsf/admin/user/searchUsers.xhtml</to-view-id>
- </navigation-case>
- </navigation-rule>
-
+ <validator>
+ <validator-id>AttributeValidator</validator-id>
+ <validator-class>org.jboss.portal.core.identity.ui.validators.UserAttributeValidator</validator-class>
+ </validator>
+ <validator>
+ <validator-id>UsernameValidator</validator-id>
+ <validator-class>org.jboss.portal.core.identity.ui.validators.UsernameValidator</validator-class>
+ </validator>
+ <validator>
+ <validator-id>PasswordValidator</validator-id>
+ <validator-class>org.jboss.portal.core.identity.ui.validators.PasswordValidator</validator-class>
+ </validator>
+ <validator>
+ <validator-id>CurrentPasswordValidator</validator-id>
+ <validator-class>org.jboss.portal.core.identity.ui.validators.CurrentPasswordValidator</validator-class>
+ </validator>
+ <validator>
+ <validator-id>CaptchaValidator</validator-id>
+ <validator-class>org.jboss.portal.core.identity.ui.validators.CaptchaValidator</validator-class>
+ </validator>
+
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>start</from-outcome>
+ <to-view-id>/jsf/index.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>lostPassword</from-outcome>
+ <to-view-id>/jsf/lostPassword/lost.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/lostPassword/lost.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>status</from-outcome>
+ <to-view-id>/jsf/lostPassword/status.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>register</from-outcome>
+ <to-view-id>/jsf/register/register.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/register/register.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>register</from-outcome>
+ <to-view-id>/jsf/register/confirm.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/register/confirm.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>revise</from-outcome>
+ <to-view-id>/jsf/register/register.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>registered</from-outcome>
+ <to-view-id>/jsf/register/success.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>changePassword</from-outcome>
+ <to-view-id>/jsf/profile/changePassword.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/profile/changePassword.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>status</from-outcome>
+ <to-view-id>/jsf/profile/viewProfile.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>changeEmail</from-outcome>
+ <to-view-id>/jsf/profile/changeEmail.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/profile/changeEmail.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>status</from-outcome>
+ <to-view-id>/jsf/profile/viewProfile.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/index.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>editProfile</from-outcome>
+ <to-view-id>/jsf/profile/editProfileRedirect.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/profile/*</from-view-id>
+ <navigation-case>
+ <from-outcome>editProfile</from-outcome>
+ <to-view-id>/jsf/profile/editProfileRedirect.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+ <from-view-id>/jsf/admin/*</from-view-id>
+ <navigation-case>
+ <from-outcome>userAdmin</from-outcome>
+ <to-view-id>/jsf/admin/index.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>start</from-outcome>
+ <to-view-id>/jsf/admin/index.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/*</from-view-id>
+ <navigation-case>
+ <from-outcome>roleAdmin</from-outcome>
+ <to-view-id>/jsf/admin/roles.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/index.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>createUser</from-outcome>
+ <to-view-id>/jsf/admin/user/createUser.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/*</from-view-id>
+ <navigation-case>
+ <from-outcome>searchUsers</from-outcome>
+ <to-view-id>/jsf/admin/user/searchUsers.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/index.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>showPendingUsers</from-outcome>
+ <to-view-id>/jsf/admin/user/pendingUsers.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/user/pendingUsers.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>confirmPendingAction</from-outcome>
+ <to-view-id>/jsf/admin/user/confirmPendingAction.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>cancel</from-outcome>
+ <to-view-id>/jsf/admin/index.xthml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/user/confirmPendingAction.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>revise</from-outcome>
+ <to-view-id>/jsf/admin/user/pendingUsers.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>success</from-outcome>
+ <to-view-id>/jsf/admin/index.xthml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/user/searchUsers.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>deleteUser</from-outcome>
+ <to-view-id>/jsf/admin/user/deleteUser.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/editProfile.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>adminChangePassword</from-outcome>
+ <to-view-id>/jsf/admin/user/changePassword.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>start</from-outcome>
+ <to-view-id>/jsf/admin/user/searchUsers.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/*</from-view-id>
+ <navigation-case>
+ <from-outcome>start</from-outcome>
+ <to-view-id>/jsf/admin/user/searchUsers.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/*</from-view-id>
+ <navigation-case>
+ <from-action>#{editprofilemgr.adminEditProfile}</from-action>
+ <from-outcome>editProfile</from-outcome>
+ <to-view-id>/jsf/admin/editProfile.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/*</from-view-id>
+ <navigation-case>
+ <from-action>#{assignrolemgr.assignRoles}</from-action>
+ <from-outcome>assignRoles</from-outcome>
+ <to-view-id>/jsf/admin/assignRoles.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/user/createUser.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>register</from-outcome>
+ <to-view-id>/jsf/admin/user/registerRoles.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/user/registerRoles.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>register</from-outcome>
+ <to-view-id>/jsf/admin/user/registerConfirm.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/user/registerConfirm.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>revise</from-outcome>
+ <to-view-id>/jsf/admin/user/createUser.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>registered</from-outcome>
+ <to-view-id>/jsf/admin/index.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/roles.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>createRole</from-outcome>
+ <to-view-id>/jsf/admin/roles/createRole.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/roles.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>editRole</from-outcome>
+ <to-view-id>/jsf/admin/roles/editRole.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/roles.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>viewMembers</from-outcome>
+ <to-view-id>/jsf/admin/roles/roleMembers.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/roles.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>deleteRole</from-outcome>
+ <to-view-id>/jsf/admin/roles/deleteRole.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/editProfile.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>resetPassword</from-outcome>
+ <to-view-id>/jsf/admin/user/resetPassword.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/user/resetPassword.xhtml</from-view-id>
+ <navigation-case>
+ <from-action>#{lostpasswordmgr.doomed}</from-action>
+ <from-outcome>status</from-outcome>
+ <to-view-id>/jsf/admin/user/searchUsers.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-action>#{lostpasswordmgr.doomed}</from-action>
+ <from-outcome>lostPassword</from-outcome>
+ <to-view-id>/jsf/admin/editProfile.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/admin/user/changePassword.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>status</from-outcome>
+ <to-view-id>/jsf/admin/user/searchUsers.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>searchUsers</from-outcome>
+ <to-view-id>/jsf/admin/user/searchUsers.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
</faces-config>
Modified: branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-war/jsf/admin/roles/createRole.xhtml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-war/jsf/admin/roles/createRole.xhtml 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-war/jsf/admin/roles/createRole.xhtml 2009-05-29 23:04:54 UTC (rev 13425)
@@ -22,9 +22,7 @@
<h:form id="create-role-form">
<h:panelGrid columns="3">
<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_ROLE}"/>
- <h:inputText id="rolename" value="#{createrolemgr.uiRole.name}" required="true">
- <f:validator validatorId="RoleValidator"/>
- </h:inputText>
+ <h:inputText id="rolename" value="#{createrolemgr.uiRole.name}" required="true"/>
<h:message for="rolename" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_ROLE_DISPLAY}"/>
Modified: branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-war/jsf/admin/roles/editRole.xhtml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-war/jsf/admin/roles/editRole.xhtml 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-war/jsf/admin/roles/editRole.xhtml 2009-05-29 23:04:54 UTC (rev 13425)
@@ -18,18 +18,22 @@
<li class="pathSeparator"><h:graphicImage url="/img/pathSeparator.png" alt=">"/></li>
<li class="selected">
<h:outputText id="rolename" value="#{editrolemgr.uiRole.name}" />
- </li>
+ </li>
</ui:define>
<ui:define name="content">
<h3><h:outputText value="#{bundle.IDENTITY_MANAGEMENT_EDIT_ROLE}"/></h3>
<h:form id="edit-role-link">
- <h:panelGrid columns="2">
+ <h:panelGrid columns="3">
<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_ROLE}"/>
<h:outputText id="rolename" value="#{editrolemgr.uiRole.name}" />
-
+ <h:message for="rolename" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+
<h:outputText value="#{bundle.IDENTITY_MANAGEMENT_ROLE_DISPLAY}"/>
- <h:inputText id="display-name" value="#{editrolemgr.uiRole.displayName}"/>
+ <h:inputText id="display-name" value="#{editrolemgr.uiRole.displayName}" required="true"/>
+ <h:message for="display-name" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
</h:panelGrid>
<hr/>
<p style="text-align: right;">
Modified: branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-war/jsf/common/editProfileInfo.xhtml
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-war/jsf/common/editProfileInfo.xhtml 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-identity/src/resources/portal-identity-war/jsf/common/editProfileInfo.xhtml 2009-05-29 23:04:54 UTC (rev 13425)
@@ -5,199 +5,253 @@
xmlns:c="http://java.sun.com/jstl/core"
class="identity-ui">
- <!-- User Profile -->
- <h:panelGrid columns="2" cellpadding="3">
- <h:panelGroup/>
- <h:panelGroup>
- <ul class="topnav">
- <li id="currentTab">
- <h:outputText value="#{bundle.IDENTITY_CATEGORY_GENERAL}" />
- </li>
- </ul>
- </h:panelGroup>
-
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_TIMEZONE}"/>
- <h:outputText value=" *" rendered="#{metadataservice.timezone.required}" />
- </h:panelGroup>
- <h:selectOneMenu id="timezone" value="#{manager.uiUser.attribute.timezone}" required="#{metadataservice.timezone.required}">
- <f:selectItems value="#{metadataservice.timezone.values}" />
- </h:selectOneMenu>
- <h:panelGroup />
- <h:message for="timezone" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+<!-- User Profile -->
+<h:panelGrid columns="2" cellpadding="3">
+<h:panelGroup/>
+<h:panelGroup>
+ <ul class="topnav">
+ <li id="currentTab">
+ <h:outputText value="#{bundle.IDENTITY_CATEGORY_GENERAL}"/>
+ </li>
+ </ul>
+</h:panelGroup>
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_THEME}"/>
- <h:outputText value=" *" rendered="#{metadataservice.theme.required}" />
- </h:panelGroup>
- <h:selectOneMenu id="theme" value="#{manager.uiUser.attribute.theme}" required="#{metadataservice.theme.required}">
- <f:selectItems value="#{metadataservice.theme.values}" />
- </h:selectOneMenu>
- <h:panelGroup />
- <h:message for="theme" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_TIMEZONE}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.timezone.required}"/>
+</h:panelGroup>
+<h:selectOneMenu id="timezone" value="#{manager.uiUser.attribute.timezone}"
+ required="#{metadataservice.timezone.required}">
+ <f:selectItems value="#{metadataservice.timezone.values}"/>
+</h:selectOneMenu>
+<h:panelGroup/>
+<h:message for="timezone" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_THEME}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.theme.required}"/>
+</h:panelGroup>
+<h:selectOneMenu id="theme" value="#{manager.uiUser.attribute.theme}" required="#{metadataservice.theme.required}">
+ <f:selectItems value="#{metadataservice.theme.values}"/>
+</h:selectOneMenu>
+<h:panelGroup/>
+<h:message for="theme" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error"
+ warnClass="portlet-msg-alert"/>
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_LOCALE}"/>
- <h:outputText value=" *" rendered="#{metadataservice.locale.required}" />
- </h:panelGroup>
- <h:selectOneMenu id="locale" value="#{manager.uiUser.attribute.locale}" required="#{metadataservice.locale.required}">
- <f:selectItems value="#{metadataservice.locale.values}" />
- </h:selectOneMenu>
- <h:panelGroup />
- <h:message for="locale" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
- <h:panelGroup/>
- <h:panelGroup>
- <ul class="topnav">
- <li id="currentTab">
- <h:outputText value="#{bundle.IDENTITY_CATEGORY_PERSONAL}" />
- </li>
- </ul>
- </h:panelGroup>
-
-
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_GIVENNAME}"/>
- <h:outputText value=" *" rendered="#{metadataservice.givenname.required}" />
- </h:panelGroup>
- <h:inputText id="givenname" value="#{manager.uiUser.attribute.givenname}" required="#{metadataservice.givenname.required}"/>
- <h:panelGroup />
- <h:message for="givenname" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_LOCALE}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.locale.required}"/>
+</h:panelGroup>
+<h:selectOneMenu id="locale" value="#{manager.uiUser.attribute.locale}"
+ required="#{metadataservice.locale.required}">
+ <f:selectItems value="#{metadataservice.locale.values}"/>
+</h:selectOneMenu>
+<h:panelGroup/>
+<h:message for="locale" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error"
+ warnClass="portlet-msg-alert"/>
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_FAMILYNAME}"/>
- <h:outputText value=" *" rendered="#{metadataservice.familyname.required}" />
- </h:panelGroup>
- <h:inputText id="lastname" value="#{manager.uiUser.attribute.familyname}" required="#{metadataservice.familyname.required}"/>
- <h:panelGroup />
- <h:message for="lastname" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+<h:panelGroup/>
+<h:panelGroup>
+ <ul class="topnav">
+ <li id="currentTab">
+ <h:outputText value="#{bundle.IDENTITY_CATEGORY_PERSONAL}"/>
+ </li>
+ </ul>
+</h:panelGroup>
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_LOCATION}"/>
- <h:outputText value=" *" rendered="#{metadataservice.location.required}" />
- </h:panelGroup>
- <h:inputText id="location" value="#{manager.uiUser.attribute.location}" required="#{metadataservice.location.required}"/>
- <h:panelGroup />
- <h:message for="location" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
- <h:panelGroup/>
- <h:panelGroup>
- <ul class="topnav">
- <li id="currentTab">
- <h:outputText value="#{bundle.IDENTITY_CATEGORY_INSTANT}" />
- </li>
- </ul>
- </h:panelGroup>
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_GIVENNAME}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.givenname.required}"/>
+</h:panelGroup>
+<h:inputText id="givenname" value="#{manager.uiUser.attribute.givenname}"
+ required="#{metadataservice.givenname.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="givenname" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
-
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_SKYPE}"/>
- <h:outputText value=" *" rendered="#{metadataservice.skype.required}" />
- </h:panelGroup>
- <h:inputText id="skype" value="#{manager.uiUser.attribute.skype}" required="#{metadataservice.skype.required}"/>
- <h:panelGroup />
- <h:message for="skype" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_FAMILYNAME}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.familyname.required}"/>
+</h:panelGroup>
+<h:inputText id="familyname" value="#{manager.uiUser.attribute.familyname}"
+ required="#{metadataservice.familyname.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="familyname" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_ICQ}"/>
- <h:outputText value=" *" rendered="#{metadataservice.icq.required}" />
- </h:panelGroup>
- <h:inputText id="icq" value="#{manager.uiUser.attribute.icq}" required="#{metadataservice.icq.required}"/>
- <h:panelGroup />
- <h:message for="icq" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
-
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_AIM}"/>
- <h:outputText value=" *" rendered="#{metadataservice.aim.required}" />
- </h:panelGroup>
- <h:inputText id="aim" value="#{manager.uiUser.attribute.aim}" required="#{metadataservice.aim.required}"/>
- <h:panelGroup />
- <h:message for="aim" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
-
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_MSNM}"/>
- <h:outputText value=" *" rendered="#{metadataservice.msnm.required}" />
- </h:panelGroup>
- <h:inputText id="msnm" value="#{manager.uiUser.attribute.msnm}" required="#{metadataservice.msnm.required}"/>
- <h:panelGroup />
- <h:message for="msnm" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_LOCATION}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.location.required}"/>
+</h:panelGroup>
+<h:inputText id="location" value="#{manager.uiUser.attribute.location}" required="#{metadataservice.location.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="location" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_YIM}"/>
- <h:outputText value=" *" rendered="#{metadataservice.yim.required}" />
- </h:panelGroup>
- <h:inputText id="yim" value="#{manager.uiUser.attribute.yim}" required="#{metadataservice.yim.required}"/>
- <h:panelGroup />
- <h:message for="yim" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+<h:panelGroup/>
+<h:panelGroup>
+ <ul class="topnav">
+ <li id="currentTab">
+ <h:outputText value="#{bundle.IDENTITY_CATEGORY_INSTANT}"/>
+ </li>
+ </ul>
+</h:panelGroup>
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_XMMP}"/>
- <h:outputText value=" *" rendered="#{metadataservice.xmmp.required}" />
- </h:panelGroup>
- <h:inputText id="xmmp" value="#{manager.uiUser.attribute.xmmp}" required="#{metadataservice.xmmp.required}"/>
- <h:panelGroup />
- <h:message for="xmmp" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
- <h:panelGroup/>
- <h:panelGroup>
- <ul class="topnav">
- <li id="currentTab">
- <h:outputText value="#{bundle.IDENTITY_CATEGORY_ADDITIONAL}" />
- </li>
- </ul>
- </h:panelGroup>
-
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_HOMEPAGE}"/>
- <h:outputText value=" *" rendered="#{metadataservice.homepage.required}" />
- </h:panelGroup>
- <h:inputText id="homepage" value="#{manager.uiUser.attribute.homepage}" required="#{metadataservice.homepage.required}"/>
- <h:panelGroup />
- <h:message for="homepage" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
-
-
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_OCCUPATION}"/>
- <h:outputText value=" *" rendered="#{metadataservice.occupation.required}" />
- </h:panelGroup>
- <h:inputText id="occupation" value="#{manager.uiUser.attribute.occupation}" required="#{metadataservice.occupation.required}"/>
- <h:panelGroup />
- <h:message for="occupation" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
-
-
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_INTERESTS}"/>
- <h:outputText value=" *" rendered="#{metadataservice.interests.required}" />
- </h:panelGroup>
- <h:inputText id="interests" value="#{manager.uiUser.attribute.interests}" required="#{metadataservice.interests.required}"/>
- <h:panelGroup />
- <h:message for="interests" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
-
-
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_SIGNATURE}"/>
- <h:outputText value=" *" rendered="#{metadataservice.signature.required}" />
- </h:panelGroup>
- <h:panelGroup>
- <h:inputTextarea id="signature" value="#{manager.uiUser.attribute.signature}" cols="50" rows="5" required="#{metadataservice.signature.required}"/><br/>
- <h:outputText value="#{bundle.IDENTITY_CATEGORY_ADDITIONAL_SIGNATURE}" />
- </h:panelGroup>
- <h:panelGroup />
- <h:message for="signature" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_SKYPE}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.skype.required}"/>
+</h:panelGroup>
+<h:inputText id="skype" value="#{manager.uiUser.attribute.skype}" required="#{metadataservice.skype.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="skype" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error"
+ warnClass="portlet-msg-alert"/>
-
- <h:panelGroup>
- <h:outputText value="#{bundle.IDENTITY_EXTRA}"/>
- <h:outputText value=" *" rendered="#{metadataservice.extra.required}" />
- </h:panelGroup>
- <h:panelGroup>
- <h:inputTextarea id="extra" value="#{manager.uiUser.attribute.extra}" cols="50" rows="5" required="#{metadataservice.extra.required}"/><br/>
- <h:outputText value="#{bundle.IDENTITY_CATEGORY_ADDITIONAL_EXTRA}" />
- </h:panelGroup>
- <h:panelGroup />
- <h:message for="extra" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
-
- </h:panelGrid>
-
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_ICQ}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.icq.required}"/>
+</h:panelGroup>
+<h:inputText id="icq" value="#{manager.uiUser.attribute.icq}" required="#{metadataservice.icq.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="icq" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error"
+ warnClass="portlet-msg-alert"/>
+
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_AIM}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.aim.required}"/>
+</h:panelGroup>
+<h:inputText id="aim" value="#{manager.uiUser.attribute.aim}" required="#{metadataservice.aim.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="aim" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error"
+ warnClass="portlet-msg-alert"/>
+
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_MSNM}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.msnm.required}"/>
+</h:panelGroup>
+<h:inputText id="msnm" value="#{manager.uiUser.attribute.msnm}" required="#{metadataservice.msnm.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="msnm" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error"
+ warnClass="portlet-msg-alert"/>
+
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_YIM}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.yim.required}"/>
+</h:panelGroup>
+<h:inputText id="yim" value="#{manager.uiUser.attribute.yim}" required="#{metadataservice.yim.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="yim" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error"
+ warnClass="portlet-msg-alert"/>
+
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_XMMP}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.xmmp.required}"/>
+</h:panelGroup>
+<h:inputText id="xmmp" value="#{manager.uiUser.attribute.xmmp}" required="#{metadataservice.xmmp.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="xmmp" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error"
+ warnClass="portlet-msg-alert"/>
+
+<h:panelGroup/>
+<h:panelGroup>
+ <ul class="topnav">
+ <li id="currentTab">
+ <h:outputText value="#{bundle.IDENTITY_CATEGORY_ADDITIONAL}"/>
+ </li>
+ </ul>
+</h:panelGroup>
+
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_HOMEPAGE}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.homepage.required}"/>
+</h:panelGroup>
+<h:inputText id="homepage" value="#{manager.uiUser.attribute.homepage}"
+ required="#{metadataservice.homepage.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="homepage" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+
+
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_OCCUPATION}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.occupation.required}"/>
+</h:panelGroup>
+<h:inputText id="occupation" value="#{manager.uiUser.attribute.occupation}"
+ required="#{metadataservice.occupation.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="occupation" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+
+
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_INTERESTS}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.interests.required}"/>
+</h:panelGroup>
+<h:inputText id="interests" value="#{manager.uiUser.attribute.interests}"
+ required="#{metadataservice.interests.required}">
+ <f:validator validatorId="AttributeValidator"/>
+</h:inputText>
+<h:panelGroup/>
+<h:message for="interests" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+
+
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_SIGNATURE}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.signature.required}"/>
+</h:panelGroup>
+<h:panelGroup>
+ <h:inputTextarea id="signature" value="#{manager.uiUser.attribute.signature}" cols="50" rows="5"
+ required="#{metadataservice.signature.required}">
+ <f:validator validatorId="AttributeValidator"/>
+ </h:inputTextarea><br/>
+ <h:outputText value="#{bundle.IDENTITY_CATEGORY_ADDITIONAL_SIGNATURE}"/>
+</h:panelGroup>
+<h:panelGroup/>
+<h:message for="signature" infoClass="portlet-msg-success" errorClass="portlet-msg-error"
+ fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+
+
+<h:panelGroup>
+ <h:outputText value="#{bundle.IDENTITY_EXTRA}"/>
+ <h:outputText value=" *" rendered="#{metadataservice.extra.required}"/>
+</h:panelGroup>
+<h:panelGroup>
+ <h:inputTextarea id="extra" value="#{manager.uiUser.attribute.extra}" cols="50" rows="5"
+ required="#{metadataservice.extra.required}">
+ <f:validator validatorId="AttributeValidator"/>
+ </h:inputTextarea><br/>
+ <h:outputText value="#{bundle.IDENTITY_CATEGORY_ADDITIONAL_EXTRA}"/>
+</h:panelGroup>
+<h:panelGroup/>
+<h:message for="extra" infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error"
+ warnClass="portlet-msg-alert"/>
+
+</h:panelGrid>
+
</div>
\ No newline at end of file
Modified: branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource.properties 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource.properties 2009-05-29 23:04:54 UTC (rev 13425)
@@ -178,5 +178,5 @@
org.jboss.portal.object.name.admin.WSRP=WSRP
-INVALID_NAME_ERROR=''{0}'' is an invalid {1} name: Cannot be null, empty or contain '\\', '<', '>', '(', ')', '=' or '%5c'
+INVALID_NAME_ERROR=''{0}'' is an invalid {1} name: Cannot be null, empty or contain '/', '.', '\\', '<', '>', '(', ')', '=' or '%5c'
DUPLICATE_ERROR=A {1} named ''{0}'' already exists!
\ No newline at end of file
Modified: branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource_fr.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource_fr.properties 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource_fr.properties 2009-05-29 23:04:54 UTC (rev 13425)
@@ -147,4 +147,4 @@
consumers_table_reload=Recharger consommateurs
CONSUMER_TYPE=Consommateur
DUPLICATE_ERROR=Un {1} nomm\u00e9 ''{0}'' existe d\u00e9j\u00e0!
-INVALID_NAME_ERROR=''{0}'' est un nom invalide pour un {1} : Ne peut pas \u00eatre null, vide ou contenir '\\', '<', '>', '(', ')', '=' ou '%5c'
\ No newline at end of file
+INVALID_NAME_ERROR=''{0}'' est un nom invalide pour un {1} : Ne peut pas \u00eatre null, vide ou contenir '/', '.', '\\', '<', '>', '(', ')', '=' ou '%5c'
\ No newline at end of file
Modified: branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource_it.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource_it.properties 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource_it.properties 2009-05-29 23:04:54 UTC (rev 13425)
@@ -178,5 +178,5 @@
org.jboss.portal.object.name.admin.WSRP=WSRP
-INVALID_NAME_ERROR=''{0}'' non \u00e8 un nome valido di {1} : Non \u00f2 essere null, vuoto o contenere '\\', '<', '>', '(', ')', '=' o '%5c'
+INVALID_NAME_ERROR=''{0}'' non \u00e8 un nome valido di {1} : Non \u00f2 essere null, vuoto o contenere '/', '.', '\\', '<', '>', '(', ')', '=' o '%5c'
DUPLICATE_ERROR=Un valore {1} con nome ''{0}'' esiste gi\u00e0!
\ No newline at end of file
Modified: branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource_pt_BR.properties
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource_pt_BR.properties 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/classes/Resource_pt_BR.properties 2009-05-29 23:04:54 UTC (rev 13425)
@@ -76,7 +76,7 @@
edit_consumer_cache = Expira\u00e7\u00e3o do cache\:
edit_consumer_cache_seconds = (segundos antes de expirar)
edit_consumer_endpoint = Configura\u00e7\u00e3o do endpoint\:
-edit_consumer_endpoint_wsdl = Usar WSDL?
+edit_consumer_endpoint_wsdl = Utilizar WSDL?
edit_consumer_endpoint_sd = URL do Service Description\:
edit_consumer_endpoint_m = URL do Markup\:
edit_consumer_endpoint_r = URL do Registro\:
@@ -109,8 +109,8 @@
# Producer configuration screen
producer_config_title = Configura\u00e7\u00e3o do Produtor
-producer_config_sd_requires_reg = O acesso \u00e0 descri\u00e7\u00e3o completa do servi\u00e7o exige que os consumidores estejam registados.
-producer_config_strict = Utilize compatibilidade estrita ao WSRP.
+producer_config_sd_requires_reg = O acesso \u00e0 descri\u00e7\u00e3o completa do servi\u00e7o exige que os consumidores estejam registrados.
+producer_config_strict = Utilizar compatibilidade estrita ao WSRP.
producer_config_requires_reg = Registro obrigat\u00f3rio. Modificar essa informa\u00e7\u00e3o invalidar\u00e1 os registros dos consumidores.
producer_config_reg_policy = Nome da classe de pol\u00edtica do registro\:
producer_config_reg_prop_validator = Nome da classe de valida\u00e7\u00e3o da propriedade do registro\:
@@ -169,5 +169,5 @@
org.jboss.portal.object.name.admin.WSRP=WSRP
-INVALID_NAME_ERROR=''{0}'' \u00e9 um nome inv\u00e1lido para {1}\: n\u00e3o deve ser nulo, vazio ou conter os caracteres '\\', '<', '>', '(', ')', '=' ou '%5c'
+INVALID_NAME_ERROR=''{0}'' \u00e9 um nome inv\u00e1lido para {1}\: n\u00e3o deve ser nulo, vazio ou conter os caracteres '/', '.', '\\', '<', '>', '(', ')', '=' ou '%5c'
DUPLICATE_ERROR=Um {1} denominado ''{0}'' j\u00e1 existe\!
\ No newline at end of file
Modified: branches/Enterprise_Portal_Platform_4_3/faces/src/main/org/jboss/portal/faces/gui/BeanContext.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/faces/src/main/org/jboss/portal/faces/gui/BeanContext.java 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/faces/src/main/org/jboss/portal/faces/gui/BeanContext.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -23,11 +23,13 @@
package org.jboss.portal.faces.gui;
+import org.apache.log4j.Logger;
import org.jboss.portal.common.util.ParameterValidation;
import java.text.MessageFormat;
import java.util.Locale;
import java.util.Map;
+import java.util.MissingResourceException;
import java.util.ResourceBundle;
/**
@@ -37,13 +39,26 @@
*/
public abstract class BeanContext
{
+ protected final static Logger log = Logger.getLogger(BeanContext.class);
+
public static final String STATUS = "status";
- private static final String RESOURCE_NAME = "Resource";
+ private static final String DEFAULT_RESOURCE_NAME = "Resource";
private static final String UNEXPECTED_ERROR = "bean_support_unexpected_error";
private static final String CAUSE = "bean_support_cause";
private static final String CURRENT_PLACEHOLDER = "###";
+ private String resourceName = DEFAULT_RESOURCE_NAME;
+ public void setResourceName(String resourceName)
+ {
+ this.resourceName = resourceName;
+ }
+
+ public String getResourceName()
+ {
+ return resourceName;
+ }
+
/**
* Retrieves the value of the parameter which name is given from the JSF request.
*
@@ -65,37 +80,76 @@
protected abstract Locale getLocale();
- public void createErrorMessage(String message, Object... params)
+ public void createErrorMessage(String localizedMessageId, Object... params)
{
- createLocalizedMessage(STATUS, message, getErrorSeverity(), params);
+ createLocalizedMessage(STATUS, localizedMessageId, getErrorSeverity(), params);
}
- public void createTargetedErrorMessage(String target, String message, Object... params)
+ public void createTargetedErrorMessage(String target, String localizedMessageId, Object... params)
{
- createLocalizedMessage(target, message, getErrorSeverity(), params);
+ createLocalizedMessage(target, localizedMessageId, getErrorSeverity(), params);
}
- protected void createLocalizedMessage(String target, String message, Object severity, Object... params)
+ /**
+ * Adds a localized message using the appropriate severity to the identified target in the context. This method
+ * accepts an arbitrary number of arguments to be passed as parameters of localized strings.
+ *
+ * @param target the target in this context that will receive the new message
+ * @param localizedMessageId a resource bundle identifier identifying which the localized string to use as a message
+ * @param severity an object representing the severity of the message (typically FacesMessage.Severity)
+ * @param params additional parameters to be passed to replace tokens in localized strings
+ */
+ protected void createLocalizedMessage(String target, String localizedMessageId, Object severity, Object... params)
{
- createMessage(target, getMessageFromBundle(message, params), severity);
+ createMessage(target, getMessageFromBundle(localizedMessageId, params), severity);
}
- public String getMessageFromBundle(String message, Object... params)
+ public String getMessageFromBundle(String localizedMessageId, Object... params)
{
- return getLocalizedMessage(message, getLocale(), params);
+ return getLocalizedMessage(localizedMessageId, getLocale(), resourceName, params);
}
public static String getLocalizedMessage(String localizationKey, Locale locale, Object... params)
{
- ResourceBundle rb = ResourceBundle.getBundle(RESOURCE_NAME, locale);
- return MessageFormat.format(rb.getString(localizationKey), params);
+ return getLocalizedMessage(localizationKey, locale, DEFAULT_RESOURCE_NAME, params);
}
+ public static String getLocalizedMessage(String localizationKey, Locale locale, String resourceName, Object... params)
+ {
+ ResourceBundle rb = ResourceBundle.getBundle(resourceName, locale);
+
+ String message;
+ try
+ {
+ message = rb.getString(localizationKey);
+ }
+ catch (MissingResourceException e)
+ {
+ // if the key doesn't exist, return it instead of failing
+ log.info("Couldn't find localization message for key '" + localizationKey + "' in bundle " + resourceName
+ + " for locale " + locale.getDisplayName());
+ return localizationKey;
+ }
+
+ return MessageFormat.format(message, params);
+ }
+
public void createErrorMessageFrom(Exception e)
{
createErrorMessageFrom(STATUS, e);
}
+ /**
+ * Creates a localized error message targeting the specified object in the context and using the specified error
+ * information. This method looks for two specific resource bundle entries to localize the message, {@link
+ * #UNEXPECTED_ERROR} and {@link #CAUSE}, using the following format for the message: <code>result of {@link
+ * #getLocalizedMessageOrExceptionName(Throwable)} for the exception\n[localized value associated with {@link
+ * #CAUSE}result of {@link #getLocalizedMessageOrExceptionName(Throwable)} for the exception's cause if the cause
+ * exists]
+ *
+ * @param target the contextual object target by the message to be created
+ * @param e the exception that we want to display as an error message
+ */
public void createErrorMessageFrom(String target, Exception e)
{
Throwable cause = e.getCause();
@@ -104,6 +158,14 @@
createMessage(target, message, getErrorSeverity());
}
+ /**
+ * Retrieves a localized message associated with the specified Throwable.
+ *
+ * @param e the Throwable for which a localized message is to be retrieved
+ * @return the localized message associated with the specified Throwable if it exists or the localized value
+ * associated with the {@link #UNEXPECTED_ERROR} resource bundle entry to which is appended the Throwable
+ * class name.
+ */
private String getLocalizedMessageOrExceptionName(Throwable e)
{
String localizedMessage = e.getLocalizedMessage();
@@ -114,14 +176,14 @@
return localizedMessage;
}
- protected void createInfoMessage(String target, String message)
+ protected void createInfoMessage(String target, String localizedMessageId)
{
- createLocalizedMessage(target, message, getInfoSeverity());
+ createLocalizedMessage(target, localizedMessageId, getInfoSeverity());
}
- public void createInfoMessage(String message)
+ public void createInfoMessage(String localizedMessageId)
{
- createInfoMessage(STATUS, message);
+ createInfoMessage(STATUS, localizedMessageId);
}
/**
@@ -179,7 +241,7 @@
}
getFromSession(name, newValue.getClass(), sessionMap, "Provided object: " + newValue
- + " is not compatible with previously assigned '" + name + "' object: " + CURRENT_PLACEHOLDER);
+ + " is not compatible with previously assigned '" + name + "' object: " + CURRENT_PLACEHOLDER);
sessionMap.put(name, newValue);
return newValue;
}
@@ -197,7 +259,7 @@
public <T> T getFromSession(String name, Class<T> expectedClass)
{
return getFromSession(name, expectedClass, getSessionMap(), "Current object:" + CURRENT_PLACEHOLDER
- + " is not compatible with expected class " + expectedClass + " for '" + name + "'");
+ + " is not compatible with expected class " + expectedClass + " for '" + name + "'");
}
/**
Modified: branches/Enterprise_Portal_Platform_4_3/faces/src/main/org/jboss/portal/faces/gui/JSFBeanContext.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/faces/src/main/org/jboss/portal/faces/gui/JSFBeanContext.java 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/faces/src/main/org/jboss/portal/faces/gui/JSFBeanContext.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -23,6 +23,8 @@
package org.jboss.portal.faces.gui;
+import org.jboss.portal.common.util.ParameterValidation;
+
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.component.UIViewRoot;
@@ -39,17 +41,37 @@
{
public String getParameter(String key)
{
- Map pmap = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ return getParameter(key, FacesContext.getCurrentInstance());
+ }
+
+ public static String getParameter(String key, FacesContext facesContext)
+ {
+ Map pmap = facesContext.getExternalContext().getRequestParameterMap();
return (String)pmap.get(key);
}
public Map<String, Object> getSessionMap()
{
- return FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
+ return JSFBeanContext.getSessionMap(FacesContext.getCurrentInstance());
}
+ public static Map<String, Object> getSessionMap(FacesContext facesContext)
+ {
+ return facesContext.getExternalContext().getSessionMap();
+ }
+
protected void createMessage(String target, String message, Object severity)
{
+ outputMessage(target, message, severity);
+ }
+
+ public static void outputMessage(String target, String message, Object severity)
+ {
+ if (ParameterValidation.isNullOrEmpty(target))
+ {
+ target = STATUS;
+ }
+
FacesMessage.Severity jsfSeverity;
if (severity instanceof FacesMessage.Severity)
{
@@ -71,13 +93,23 @@
else
{
// todo: do something better here
- System.out.println("Couldn't resolve component target: " + target);
+ log.info("Couldn't resolve component target: " + target);
}
FacesMessage msg = new FacesMessage(jsfSeverity, message, message);
facesContext.addMessage(target, msg);
}
+ public static void outputLocalizedMessage(String target, String localizationKey, Object severity, String resourceName, Object... params)
+ {
+ if(severity == null)
+ {
+ severity = FacesMessage.SEVERITY_ERROR;
+ }
+
+ outputMessage(target, getLocalizedMessage(localizationKey, getRequestLocale(), resourceName, params), severity);
+ }
+
protected Object getErrorSeverity()
{
return FacesMessage.SEVERITY_ERROR;
@@ -90,6 +122,11 @@
protected Locale getLocale()
{
+ return getRequestLocale();
+ }
+
+ public static Locale getRequestLocale()
+ {
return FacesContext.getCurrentInstance().getExternalContext().getRequestLocale();
}
}
Modified: branches/Enterprise_Portal_Platform_4_3/faces/src/main/org/jboss/portal/faces/gui/ManagedBean.java
===================================================================
--- branches/Enterprise_Portal_Platform_4_3/faces/src/main/org/jboss/portal/faces/gui/ManagedBean.java 2009-05-29 19:21:35 UTC (rev 13424)
+++ branches/Enterprise_Portal_Platform_4_3/faces/src/main/org/jboss/portal/faces/gui/ManagedBean.java 2009-05-29 23:04:54 UTC (rev 13425)
@@ -26,7 +26,9 @@
import org.apache.log4j.Logger;
import org.jboss.portal.common.util.ParameterValidation;
+import java.util.regex.Pattern;
+
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
@@ -38,8 +40,31 @@
protected BeanContext beanContext;
public static final String INVALID_NAME = "INVALID_NAME_ERROR";
+ public static final String INVALID_PATH = "INVALID_PATH_ERROR";
public static final String DUPLICATE = "DUPLICATE_ERROR";
+ public static interface PropertyValidator
+ {
+ boolean checkForDuplicates();
+
+ String getObjectTypeName();
+
+ boolean isAlreadyExisting(String propertyName);
+
+ String doSimpleChecks(String name);
+
+ ParameterValidation.ValidationErrorHandler getValidationErrorHandler(String name, String targetForErrorMessage);
+
+ Pattern getValidationPattern();
+ }
+
+ private PropertyValidator validator = new DefaultPropertyValidator();
+
+ protected void setValidator(PropertyValidator validator)
+ {
+ this.validator = validator;
+ }
+
public void setBeanContext(BeanContext beanContext)
{
this.beanContext = beanContext;
@@ -47,19 +72,37 @@
public String checkNameValidity(String name, String targetForErrorMessage)
{
+ return checkNameValidity(name, targetForErrorMessage, validator);
+ }
+
+ public String checkNameValidity(String name, String targetForErrorMessage, PropertyValidator validator)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(validator, "PropertyValidator");
+
+ String objectTypeName = validator.getObjectTypeName();
if (ParameterValidation.isNullOrEmpty(name))
{
- beanContext.createTargetedErrorMessage(targetForErrorMessage, INVALID_NAME, name, getLocalizedType());
+ beanContext.createTargetedErrorMessage(targetForErrorMessage, INVALID_NAME, name, getLocalizedType(objectTypeName));
return null;
}
else
{
+ String original = name;
+ name = validator.doSimpleChecks(name);
+
+ // we got an invalid name after simple checks, fail!
+ if (name == null)
+ {
+ beanContext.createTargetedErrorMessage(targetForErrorMessage, INVALID_NAME, original, getLocalizedType(objectTypeName));
+ return null;
+ }
+
// Trim name
name = name.trim();
// "sanitize" name: if it's invalid, return null and output message
- name = ParameterValidation.sanitizeFromPatternWithHandler(name, ParameterValidation.XSS_CHECK,
- new MessageValidationHandler(null, targetForErrorMessage, name));
+ name = ParameterValidation.sanitizeFromPatternWithHandler(name, validator.getValidationPattern(),
+ validator.getValidationErrorHandler(name, targetForErrorMessage));
// we got an invalid name, fail!
if (name == null)
@@ -68,9 +111,9 @@
}
// Check for duplicate
- if (isAlreadyExisting(name))
+ if (validator.checkForDuplicates() && validator.isAlreadyExisting(name))
{
- beanContext.createTargetedErrorMessage(targetForErrorMessage, DUPLICATE, name, getLocalizedType());
+ getDuplicateErrorMessage(name, targetForErrorMessage, objectTypeName);
return null;
}
@@ -78,11 +121,16 @@
}
}
- private String getLocalizedType()
+ protected void getDuplicateErrorMessage(String name, String targetForErrorMessage, String objectTypeName)
{
- return beanContext.getMessageFromBundle(getObjectTypeName());
+ beanContext.createTargetedErrorMessage(targetForErrorMessage, DUPLICATE, name, getLocalizedType(objectTypeName));
}
+ private String getLocalizedType(String objectTypeName)
+ {
+ return beanContext.getMessageFromBundle(objectTypeName);
+ }
+
protected abstract String getObjectTypeName();
public abstract boolean isAlreadyExisting(String objectName);
@@ -128,22 +176,65 @@
}
}
- private class MessageValidationHandler extends ParameterValidation.ValidationErrorHandler
+ protected class MessageValidationHandler extends ParameterValidation.ValidationErrorHandler
{
private String targetForErrorMessage;
private String validatedName;
+ private String objectTypeName;
+ private String errorMessageKey;
- private MessageValidationHandler(String defaultValue, String targetForErrorMessage, String validatedName)
+ public MessageValidationHandler(String defaultValue, String targetForErrorMessage, String validatedName, String objectTypeName)
{
+ this(defaultValue, targetForErrorMessage, validatedName, objectTypeName, INVALID_NAME);
+ }
+
+ public MessageValidationHandler(String defaultValue, String targetForErrorMessage, String validatedName, String objectTypeName, String errorMessageKey)
+ {
super(defaultValue);
this.targetForErrorMessage = targetForErrorMessage;
this.validatedName = validatedName;
+ this.objectTypeName = objectTypeName;
+ this.errorMessageKey = errorMessageKey;
}
protected String internalValidationErrorHandling(String s)
{
- beanContext.createTargetedErrorMessage(targetForErrorMessage, INVALID_NAME, validatedName, getLocalizedType());
+ beanContext.createTargetedErrorMessage(targetForErrorMessage, errorMessageKey, validatedName, getLocalizedType(objectTypeName));
return null;
}
}
+
+ protected class DefaultPropertyValidator implements PropertyValidator
+ {
+ public boolean checkForDuplicates()
+ {
+ return true;
+ }
+
+ public String getObjectTypeName()
+ {
+ return ManagedBean.this.getObjectTypeName();
+ }
+
+ public boolean isAlreadyExisting(String propertyName)
+ {
+ return ManagedBean.this.isAlreadyExisting(propertyName);
+ }
+
+ public String doSimpleChecks(String name)
+ {
+ // if name contains . or /, it's invalid for a Portal object
+ return (name.indexOf('.') != -1 || name.indexOf('/') != -1) ? null : name;
+ }
+
+ public ParameterValidation.ValidationErrorHandler getValidationErrorHandler(String name, String targetForErrorMessage)
+ {
+ return new MessageValidationHandler(null, targetForErrorMessage, name, getObjectTypeName());
+ }
+
+ public Pattern getValidationPattern()
+ {
+ return ParameterValidation.XSS_CHECK;
+ }
+ }
}
14 years, 10 months
JBoss Portal SVN: r13424 - modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-05-29 15:21:35 -0400 (Fri, 29 May 2009)
New Revision: 13424
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/PortalContext.java
Log:
- Added version field to PortalContext.
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/PortalContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/PortalContext.java 2009-05-29 14:58:56 UTC (rev 13423)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/PortalContext.java 2009-05-29 19:21:35 UTC (rev 13424)
@@ -22,8 +22,9 @@
******************************************************************************/
package org.jboss.portal.portlet.spi;
+import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
-import org.jboss.portal.Mode;
+import org.jboss.portal.common.util.Version;
import java.util.Map;
import java.util.Set;
@@ -36,6 +37,8 @@
*/
public interface PortalContext
{
+ public static final Version VERSION = new Version("JBoss Portlet Container", 2, 0, 8, new Version.Qualifier(Version.Qualifier.Prefix.SNAPSHOT), "Community");
+
/**
* Return info about the portal.
*
14 years, 10 months
JBoss Portal SVN: r13423 - branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-05-29 10:58:56 -0400 (Fri, 29 May 2009)
New Revision: 13423
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java
Log:
[JBPORTAL-2309] - test fixes, refactoring
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java 2009-05-29 02:49:28 UTC (rev 13422)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java 2009-05-29 14:58:56 UTC (rev 13423)
@@ -12,57 +12,40 @@
import org.testng.annotations.Test;
/**
- * EndtoEndPortalAdminTestCase is responsible for end-to-end testing of portal admin. Creating of new portal, adding pages to it and setting it as a default portal
- * is the main goal of this test case.
+ * EndtoEndPortalAdminTestCase is responsible for end-to-end testing of portal
+ * admin. Creating of new portal, adding pages to it and setting it as a default
+ * portal is the main goal of this test case.
+ *
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
@Test(groups = { "end2end" }, enabled = true, description = "Creating of new portal with content.")
public class EndtoEndPortalAdminTestCase extends JBossPortalSeleniumTestCase {
-
- private static final String SUB_POR_PROPS_UPDATE = "_AdminPortletWindow:j_id108:common-manage-prop-form:update";
-
- private static final String SUB_POR_PROPERTY = "_AdminPortletWindow:j_id108:common-edit-prop-form:add-property";
-
- private static final String INP_POR_PROPERTY = "_AdminPortletWindow:j_id108:common-edit-prop-form:property";
-
- private static final String SUB_POR_LISTENER = "_AdminPortletWindow:j_id108:edit-prop-form:update";
-
- private static final String SEL_POR_LISTENER = "_AdminPortletWindow:j_id108:edit-prop-form:listener";
-
- private static final String SUB_PAL = "_AdminPortletWindow:j_id134:common-edit-page-error-form:update";
-
- private static final String SEL_PAL_PR = "_AdminPortletWindow:j_id134:common-edit-page-error-form:page-res-select";
-
- private static final String SEL_PAL_PN = "_AdminPortletWindow:j_id134:common-edit-page-error-form:page-not-found-select";
-
- private static final String SEL_PAL_PI = "_AdminPortletWindow:j_id134:common-edit-page-error-form:page-internal-select";
-
- private static final String SEL_PAL_PE = "_AdminPortletWindow:j_id134:common-edit-page-error-form:page-error-select";
-
- private static final String SEL_PAL_PC = "_AdminPortletWindow:j_id134:common-edit-page-error-form:page-control-select";
-
- private static final String SEL_PAL_PA = "_AdminPortletWindow:j_id134:common-edit-page-error-form:page-access-select";
-
- private static final String SUB_POL = "_AdminPortletWindow:j_id134:common-edit-portal-error-form:update";
-
- private static final String SEL_POL_PR = "_AdminPortletWindow:j_id134:common-edit-portal-error-form:portal-res-input";
-
- private static final String SEL_POL_PN = "_AdminPortletWindow:j_id134:common-edit-portal-error-form:portal-not-found-select";
-
- private static final String SEL_POL_PI = "_AdminPortletWindow:j_id134:common-edit-portal-error-form:portal-internal-select";
-
- private static final String SEL_POL_PE = "_AdminPortletWindow:j_id134:common-edit-portal-error-form:portal-error-select";
-
- private static final String SEL_POL_PU = "_AdminPortletWindow:j_id134:common-edit-portal-error-form:portal-unavail-select";
-
- private static final String SEL_POL_PA = "_AdminPortletWindow:j_id134:common-edit-portal-error-form:portal-access-select";
-
- /** prefix for locator properties = portal.e2e.*/
+ /** prefix for locator properties = portal.e2e. */
public static String casePfx = "portal.e2e.";
+
+ private final String SUB_POR_PROPS_UPDATE = getLoc(casePfx + "sub.por.props.update", "//input[contains(@id,'common-manage-prop-form:update')]");
+ private final String SUB_POR_PROPERTY = getLoc(casePfx + "sub.por.property", "//input[contains(@id,'common-edit-prop-form:add-property')]");
+ private final String INP_POR_PROPERTY = getLoc(casePfx + "inp.por.property", "//input[contains(@id,'common-edit-prop-form:property')]");
+ private final String SUB_POR_LISTENER = getLoc(casePfx + "sub.por.listener", "//input[contains(@id,'edit-prop-form:update')]");
+ private final String SEL_POR_LISTENER = getLoc(casePfx + "sel.por.listener", "//select[contains(@id,'edit-prop-form:listener')]");
+ private final String SUB_PAL = getLoc(casePfx + "sub.pal", "//input[contains(@id,'common-edit-page-error-form:update')]");
+ private final String INP_PAL_PR = getLoc(casePfx + "inp.pal.pr", "//input[contains(@id,'common-edit-page-error-form:page-res-select')]");
+ private final String SEL_PAL_PN = getLoc(casePfx + "sel.pal.pn", "//select[contains(@id,'common-edit-page-error-form:page-not-found-select')]");
+ private final String SEL_PAL_PI = getLoc(casePfx + "sel.pal.pi", "//select[contains(@id,'common-edit-page-error-form:page-internal-select')]");
+ private final String SEL_PAL_PE = getLoc(casePfx + "sel.pal.pe", "//select[contains(@id,'common-edit-page-error-form:page-error-select')]");
+ private final String SEL_PAL_PC = getLoc(casePfx + "sel.pal.pc", "//select[contains(@id,'common-edit-page-error-form:page-control-select')]");
+ private final String SEL_PAL_PA = getLoc(casePfx + "sel.pal.pa", "//select[contains(@id,'common-edit-page-error-form:page-access-select')]");
+ private final String SUB_POL = getLoc(casePfx + "sub.pol", "//input[contains(@id,'common-edit-portal-error-form:update')]");
+ private final String INP_POL_PR = getLoc(casePfx + "inp.pol.pr", "//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]");
+ private final String SEL_POL_PN = getLoc(casePfx + "sel.pol.pn", "//select[contains(@id,'common-edit-portal-error-form:portal-not-found-select')]");
+ private final String SEL_POL_PI = getLoc(casePfx + "sel.pol.pi", "//select[contains(@id,'common-edit-portal-error-form:portal-internal-select')]");
+ private final String SEL_POL_PE = getLoc(casePfx + "sel.pol.pe", "//select[contains(@id,'common-edit-portal-error-form:portal-error-select')]");
+ private final String SEL_POL_PU = getLoc(casePfx + "sel.pol.pu", "//select[contains(@id,'common-edit-portal-error-form:portal-unavail-select')]");
+ private final String SEL_POL_PA = getLoc(casePfx + "sel.pol.pa", "//select[contains(@id,'common-edit-portal-error-form:portal-access-select')]");
- private final String ADR_PORTAL = getLoc(casePfx + "adr.home","/portal");
- public final String SEL_PORTLET_TYPE = getLoc(casePfx + "sel.portlet.type","//select[contains(@id,'windowForm:instanceId')]");
+ private final String ADR_PORTAL = getLoc(casePfx + "adr.home", "/portal");
+ public final String SEL_PORTLET_TYPE = getLoc(casePfx + "sel.portlet.type", "//select[contains(@id,'windowForm:instanceId')]");
private final String SUB_LAYOUT_ADD_CENTER = getLoc(casePfx + "sub.layout.add.center", "//input[contains(@id,'layoutForm:a_center')]");
private final String INP_WINDOW_NAME = getLoc(casePfx + "inp.window.name", "//input[contains(@id,'windowForm:windowName')]");
private final String SUB_RENAME_PORTAL = getLoc(casePfx + "sub.rename.portal", "//input[contains(@id,'renameForm:rename')]");
@@ -99,10 +82,10 @@
private final String INP_NET_SEARCH = getLoc(casePfx + "inp.net.search", "//div[contains(@id,'directory_search_div')]/form/input[@name='query']");
private final String SUB_NET_SEARCH = getLoc(casePfx + "sub.net.search", "//div[contains(@id,'directory_search_div')]/form/input[@type='submit']");
private final String TAB_PROPERTIES = getLoc(casePfx + "tab.properties", "//table[contains(@id,'common-manage-prop-form:prop-data-table')]");
- private final String TAB_PROP_VAL = getLoc(casePfx + "tab.prop.val", "//input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:prop-value-input'')]");
+ private final String TAB_PROP_VAL = getLoc(casePfx + "tab.prop.val",
+ "//input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:prop-value-input'')]");
private final String TAB_PROP_DEL = getLoc(casePfx + "tab.prop.val", "//a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]");
-
-
+
@BeforeMethod(groups = { "log" })
protected void loginBeforeTest() {
logoutIfPossible();
@@ -115,80 +98,91 @@
final String portalName = "UseCasePortal";
final String portalManName = "UseManagePortal";
-
+
final String page1Name = "firstPage";
final String page2Name = "anotherPage";
final String page3Name = "lastPage with whitespace";
final String page4Name = "dseer";
final String page5Name = "cemese";
-
+
final String page1ManName = "firstManPage";
-
+
final String PORTLET1 = "Cart Portlet";
final String por1str = "Cart Portlet";
final String PORTLET2 = "Band Culinaria";
final String por2str = "Band Culinaria";
- final String PORTLET3 = "Cahuete.com";
- final String por3str = "Cahuete.com";
+ final String PORTLET3 = "Web Assurance";
+ final String por3str = "web-assurance.net";
final String PORTLET4 = "dir1/foo.txt";
final String por4str = "File Portlet";
final String PORTLET5 = "default/project.html";
final String por5str = "Our wiki knowledge base";
/**
- * Usecase for creating small portal with content. Portal named "UseCasePortal" is created similar way as in {@link AdminPortalTestCase#testPortalCreate()}. Then few pages are added similar way
- * as in {@link AdminPortalTestCase#testAddPage()}. A portlet is added to each page similar way as in {@link AdminPortalTestCase#testCreateWindow()}. The important information about pages and portlets are
- * listed in the table below
+ * Usecase for creating small portal with content. Portal named
+ * "UseCasePortal" is created similar way as in
+ * {@link AdminPortalTestCase#testPortalCreate()}. Then few pages are added
+ * similar way as in {@link AdminPortalTestCase#testAddPage()}. A portlet is
+ * added to each page similar way as in
+ * {@link AdminPortalTestCase#testCreateWindow()}. The important information
+ * about pages and portlets are listed in the table below
*
* <table>
- * <caption>Important information about portlets in EndtoEndPortalAdminTestCase</caption>
- * <thead>
+ * <caption>Important information about portlets in
+ * EndtoEndPortalAdminTestCase</caption> <thead>
* <tr>
* <th>page name</th>
* <th>portlet name</th>
* <th>asserted string</th>
- * <th>portlet type</th>
+ * <th>portlet type</th>
* </tr>
* </thead>
* <tr>
- * <td>firstPage</td>
- * <td>Cart Portlet</td><td>Cart Portlet</td>
+ * <td>firstPage</td>
+ * <td>Cart Portlet</td>
+ * <td>Cart Portlet</td>
* <td>portlet</td>
* </tr>
* <tr>
- * <td>anotherPage</td>
- * <td>Band Culinaria</td><td>Band Culinaria</td>
+ * <td>anotherPage</td>
+ * <td>Band Culinaria</td>
+ * <td>Band Culinaria</td>
* <td>widget/google</td>
* </tr>
* <tr>
- * <td>lastPage with whitespace</td>
- * <td>Cahuete.com</td><td>Cahuete.com</td>
+ * <td>lastPage with whitespace</td>
+ * <td>Cahuete.com</td>
+ * <td>Cahuete.com</td>
* <td>widget/netvibes</td>
* </tr>
* <tr>
- * <td>dseer</td>
- * <td>dir1/foo.txt</td><td>File Portlet</td>
+ * <td>dseer</td>
+ * <td>dir1/foo.txt</td>
+ * <td>File Portlet</td>
* <td>filesystem</td>
* </tr>
* <tr>
- * <td>cemese</td>
- * <td>default/project.html</td><td>Our wiki knowledge base</td>
+ * <td>cemese</td>
+ * <td>default/project.html</td>
+ * <td>Our wiki knowledge base</td>
* <td>cms</td>
* </tr>
* </table>
*
- * Final assertions are made by clicking on the pages listed above and asserting that each page contains the string specific for the portlet used (again listed in table).
+ * Final assertions are made by clicking on the pages listed above and
+ * asserting that each page contains the string specific for the portlet
+ * used (again listed in table).
*
*/
@Test(enabled = true, description = "Usecase for creating small portal with content.")
public void testCreatePortalUsecase() {
createPortal(portalName);
- addPage(portalName,page1Name);
- addPage(portalName,page2Name);
- addPage(portalName,page3Name);
- addPage(portalName,page4Name);
- addPage(portalName,page5Name);
+ addPage(portalName, page1Name);
+ addPage(portalName, page2Name);
+ addPage(portalName, page3Name);
+ addPage(portalName, page4Name);
+ addPage(portalName, page5Name);
addPortlet(portalName, page1Name, PORTLET1, "portlet");
addPortlet(portalName, page2Name, PORTLET2, "widget/google");
@@ -216,205 +210,185 @@
assertPageContains(page5Name, por5str);
}
-
- @Test(enabled = false, description = "Usecase for managing portals - listeners and properties.")
- public void testManagePortalUsecase() {
+
+ @Test(enabled = true, description = "Usecase for managing portals - listeners and properties.")
+ public void testManagePortalListernersUsecase() {
int r = -1;
-
- createPortal(portalManName);
- addPage(portalManName,page1ManName);
- //- Verify that you can add listener
+
+ //createPortal(portalManName);
+ // addPage(portalManName,page1ManName);
+ // - Verify that you can add listener
goToProperties();
selenium.select(SEL_POR_LISTENER, "label=test_listener");
selenium.click(SUB_POR_LISTENER);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
goToProperties();
- Assert.assertEquals(selenium.getSelectedLabel(SEL_POR_LISTENER),"test_listener","Previously selected label not being the current label.");
-
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_POR_LISTENER), "test_listener", "Previously selected label not being the current label.");
+
selenium.select(SEL_POR_LISTENER, "label=user_listener");
selenium.click(SUB_POR_LISTENER);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
goToProperties();
- Assert.assertEquals(selenium.getSelectedLabel(SEL_POR_LISTENER),"user_listener","Previously selected label not being the current label.");
-
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_POR_LISTENER), "user_listener", "Previously selected label not being the current label.");
+ }
+
+ @Test(enabled = true, description = "Usecase for managing portals - listeners and properties.")
+ public void testManagePortalPropertiesUsecase() {
+ int r = -1;
+
goToProperties();
- //- assert no property is added
- //r = countTableRows(TAB_PROPERTIES);
- //Assert.assertTrue(r==0,"Property table is not empty.");
+ // - assert no property is added
+ // r = countTableRows(TAB_PROPERTIES);
+ // Assert.assertTrue(r==0,"Property table is not empty.");
Assert.assertFalse(selenium.isElementPresent(TAB_PROPERTIES));
-
- //- add d&d prop
+
+ // - add d&d prop
selenium.type(INP_POR_PROPERTY, "dragadrop");
selenium.click(SUB_POR_PROPERTY);
selenium.waitForPageToLoad(PAGE_LOAD);
- r = findTableRow(TAB_PROPERTIES, "dragadrop", 0)-1;
- selenium.type(MessageFormat.format(TAB_PROP_VAL, r),"dragicek");
+ r = findTableRow(TAB_PROPERTIES, "dragadrop", 0) - 1;
+ selenium.type(MessageFormat.format(TAB_PROP_VAL, r), "dragicek");
selenium.click(SUB_POR_PROPS_UPDATE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
goToProperties();
- //- assert d&d is added
- r = findTableRow(TAB_PROPERTIES, "dragadrop", 0)-1;
- Assert.assertTrue(r>-1,"Previously added property drag&drop not found in the property table");
-
- //- add partial refresh prop
+ // - assert d&d is added
+ //selenium.setSpeed("5000");
+ r = findTableRow(TAB_PROPERTIES, "dragadrop", 0) - 1;
+ Assert.assertTrue(r > -1, "Previously added property drag&drop not found in the property table");
+
+ // - add partial refresh prop
selenium.type(INP_POR_PROPERTY, "partialRef");
selenium.click(SUB_POR_PROPERTY);
- selenium.waitForPageToLoad("30000");
-
- r = findTableRow(TAB_PROPERTIES, "partialRef", 0)-1;
- selenium.type(MessageFormat.format(TAB_PROP_VAL, r),"partialicek");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ r = findTableRow(TAB_PROPERTIES, "partialRef", 0) - 1;
+ selenium.type(MessageFormat.format(TAB_PROP_VAL, r), "partialicek");
selenium.click(SUB_POR_PROPS_UPDATE);
selenium.waitForPageToLoad("30000");
-
+
goToProperties();
- //- assert partial refresh is added
- r = findTableRow(TAB_PROPERTIES, "partialRef", 0)-1;
- Assert.assertTrue(r>-1,"Previously added property partial refresh not found in the property table");
-
- //- delete d&d prop
- r = findTableRow(TAB_PROPERTIES, "dragadrop", 0)-1;
+ // - assert partial refresh is added
+ r = findTableRow(TAB_PROPERTIES, "partialRef", 0) - 1;
+ Assert.assertTrue(r > -1, "Previously added property partial refresh not found in the property table");
+
+ // - delete d&d prop
+ r = findTableRow(TAB_PROPERTIES, "dragadrop", 0) - 1;
selenium.click(MessageFormat.format(TAB_PROP_DEL, r));
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
goToProperties();
- //- assert d&d is not present
- r = findTableRow(TAB_PROPERTIES, "dragadrop", 0)-1;
- Assert.assertTrue(r==-1,"Deleted property drag and drop was found in property table.");
-
- //- delete partial refresh prop
- r = findTableRow(TAB_PROPERTIES, "partialRef", 0)-1;
+ // - assert d&d is not present
+ r = findTableRow(TAB_PROPERTIES, "dragadrop", 0) - 1;
+ Assert.assertTrue(r < 0, "Deleted property drag and drop was found in property table.");
+
+ // - delete partial refresh prop
+ r = findTableRow(TAB_PROPERTIES, "partialRef", 0) - 1;
selenium.click(MessageFormat.format(TAB_PROP_DEL, r));
selenium.waitForPageToLoad(PAGE_LOAD);
goToProperties();
- //- assert partial refresh is not added
- r = findTableRow(TAB_PROPERTIES, "partialRef", 0)-1;
- Assert.assertTrue(r<0,"Deleted property partial refresh was found in property table.");
-
+ // - assert partial refresh is not added
+ Assert.assertFalse(selenium.isElementPresent(TAB_PROPERTIES));
+
}
-
+
@Test(enabled = false, description = "Usecase for managing portals - error handling.")
public void testPortalErrorHandlingUsecase() {
-
+
String LAB_RED = "Redirect to the specified resource";
String LAB_ERR = "Display the default error message";
String LAB_REM = "Remove the resource from page";
-
+
// ***
// *** Portal level
// ***
-
+
// select RED handling
goToProperties();
- selenium.select(SEL_POL_PA, "label="+LAB_RED);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SEL_POL_PU, "label="+LAB_RED);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SEL_POL_PE, "label="+LAB_RED);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SEL_POL_PI, "label="+LAB_RED);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SEL_POL_PN, "label="+LAB_RED);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(SEL_POL_PR, "/WEB-INF/jsp/error/port3al.jsp");
+ selectIfNotSelected(SEL_POL_PA, LAB_RED);
+ selectIfNotSelected(SEL_POL_PU, LAB_RED);
+ selectIfNotSelected(SEL_POL_PE, LAB_RED);
+ selectIfNotSelected(SEL_POL_PI, LAB_RED);
+ selectIfNotSelected(SEL_POL_PN, LAB_RED);
+ selenium.type(INP_POL_PR, "/WEB-INF/jsp/error/portal.jsp");
selenium.click(SUB_POL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
// assert RED handling
openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1", "ERROR");
openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1", "Powered by JBoss Portal");
-
+
// select ERR handling
goToProperties();
- selenium.select(SEL_POL_PA, "label="+LAB_ERR);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SEL_POL_PU, "label="+LAB_ERR);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SEL_POL_PE, "label="+LAB_ERR);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SEL_POL_PI, "label="+LAB_ERR);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SEL_POL_PN, "label="+LAB_ERR);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(SEL_POL_PR, "/WEB-INF/jsp/error/port3al.jsp");
+ selectIfNotSelected(SEL_POL_PA, LAB_ERR);
+ selectIfNotSelected(SEL_POL_PU, LAB_ERR);
+ selectIfNotSelected(SEL_POL_PE, LAB_ERR);
+ selectIfNotSelected(SEL_POL_PI, LAB_ERR);
+ selectIfNotSelected(SEL_POL_PN, LAB_ERR);
+ selenium.type(INP_POL_PR, "/WEB-INF/jsp/error/portal.jsp");
selenium.click(SUB_POL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
// assert ERR handling
openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1", "HTTP Status 500");
-
+
// ***
// *** Page level
// ***
-
+
// select RED handling
goToProperties();
- selenium.select(SEL_PAL_PA, "label="+LAB_RED);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SEL_PAL_PC, "label="+LAB_RED);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SEL_PAL_PE, "label="+LAB_RED);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SEL_PAL_PI, "label="+LAB_RED);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SEL_PAL_PN, "label="+LAB_RED);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(SEL_PAL_PR, "/WEB-INF/jsp/error/pa9ge.jsp");
+ selectIfNotSelected(SEL_PAL_PA, LAB_RED);
+ selectIfNotSelected(SEL_PAL_PC, LAB_RED);
+ selectIfNotSelected(SEL_PAL_PE, LAB_RED);
+ selectIfNotSelected(SEL_PAL_PI, LAB_RED);
+ selectIfNotSelected(SEL_PAL_PN, LAB_RED);
+ selenium.type(INP_PAL_PR, "/WEB-INF/jsp/error/page.jsp");
selenium.click(SUB_PAL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
// assert RED handling
openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1", "ERROR");
openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1", "Powered by JBoss Portal");
-
+
// select ERR handling
goToProperties();
- selenium.select(SEL_PAL_PA, "label="+LAB_ERR);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SEL_PAL_PC, "label="+LAB_ERR);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SEL_PAL_PE, "label="+LAB_ERR);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SEL_PAL_PI, "label="+LAB_ERR);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SEL_PAL_PN, "label="+LAB_ERR);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(SEL_PAL_PR, "/WEB-INF/jsp/error/pa9ge.jsp");
+ selectIfNotSelected(SEL_PAL_PA, LAB_ERR);
+ selectIfNotSelected(SEL_PAL_PC, LAB_ERR);
+ selectIfNotSelected(SEL_PAL_PE, LAB_ERR);
+ selectIfNotSelected(SEL_PAL_PI, LAB_ERR);
+ selectIfNotSelected(SEL_PAL_PN, LAB_ERR);
+ selenium.type(INP_PAL_PR, "/WEB-INF/jsp/error/page.jsp");
selenium.click(SUB_PAL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
// assert ERR handling
openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1", "ERROR");
openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1", "Powered by JBoss Portal");
-
+
// select REM handling
goToProperties();
- selenium.select(SEL_PAL_PA, "label="+LAB_REM);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SEL_PAL_PC, "label="+LAB_REM);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SEL_PAL_PE, "label="+LAB_REM);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SEL_PAL_PI, "label="+LAB_REM);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select(SEL_PAL_PN, "label="+LAB_REM);
- selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.type(SEL_PAL_PR, "/WEB-INF/jsp/error/pa9ge.jsp");
+ selectIfNotSelected(SEL_PAL_PA, LAB_REM);
+ selectIfNotSelected(SEL_PAL_PC, LAB_REM);
+ selectIfNotSelected(SEL_PAL_PE, LAB_REM);
+ selectIfNotSelected(SEL_PAL_PI, LAB_REM);
+ selectIfNotSelected(SEL_PAL_PN, LAB_REM);
+ selenium.type(INP_PAL_PR, "/WEB-INF/jsp/error/page.jsp");
selenium.click(SUB_PAL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
// assert REM handling
openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1", "ERROR");
openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1", "Powered by JBoss Portal");
}
-
- private void openAndAssert(String add, String ass){
+
+ private void openAndAssert(String add, String ass) {
selenium.open(add);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertTrue(selenium.isTextPresent(ass),"Text: {\"" + ass + "\"} not found on the page");
+ Assert.assertTrue(selenium.isTextPresent(ass), "Text: {\"" + ass + "\"} not found on the page");
}
private void goToProperties() {
@@ -427,7 +401,7 @@
clickIfVisible(TAB_PORTALOBJ_ID);
clickIfVisible(LNK_PORTALS_ID);
clickIfVisible(LNK_PORTAL_HOME);
-
+
selenium.click("link=Properties");
selenium.waitForPageToLoad(PAGE_LOAD);
}
@@ -435,12 +409,12 @@
private void assertPageContains(String pageName, String awaitStr) {
selenium.open(ADR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- if(selenium.isAlertPresent()){
- selenium.getAlert();
- debugPrint("[EndtoEndPortalAdminTestCase] - alert was caught");
+
+ if (selenium.isAlertPresent()) {
+ selenium.getAlert();
+ debugPrint("[EndtoEndPortalAdminTestCase] - alert was caught");
}
-
+
selenium.click("link=" + pageName);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -537,21 +511,20 @@
selenium.waitForPageToLoad(PAGE_LOAD);
} else if ("cms".equals(type)) {
String[] links = portletName.split("/");
- selenium.click("link="+links[0]);
+ selenium.click("link=" + links[0]);
selenium.waitForPageToLoad(PAGE_LOAD);
portletName = links[1];
} else if ("filesystem".equals(type)) {
String[] links = portletName.split("/");
- selenium.click("link="+links[0]);
+ selenium.click("link=" + links[0]);
selenium.waitForPageToLoad(PAGE_LOAD);
portletName = links[1];
}
-
- selenium.click("link=*" + portletName+"*");
+
+ selenium.click("link=*" + portletName + "*");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(SUB_LAYOUT_ADD_CENTER);
selenium.waitForPageToLoad(PAGE_LOAD);
-
}
14 years, 10 months
JBoss Portal SVN: r13422 - in branches/JBoss_Portal_Branch_2_7/core-cms/src: resources/portal-cms-war/WEB-INF/jsp/cms/admin and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-05-28 22:49:28 -0400 (Thu, 28 May 2009)
New Revision: 13422
Modified:
branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp
Log:
- JBEPP-86: Improved error reporting when creating a new file with invalid data.
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2009-05-28 16:43:34 UTC (rev 13421)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2009-05-29 02:49:28 UTC (rev 13422)
@@ -109,9 +109,9 @@
private static final Pattern CHECK_FOR_XSS_PATTERN = ParameterValidation.XSS_CHECK;
private static final String SLASH = "/";
- private static final String INVALID_TITLE = "Invalid title";
- private static final String INVALID_DESCRIPTION = "Invalid description";
- private static final String INVALID_LANG = "INVALID_LANG";
+ private static final String INVALID_TITLE = "__INVALID_TITLE__";
+ private static final String INVALID_DESCRIPTION = "__INVALID_DESCRIPTION__";
+ private static final String INVALID_LANG = "__INVALID_LANG__";
private static final String ERROR_MESSAGE = "error:message";
@@ -982,10 +982,9 @@
String sTitle = "";
String sLanguage = "";
List fileItems = upload.parseRequest(aReq);
- Iterator itr = fileItems.iterator();
- while (itr.hasNext())
+ for (Object fileItem : fileItems)
{
- FileItem item = (FileItem)itr.next();
+ FileItem item = (FileItem)fileItem;
// check if the current item is a form field or an uploaded file
if (!item.isFormField())
@@ -1405,9 +1404,10 @@
aRes.setRenderParameter("path", sDirectory);
//used to remember the data already submitted by the user
+ aRes.setRenderParameter(ERROR_MESSAGE, CMSAdminConstants.CMS_INVALID_PARAMETER);
aRes.setRenderParameter("error:content", aReq.getParameter("elm1"));
- aRes.setRenderParameter("error:description", sDescription);
- aRes.setRenderParameter("error:title", sTitle);
+ aRes.setRenderParameter("error:description", aReq.getParameter("description"));
+ aRes.setRenderParameter("error:title", aReq.getParameter("title"));
aRes.setRenderParameter("error:language", aReq.getParameter("language"));
return;
@@ -1506,26 +1506,15 @@
String sLanguage = aReq.getParameter("language");
// check title and description for XSS injection... If one found, re-display page with old values
- String parameter = null;
sTitle = ParameterValidation.sanitizeFromPattern(sTitle, CHECK_FOR_XSS_PATTERN, INVALID_TITLE);
boolean invalidTitle = INVALID_TITLE.equals(sTitle);
- if(invalidTitle)
- {
- parameter = "CMS_TITLE";
- }
+
sDescription = ParameterValidation.sanitizeFromPattern(sDescription, CHECK_FOR_XSS_PATTERN, INVALID_DESCRIPTION);
boolean invalidDesc = INVALID_DESCRIPTION.equals(sDescription);
- if(invalidDesc)
- {
- parameter = "CMS_DESCRIPTION";
- }
sLanguage = ParameterValidation.sanitizeFromPattern(sLanguage, CHECK_FOR_XSS_PATTERN, INVALID_LANG);
boolean invalidLang = INVALID_LANG.equals(sLanguage);
if(invalidLang)
- {
- parameter = "CMS_LANGUAGE";
- }
if (invalidTitle || invalidDesc || invalidLang)
{
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp 2009-05-28 16:43:34 UTC (rev 13421)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp 2009-05-29 02:49:28 UTC (rev 13422)
@@ -116,9 +116,7 @@
<%if(errorMessage != null){%>
<tr>
- <td colspan="2">
- <font color="red">${n:i18n("CMS_FILENAME_INVALID")}</font>
- </td>
+ <td><span style="color: red">${n:i18n("CMS_INVALID_PARAMETER")}></span></td>
</tr>
<%}%>
14 years, 10 months
JBoss Portal SVN: r13421 - branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-05-28 12:43:34 -0400 (Thu, 28 May 2009)
New Revision: 13421
Modified:
branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/
Log:
ignoring output
Property changes on: branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz
___________________________________________________________________
Name: svn:ignore
+ output
14 years, 10 months
JBoss Portal SVN: r13420 - in branches/JBoss_Portal_Branch_2_7_Security_POC: build and 23 other directories.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2009-05-28 12:26:13 -0400 (Thu, 28 May 2009)
New Revision: 13420
Added:
branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/
branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/build.bat
branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/build.sh
branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/build.xml
branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/
branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/main/
branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/main/org/
branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/main/org/jboss/
branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/main/org/jboss/portal/
branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/main/org/jboss/portal/core/
branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/main/org/jboss/portal/core/authz/
branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/main/org/jboss/portal/core/authz/PolicyContext.java
branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/main/org/jboss/portal/core/authz/PolicyService.java
branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/main/org/jboss/portal/core/authz/PolicyServiceImpl.java
branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/resources/
branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/resources/sar/
branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/resources/sar/META-INF/
branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/resources/sar/META-INF/jboss-service.xml
Modified:
branches/JBoss_Portal_Branch_2_7_Security_POC/build/build.xml
branches/JBoss_Portal_Branch_2_7_Security_POC/core-cms/build.xml
branches/JBoss_Portal_Branch_2_7_Security_POC/core-samples/build.xml
branches/JBoss_Portal_Branch_2_7_Security_POC/core/build.xml
branches/JBoss_Portal_Branch_2_7_Security_POC/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
branches/JBoss_Portal_Branch_2_7_Security_POC/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java
branches/JBoss_Portal_Branch_2_7_Security_POC/core/src/main/org/jboss/portal/core/model/portal/command/PortalObjectCommand.java
branches/JBoss_Portal_Branch_2_7_Security_POC/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java
branches/JBoss_Portal_Branch_2_7_Security_POC/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
branches/JBoss_Portal_Branch_2_7_Security_POC/security/build.xml
branches/JBoss_Portal_Branch_2_7_Security_POC/security/src/main/org/jboss/portal/security/impl/jacc/JACCPortalAuthorizationManager.java
branches/JBoss_Portal_Branch_2_7_Security_POC/security/src/main/org/jboss/portal/security/impl/jacc/JACCPortalAuthorizationManagerFactory.java
branches/JBoss_Portal_Branch_2_7_Security_POC/security/src/main/org/jboss/portal/security/spi/auth/PortalAuthorizationManager.java
branches/JBoss_Portal_Branch_2_7_Security_POC/tools/etc/buildfragments/modules.ent
Log:
first successful pass at integrating the core-authz module
Modified: branches/JBoss_Portal_Branch_2_7_Security_POC/build/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/build/build.xml 2009-05-28 15:27:04 UTC (rev 13419)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/build/build.xml 2009-05-28 16:26:13 UTC (rev 13420)
@@ -152,16 +152,17 @@
<module name="registration"/>
<module name="workflow"/>
<module name="widget"/>
+ <module name="core-authz"/>
<!-- Module groups -->
<group name="portal">
<include
- modules="api, jems, server, security, search, portlet-server, faces, theme, workflow, registration, core, wsrp, core-admin, core-identity, core-cms, core-samples, widget"/>
+ modules="api, jems, server, core-authz, security, search, portlet-server, faces, theme, workflow, registration, core, wsrp, core-admin, core-identity, core-cms, core-samples, widget"/>
</group>
<group name="security">
- <include modules="jems, security"/>
+ <include modules="jems, core-authz, security"/>
</group>
<group name="default">
@@ -169,7 +170,7 @@
</group>
<group name="core">
- <include modules="api, jems, server, security, portlet-server, theme, registration, core"/>
+ <include modules="api, jems, server, core-authz, security, portlet-server, theme, registration, core"/>
</group>
</moduleconfig>
Modified: branches/JBoss_Portal_Branch_2_7_Security_POC/core/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/core/build.xml 2009-05-28 15:27:04 UTC (rev 13419)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/core/build.xml 2009-05-28 16:26:13 UTC (rev 13420)
@@ -135,6 +135,7 @@
<path refid="jboss.portal-api.classpath"/>
<path refid="jboss.portal-theme.classpath"/>
<path refid="jboss.portal-security.classpath"/>
+ <path refid="jboss.portal-core-authz.classpath"/>
</path>
<!--+=======================================+-->
Modified: branches/JBoss_Portal_Branch_2_7_Security_POC/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2009-05-28 15:27:04 UTC (rev 13419)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2009-05-28 16:26:13 UTC (rev 13420)
@@ -63,6 +63,7 @@
import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
import org.jboss.portal.theme.impl.render.dynamic.DynaRenderOptions;
+import org.jboss.portal.core.authz.PolicyContext;
import org.w3c.dom.Element;
import javax.portlet.MimeResponse;
@@ -280,10 +281,15 @@
supportedModes.remove(Mode.EDIT);
}
- //
+ //TODO: remove this security code eventually
InstancePermission perm = new InstancePermission(instance.getId(), InstancePermission.ADMIN_ACTION);
PortalAuthorizationManager pam = pamf.getManager();
boolean authorized = pam.checkPermission(perm);
+
+ //TODO: populate the PolicyContext with contextual data upon which security rules can be applied by the security engine
+ //boolean authorized = this.pamf.getManager().checkPermission(new PolicyContext());
+
+
if (!authorized)
{
// Remove the modes that we know only admin are authorized to use
Modified: branches/JBoss_Portal_Branch_2_7_Security_POC/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java 2009-05-28 15:27:04 UTC (rev 13419)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java 2009-05-28 16:26:13 UTC (rev 13420)
@@ -34,6 +34,8 @@
import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
+import org.jboss.portal.core.authz.PolicyContext;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
@@ -49,7 +51,8 @@
/** . */
private PortalAuthorizationManagerFactory pamf;
-
+
+
public PortalAuthorizationManagerFactory getPortalAuthorizationManagerFactory()
{
return pamf;
@@ -59,27 +62,30 @@
{
this.pamf = portalAuthorizationManagerFactory;
}
-
+
+
public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
{
try
- {
- // Compute the security mask
+ {
+ //TODO: remove this security code eventually
+ // Compute the security mask
int mask = InstancePermission.VIEW_MASK;
Mode mode = invocation.getMode();
if (Mode.ADMIN.equals(mode))
{
mask |= InstancePermission.ADMIN_MASK;
}
-
- //
String instanceid = (String)invocation.getAttribute(Instance.INSTANCE_ID_ATTRIBUTE);
PortalAuthorizationManager pam = pamf.getManager();
InstancePermission perm = new InstancePermission(instanceid, mask);
boolean authorized = pam.checkPermission(perm);
+
+ //TODO: populate this PolicyContext with contextual data upon which the security rules will be applied
+ //by the security engine
+ //String instanceid = (String)invocation.getAttribute(Instance.INSTANCE_ID_ATTRIBUTE);
+ //boolean authorized = pamf.getManager().checkPermission(new PolicyContext());
- //
- //
if (trace)
{
log.trace("Access granted=" + authorized + " for instance " + instanceid);
Modified: branches/JBoss_Portal_Branch_2_7_Security_POC/core/src/main/org/jboss/portal/core/model/portal/command/PortalObjectCommand.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/core/src/main/org/jboss/portal/core/model/portal/command/PortalObjectCommand.java 2009-05-28 15:27:04 UTC (rev 13419)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/core/src/main/org/jboss/portal/core/model/portal/command/PortalObjectCommand.java 2009-05-28 16:26:13 UTC (rev 13420)
@@ -30,6 +30,7 @@
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.PortalObjectPermission;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
+import org.jboss.portal.core.authz.PolicyContext;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -83,6 +84,7 @@
*/
public void enforceSecurity(PortalAuthorizationManager pam) throws SecurityException
{
+ //TODO: remove this security code eventually
PortalObject target = getTarget();
PortalObjectId id = target.getId();
PortalObjectPermission perm = new PortalObjectPermission(id, PortalObjectPermission.VIEW_MASK);
@@ -90,6 +92,9 @@
{
throw new AccessDeniedException(id.toString(), "View permission not granted");
}
+
+ //TODO: populate the PolicyContext with contextual data upon which security rules can be applied by the security engine
+ //boolean authorized = pam.checkPermission(new PolicyContext());
}
/**
Modified: branches/JBoss_Portal_Branch_2_7_Security_POC/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java 2009-05-28 15:27:04 UTC (rev 13419)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java 2009-05-28 16:26:13 UTC (rev 13420)
@@ -43,6 +43,7 @@
import org.jboss.portal.core.theme.PageRendition;
import org.jboss.portal.core.theme.WindowContextFactory;
import org.jboss.portal.core.aspects.server.UserInterceptor;
+import org.jboss.portal.core.authz.PolicyContext;
import org.jboss.portal.identity.User;
import org.jboss.portal.identity.UserProfileModule;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
@@ -123,9 +124,13 @@
//
super.enforceSecurity(pam);
+ //TODO: remove this security code eventually
// Check if the user can personalize the page
PortalObjectPermission perm = new PortalObjectPermission(page.getId(), PortalObjectPermission.PERSONALIZE_MASK);
- personalizable = pam.checkPermission(perm);
+ personalizable = pam.checkPermission(perm);
+
+ //TODO: populate the PolicyContext with contextual data upon which security rules can be applied by the security engine
+ //boolean authorized = pam.checkPermission(new PolicyContext());
}
/**
Modified: branches/JBoss_Portal_Branch_2_7_Security_POC/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2009-05-28 15:27:04 UTC (rev 13419)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2009-05-28 16:26:13 UTC (rev 13420)
@@ -64,6 +64,9 @@
<depends optional-attribute-name="AuthorizationDomainRegistry" proxy-type="attribute">
portal:service=AuthorizationDomainRegistry
</depends>
+ <depends optional-attribute-name="PolicyService" proxy-type="attribute">
+ portal.authorization:service=Policy
+ </depends>
</mbean>
<mbean code="org.jboss.portal.portlet.impl.security.JBossPortletSecurityService"
name="portal:service=PortletSecurityService" xmbean-dd=""
Added: branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/build.bat
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/build.bat (rev 0)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/build.bat 2009-05-28 16:26:13 UTC (rev 13420)
@@ -0,0 +1,54 @@
+@echo off
+rem
+rem Invokes a script of the same name in the 'tools' module.
+rem
+rem The 'tools' module is expected to be a peer directory of the directory
+rem in which this script lives.
+rem
+rem @author Jason Dillon <jason(a)planet57.com>
+rem
+
+rem $Id: build.bat 8784 2007-10-27 23:01:46Z chris.laprun(a)jboss.com $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+set MODULE_ROOT=%DIRNAME%
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..\tools
+set TARGET=%TOOLS_ROOT%\bin\build.bat
+set ARGS=%*
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug TARGET=%TARGET%
+
+if exist %TARGET% call :call-script & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target executable does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%: %TARGET%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools' module
+echo %PROGNAME%: and make sure it is up to date.
+goto :EOF
+
+:call-script
+call :debug Executing %TARGET% %ARGS%
+call %TARGET% %ARGS%
+goto :EOF
Property changes on: branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/build.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/build.sh
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/build.sh (rev 0)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/build.sh 2009-05-28 16:26:13 UTC (rev 13420)
@@ -0,0 +1,49 @@
+#!/bin/sh
+##
+## Invokes a script of the same name in the 'tools' module.
+##
+## The 'tools' module is expected to be a peer directory of the directory
+## in which this script lives.
+##
+## @author Jason Dillon <jason(a)planet57.com>
+##
+
+# $Id: build.sh 8784 2007-10-27 23:01:46Z chris.laprun(a)jboss.com $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+
+# Buss it yo
+main() {
+ if [ "x$TOOLS_ROOT" = "x" ]; then
+ TOOLS_ROOT=`cd $DIRNAME/../tools && pwd`
+ fi
+
+ MODULE_ROOT=`cd $DIRNAME; pwd`
+ export TOOLS_ROOT MODULE_ROOT DEBUG TRACE
+
+ # Where is the target script?
+ target="$TOOLS_ROOT/bin/$PROGNAME"
+ if [ ! -f "$target" ]; then
+ echo "${PROGNAME}: *ERROR* The target executable does not exist:"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: $target"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: Please make sure you have checked out the 'tools' module"
+ echo "${PROGNAME}: and make sure it is up to date."
+ exit 2
+ fi
+
+ # Get busy yo!
+ if [ "x$DEBUG" != "x" ]; then
+ echo "${PROGNAME}: Executing: /bin/sh $target $@"
+ fi
+ if [ "x$TRACE" = "x" ]; then
+ exec /bin/sh $target "$@"
+ else
+ exec /bin/sh -x $target "$@"
+ fi
+}
+
+# Lets get ready to rumble!
+main "$@"
Property changes on: branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/build.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/build.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/build.xml 2009-05-28 16:26:13 UTC (rev 13420)
@@ -0,0 +1,237 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, Red Hat Middleware, LLC, and individual
+ ~ contributors as indicated by the @authors tag. See the
+ ~ copyright.txt in the distribution for a full listing of
+ ~ individual contributors.
+ ~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE project [
+ <!ENTITY libraries SYSTEM "../thirdparty/libraries.ent">
+ <!ENTITY buildmagic SYSTEM "../tools/etc/buildfragments/buildmagic.ent">
+ <!ENTITY tools SYSTEM "../tools/etc/buildfragments/tools.ent">
+ <!ENTITY modules SYSTEM "../tools/etc/buildfragments/modules.ent">
+ <!ENTITY defaults SYSTEM "../tools/etc/buildfragments/defaults.ent">
+ <!ENTITY targets SYSTEM "../tools/etc/buildfragments/targets.ent">
+ ]>
+
+<!-- $Id: build.xml 12755 2009-01-31 19:49:19Z chris.laprun(a)jboss.com $ -->
+
+<!--+======================================================================+-->
+<!--| JBoss Portal (The OpenSource Portal) Build File |-->
+<!--| |-->
+<!--| Distributable under LGPL license. |-->
+<!--| See terms of license at http://www.gnu.org. |-->
+<!--| |-->
+<!--| This file has been designed to work with the 'tools' module and |-->
+<!--| Buildmagic extentions. |-->
+<!--+======================================================================+-->
+
+<project default="main" name="JBoss Portal">
+
+ <!--+====================================================================+-->
+ <!--| Setup |-->
+ <!--| |-->
+ <!--| Include the common build elements. |-->
+ <!--| |-->
+ <!--| This defines several different targets, properties and paths. |-->
+ <!--| It also sets up the basic extention tasks amoung other things. |-->
+ <!--+====================================================================+-->
+
+ &buildmagic;
+ &modules;
+ &defaults;
+ &tools;
+ &targets;
+
+ <!-- ================================================================== -->
+ <!-- Initialization -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Initialize the build system. Must depend on '_buildmagic:init'.
+ | Other targets should depend on 'init' or things will mysteriously fail.
+ -->
+
+ <target name="init" unless="init.disable" depends="_buildmagic:init">
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Configuration |-->
+ <!--| |-->
+ <!--| This target is invoked by the Buildmagic initialization logic |-->
+ <!--| and should contain module specific configuration elements. |-->
+ <!--+====================================================================+-->
+
+ <target name="configure" unless="configure.disable">
+
+ <!-- Configure some properties -->
+ <property name="jboss-junit-configuration" value=""/>
+ <property name="junit.formatter.usefile" value="true"/>
+
+ <!-- Configure thirdparty libraries -->
+ &libraries;
+ <path id="library.classpath">
+ <path refid="jbossas/core.libs.classpath"/>
+ <path refid="apache.log4j.classpath"/>
+ <path refid="jboss.portal/modules/portlet.classpath"/>
+ <!--
+ <path refid="jboss.portal/modules/common.classpath"/>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="jbossas/core.libs.classpath"/>
+ <path refid="junit.junit.classpath"/>
+ <path refid="apache.log4j.classpath"/>
+ <path refid="dom4j.dom4j.classpath"/>
+ -->
+ </path>
+
+ <!-- Configure modules -->
+ <call target="configure-modules"/>
+ <path id="dependentmodule.classpath">
+ <path refid="jboss.portal-jems.classpath"/>
+ </path>
+
+ <!--+=======================================+-->
+ <!--| Override any default properties here. |-->
+ <!--+=======================================+-->
+
+ <!-- Configure defaults & build tools -->
+ <call target="configure-defaults"/>
+ <call target="configure-tools"/>
+
+ <!--+=======================================+-->
+ <!--| Define module specific elements here. |-->
+ <!--+=======================================+-->
+ <property name="javadoc.private" value="true"/>
+ <property name="javadoc.protected" value="false"/>
+
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Compile |-->
+ <!--| |-->
+ <!--| This target should depend on other compile-* targets for each |-->
+ <!--| different type of compile that needs to be performed, short of |-->
+ <!--| documentation compiles. |-->
+ <!--+====================================================================+-->
+
+ <target name="compile"
+ description="Compile all source files."
+ depends="_default:compile-classes,
+ _default:compile-etc,
+ _default:compile-resources">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Generate Output |-->
+ <!--| |-->
+ <!--| Generates the target output for this module. Target output is |-->
+ <!--| the output which is ment to be released or used by external |-->
+ <!--| modules. |-->
+ <!--+====================================================================+-->
+
+ <target name="output"
+ description="Generate all target output."
+ depends="compile">
+
+ <!-- -->
+ <mkdir dir="${build.lib}"/>
+
+ <jar jarfile="${build.lib}/portal-authz-lib.jar">
+ <fileset dir="${build.classes}">
+ <exclude name="org/jboss/portal/core/authz/test/**"/>
+ </fileset>
+ </jar>
+
+ <copy todir="${build.lib}/portal-authz.sar">
+ <fileset dir="${build.resources}/sar"/>
+ <fileset file="${build.lib}/portal-authz-lib.jar"/>
+ </copy>
+ </target>
+
+ <!-- generates artifacts used for tests, requires output to be previously run -->
+ <target name="package-tests" depends="init"/>
+
+ <!-- ================================================================== -->
+ <!-- Cleaning -->
+ <!-- ================================================================== -->
+
+ <!-- Clean up all build output -->
+ <target name="clean" depends="_default:clean">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Documents |-->
+ <!--| |-->
+ <!--| Generate all documentation for this module. |-->
+ <!--+====================================================================+-->
+
+ <target name="docs" depends="_default:docs">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Misc. -->
+ <!-- ================================================================== -->
+
+ <target name="main" depends="most"/>
+ <target name="all" depends="_default:all"/>
+ <target name="most" depends="_default:most"/>
+ <target name="help" depends="_default:help"/>
+
+ <!-- ================================================================== -->
+ <!-- Deployment -->
+ <!-- ================================================================== -->
+ <target name="deploy"
+ description="Deploy."
+ depends="output">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <copy todir="${jboss.home}/server/${portal.deploy.dir}/jboss-portal.sar/portal-authz.sar" overwrite="true">
+ <fileset dir="${build.lib}/portal-authz.sar"/>
+ </copy>
+ </target>
+
+ <target name="style" depends="init">
+ <xslt
+ style="${source.resources}/style/toto.xsl"
+ in="${source.resources}/test/default-portal.xml"
+ out="${build.resources}/test/toto.xml">
+ </xslt>
+ </target>
+
+ <target name="tests" depends="init">
+ <property name="build.testlog" value="${module.output}/log"/>
+ <echo message="testlog: ${build.testlog}"/>
+ <mkdir dir="${build.testlog}"/>
+ <execute-tests>
+ <x-test>
+ <test todir="${test.reports}" name="org.jboss.portal.test.security.SimpleTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.security.ComplexTestCase"/>
+ </x-test>
+ <x-classpath>
+ <pathelement location="${build.classes}"/>
+ <pathelement location="${build.resources}"/>
+ <path refid="library.classpath"/>
+ <path refid="dependentmodule.classpath"/>
+ </x-classpath>
+ </execute-tests>
+ </target>
+</project>
Property changes on: branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/build.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/main/org/jboss/portal/core/authz/PolicyContext.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/main/org/jboss/portal/core/authz/PolicyContext.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/main/org/jboss/portal/core/authz/PolicyContext.java 2009-05-28 16:26:13 UTC (rev 13420)
@@ -0,0 +1,104 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* 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.jboss.portal.core.authz;
+
+import java.util.Map;
+import java.util.HashMap;
+
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class PolicyContext
+{
+ private static final String portlet_invocation = "portlet_invocation";
+ private static final String resource_uri = "resource_uri";
+ private static final String action_uri = "action_uri";
+
+ private Map<String, Object> attributes;
+
+ public PolicyContext()
+ {
+ this.attributes = new HashMap<String, Object>();
+ }
+ //-------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ public Object getAttribute(String name)
+ {
+ return this.attributes.get(name);
+ }
+
+ public void setAttribute(String name, Object value)
+ {
+ this.attributes.put(name, value);
+ }
+
+ public void removeAttribute(String name)
+ {
+ this.attributes.remove(name);
+ }
+ //-------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ public PortletInvocation getPortletInvocation()
+ {
+ return (PortletInvocation)this.getAttribute(PolicyContext.portlet_invocation);
+ }
+
+ public void setPortletInvocation(PortletInvocation portletInvocation)
+ {
+ if(portletInvocation != null)
+ {
+ this.setAttribute(PolicyContext.portlet_invocation, portletInvocation);
+ }
+ else
+ {
+ this.removeAttribute(PolicyContext.portlet_invocation);
+ }
+ }
+
+ public String getResourceUri()
+ {
+ return (String)this.getAttribute(PolicyContext.resource_uri);
+ }
+
+ public void setResourceUri(String resourceUri)
+ {
+ if(resourceUri == null || resourceUri.trim().length() == 0)
+ {
+ throw new IllegalArgumentException("ResourceUri must not be empty!!");
+ }
+ this.setAttribute(PolicyContext.resource_uri, resourceUri);
+ }
+
+ public String getActionUri()
+ {
+ return (String)this.getAttribute(PolicyContext.action_uri);
+ }
+
+ public void setActionUri(String actionUri)
+ {
+ if(actionUri == null || actionUri.trim().length() == 0)
+ {
+ throw new IllegalArgumentException("ActionUri must not be empty!!");
+ }
+ this.setAttribute(PolicyContext.action_uri, actionUri);
+ }
+}
Added: branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/main/org/jboss/portal/core/authz/PolicyService.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/main/org/jboss/portal/core/authz/PolicyService.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/main/org/jboss/portal/core/authz/PolicyService.java 2009-05-28 16:26:13 UTC (rev 13420)
@@ -0,0 +1,30 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* 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.jboss.portal.core.authz;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public interface PolicyService
+{
+ public boolean checkAccess(PolicyContext policyContext);
+}
Added: branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/main/org/jboss/portal/core/authz/PolicyServiceImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/main/org/jboss/portal/core/authz/PolicyServiceImpl.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/main/org/jboss/portal/core/authz/PolicyServiceImpl.java 2009-05-28 16:26:13 UTC (rev 13420)
@@ -0,0 +1,57 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* 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.jboss.portal.core.authz;
+
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+
+import org.apache.log4j.Logger;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ */
+public class PolicyServiceImpl extends AbstractJBossService implements PolicyService
+{
+ private static Logger log = Logger.getLogger(PolicyServiceImpl.class);
+
+ public PolicyServiceImpl()
+ {
+
+ }
+ //----AbstractJBossService implementation-----------------------------------------------------------------------------------------------------------------------
+ @Override
+ protected void startService() throws Exception
+ {
+ log.info("------------------------------------------------------");
+ log.info("Policy Service successfully started...................");
+ log.info("------------------------------------------------------");
+ }
+
+ @Override
+ protected void stopService() throws Exception
+ {
+ }
+ //--------PolicyService operations-------------------------------------------------------------------------------------------------------------------------------
+ public boolean checkAccess(PolicyContext policyContext)
+ {
+ return false;
+ }
+}
Added: branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/resources/sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/resources/sar/META-INF/jboss-service.xml (rev 0)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/resources/sar/META-INF/jboss-service.xml 2009-05-28 16:26:13 UTC (rev 13420)
@@ -0,0 +1,33 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<server>
+ <!-- PolicyService MBean -->
+ <mbean
+ code="org.jboss.portal.core.authz.PolicyServiceImpl"
+ name="portal.authorization:service=Policy"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+</server>
Property changes on: branches/JBoss_Portal_Branch_2_7_Security_POC/core-authz/src/resources/sar/META-INF/jboss-service.xml
___________________________________________________________________
Name: svn:executable
+ *
Modified: branches/JBoss_Portal_Branch_2_7_Security_POC/core-cms/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/core-cms/build.xml 2009-05-28 15:27:04 UTC (rev 13419)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/core-cms/build.xml 2009-05-28 16:26:13 UTC (rev 13420)
@@ -135,6 +135,7 @@
<path refid="jboss.portal-core.classpath"/>
<path refid="jboss.portal-workflow.classpath"/>
<path refid="jboss.portal-core-admin.classpath"/>
+ <path refid="jboss.portal-core-authz.classpath"/>
</path>
<!--+=======================================+-->
Modified: branches/JBoss_Portal_Branch_2_7_Security_POC/core-samples/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/core-samples/build.xml 2009-05-28 15:27:04 UTC (rev 13419)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/core-samples/build.xml 2009-05-28 16:26:13 UTC (rev 13420)
@@ -126,6 +126,7 @@
<path refid="jboss.portal-format.classpath"/>
<path refid="jboss.portal-api.classpath"/>
<path refid="jboss.portal-security.classpath"/>
+ <path refid="jboss.portal-core-authz.classpath"/>
</path>
<!--+=======================================+-->
Modified: branches/JBoss_Portal_Branch_2_7_Security_POC/security/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/security/build.xml 2009-05-28 15:27:04 UTC (rev 13419)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/security/build.xml 2009-05-28 16:26:13 UTC (rev 13420)
@@ -100,6 +100,7 @@
<call target="configure-modules"/>
<path id="dependentmodule.classpath">
<path refid="jboss.portal-jems.classpath"/>
+ <path refid="jboss.portal-core-authz.classpath"/>
</path>
<!--+=======================================+-->
Modified: branches/JBoss_Portal_Branch_2_7_Security_POC/security/src/main/org/jboss/portal/security/impl/jacc/JACCPortalAuthorizationManager.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/security/src/main/org/jboss/portal/security/impl/jacc/JACCPortalAuthorizationManager.java 2009-05-28 15:27:04 UTC (rev 13419)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/security/src/main/org/jboss/portal/security/impl/jacc/JACCPortalAuthorizationManager.java 2009-05-28 16:26:13 UTC (rev 13420)
@@ -29,6 +29,7 @@
import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
import org.jboss.portal.security.spi.provider.AuthorizationDomain;
import org.jboss.portal.security.spi.provider.PermissionFactory;
+import org.jboss.portal.core.authz.PolicyService;
import javax.security.auth.Subject;
import javax.security.jacc.PolicyConfigurationFactory;
@@ -69,6 +70,8 @@
/** JACC bypass */
private SecurityContext securityContext = null;
+
+ private PolicyService policyService;
/**
* JACC bypass
@@ -79,9 +82,21 @@
{
this.securityContext = securityContext;
}
+
+ PolicyService getPolicyService()
+ {
+ return policyService;
+ }
- public JACCPortalAuthorizationManager(JACCPortalAuthorizationManagerFactory factory)
+ void setPolicyService(PolicyService policyService)
{
+ this.policyService = policyService;
+ }
+
+
+
+public JACCPortalAuthorizationManager(JACCPortalAuthorizationManagerFactory factory)
+ {
this.factory = factory;
try
{
@@ -335,4 +350,10 @@
{
return (Subject)checkedSubjectLocal.get();
}
+
+
+ public boolean checkPermission(org.jboss.portal.core.authz.PolicyContext policyContext) throws IllegalArgumentException, PortalSecurityException
+ {
+ return this.policyService.checkAccess(policyContext);
+ }
}
Modified: branches/JBoss_Portal_Branch_2_7_Security_POC/security/src/main/org/jboss/portal/security/impl/jacc/JACCPortalAuthorizationManagerFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/security/src/main/org/jboss/portal/security/impl/jacc/JACCPortalAuthorizationManagerFactory.java 2009-05-28 15:27:04 UTC (rev 13419)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/security/src/main/org/jboss/portal/security/impl/jacc/JACCPortalAuthorizationManagerFactory.java 2009-05-28 16:26:13 UTC (rev 13420)
@@ -29,6 +29,7 @@
import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
import org.jboss.security.jacc.DelegatingPolicy;
import org.jboss.security.jacc.SubjectPolicyContextHandler;
+import org.jboss.portal.core.authz.PolicyService;
import javax.security.jacc.PolicyContext;
import java.security.Policy;
@@ -54,6 +55,8 @@
/** JACC bypass */
private SecurityContext securityContext = null;
+
+ private PolicyService policyService;
public AuthorizationDomainRegistry getAuthorizationDomainRegistry()
{
@@ -75,6 +78,7 @@
}
manager.setSecurityContext(this.securityContext);
+ manager.setPolicyService(policyService);
return manager;
}
@@ -110,4 +114,14 @@
//JACC bypass
this.securityContext = new SecurityContext();
}
+
+ public PolicyService getPolicyService()
+ {
+ return policyService;
+ }
+
+ public void setPolicyService(PolicyService policyService)
+ {
+ this.policyService = policyService;
+ }
}
Modified: branches/JBoss_Portal_Branch_2_7_Security_POC/security/src/main/org/jboss/portal/security/spi/auth/PortalAuthorizationManager.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/security/src/main/org/jboss/portal/security/spi/auth/PortalAuthorizationManager.java 2009-05-28 15:27:04 UTC (rev 13419)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/security/src/main/org/jboss/portal/security/spi/auth/PortalAuthorizationManager.java 2009-05-28 16:26:13 UTC (rev 13420)
@@ -25,6 +25,8 @@
import org.jboss.portal.security.PortalPermission;
import org.jboss.portal.security.PortalSecurityException;
+import org.jboss.portal.core.authz.PolicyContext;
+
import javax.security.auth.Subject;
/**
@@ -51,4 +53,6 @@
* @throws IllegalArgumentException if the permission is null
*/
public boolean checkPermission(Subject checkedSubject, PortalPermission permission) throws IllegalArgumentException, PortalSecurityException;
+
+ public boolean checkPermission(PolicyContext policyContext) throws IllegalArgumentException, PortalSecurityException;
}
Modified: branches/JBoss_Portal_Branch_2_7_Security_POC/tools/etc/buildfragments/modules.ent
===================================================================
--- branches/JBoss_Portal_Branch_2_7_Security_POC/tools/etc/buildfragments/modules.ent 2009-05-28 15:27:04 UTC (rev 13419)
+++ branches/JBoss_Portal_Branch_2_7_Security_POC/tools/etc/buildfragments/modules.ent 2009-05-28 16:26:13 UTC (rev 13420)
@@ -146,4 +146,11 @@
<path id="jboss.portal-samples.classpath">
<pathelement path="${jboss.portal-samples.lib}/portal-samples-lib.jar"/>
</path>
+
+ <!-- core-authz -->
+ <property name="jboss.portal-core-authz.root" value="${project.root}/core-authz/output"/>
+ <property name="jboss.portal-core-authz.lib" value="${jboss.portal-core-authz.root}/lib"/>
+ <path id="jboss.portal-core-authz.classpath">
+ <pathelement path="${jboss.portal-core-authz.lib}/portal-authz-lib.jar"/>
+ </path>
</target>
14 years, 10 months
JBoss Portal SVN: r13419 - branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-05-28 11:27:04 -0400 (Thu, 28 May 2009)
New Revision: 13419
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java
Log:
[selenium] - portal end2end
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java 2009-05-28 11:35:22 UTC (rev 13418)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java 2009-05-28 15:27:04 UTC (rev 13419)
@@ -19,6 +19,45 @@
@Test(groups = { "end2end" }, enabled = true, description = "Creating of new portal with content.")
public class EndtoEndPortalAdminTestCase extends JBossPortalSeleniumTestCase {
+
+ private static final String SUB_POR_PROPS_UPDATE = "_AdminPortletWindow:j_id108:common-manage-prop-form:update";
+
+ private static final String SUB_POR_PROPERTY = "_AdminPortletWindow:j_id108:common-edit-prop-form:add-property";
+
+ private static final String INP_POR_PROPERTY = "_AdminPortletWindow:j_id108:common-edit-prop-form:property";
+
+ private static final String SUB_POR_LISTENER = "_AdminPortletWindow:j_id108:edit-prop-form:update";
+
+ private static final String SEL_POR_LISTENER = "_AdminPortletWindow:j_id108:edit-prop-form:listener";
+
+ private static final String SUB_PAL = "_AdminPortletWindow:j_id134:common-edit-page-error-form:update";
+
+ private static final String SEL_PAL_PR = "_AdminPortletWindow:j_id134:common-edit-page-error-form:page-res-select";
+
+ private static final String SEL_PAL_PN = "_AdminPortletWindow:j_id134:common-edit-page-error-form:page-not-found-select";
+
+ private static final String SEL_PAL_PI = "_AdminPortletWindow:j_id134:common-edit-page-error-form:page-internal-select";
+
+ private static final String SEL_PAL_PE = "_AdminPortletWindow:j_id134:common-edit-page-error-form:page-error-select";
+
+ private static final String SEL_PAL_PC = "_AdminPortletWindow:j_id134:common-edit-page-error-form:page-control-select";
+
+ private static final String SEL_PAL_PA = "_AdminPortletWindow:j_id134:common-edit-page-error-form:page-access-select";
+
+ private static final String SUB_POL = "_AdminPortletWindow:j_id134:common-edit-portal-error-form:update";
+
+ private static final String SEL_POL_PR = "_AdminPortletWindow:j_id134:common-edit-portal-error-form:portal-res-input";
+
+ private static final String SEL_POL_PN = "_AdminPortletWindow:j_id134:common-edit-portal-error-form:portal-not-found-select";
+
+ private static final String SEL_POL_PI = "_AdminPortletWindow:j_id134:common-edit-portal-error-form:portal-internal-select";
+
+ private static final String SEL_POL_PE = "_AdminPortletWindow:j_id134:common-edit-portal-error-form:portal-error-select";
+
+ private static final String SEL_POL_PU = "_AdminPortletWindow:j_id134:common-edit-portal-error-form:portal-unavail-select";
+
+ private static final String SEL_POL_PA = "_AdminPortletWindow:j_id134:common-edit-portal-error-form:portal-access-select";
+
/** prefix for locator properties = portal.e2e.*/
public static String casePfx = "portal.e2e.";
@@ -59,7 +98,11 @@
private final String SUB_GOO_SEARCH = getLoc(casePfx + "sup.goo.search", "//div[contains(@id,'directory_search_div')]/form/input[@type='submit']");
private final String INP_NET_SEARCH = getLoc(casePfx + "inp.net.search", "//div[contains(@id,'directory_search_div')]/form/input[@name='query']");
private final String SUB_NET_SEARCH = getLoc(casePfx + "sub.net.search", "//div[contains(@id,'directory_search_div')]/form/input[@type='submit']");
-
+ private final String TAB_PROPERTIES = getLoc(casePfx + "tab.properties", "//table[contains(@id,'common-manage-prop-form:prop-data-table')]");
+ private final String TAB_PROP_VAL = getLoc(casePfx + "tab.prop.val", "//input[contains(@id,''common-manage-prop-form:prop-data-table:{0}:prop-value-input'')]");
+ private final String TAB_PROP_DEL = getLoc(casePfx + "tab.prop.val", "//a[contains(@id,''common-manage-prop-form:prop-data-table:{0}:delete'')]");
+
+
@BeforeMethod(groups = { "log" })
protected void loginBeforeTest() {
logoutIfPossible();
@@ -72,11 +115,15 @@
final String portalName = "UseCasePortal";
final String portalManName = "UseManagePortal";
+
final String page1Name = "firstPage";
final String page2Name = "anotherPage";
final String page3Name = "lastPage with whitespace";
final String page4Name = "dseer";
final String page5Name = "cemese";
+
+ final String page1ManName = "firstManPage";
+
final String PORTLET1 = "Cart Portlet";
final String por1str = "Cart Portlet";
final String PORTLET2 = "Band Culinaria";
@@ -137,11 +184,11 @@
public void testCreatePortalUsecase() {
createPortal(portalName);
- addPage(page1Name);
- addPage(page2Name);
- addPage(page3Name);
- addPage(page4Name);
- addPage(page5Name);
+ addPage(portalName,page1Name);
+ addPage(portalName,page2Name);
+ addPage(portalName,page3Name);
+ addPage(portalName,page4Name);
+ addPage(portalName,page5Name);
addPortlet(portalName, page1Name, PORTLET1, "portlet");
addPortlet(portalName, page2Name, PORTLET2, "widget/google");
@@ -170,11 +217,221 @@
}
- @Test(enabled = true, description = "Usecase for creating small portal with content.")
+ @Test(enabled = false, description = "Usecase for managing portals - listeners and properties.")
public void testManagePortalUsecase() {
+ int r = -1;
+
createPortal(portalManName);
+ addPage(portalManName,page1ManName);
+ //- Verify that you can add listener
+ goToProperties();
+
+ selenium.select(SEL_POR_LISTENER, "label=test_listener");
+ selenium.click(SUB_POR_LISTENER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ goToProperties();
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_POR_LISTENER),"test_listener","Previously selected label not being the current label.");
+
+ selenium.select(SEL_POR_LISTENER, "label=user_listener");
+ selenium.click(SUB_POR_LISTENER);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ goToProperties();
+ Assert.assertEquals(selenium.getSelectedLabel(SEL_POR_LISTENER),"user_listener","Previously selected label not being the current label.");
+
+ goToProperties();
+ //- assert no property is added
+ //r = countTableRows(TAB_PROPERTIES);
+ //Assert.assertTrue(r==0,"Property table is not empty.");
+ Assert.assertFalse(selenium.isElementPresent(TAB_PROPERTIES));
+
+ //- add d&d prop
+ selenium.type(INP_POR_PROPERTY, "dragadrop");
+ selenium.click(SUB_POR_PROPERTY);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ r = findTableRow(TAB_PROPERTIES, "dragadrop", 0)-1;
+ selenium.type(MessageFormat.format(TAB_PROP_VAL, r),"dragicek");
+ selenium.click(SUB_POR_PROPS_UPDATE);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ goToProperties();
+ //- assert d&d is added
+ r = findTableRow(TAB_PROPERTIES, "dragadrop", 0)-1;
+ Assert.assertTrue(r>-1,"Previously added property drag&drop not found in the property table");
+
+ //- add partial refresh prop
+ selenium.type(INP_POR_PROPERTY, "partialRef");
+ selenium.click(SUB_POR_PROPERTY);
+ selenium.waitForPageToLoad("30000");
+
+ r = findTableRow(TAB_PROPERTIES, "partialRef", 0)-1;
+ selenium.type(MessageFormat.format(TAB_PROP_VAL, r),"partialicek");
+ selenium.click(SUB_POR_PROPS_UPDATE);
+ selenium.waitForPageToLoad("30000");
+
+ goToProperties();
+ //- assert partial refresh is added
+ r = findTableRow(TAB_PROPERTIES, "partialRef", 0)-1;
+ Assert.assertTrue(r>-1,"Previously added property partial refresh not found in the property table");
+
+ //- delete d&d prop
+ r = findTableRow(TAB_PROPERTIES, "dragadrop", 0)-1;
+ selenium.click(MessageFormat.format(TAB_PROP_DEL, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ goToProperties();
+ //- assert d&d is not present
+ r = findTableRow(TAB_PROPERTIES, "dragadrop", 0)-1;
+ Assert.assertTrue(r==-1,"Deleted property drag and drop was found in property table.");
+
+ //- delete partial refresh prop
+ r = findTableRow(TAB_PROPERTIES, "partialRef", 0)-1;
+ selenium.click(MessageFormat.format(TAB_PROP_DEL, r));
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ goToProperties();
+ //- assert partial refresh is not added
+ r = findTableRow(TAB_PROPERTIES, "partialRef", 0)-1;
+ Assert.assertTrue(r<0,"Deleted property partial refresh was found in property table.");
+
}
+
+ @Test(enabled = false, description = "Usecase for managing portals - error handling.")
+ public void testPortalErrorHandlingUsecase() {
+
+ String LAB_RED = "Redirect to the specified resource";
+ String LAB_ERR = "Display the default error message";
+ String LAB_REM = "Remove the resource from page";
+
+ // ***
+ // *** Portal level
+ // ***
+
+ // select RED handling
+ goToProperties();
+ selenium.select(SEL_POL_PA, "label="+LAB_RED);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_POL_PU, "label="+LAB_RED);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_POL_PE, "label="+LAB_RED);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_POL_PI, "label="+LAB_RED);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_POL_PN, "label="+LAB_RED);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(SEL_POL_PR, "/WEB-INF/jsp/error/port3al.jsp");
+ selenium.click(SUB_POL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // assert RED handling
+ openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1", "ERROR");
+ openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1", "Powered by JBoss Portal");
+
+ // select ERR handling
+ goToProperties();
+ selenium.select(SEL_POL_PA, "label="+LAB_ERR);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_POL_PU, "label="+LAB_ERR);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_POL_PE, "label="+LAB_ERR);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_POL_PI, "label="+LAB_ERR);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_POL_PN, "label="+LAB_ERR);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(SEL_POL_PR, "/WEB-INF/jsp/error/port3al.jsp");
+ selenium.click(SUB_POL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // assert ERR handling
+ openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1", "HTTP Status 500");
+
+ // ***
+ // *** Page level
+ // ***
+
+ // select RED handling
+ goToProperties();
+ selenium.select(SEL_PAL_PA, "label="+LAB_RED);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PAL_PC, "label="+LAB_RED);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PAL_PE, "label="+LAB_RED);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PAL_PI, "label="+LAB_RED);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PAL_PN, "label="+LAB_RED);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(SEL_PAL_PR, "/WEB-INF/jsp/error/pa9ge.jsp");
+ selenium.click(SUB_PAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // assert RED handling
+ openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1", "ERROR");
+ openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1", "Powered by JBoss Portal");
+
+ // select ERR handling
+ goToProperties();
+ selenium.select(SEL_PAL_PA, "label="+LAB_ERR);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PAL_PC, "label="+LAB_ERR);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PAL_PE, "label="+LAB_ERR);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PAL_PI, "label="+LAB_ERR);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PAL_PN, "label="+LAB_ERR);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(SEL_PAL_PR, "/WEB-INF/jsp/error/pa9ge.jsp");
+ selenium.click(SUB_PAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // assert ERR handling
+ openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1", "ERROR");
+ openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1", "Powered by JBoss Portal");
+
+ // select REM handling
+ goToProperties();
+ selenium.select(SEL_PAL_PA, "label="+LAB_REM);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PAL_PC, "label="+LAB_REM);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PAL_PE, "label="+LAB_REM);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PAL_PI, "label="+LAB_REM);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.select(SEL_PAL_PN, "label="+LAB_REM);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ selenium.type(SEL_PAL_PR, "/WEB-INF/jsp/error/pa9ge.jsp");
+ selenium.click(SUB_PAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ // assert REM handling
+ openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1", "ERROR");
+ openAndAssert("/portal/auth/portal/default/Test/Exception+test/ExceptionPortletWindow?op=error&action=1", "Powered by JBoss Portal");
+ }
+
+ private void openAndAssert(String add, String ass){
+ selenium.open(add);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ Assert.assertTrue(selenium.isTextPresent(ass),"Text: {\"" + ass + "\"} not found on the page");
+ }
+ private void goToProperties() {
+ selenium.open(ADR_PORTAL);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LNK_PORTALS_ID);
+ clickIfVisible(LNK_PORTAL_HOME);
+
+ selenium.click("link=Properties");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
+
private void assertPageContains(String pageName, String awaitStr) {
selenium.open(ADR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -210,7 +467,7 @@
Assert.assertTrue(selenium.isTextPresent(portalName));
}
- private void addPage(String pageName) {
+ private void addPage(String portalName, String pageName) {
selenium.open(ADR_PORTAL);
selenium.waitForPageToLoad(PAGE_LOAD);
14 years, 10 months
JBoss Portal SVN: r13417 - in branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium: portal and 1 other directory.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-05-28 06:06:10 -0400 (Thu, 28 May 2009)
New Revision: 13417
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileUploadTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowUploadTestCase.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java
Log:
[BPORTAL-2311] cms workflow refactoring
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileTestCase.java 2009-05-27 10:33:48 UTC (rev 13416)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileTestCase.java 2009-05-28 10:06:10 UTC (rev 13417)
@@ -22,7 +22,7 @@
private final String TBL_CMS_FILEVER = getLoc(casePfx + "tbl.cms.filever", "//div[@id='center']/div/div/table");
public final String TBL_CMS_FILE = getLoc(casePfx + "tbl.cms.file", "//div[@id='center']/div/div/div[3]/table");
public final String TBL_FILE_PENDING = getLoc(casePfx + "tbl.file.pending", "//div[@id='center']/div/div/table[2]");
-
+
@BeforeMethod(groups = { "log" })
protected void loginBeforeTest() {
logoutIfPossible();
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileUploadTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileUploadTestCase.java 2009-05-27 10:33:48 UTC (rev 13416)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileUploadTestCase.java 2009-05-28 10:06:10 UTC (rev 13417)
@@ -13,7 +13,7 @@
*
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
-
+//TODO refactoring needed
@Test(groups = { "cms_file_upload" }, enabled = true)
public class CMSFileUploadTestCase extends JBossPortalSeleniumTestCase {
/*
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowTestCase.java 2009-05-27 10:33:48 UTC (rev 13416)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowTestCase.java 2009-05-28 10:06:10 UTC (rev 13417)
@@ -17,12 +17,14 @@
@Test(groups = { "cms_file_workflow" }, enabled = true)
public class CMSFileWorkflowTestCase extends JBossPortalSeleniumTestCase {
- private static final String SUB_MOVE = "submit";
+
/** prefix for locator properties = cms.file.work. */
public final String casePfx = "cms.file.work.";
private final String LAB_LANG_CZECH = getLoc(casePfx + "lab.lang.czech", "label=Czech");
+ private final String SUB_MOVE = getLoc(casePfx + "sub.move", "submit");
+ private final String LNK_HOME = getLoc(casePfx + "lnk.home", "link=Home");
private final String LNK_DENY = getLoc(casePfx + "lnk.deny", "link=Deny");
private final String LNK_PREVIEW = getLoc(casePfx + "lnk.preview", "link=Preview");
private final String LNK_APPROVE = getLoc(casePfx + "lnk.approve", "link=Approve");
@@ -169,7 +171,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Home");
+ selenium.click(LNK_HOME);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.select(SELECT_CMS_MAIN, LAB_CREATE_FILE);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -270,7 +272,7 @@
Assert.assertFalse(selenium.isElementPresent("link=fileToMove"));
- selenium.click("link=Home");
+ selenium.click(LNK_HOME);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isElementPresent("link=fileToMove"));
@@ -298,7 +300,7 @@
Assert.assertTrue(selenium.isElementPresent("link=fileToMove"));
- selenium.click("link=Home");
+ selenium.click(LNK_HOME);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertFalse(selenium.isElementPresent("link=fileToMove"));
@@ -329,7 +331,7 @@
Assert.assertTrue(selenium.isElementPresent("link=file2copy"));
- selenium.click("link=Home");
+ selenium.click(LNK_HOME);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertTrue(selenium.isElementPresent("link=file2copy"));
@@ -376,7 +378,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Home");
+ selenium.click(LNK_HOME);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=" + file);
@@ -421,7 +423,7 @@
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click(LNK_CMS);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Home");
+ selenium.click(LNK_HOME);
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.select(SELECT_CMS_MAIN, LAB_CREATE_FILE);
selenium.waitForPageToLoad(PAGE_LOAD);
@@ -436,7 +438,7 @@
selenium.click(LNK_APPROVE);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.click("link=Home");
+ selenium.click(LNK_HOME);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertEquals(name, selenium.getText("link=" + name));
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowUploadTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowUploadTestCase.java 2009-05-27 10:33:48 UTC (rev 13416)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/cms/CMSFileWorkflowUploadTestCase.java 2009-05-28 10:06:10 UTC (rev 13417)
@@ -9,32 +9,33 @@
import org.testng.annotations.Test;
/**
- * CMSFileUploadTestCase is responsible for testing of file uploading.
+ * CMSFileUploadTestCase is responsible for testing of file uploading. Files
+ * used in these tests are stored in the path defined by the system variable
+ * workspace (-Dworkspace).
*
* @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
*/
-//TODO refactoring needed
@Test(groups = { "cms_file_upload" }, enabled = true)
public class CMSFileWorkflowUploadTestCase extends JBossPortalSeleniumTestCase {
- /*
- * uncomment following lines and set the right path to the workspace in the
- * case you want to use this test case locally from eclipse
- */
- /*
- * {
- * System.setProperty("workspace","/home/vrockai/workspace/selenium-2.7/"
- * ); }
- */
-
/** prefix for locator properties = cms.file.up. */
private final String casePfx = "cms.file.up.";
+
+ private final String SUB_FIL_SUBMIT = getLoc(casePfx + "sub.fil.submit", "submit");
+ private final String SUB_FIL_CANCEL = getLoc(casePfx + "sub.fil.cancel", "cancel");
+ private final String INP_FIL_FIL = getLoc(casePfx + "inp.fil.fil", "response");
+ private final String INP_FIL_LAN = getLoc(casePfx + "inp.fil.lan", "language");
+ private final String INP_FIL_TIT = getLoc(casePfx + "inp.fil.tit", "title");
+ private final String INP_FIL_DES = getLoc(casePfx + "inp.fil.des", "description");
private final String LNK_DENY = getLoc(casePfx + "lnk.deny", "link=Deny");
private final String LNK_PREVIEW = getLoc(casePfx + "lnk.preview", "link=Preview");
private final String LNK_APPROVE = getLoc(casePfx + "lnk.approve", "link=Approve");
private final String CMS_FILE_TABLE = getLoc(casePfx + "cms.file.table", "//div[@id='center']/div/div/div[3]/table");
private final String WORKSPACE = System.getProperty("workspace");
- private final String TEST_FILES_DIR = WORKSPACE + File.separatorChar + "test_files" + File.separatorChar;
-
+ private final String TEST_FILES_DIR = WORKSPACE + File.separatorChar + "test_files" + File.separatorChar;
+ private final String SEL_ACTION = getLoc(casePfx + "sel.action", "//div[@id='center']/div/div/div[1]/div/select");
+ private final String LNK_CMS_ROOT = getLoc(casePfx + "lnk.cms.root", "link=Home");
+ private final String TAB_FILE_VER = getLoc(casePfx + "tab.file.ver", "//div[@id='center']/div/div/table");
+
@BeforeMethod(groups = { "log" })
protected void loginBeforeTest() {
logoutIfPossible();
@@ -68,18 +69,18 @@
int rc_d_before = countTableRows(CMS_FILE_TABLE);
- selenium.click("link=Home");
+ selenium.click(LNK_CMS_ROOT);
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select("//div[@id='center']/div/div/div[1]/div/select", "label=Upload File");
+ selenium.select(SEL_ACTION, "label=Upload File");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
- selenium.type("description", "myFile");
- selenium.type("title", "file to upload");
- selenium.select("language", "label=Afar");
- selenium.type("response", WORKSPACE + "/test_files/testFile.txt");
+ selenium.type(INP_FIL_DES, "myFile");
+ selenium.type(INP_FIL_TIT, "file to upload");
+ selenium.select(INP_FIL_LAN, "label=Afar");
+ selenium.type(INP_FIL_FIL, WORKSPACE + "/test_files/testFile.txt");
selenium.click("link=default");
- selenium.click("cancel");
+ selenium.click(SUB_FIL_CANCEL);
selenium.waitForPageToLoad(PAGE_LOAD);
int rc_m_after = countTableRows(CMS_FILE_TABLE);
@@ -89,7 +90,7 @@
int rc_d_after = countTableRows(CMS_FILE_TABLE);
- selenium.click("link=Home");
+ selenium.click(LNK_CMS_ROOT);
selenium.waitForPageToLoad(PAGE_LOAD);
Assert.assertEquals(rc_m_after, rc_m_before, "The row count in CMS file table has changes after canceling the upload of file in the root dir.");
@@ -100,129 +101,135 @@
* File upload test. The form for uploading file is filled with relevant
* values and the file located in "test_files/testFile.txt" is chosen for
* uploading into the root directory. Submit button is pressed and the
- * upload should take the action and afterwards the file is approved. The existence of the file in root
- * directory is asserted.
+ * upload should take the action and afterwards the file is approved. The
+ * existence of the file in root directory is asserted.
*/
@Test(enabled = true, description = "File upload test")
public void testFileApproveUpload() {
+ String fileName = "testFile.txt";
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select("//div[@id='center']/div/div/div[1]/div/select", "label=Upload File");
+ selenium.select(SEL_ACTION, "label=Upload File");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
- selenium.type("description", "myFile");
- selenium.type("title", "file to upload");
- selenium.select("language", "label=Afar");
- selenium.type("response", TEST_FILES_DIR + "testFile.txt");
- selenium.click("submit");
+ selenium.type(INP_FIL_DES, "myFile");
+ selenium.type(INP_FIL_TIT, "file to upload");
+ selenium.select(INP_FIL_LAN, "label=Afar");
+ selenium.type(INP_FIL_FIL, TEST_FILES_DIR + fileName);
+ selenium.click(SUB_FIL_SUBMIT);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertTrue(selenium.isElementPresent(LNK_PREVIEW));
Assert.assertTrue(selenium.isElementPresent(LNK_APPROVE));
Assert.assertTrue(selenium.isElementPresent(LNK_DENY));
-
+
selenium.click(LNK_APPROVE);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- Assert.assertEquals(selenium.getText("//div[@id='center']/div/div/ul/li[3]"), "testFile.txt");
+
+ Assert.assertTrue(selenium.isTextPresent(fileName));
Assert.assertTrue(selenium.isElementPresent("link=text/plain"));
- Assert.assertTrue(selenium.isElementPresent("//div[@id='center']/div/div/table/tbody/tr[4]/td[3]"));
- Assert.assertEquals(selenium.getText("//div[@id='center']/div/div/table/tbody/tr[4]/td[6]"), "file to upload");
+ int r = findTableRow(TAB_FILE_VER, "file to upload", 5);
+
+ Assert.assertTrue(r > -1, "File title not found in the file table");
+
Assert.assertTrue(selenium.isElementPresent("link=Afar"));
- Assert.assertTrue(selenium.isTextPresent("testFile.txt"));
+ Assert.assertTrue(selenium.isTextPresent(fileName));
- selenium.click("link=Home");
+ selenium.click(LNK_CMS_ROOT);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertEquals(selenium.getText("link=testFile.txt"), "testFile.txt");
+ Assert.assertEquals(selenium.getText("link=" + fileName), fileName);
}
-
+
/**
* File upload test. The form for uploading file is filled with relevant
- * values and the file located in "test_files/testFileDeny.txt" is chosen for
- * uploading into the root directory. Submit button is pressed and the
- * upload should take the action and afterwards the file is denied. The non-existence of the file in root
- * directory is asserted.
+ * values and the file located in "test_files/testFileDeny.txt" is chosen
+ * for uploading into the root directory. Submit button is pressed and the
+ * upload should take the action and afterwards the file is denied. The
+ * non-existence of the file in root directory is asserted.
*/
@Test(enabled = true, description = "File upload test")
public void testFileDenyUpload() {
+ String filename = "testFileDeny.txt";
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select("//div[@id='center']/div/div/div[1]/div/select", "label=Upload File");
+ selenium.select(SEL_ACTION, "label=Upload File");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
- selenium.type("description", "myFile");
- selenium.type("title", "file to deny upload");
- selenium.select("language", "label=Afar");
- selenium.type("response", TEST_FILES_DIR + "testFileDeny.txt");
- selenium.click("submit");
+ selenium.type(INP_FIL_DES, "myFile");
+ selenium.type(INP_FIL_TIT, "file to deny upload");
+ selenium.select(INP_FIL_LAN, "label=Afar");
+ selenium.type(INP_FIL_FIL, TEST_FILES_DIR + filename);
+ selenium.click(SUB_FIL_SUBMIT);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertTrue(selenium.isElementPresent(LNK_PREVIEW));
Assert.assertTrue(selenium.isElementPresent(LNK_APPROVE));
Assert.assertTrue(selenium.isElementPresent(LNK_DENY));
-
+
selenium.click(LNK_DENY);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- Assert.assertFalse(selenium.isTextPresent("testFileDeny.txt"));
- selenium.click("link=Home");
+ Assert.assertFalse(selenium.isTextPresent(filename));
+
+ selenium.click(LNK_CMS_ROOT);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertFalse(selenium.isElementPresent("link=testFileDeny.txt"));
+ Assert.assertFalse(selenium.isElementPresent("link=" + filename));
}
-
+
/**
- * Selenium doesn't support file downloading, therefore the test is disabled. The form for uploading file is filled with relevant
- * values and the file located in "test_files/testFilePrev.txt" is chosen for
- * uploading into the root directory. Submit button is pressed and the
- * upload should take the action and afterwards the file is previewed and denied. non-existence of the file in root
- * directory is asserted.
+ * Selenium doesn't support file downloading, therefore the test is
+ * disabled. The form for uploading file is filled with relevant values and
+ * the file located in "test_files/testFilePrev.txt" is chosen for uploading
+ * into the root directory. Submit button is pressed and the upload should
+ * take the action and afterwards the file is previewed and denied.
+ * non-existence of the file in root directory is asserted.
*/
@Test(enabled = false, description = "File upload test")
public void testFilePreviewUpload() {
+ String filename = "testFilePrev.txt";
selenium.click("link=Admin");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.click("link=CMS");
selenium.waitForPageToLoad(PAGE_LOAD);
- selenium.select("//div[@id='center']/div/div/div[1]/div/select", "label=Upload File");
+ selenium.select(SEL_ACTION, "label=Upload File");
selenium.waitForPageToLoad(PAGE_LOAD);
selenium.waitForPopUp("_top", PAGE_LOAD);
- selenium.type("description", "myFile");
- selenium.type("title", "file to deny upload");
- selenium.select("language", "label=Afar");
- selenium.type("response", TEST_FILES_DIR + "testFilePrev.txt");
- selenium.click("submit");
+ selenium.type(INP_FIL_DES, "myFile");
+ selenium.type(INP_FIL_TIT, "file to deny upload");
+ selenium.select(INP_FIL_LAN, "label=Afar");
+ selenium.type(INP_FIL_FIL, TEST_FILES_DIR + filename);
+ selenium.click(SUB_FIL_SUBMIT);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
Assert.assertTrue(selenium.isElementPresent(LNK_PREVIEW));
Assert.assertTrue(selenium.isElementPresent(LNK_APPROVE));
Assert.assertTrue(selenium.isElementPresent(LNK_DENY));
-
+
selenium.click(LNK_PREVIEW);
selenium.waitForPageToLoad(PAGE_LOAD);
-
+
selenium.click(LNK_DENY);
selenium.waitForPageToLoad(PAGE_LOAD);
-
- Assert.assertFalse(selenium.isTextPresent("testFileDenyPrev.txt"));
- selenium.click("link=Home");
+ Assert.assertFalse(selenium.isTextPresent(filename));
+
+ selenium.click(LNK_CMS_ROOT);
selenium.waitForPageToLoad(PAGE_LOAD);
- Assert.assertFalse(selenium.isElementPresent("link=testFilePrev.txt"));
+ Assert.assertFalse(selenium.isElementPresent("link=" + filename));
}
}
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java 2009-05-27 10:33:48 UTC (rev 13416)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/portal/EndtoEndPortalAdminTestCase.java 2009-05-28 10:06:10 UTC (rev 13417)
@@ -71,6 +71,7 @@
}
final String portalName = "UseCasePortal";
+ final String portalManName = "UseManagePortal";
final String page1Name = "firstPage";
final String page2Name = "anotherPage";
final String page3Name = "lastPage with whitespace";
@@ -168,6 +169,11 @@
assertPageContains(page5Name, por5str);
}
+
+ @Test(enabled = true, description = "Usecase for creating small portal with content.")
+ public void testManagePortalUsecase() {
+ createPortal(portalManName);
+ }
private void assertPageContains(String pageName, String awaitStr) {
selenium.open(ADR_PORTAL);
14 years, 10 months
JBoss Portal SVN: r13416 - in branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test: selenium and 1 other directory.
by portal-commits@lists.jboss.org
Author: vrockai
Date: 2009-05-27 06:33:48 -0400 (Wed, 27 May 2009)
New Revision: 13416
Added:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/XssTestCase.java
Modified:
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/ant/FileCreate.java
branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
Log:
[selenium] - ajax timeout, ant task javadoc, xss testcase preview
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/ant/FileCreate.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/ant/FileCreate.java 2009-05-27 09:11:34 UTC (rev 13415)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/ant/FileCreate.java 2009-05-27 10:33:48 UTC (rev 13416)
@@ -6,6 +6,38 @@
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
+/**
+ * @author vrockai
+ * FileCreate task is responsible for creating specified number of files of random content and of specified name and size.
+ * <h2>Parameters</h2>
+ * <table>
+ * <thead>
+ * <tr>
+ * <th>Attribute</th>
+ * <th>Description</th>
+ * </tr>
+ * </thead>
+ * <tbody>
+ * <tr>
+ * <td>filename</td>
+ * <td>The prefix of name of file(s) to be generated.</td>
+ * </tr>
+ * <tr>
+ * <td>suffix</td>
+ * <td>When more then one file is about to be created (set by the count attribute) the filename then consist of the string set by the filename attribe + "[i]" string + the suffix string set by the suffix attribute.</td>
+ * </tr>
+ * <tr>
+ * <td>size</td>
+ * <td>The size of individual file to be generated in bytes. When more files are generated (set by count attribute), each file has specified size.</td>
+ * </tr>
+ * <tr>
+ * <td>count</td>
+ * <td>The number of files to be generated. The filename then consist of the string set by the filename attribe + "[i]" string + the suffix string set by the suffix attribute.</td>
+ * </tr>
+ * </tbody>
+ * </table>
+ *
+ */
public class FileCreate extends Task {
String filename;
Modified: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2009-05-27 09:11:34 UTC (rev 13415)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/JBossPortalSeleniumTestCase.java 2009-05-27 10:33:48 UTC (rev 13416)
@@ -57,7 +57,7 @@
*/
public static String PAGE_LOAD = "180000";
/** Generic timeout in miliseconds used for AJAX timeouts } */
- public static long AJAX_LOAD = 3000;
+ public static long AJAX_LOAD = 6000;
// protected static final String PAGE_LOAD = "60000";
// protected static final long AJAX_LOAD = 2000;
Added: branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/XssTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/XssTestCase.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_7/testsuite/ui-tests/src/org/jboss/portal/test/selenium/XssTestCase.java 2009-05-27 10:33:48 UTC (rev 13416)
@@ -0,0 +1,142 @@
+package org.jboss.portal.test.selenium;
+
+import java.text.MessageFormat;
+
+import org.testng.Assert;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * XssTestCase is responsible for testing the security of JBoss Portal related
+ * to XSS attacks. Each test is running with user "admin" logged in.
+ *
+ * @author <a href="mailto:vrockai@redhat.com">Viliam Rockai</a>
+ */
+@Test(groups = { "xss" }, enabled = true, description = "XSS issues test case.")
+public class XssTestCase extends JBossPortalSeleniumTestCase {
+
+ /** prefix for locator properties = dash. */
+ public String casePfx = "xss.";
+
+ private final String TAB_PORTALOBJ_ID = getLoc("portal.admin."
+ + "tab.portalobj.id", "Link=Admin");
+ private final String LINK_PORTALS_ID = getLoc("portal.admin."
+ + "link.portals.id", "link=*Portal Objects*");
+ private final String LNK_PROPERTIES = getLoc("portal.admin."
+ + "lnk.properties",
+ "//a[contains(@id,'edit-context-form:object-link')]");
+ private final String INP_POR_REDIR = getLoc("portal.admin."
+ + "inp.por.redir",
+ "//input[contains(@id,'common-edit-portal-error-form:portal-res-input')]");
+ private final String SUB_POR_REDIR = getLoc("portal.admin."
+ + "sub.por.redir",
+ "//input[contains(@id,'common-edit-portal-error-form:update')]");
+ private final String INP_PAG_REDIR = getLoc("portal.admin."
+ + "inp.pag.redir",
+ "//input[contains(@id,'common-edit-page-error-form:page-res-select')]");
+ private final String SUB_PAG_REDIR = getLoc("portal.admin."
+ + "sub.pag.redir",
+ "//input[contains(@id,'common-edit-page-error-form:update')]");
+
+ private final String URL_EXC_TEST = "/portal/auth/portal/default/Test/Exception+test";
+ private final String LNK_POR_EXC = "link=*render PortletException*";
+
+ private String XSS_S1 = "/Dave</option><script>alert(document.cookie);</script>";
+
+ private String comm = "if(expectedAlertWarningText.contains(browser.getAlert())) {verifyTrue(true, \"Alert/Warning: '\" + expectedAlertWarningText + \"' is displayed\");return;}";
+
+ @BeforeMethod(groups = { "log" })
+ protected void loginBeforeTest() {
+ logoutIfPossible();
+ login("admin", "admin");
+ }
+
+ @AfterMethod(groups = { "log" })
+ protected void logoutAfterTest() {
+
+ }
+
+ @Test(enabled = true)
+ public void portalPageErrorTest() throws Exception {
+ selenium.click("link=Admin");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ clickIfVisible(TAB_PORTALOBJ_ID);
+ clickIfVisible(LINK_PORTALS_ID);
+
+ selenium.click(LNK_PROPERTIES);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.type(INP_POR_REDIR, XSS_S1);
+ selenium.click(SUB_POR_REDIR);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.type(INP_PAG_REDIR, XSS_S1);
+ selenium.click(SUB_PAG_REDIR);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ Assert.assertFalse(selenium.isAlertPresent(), "XSS alert is present!");
+
+ selenium.open(URL_EXC_TEST);
+ selenium.waitForPageToLoad(PAGE_LOAD);
+
+ selenium.click(LNK_POR_EXC);
+
+ waitFor(AJAX_LOAD);
+
+ selenium.runScript(comm);
+ System.out.println("ahoj1");
+
+ System.out.println("ahoj2");
+
+ Assert.assertFalse(selenium.isAlertPresent(), "XSS alert is present!");
+
+ selenium.open("/portal/auth/portal/default/default");
+ selenium.waitForPageToLoad(PAGE_LOAD);
+ }
+
+ private boolean hasAlert() throws Exception {
+ boolean res = false;
+ for (int second = 0; second < 60; second++) {
+
+ try {
+
+ if ((selenium.isAlertPresent())) {
+
+ res = true;
+
+ break;
+
+ }
+
+ }
+
+ catch (Exception ignore) {
+
+ }
+
+ Thread.sleep(1000);
+
+ }
+ return res ;
+ /*
+ selenium.selectFrame("index=0");
+
+ for (int second = 0;; second++) {
+ if (second >= 10){
+ res = false;
+ break;
+ }
+ try {
+ if (selenium.getAlert().startsWith("J"))
+ break;
+ } catch (Exception e) {
+ }
+ Thread.sleep(1000);
+ }
+
+ return res;
+ */
+ }
+}
14 years, 10 months
JBoss Portal SVN: r13415 - in branches/JBoss_Portal_Branch_2_7/core-cms/src: resources/portal-cms-war/WEB-INF/classes and 1 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-05-27 05:11:34 -0400 (Wed, 27 May 2009)
New Revision: 13415
Modified:
branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminConstants.java
branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_fr.properties
branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp
Log:
- JBEPP-86: Fixed problem with disappearing values... We need to TEST this more.
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminConstants.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminConstants.java 2009-05-26 11:48:45 UTC (rev 13414)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminConstants.java 2009-05-27 09:11:34 UTC (rev 13415)
@@ -121,4 +121,6 @@
public static final String CMS_DATE_PATTERN = "CMS_DATE_PATTERN";
public static final String DATE_FORMAT = "dateFormat";
+
+ public static final String CMS_INVALID_PARAMETER = "CMS_INVALID_PARAMETER";
}
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2009-05-26 11:48:45 UTC (rev 13414)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2009-05-27 09:11:34 UTC (rev 13415)
@@ -48,7 +48,6 @@
import org.jboss.portal.cms.workflow.CMSWorkflowUtil;
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.core.cms.command.StreamContentCommand;
-import org.jboss.portal.core.cms.ui.Util;
import org.jboss.portal.core.controller.ControllerContext;
import org.jboss.portal.identity.AnonymousRole;
import org.jboss.portal.identity.IdentityException;
@@ -112,6 +111,8 @@
private static final String SLASH = "/";
private static final String INVALID_TITLE = "Invalid title";
private static final String INVALID_DESCRIPTION = "Invalid description";
+ private static final String INVALID_LANG = "INVALID_LANG";
+ private static final String ERROR_MESSAGE = "error:message";
public void init() throws PortletException
@@ -335,10 +336,10 @@
rRes.setContentType("text/html");
rReq.setAttribute("createpath", sPath);
- String parameter = rReq.getParameter("error:message");
+ String parameter = rReq.getParameter(ERROR_MESSAGE);
if (parameter != null)
{
- rReq.setAttribute("error:message", parameter);
+ rReq.setAttribute(ERROR_MESSAGE, parameter);
}
parameter = rReq.getParameter("error:newcollectionname");
if (parameter != null)
@@ -616,10 +617,10 @@
{
rReq.setAttribute("error:filename", parameter);
}
- parameter = rReq.getParameter("error:message");
+ parameter = rReq.getParameter(ERROR_MESSAGE);
if (parameter != null)
{
- rReq.setAttribute("error:message", parameter);
+ rReq.setAttribute(ERROR_MESSAGE, parameter);
}
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/create.jsp");
@@ -679,6 +680,7 @@
rReq.setAttribute("language", sLanguage);
rReq.setAttribute("title", file.getContent().getTitle());
rReq.setAttribute("description", file.getContent().getDescription());
+ rReq.setAttribute(ERROR_MESSAGE, rReq.getParameter(ERROR_MESSAGE));
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/edit.jsp");
prd.include(rReq, rRes);
@@ -942,7 +944,7 @@
aRes.setRenderParameter("path", aReq.getParameter("destination"));
//used to remember the data already submitted by the user
- aRes.setRenderParameter("error:message", CMSAdminConstants.CMS_FOLDERNAME_INVALID);
+ aRes.setRenderParameter(ERROR_MESSAGE, CMSAdminConstants.CMS_FOLDERNAME_INVALID);
aRes.setRenderParameter("error:newcollectionname", aReq.getParameter("newcollectionname"));
aRes.setRenderParameter("error:newcollectiondescription", aReq.getParameter("newcollectiondescription"));
@@ -964,7 +966,7 @@
aRes.setRenderParameter("path", aReq.getParameter("destination"));
//used to remember the data already submitted by the user
- aRes.setRenderParameter("error:message", CMSAdminConstants.CMS_FOLDERNAME_INVALID);
+ aRes.setRenderParameter(ERROR_MESSAGE, CMSAdminConstants.CMS_FOLDERNAME_INVALID);
aRes.setRenderParameter("error:newcollectionname", aReq.getParameter("newcollectionname"));
aRes.setRenderParameter("error:newcollectiondescription", aReq.getParameter("newcollectiondescription"));
}
@@ -1386,7 +1388,7 @@
String sDescription = aReq.getParameter("description");
String sLanguage = aReq.getParameter("language");
- sFileName = ParameterValidation.sanitizeFromPattern(sFileName, CHECK_FOR_XSS_PATTERN, "");
+ sFileName = ParameterValidation.sanitizeFromPattern(sFileName, CHECK_FOR_XSS_PATTERN, "");
sDirectory = ParameterValidation.sanitizeFromPattern(sDirectory, CHECK_FOR_XSS_PATTERN, SLASH);
sTitle = ParameterValidation.sanitizeFromPattern(sTitle, CHECK_FOR_XSS_PATTERN, INVALID_TITLE);
sDescription = ParameterValidation.sanitizeFromPattern(sDescription, CHECK_FOR_XSS_PATTERN, INVALID_DESCRIPTION);
@@ -1464,7 +1466,7 @@
aRes.setRenderParameter("path", sDirectory);
//used to remember the data already submitted by the user
- aRes.setRenderParameter("error:message", CMSAdminConstants.CMS_FILENAME_INVALID);
+ aRes.setRenderParameter(ERROR_MESSAGE, CMSAdminConstants.CMS_FILENAME_INVALID);
aRes.setRenderParameter("error:filename", aReq.getParameter("filename"));
aRes.setRenderParameter("error:content", aReq.getParameter("elm1"));
aRes.setRenderParameter("error:description", aReq.getParameter("description"));
@@ -1497,22 +1499,56 @@
else if (CMSAdminConstants.OP_SAVETEXT.equals(op))
{
String sFilePath = aReq.getParameter("savetopath");
- String sTitle = aReq.getParameter("title");
- String sDescription = aReq.getParameter("description");
- String sLanguage = aReq.getParameter("language");
-
- sTitle = ParameterValidation.sanitizeFromPattern(sTitle, CHECK_FOR_XSS_PATTERN, "");
- sDescription = ParameterValidation.sanitizeFromPattern(sDescription, CHECK_FOR_XSS_PATTERN, "");
- sLanguage = ParameterValidation.sanitizeFromPattern(sLanguage, CHECK_FOR_XSS_PATTERN, "en");
-
- String sMakeLive = "off";
- if (aReq.getParameterValues("makelive") != null)
+ if (!"".equals(sFilePath) && CHECK_FOR_XSS_PATTERN.matcher(sFilePath).matches())
{
- sMakeLive = "on";
- }
+ String sTitle = aReq.getParameter("title");
+ String sDescription = aReq.getParameter("description");
+ String sLanguage = aReq.getParameter("language");
- if (!"".equals(sFilePath) && CHECK_FOR_XSS_PATTERN.matcher(sFilePath).matches())
- {
+ // check title and description for XSS injection... If one found, re-display page with old values
+ String parameter = null;
+ sTitle = ParameterValidation.sanitizeFromPattern(sTitle, CHECK_FOR_XSS_PATTERN, INVALID_TITLE);
+ boolean invalidTitle = INVALID_TITLE.equals(sTitle);
+ if(invalidTitle)
+ {
+ parameter = "CMS_TITLE";
+ }
+ sDescription = ParameterValidation.sanitizeFromPattern(sDescription, CHECK_FOR_XSS_PATTERN, INVALID_DESCRIPTION);
+ boolean invalidDesc = INVALID_DESCRIPTION.equals(sDescription);
+ if(invalidDesc)
+ {
+ parameter = "CMS_DESCRIPTION";
+ }
+
+ sLanguage = ParameterValidation.sanitizeFromPattern(sLanguage, CHECK_FOR_XSS_PATTERN, INVALID_LANG);
+ boolean invalidLang = INVALID_LANG.equals(sLanguage);
+ if(invalidLang)
+ {
+ parameter = "CMS_LANGUAGE";
+ }
+
+ if (invalidTitle || invalidDesc || invalidLang)
+ {
+ aRes.setRenderParameter("op", CMSAdminConstants.OP_EDIT);
+
+ // output error message
+ aRes.setRenderParameter(ERROR_MESSAGE, CMSAdminConstants.CMS_INVALID_PARAMETER);
+
+ aRes.setRenderParameter("path", aReq.getParameter("savetopath"));
+ aRes.setRenderParameter("language", aReq.getParameter("language"));
+
+ return;
+ }
+
+ Locale locale = new Locale(sLanguage);
+
+ String sMakeLive = "off";
+ if (aReq.getParameterValues("makelive") != null)
+ {
+ sMakeLive = "on";
+ }
+
+
String sContent = aReq.getParameter("elm1");
File file = new FileImpl();
@@ -1533,9 +1569,9 @@
content.setTitle(sTitle);
content.setDescription(sDescription);
- content.setBasePath(sFilePath + SLASH + new Locale(sLanguage).getLanguage());
+ content.setBasePath(sFilePath + SLASH + locale.getLanguage());
content.setBytes(sContent.getBytes());
- file.setContent(new Locale(sLanguage), content);
+ file.setContent(locale, content);
boolean bMakeLive = false;
if ("on".equalsIgnoreCase(sMakeLive))
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2009-05-26 11:48:45 UTC (rev 13414)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2009-05-27 09:11:34 UTC (rev 13415)
@@ -143,6 +143,7 @@
CMS_FILENAME_INVALID=File Name is invalid. It may not contain illegal characters such as '.', '/', ':', '[', ']', '*', ''', '"', '|' or any whitespace character.
CMS_FOLDERNAME_INVALID=Folder Name is invalid. It may not contain illegal characters such as '.', '/', ':', '[', ']', '*', ''', '"', '|' or any whitespace character.
+CMS_INVALID_PARAMETER=A value below is invalid. It may not contain illegal characters such as '\\', '<', '>', '(', ')', '=' or '%5c'.
CMS_MSG_DESTINATION_ALREADY_EXISTS=The command was not performed, because the destination already exists.
CMS_CANT_MOVE_SAME_DESTINATION=You cannot move a folder to the same location
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_fr.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_fr.properties 2009-05-26 11:48:45 UTC (rev 13414)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_fr.properties 2009-05-27 09:11:34 UTC (rev 13415)
@@ -32,23 +32,23 @@
CMS_CANCEL = Annuler
-CMS_CONTENT_DIR = R\u00E9pertoire de contenu
+CMS_CONTENT_DIR = R\u00e9pertoire de contenu
-CMS_CONTENT_DIR_USE = Utilisez l'arborescence des dossiers afin de parcourir la structure du r\u00E9pertoire.
+CMS_CONTENT_DIR_USE = Utilisez l'arborescence des dossiers afin de parcourir la structure du r\u00e9pertoire.
CMS_COPY = Copier
-CMS_CREATE = Cr\u00E9er
+CMS_CREATE = Cr\u00e9er
-CMS_CREATED = Cr\u00E9\u00E9
+CMS_CREATED = Cr\u00e9\u00e9
-CMS_CREATED_BY = Cr\u00E9\u00E9 par
+CMS_CREATED_BY = Cr\u00e9\u00e9 par
-CMS_CREATEFILE = Cr\u00E9er un fichier
+CMS_CREATEFILE = Cr\u00e9er un fichier
-CMS_CREATEFILEINDIR = Cr\u00E9er un fichier dans le dossier
+CMS_CREATEFILEINDIR = Cr\u00e9er un fichier dans le dossier
-CMS_CREATEFOLDER = Cr\u00E9er un dossier
+CMS_CREATEFOLDER = Cr\u00e9er un dossier
CMS_DELETE = Supprimer
@@ -56,7 +56,7 @@
CMS_DELETEWARN1 = ATTENTION ! Vous ne pourrez pas annuler cette action.
-CMS_DELETEWARN2 = \u00CAtes vous certain de vouloir supprimer cette ressource ?
+CMS_DELETEWARN2 = \u00cates vous certain de vouloir supprimer cette ressource ?
CMS_DENY = Refuser
@@ -78,35 +78,35 @@
CMS_LANGUAGE = Langue
-CMS_LIVE = Diffusion imm\u00E9diate
+CMS_LIVE = Diffusion imm\u00e9diate
CMS_LIVEVERSION = Version en ligne
-CMS_MAIN_USE = Utilisez le portlet d'administration du CMS afin de modifier le contenu de votre r\u00E9pertoire.
+CMS_MAIN_USE = Utilisez le portlet d'administration du CMS afin de modifier le contenu de votre r\u00e9pertoire.
-CMS_MANAGE = G\u00E9rer le contenu
+CMS_MANAGE = G\u00e9rer le contenu
CMS_MENU = Menu action
-CMS_MODIFIED = Derni\u00E8re modification
+CMS_MODIFIED = Derni\u00e8re modification
CMS_MODIFY = Modifier
-CMS_MOVE = D\u00E9placer
+CMS_MOVE = D\u00e9placer
CMS_NAME = Nom
CMS_PATH = Emplacement
-CMS_PREVIEW = Pr\u00E9visualiser
+CMS_PREVIEW = Pr\u00e9visualiser
-CMS_RESET = R\u00E9initialiser
+CMS_RESET = R\u00e9initialiser
CMS_SEARCH = Rechercher
-CMS_SEARCHNORESULT = Aucun r\u00E9sultat pour cette recherche
+CMS_SEARCHNORESULT = Aucun r\u00e9sultat pour cette recherche
-CMS_SECURE = S\u00E9curiser
+CMS_SECURE = S\u00e9curiser
CMS_SIZE = Taille
@@ -118,23 +118,23 @@
CMS_TYPE = Type
-CMS_UPLOAD = T\u00E9l\u00E9d\u00E9verser
+CMS_UPLOAD = T\u00e9l\u00e9d\u00e9verser
-CMS_UPLOADARCHIVE = T\u00E9l\u00E9d\u00E9verser une archive
+CMS_UPLOADARCHIVE = T\u00e9l\u00e9d\u00e9verser une archive
CMS_VERSION = Version
CMS_VIEW = Visualiser
-CMS_WYSIWYG = \u00C9diteur visuel WYSIWYG
+CMS_WYSIWYG = \u00c9diteur visuel WYSIWYG
TITLE_BROWSE = Navigateur de dossiers
TITLE_COPYCONFIRM = Confirmer la copie
-TITLE_CREATE = Cr\u00E9er un fichier
+TITLE_CREATE = Cr\u00e9er un fichier
-TITLE_CREATECOLLCONFIRM = Confirmer la cr\u00E9ation d'un r\u00E9pertoire
+TITLE_CREATECOLLCONFIRM = Confirmer la cr\u00e9ation d'un r\u00e9pertoire
TITLE_DELETECONFIRM = Confirmer la suppression
@@ -145,17 +145,19 @@
## CMS ADMIN PORTLET
TITLE_HEAD = Administration du CMS
-TITLE_MOVECONFIRM = Confirmer le d\u00E9placement
+TITLE_MOVECONFIRM = Confirmer le d\u00e9placement
-TITLE_SECURECONFIRM = S\u00E9curiser le noeud
+TITLE_SECURECONFIRM = S\u00e9curiser le noeud
-TITLE_UPLOAD = T\u00E9l\u00E9d\u00E9verser un fichier
+TITLE_UPLOAD = T\u00e9l\u00e9d\u00e9verser un fichier
-TITLE_VIEWFILE = Propri\u00E9t\u00E9s du fichier
+TITLE_VIEWFILE = Propri\u00e9t\u00e9s du fichier
-CMS_ACCESS_DENIED=Acc\u00E9s interdit
-CMS_ACCESS_DENIED_DESCRIPTION=Vous n'\u00eates pas autoris\u00E9 \u00e0 acc\u00e9der a ce document
-CMS_ACCESS_DENIED_DESCRIPTION_PATH=Vous n'\u00eates pas autoris\u00E9 \u00e0 acc\u00e9der au document
+CMS_ACCESS_DENIED=Acc\u00e9s interdit
+CMS_ACCESS_DENIED_DESCRIPTION=Vous n'\u00eates pas autoris\u00e9 \u00e0 acc\u00e9der a ce document
+CMS_ACCESS_DENIED_DESCRIPTION_PATH=Vous n'\u00eates pas autoris\u00e9 \u00e0 acc\u00e9der au document
-CMS_MISSING_DOCUMENT=404 - Page non trouv\u00E9e
-CMS_MISSING_DOCUMENT_DESCRIPTION=Le document auquel vous avez tent\u00E9 d'acc\u00E9der est introuvable
+CMS_MISSING_DOCUMENT=404 - Page non trouv\u00e9e
+CMS_MISSING_DOCUMENT_DESCRIPTION=Le document auquel vous avez tent\u00e9 d'acc\u00e9der est introuvable
+
+CMS_INVALID_PARAMETER=Une valeur ci-dessous est invalide car elle contient des caract\u00e8rs invalides '\\', '<', '>', '(', ')', '=' ou '%5c'.
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp 2009-05-26 11:48:45 UTC (rev 13414)
+++ branches/JBoss_Portal_Branch_2_7/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp 2009-05-27 09:11:34 UTC (rev 13415)
@@ -21,6 +21,9 @@
String sVersion = (String)request.getAttribute("version");
String sTitle = (String)request.getAttribute("title");
String sDescription = (String)request.getAttribute("description");
+
+ // for error handling
+ String errorMessage = (String)request.getAttribute("error:message");
%>
<!-- tinyMCE -->
@@ -74,8 +77,20 @@
<tr>
<td height="10"></td>
</tr>
+
+ <%
+ if(errorMessage != null)
+ {
+ %>
+ <tr>
+ <td><span style="color: red">${n:i18n("CMS_INVALID_PARAMETER")}></span></td>
+ </tr>
+ <%
+ }
+ %>
<tr>
- <td>
+ <td></td>
+</tr>
<tr>
<td>
<table>
14 years, 10 months