JBoss Portal SVN: r7908 - modules/common.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-13 18:34:43 -0400 (Mon, 13 Aug 2007)
New Revision: 7908
Added:
modules/common/tags/
Log:
create the common module directory
18 years, 8 months
JBoss Portal SVN: r7907 - modules/common.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-13 18:34:26 -0400 (Mon, 13 Aug 2007)
New Revision: 7907
Added:
modules/common/branches/
Log:
create the common module directory
18 years, 8 months
JBoss Portal SVN: r7906 - modules/common.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-13 18:34:16 -0400 (Mon, 13 Aug 2007)
New Revision: 7906
Added:
modules/common/trunk/
Log:
create the common module directory
18 years, 8 months
JBoss Portal SVN: r7905 - modules.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-13 18:33:43 -0400 (Mon, 13 Aug 2007)
New Revision: 7905
Added:
modules/common/
Log:
create the common module directory
18 years, 8 months
JBoss Portal SVN: r7904 - /.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-08-13 18:33:07 -0400 (Mon, 13 Aug 2007)
New Revision: 7904
Added:
modules/
Log:
create the module directory
18 years, 8 months
JBoss Portal SVN: r7903 - in trunk/core-identity: src/main/org/jboss/portal/core/identity/ui and 13 other directories.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2007-08-13 16:48:38 -0400 (Mon, 13 Aug 2007)
New Revision: 7903
Added:
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileBean.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/ValidateEmailServlet.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/RoleManagementBean.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/CurrentPasswordValidator.java
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/classes/
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/classes/Identity.properties
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/classes/Identity_de.properties
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/adminTemplate.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/assignRoles.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/confirm.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/editProfile.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/index.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/register.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/registerRoles.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles/
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles/editRole.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles/roleMembers.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/profile.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/register.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/status.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/registerTemplate.xhtml
Removed:
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/ProfileBean.java
Modified:
trunk/core-identity/.classpath
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/IdentityUIUser.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/UIAttribute.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordBean.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/UserRegisterBean.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityUserBean.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/MetaDataServiceBean.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/EmailValidator.java
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jboss-portlet.xml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/lost.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changeEmail.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changePassword.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/editProfile.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/viewProfile.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/confirm.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/overview.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/register.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/success.xhtml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet-instances.xml
trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml
Log:
basic functionality for User and Admin Portlet
Modified: trunk/core-identity/.classpath
===================================================================
--- trunk/core-identity/.classpath 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/.classpath 2007-08-13 20:48:38 UTC (rev 7903)
@@ -25,5 +25,8 @@
<classpathentry kind="lib" path="output/resources/portal-identity-war/WEB-INF/lib2/myfaces-impl.jar"/>
<classpathentry kind="lib" path="output/resources/portal-identity-war/WEB-INF/lib2/portal-faces-lib.jar"/>
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-common.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/common"/>
+ <classpathentry kind="lib" path="/thirdparty/sun-servlet/lib/servlet-api.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/hibernate/lib/hibernate3.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/DynamicUserAttribute.java 2007-08-13 20:48:38 UTC (rev 7903)
@@ -33,6 +33,7 @@
public Class getType(Object propertyName) throws IllegalArgumentException
{
+ //Object o = map.get((String) propertyName);
return String.class;
}
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/IdentityUIUser.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/IdentityUIUser.java 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/IdentityUIUser.java 2007-08-13 20:48:38 UTC (rev 7903)
@@ -24,21 +24,28 @@
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Set;
+import org.jboss.portal.core.identity.ui.common.MetaDataServiceBean;
import org.jboss.portal.faces.el.PropertyValue;
import org.jboss.portal.faces.el.dynamic.AbstractDynamicBean;
import org.jboss.portal.faces.el.dynamic.DynamicBean;
+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 org.jboss.portal.identity.UserProfileModule;
public class IdentityUIUser
{
-
+
private String username;
private String password;
private DynamicUserAttribute attribute = new DynamicUserAttribute();
-
+
public String getUsername()
{
return username;
@@ -55,6 +62,7 @@
{
this.password = password;
}
+
public DynamicUserAttribute getAttribute()
{
return attribute;
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/UIAttribute.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/UIAttribute.java 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/UIAttribute.java 2007-08-13 20:48:38 UTC (rev 7903)
@@ -34,6 +34,14 @@
private String converter;
private boolean required;
+ public UIAttribute(String identifier, String name) {
+ this.identifier = identifier;
+ this.name = name;
+ this.validator = null;
+ this.converter = null;
+ this.required = false;
+ }
+
public String getIdentifier()
{
return identifier;
Added: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileBean.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileBean.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/EditProfileBean.java 2007-08-13 20:48:38 UTC (rev 7903)
@@ -0,0 +1,164 @@
+/******************************************************************************
+ * 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.actions;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+
+import org.jboss.logging.Logger;
+import org.jboss.portal.core.identity.ui.IdentityUIUser;
+import org.jboss.portal.core.identity.ui.common.IdentityUserBean;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.NoSuchUserException;
+import org.jboss.portal.identity.User;
+import org.jboss.portlet.JBossRenderRequest;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class EditProfileBean
+{
+ private String currentUser;
+ private IdentityUIUser uiUser;
+ private IdentityUserBean identityUserBean;
+ private String password;
+ private String email;
+
+ private static final Logger log = Logger.getLogger(UserRegisterBean.class);
+
+ public EditProfileBean()
+ {
+ super();
+ this.currentUser = FacesContext.getCurrentInstance().getExternalContext().getRemoteUser();
+ }
+
+ public String getCurrentUser()
+ {
+ return currentUser;
+ }
+
+ public void setCurrentUser(String currentUser)
+ {
+ this.currentUser = currentUser;
+ }
+
+ public IdentityUIUser getUiUser()
+ {
+ try
+ {
+ this.uiUser = identityUserBean.getValues(this.currentUser, null);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ return uiUser;
+ }
+
+ public void setUiUser(IdentityUIUser uiUser)
+ {
+ this.uiUser = uiUser;
+ }
+
+ public IdentityUserBean getIdentityUserBean()
+ {
+ return identityUserBean;
+ }
+
+ public void setIdentityUserBean(IdentityUserBean identityUserBean)
+ {
+ this.identityUserBean = identityUserBean;
+ }
+
+ public String getPassword()
+ {
+ return password;
+ }
+
+ public void setPassword(String password)
+ {
+ this.password = password;
+ }
+
+ public String updateProfile()
+ {
+ try
+ {
+ User user = identityUserBean.findUserByUserName(this.currentUser);
+ // Adding dynamically set properties
+ identityUserBean.updateProfile(user, uiUser.getAttribute().getProfileAttributes());
+ }
+ catch (RuntimeException e)
+ {
+ e.printStackTrace();
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("RuntimeException"));
+ }
+ catch (IdentityException e)
+ {
+ e.printStackTrace();
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("IdentityExeption"));
+ }
+ return "editProfile";
+ }
+
+ public void changePassword()
+ {
+
+ if (this.password != null)
+ {
+ try
+ {
+ this.identityUserBean.updatePassword(this.currentUser, this.password);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Error"));
+ }
+ }
+ }
+
+ public void changeEmail()
+ {
+ if (this.email != null)
+ {
+ try
+ {
+ HashMap profileMap = new HashMap();
+ User user = this.identityUserBean.findUserByUserName(this.currentUser);
+ profileMap.put("email", email);
+ this.identityUserBean.updateProfile(user, profileMap);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Error"));
+ }
+ }
+ }
+}
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordBean.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordBean.java 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/LostPasswordBean.java 2007-08-13 20:48:38 UTC (rev 7903)
@@ -22,6 +22,20 @@
******************************************************************************/
package org.jboss.portal.core.identity.ui.actions;
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.jboss.portal.core.identity.ui.common.IdentityUserBean;
+import org.jboss.portal.core.modules.MailModule;
+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$
@@ -30,6 +44,24 @@
{
private String username;
private String email;
+
+ private IdentityUserBean identityUserBean;
+ private Session session;
+
+ public LostPasswordBean()
+ {
+ try
+ {
+ SessionFactory sessionFactory = (SessionFactory)new InitialContext().lookup("java:/portal/IdentitySessionFactory");
+ session = sessionFactory.getCurrentSession();
+ }
+ catch (NamingException e)
+ {
+ // FIXME
+ e.printStackTrace();
+ }
+ }
+
public String getUsername()
{
return username;
@@ -47,12 +79,38 @@
this.email = email;
}
- public void doomed()
+ public String doomed()
{
+ if ( username != null && email == null)
+ {
+ try
+ {
+ User user = identityUserBean.findUserByUserName(username);
+ // Send Email with new credentials
+ }
+ catch (NoSuchUserException e)
+ {
+ FacesContext.getCurrentInstance().addMessage("username", new FacesMessage("no account with this username found."));
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ FacesContext.getCurrentInstance().addMessage("username", new FacesMessage("Error"));
+ }
+ } else if ( username== null && email != null )
+ {
+ // Search properties
+
+ } else {
+ return "lostPassword";
+ }
+ return "lostPassword";
}
+ private boolean sendEmail() {
+ return false;
+ }
-
}
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/UserRegisterBean.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/UserRegisterBean.java 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/UserRegisterBean.java 2007-08-13 20:48:38 UTC (rev 7903)
@@ -22,13 +22,21 @@
******************************************************************************/
package org.jboss.portal.core.identity.ui.actions;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
+import javax.faces.model.SelectItem;
import org.jboss.logging.Logger;
import org.jboss.portal.core.identity.ui.IdentityUIUser;
import org.jboss.portal.core.identity.ui.common.IdentityUserBean;
import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.Role;
import org.jboss.portal.identity.User;
/**
@@ -38,6 +46,7 @@
public class UserRegisterBean
{
+ private List roles = new ArrayList();
private IdentityUIUser uiUser = new IdentityUIUser();
private IdentityUserBean identityUserBean;
@@ -64,6 +73,15 @@
this.identityUserBean = identityUserBean;
}
+ public List getRoles()
+ {
+ return roles;
+ }
+ public void setRoles(List roles)
+ {
+ this.roles = roles;
+ }
+
public String register()
{
if (uiUser.getUsername() != null && uiUser.getPassword() != null)
@@ -74,7 +92,9 @@
{
User user;
// Create user && assign roles
- user = identityUserBean.createUser(uiUser.getUsername(), uiUser.getPassword(), null);
+ user = identityUserBean.createUser(uiUser.getUsername(), uiUser.getPassword(), this.roles);
+// uiUser.getAttribute().setValue("", new Date);
+// uiUser.setEnabled
// Adding dynamically set properties
identityUserBean.updateProfile(user, uiUser.getAttribute().getProfileAttributes());
}
@@ -97,5 +117,4 @@
return "success";
}
-
}
Added: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/ValidateEmailServlet.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/ValidateEmailServlet.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/actions/ValidateEmailServlet.java 2007-08-13 20:48:38 UTC (rev 7903)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * 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.actions;
+
+import java.io.IOException;
+
+import javax.naming.InitialContext;
+import javax.servlet.ServletException;
+import javax.servlet.UnavailableException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.identity.UserProfileModule;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class ValidateEmailServlet extends HttpServlet
+{
+ private UserModule userModule;
+ private UserProfileModule userProfileModule;
+
+ public void init() throws ServletException
+ {
+ try
+ {
+ super.init();
+ InitialContext context = new InitialContext();
+ userModule = (UserModule) context.lookup("java:portal/UserModule");
+ userProfileModule = (UserProfileModule) context.lookup("java:portal/UserProfileModule");
+ }
+ catch (Exception e)
+ {
+ throw new UnavailableException(e.toString());
+ }
+ }
+
+ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ {
+ this.doPost(request, response);
+ }
+
+ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+ {
+ String userId = request.getParameter("uId");
+ String hash = request.getParameter("hash");
+ }
+}
+
Added: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/RoleManagementBean.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/RoleManagementBean.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/RoleManagementBean.java 2007-08-13 20:48:38 UTC (rev 7903)
@@ -0,0 +1,199 @@
+/******************************************************************************
+ * 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.admin;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.faces.model.ListDataModel;
+import javax.faces.model.SelectItem;
+
+import org.jboss.portal.core.identity.ui.common.IdentityUserBean;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.NoSuchUserException;
+import org.jboss.portal.identity.Role;
+import org.jboss.portal.identity.User;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class RoleManagementBean
+{
+
+ private Role role;
+ private ListDataModel roleList;
+
+ private IdentityUserBean identityUserBean;
+
+ public Role getRole()
+ {
+ return role;
+ }
+
+ public void setRole(Role role)
+ {
+ this.role = role;
+ }
+
+ public IdentityUserBean getIdentityUserBean()
+ {
+ return identityUserBean;
+ }
+
+ public void setIdentityUserBean(IdentityUserBean identityUserBean)
+ {
+ this.identityUserBean = identityUserBean;
+ }
+
+ public ListDataModel getRoleList()
+ {
+ List list = new ArrayList();
+ Set set = new HashSet();
+ try
+ {
+ set = identityUserBean.getRoleModule().findRoles();
+ }
+ catch (IdentityException e)
+ {
+ // FIXME
+ e.printStackTrace();
+ }
+ Iterator i = set.iterator();
+ while (i.hasNext())
+ {
+ Role role = (Role) i.next();
+ list.add(role);
+ }
+ this.roleList = new ListDataModel(list);
+ return this.roleList;
+ }
+
+ public List getRoleSelectItems()
+ {
+ List list = new ArrayList();
+ Set set = new HashSet();
+ try
+ {
+ set = identityUserBean.getRoleModule().findRoles();
+ }
+ catch (IdentityException e)
+ {
+ // FIXME
+ e.printStackTrace();
+ }
+ Iterator i = set.iterator();
+ while (i.hasNext())
+ {
+ Role role = (Role) i.next();
+ list.add(new SelectItem(role.getName()));
+ }
+ return list;
+ }
+
+ public ListDataModel getRoleMembers()
+ {
+ Set members = new HashSet();
+ List roleMembers = new ArrayList();
+ try
+ {
+ Role role = this.identityUserBean.getRoleModule().findRoleById(this.role.getId());
+ members = identityUserBean.getMembershipModule().getUsers(role);
+ } catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ Iterator i = members.iterator();
+ while(i.hasNext())
+ {
+ User user = (User) i.next();
+ try
+ {
+ roleMembers.add(identityUserBean.getValues(user.getUserName(), null));
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ return new ListDataModel(roleMembers);
+ }
+
+ public String viewRoleMembers()
+ {
+ try
+ {
+ this.role = identityUserBean.getRoleModule().findRoleById(((Role) this.roleList.getRowData()).getId());
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ return "viewMembers";
+ }
+
+ public String editRole()
+ {
+ try
+ {
+ this.role = identityUserBean.getRoleModule().findRoleById(((Role) this.roleList.getRowData()).getId());
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ return "editRole";
+ }
+
+ public String updateRole()
+ {
+ try
+ {
+ Role uRole = identityUserBean.getRoleModule().findRoleById(this.role.getId());
+ uRole.setDisplayName(role.getDisplayName());
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ return "success";
+ }
+
+ public String deleteRole()
+ {
+ Role uRole;
+ try
+ {
+ uRole = identityUserBean.getRoleModule().findRoleById(this.role.getId());
+ this.identityUserBean.getRoleModule().removeRole(uRole);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ return "success";
+ }
+}
\ No newline at end of file
Added: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java 2007-08-13 20:48:38 UTC (rev 7903)
@@ -0,0 +1,160 @@
+/******************************************************************************
+ * 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.admin;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.faces.component.UIParameter;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import javax.faces.model.DataModel;
+import javax.faces.model.ListDataModel;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.apache.myfaces.context.portlet.SessionMap;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.jboss.logging.Logger;
+import org.jboss.portal.core.identity.ui.IdentityUIUser;
+import org.jboss.portal.core.identity.ui.actions.UserRegisterBean;
+import org.jboss.portal.core.identity.ui.common.IdentityUserBean;
+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 org.jboss.portal.portlet.PortletContext;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class UserAdministrationBean
+{
+ private String currentUser;
+ private ListDataModel userList;
+ private List roles = new ArrayList();
+ private IdentityUIUser uiUser = new IdentityUIUser();
+ private String searchString;
+ private IdentityUserBean identityUserBean;
+
+ private static final Logger log = Logger.getLogger(UserAdministrationBean.class);
+
+ public UserAdministrationBean()
+ {
+ this.userList = new ListDataModel();
+ }
+
+ public DataModel getUserList()
+ {
+ return userList;
+ }
+ public String getSearchString()
+ {
+ return searchString;
+ }
+ public void setSearchString(String searchString)
+ {
+ this.searchString = searchString;
+ }
+ public List getRoles()
+ {
+ return roles;
+ }
+ public void setRoles(List roles)
+ {
+ this.roles = roles;
+ }
+
+ public IdentityUIUser getUiUser()
+ {
+ try
+ {
+ this.uiUser = identityUserBean.getValues(this.currentUser, null);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ return uiUser;
+ }
+ public void setUiUser(IdentityUIUser uiUser)
+ {
+ this.uiUser = uiUser;
+ }
+ public IdentityUserBean getIdentityUserBean()
+ {
+ return identityUserBean;
+ }
+ public void setIdentityUserBean(IdentityUserBean identityUserBean)
+ {
+ this.identityUserBean = identityUserBean;
+ }
+
+ public String searchUsers()
+ {
+ if ( this.searchString != null )
+ {
+ try
+ {
+ int offset = 0;
+ int limit = 100;
+ this.userList = new ListDataModel(identityUserBean.findUsersFilteredByUserName(searchString, offset, limit)) ;
+ }
+ catch (IllegalArgumentException e)
+ {
+ // FIXME
+ e.printStackTrace();
+ }
+ catch (NoSuchUserException e)
+ {
+ // FIXME
+ e.printStackTrace();
+ }
+ catch (IdentityException e)
+ {
+ // FIXME
+ e.printStackTrace();
+ }
+ }
+ return "userAdmin";
+ }
+
+ public String viewRoles()
+ {
+ this.currentUser = ((IdentityUIUser) userList.getRowData()).getUsername();
+ return "viewRoles";
+ }
+
+ public String editProfile()
+ {
+ this.currentUser = ((IdentityUIUser) userList.getRowData()).getUsername();
+ return "editProfile";
+ }
+
+}
+
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityUserBean.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityUserBean.java 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/IdentityUserBean.java 2007-08-13 20:48:38 UTC (rev 7903)
@@ -22,24 +22,30 @@
******************************************************************************/
package org.jboss.portal.core.identity.ui.common;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.List;
import java.util.Set;
import javax.faces.context.FacesContext;
+import javax.faces.model.ListDataModel;
import org.jboss.logging.Logger;
+import org.jboss.portal.core.identity.ui.IdentityUIUser;
import org.jboss.portal.core.identity.ui.UIAttribute;
import org.jboss.portal.core.identity.ui.actions.UserRegisterBean;
import org.jboss.portal.core.ui.portlet.user.UserPortletConstants;
import org.jboss.portal.identity.IdentityException;
import org.jboss.portal.identity.MembershipModule;
+import org.jboss.portal.identity.NoSuchUserException;
import org.jboss.portal.identity.Role;
import org.jboss.portal.identity.RoleModule;
import org.jboss.portal.identity.User;
import org.jboss.portal.identity.UserModule;
import org.jboss.portal.identity.UserProfileModule;
+import org.jboss.portal.identity.service.UserProfileModuleService;
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
@@ -48,7 +54,8 @@
public class IdentityUserBean
{
private String defaultRole;
-
+ private Set availableProperties;
+
private UserModule userModule;
private RoleModule roleModule;
private MembershipModule membershipModule;
@@ -56,8 +63,25 @@
private MetaDataServiceBean metaDataService;
- private static final Logger log = Logger.getLogger(UserRegisterBean.class);
+ private static final Logger log = Logger.getLogger(IdentityUserBean.class);
+
+ public IdentityUserBean()
+ {
+ this.availableProperties = new HashSet();
+ availableProperties.add("email");
+ availableProperties.add("givenname");
+ availableProperties.add("familyname");
+ availableProperties.add("skype");
+ availableProperties.add("location");
+ availableProperties.add("homepage");
+ availableProperties.add("icq");
+ availableProperties.add("aim");
+ availableProperties.add("msnm");
+ availableProperties.add("occupation");
+ availableProperties.add("interests");
+ }
+
public UserModule getUserModule()
{
return userModule;
@@ -118,12 +142,42 @@
this.metaDataService = metaDataService;
}
- public User createUser(String username, String password, Set roles) throws RuntimeException, IdentityException
+ public IdentityUIUser getValues(String username, Set values) throws RuntimeException, NoSuchUserException,
+ IdentityException
{
+ IdentityUIUser uiUser = new IdentityUIUser();
+
+ if (username != null)
+ {
+ Iterator i = this.availableProperties.iterator();
+ User user = this.findUserByUserName(username);
+ // Setting values
+ uiUser.setUsername(user.getUserName());
+
+ while (i.hasNext())
+ {
+ String key = (String) i.next();
+ UIAttribute uiAttribute = (UIAttribute) this.metaDataService.getValue(key).getObject();
+ try {
+ String id = (String) uiAttribute.getIdentifier();
+ String value = (String) userProfileModule.getProperty(user, id);
+ uiUser.getAttribute().setValue(key, value);
+ } catch (IdentityException e) {
+ //
+ }
+
+ }
+
+ }
+ return uiUser;
+ }
+
+ public User createUser(String username, String password, List roles) throws RuntimeException, IdentityException
+ {
// Checking roles
Set roleSet = new HashSet();
roleSet = this.checkRoles(roles);
-
+
// Create User
User user = userModule.createUser(username, password);
@@ -142,14 +196,46 @@
String key = (String) i.next();
String value = (String) profileMap.get(key);
UIAttribute uiAttribute = (UIAttribute) this.metaDataService.getValue(key).getObject();
- userProfileModule.setProperty(user, uiAttribute.getIdentifier(), value);
+ if (uiAttribute != null )
+ {
+ userProfileModule.setProperty(user, uiAttribute.getIdentifier(), value);
+ }
}
-
}
+
+ public User findUserByUserName(String username) throws IllegalArgumentException, NoSuchUserException, IdentityException
+ {
+ return userModule.findUserByUserName(username);
+ }
+
+ public List findUsersFilteredByUserName(String filter, int offset, int limit) throws IllegalArgumentException, IdentityException
+ {
+ Set users = new HashSet();
+ List list = new ArrayList();
+
+ users = userModule.findUsersFilteredByUserName(filter, offset, limit);
+
+ Iterator i = users.iterator();
+
+ while(i.hasNext())
+ {
+ User u = (User) i.next();
+ IdentityUIUser nu = new IdentityUIUser();
+ nu.setUsername(u.getUserName());
+ list.add(nu);
+ }
+ return list;
+ }
+
+ public void updatePassword(String username, String password) throws IllegalArgumentException, IdentityException, IdentityException
+ {
+ User user = userModule.findUserByUserName(username);
+ user.updatePassword(password);
+ }
- private Set checkRoles(Set roles) throws IllegalArgumentException, IdentityException
+ private Set checkRoles(List roles) throws IllegalArgumentException, IdentityException
{
-
+ Set roleSet = new HashSet();
if (roles != null)
{ // Checking existing roles
Iterator i = roles.iterator();
@@ -166,27 +252,40 @@
}
else
{
- roles.add(role);
+ roleSet.add(role);
}
}
- return roles;
+ return roleSet;
}
else
{
- roles = new HashSet();
Role role = roleModule.findRoleByName(defaultRole);
if (role != null)
{
- roles.add(role);
+ roleSet.add(role);
}
else
{
throw new IllegalArgumentException();
}
- return roles;
+ return roleSet;
}
}
+
+ public ListDataModel getFindRoles() {
+ Set set = new HashSet();
+ try
+ {
+ set = roleModule.findRoles();
+ }
+ catch (IdentityException e)
+ {
+ // FIXME
+ e.printStackTrace();
+ }
+ return new ListDataModel( new ArrayList(set) );
+ }
}
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/MetaDataServiceBean.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/MetaDataServiceBean.java 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/MetaDataServiceBean.java 2007-08-13 20:48:38 UTC (rev 7903)
@@ -23,7 +23,9 @@
package org.jboss.portal.core.identity.ui.common;
import java.util.HashMap;
+import java.util.Set;
+import org.jboss.portal.common.p3p.P3PConstants;
import org.jboss.portal.core.identity.ui.UIAttribute;
import org.jboss.portal.faces.el.PropertyValue;
import org.jboss.portal.faces.el.dynamic.DynamicBean;
@@ -38,13 +40,58 @@
HashMap map = new HashMap();
public MetaDataServiceBean() {
- UIAttribute uiAttribute = new UIAttribute();
- uiAttribute.setIdentifier(User.INFO_USER_EMAIL_REAL);
- uiAttribute.setName("email");
- uiAttribute.setValidator("EmailValidator");
- uiAttribute.setRequired(true);
- map.put("email", uiAttribute);
+ UIAttribute uiEmail = new UIAttribute(P3PConstants.INFO_USER_BUSINESS_INFO_ONLINE_EMAIL, "email");
+ uiEmail.setValidator("EmailValidator");
+ uiEmail.setRequired(true);
+
+ UIAttribute uiGivenName = new UIAttribute(P3PConstants.INFO_USER_NAME_GIVEN, "givenname");
+ UIAttribute uiFamilyName = new UIAttribute(P3PConstants.INFO_USER_NAME_FAMILY, "familyname");
+ UIAttribute uiSkype = new UIAttribute(User.INFO_USER_IM_SKYPE, "skype");
+ UIAttribute uiLocation = new UIAttribute(User.INFO_USER_LOCATION, "location");
+ UIAttribute uiOccupation = new UIAttribute(User.INFO_USER_OCCUPATION, "occupation");
+ UIAttribute uiExtra = new UIAttribute(User.INFO_USER_EXTRA, "extra");
+ UIAttribute uiSignature = new UIAttribute(User.INFO_USER_SIGNATURE, "signature");
+ UIAttribute uiInterests = new UIAttribute(User.INFO_USER_INTERESTS, "interests");
+ UIAttribute uiLocale = new UIAttribute(User.INFO_USER_LOCALE, "locale");
+ UIAttribute uiIcq = new UIAttribute(User.INFO_USER_IM_ICQ, "icq");
+ UIAttribute uiAim = new UIAttribute(User.INFO_USER_IM_AIM, "aim" );
+ UIAttribute uiMsmn = new UIAttribute(User.INFO_USER_IM_MSNM, "msnm" );
+ UIAttribute uiYim = new UIAttribute(User.INFO_USER_IM_YIM, "yim" );
+ UIAttribute uiXmmp = new UIAttribute(User.INFO_USER_IM_XMMP, "xmmp");
+ UIAttribute uiHomepage = new UIAttribute(User.INFO_USER_HOMEPAGE, "homepage" );
+ UIAttribute uiTimeZone = new UIAttribute(User.INFO_USER_TIME_ZONE_OFFSET, "timezone" );
+ UIAttribute uiTheme = new UIAttribute(User.INFO_USER_THEME, "theme" );
+ UIAttribute uiSecurityQuestion = new UIAttribute(User.INFO_USER_SECURITY_QUESTION, "securityquestion" );
+ UIAttribute uiSecurityAnswer = new UIAttribute(User.INFO_USER_SECURITY_ANSWER, "securityanswer" );
+ UIAttribute uiLastLogin = new UIAttribute(User.INFO_USER_LAST_LOGIN_DATE, "lastlogin" );
+ UIAttribute uiRegistrationDate = new UIAttribute(User.INFO_USER_REGISTRATION_DATE, "registrationdate" );
+ UIAttribute uiEnabled = new UIAttribute(User.INFO_USER_ENABLED, "enabled" );
+
+ this.addToMap(uiEmail);
+ this.addToMap(uiGivenName);
+ this.addToMap(uiFamilyName);
+ this.addToMap(uiSkype);
+ this.addToMap(uiLocation);
+ this.addToMap(uiOccupation);
+ this.addToMap(uiExtra);
+ this.addToMap(uiSignature);
+ this.addToMap(uiInterests);
+ this.addToMap(uiLocale);
+ this.addToMap(uiIcq);
+ this.addToMap(uiAim);
+ this.addToMap(uiMsmn);
+ this.addToMap(uiYim);
+ this.addToMap(uiXmmp);
+ this.addToMap(uiHomepage);
+ this.addToMap(uiTimeZone);
+ this.addToMap(uiTheme);
+ this.addToMap(uiSecurityQuestion);
+ this.addToMap(uiSecurityAnswer);
+ this.addToMap(uiLastLogin);
+ this.addToMap(uiRegistrationDate);
+ this.addToMap(uiEnabled);
+
}
public Class getType(Object propertyName) throws IllegalArgumentException
@@ -63,5 +110,10 @@
return false;
}
+ private void addToMap(UIAttribute uiAttribute)
+ {
+ this.map.put(uiAttribute.getName(), uiAttribute);
+ }
+
}
Deleted: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/ProfileBean.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/ProfileBean.java 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/common/ProfileBean.java 2007-08-13 20:48:38 UTC (rev 7903)
@@ -1,72 +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.common;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
-
-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 org.jboss.portlet.JBossRenderRequest;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class ProfileBean
-{
-
- private User user = null;
- private UserModule userModule;
-
- public ProfileBean()
- {
- JBossRenderRequest request = (JBossRenderRequest) FacesContext.getCurrentInstance().getExternalContext()
- .getRequest();
- this.user =request.getUser();
- }
-
-
- public User getUser()
- {
- return user;
- }
-
- public void setUser(User user)
- {
- this.user = user;
- }
-
- public UserModule getUserModule()
- {
- return userModule;
- }
-
- public void setUserModule(UserModule userModule)
- {
- this.userModule = userModule;
- }
-
-}
Added: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/CurrentPasswordValidator.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/CurrentPasswordValidator.java (rev 0)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/CurrentPasswordValidator.java 2007-08-13 20:48:38 UTC (rev 7903)
@@ -0,0 +1,74 @@
+/******************************************************************************
+ * 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.regex.Pattern;
+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.logging.Logger;
+import org.jboss.portal.core.identity.ui.actions.UserRegisterBean;
+import org.jboss.portal.core.ui.portlet.user.UserPortletConstants;
+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 org.jboss.portlet.JBossActionRequest;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+
+public class CurrentPasswordValidator implements Validator
+{
+ private UserModule userModule;
+ private String currentUser;
+ private User user;
+
+ private static final Logger log = Logger.getLogger(UserRegisterBean.class);
+
+ public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException
+ {
+ PortletContext portletContext = (PortletContext) context.getExternalContext().getContext();
+ userModule = (UserModule) portletContext.getAttribute("UserModule");
+ this.currentUser = context.getExternalContext().getRemoteUser();
+ try
+ {
+ user = userModule.findUserByUserName(this.currentUser);
+
+ } catch (Exception e) {
+ throw new ValidatorException( new FacesMessage("Password cannot be validated."));
+ }
+
+ if (user == null || (!user.validatePassword((String) value)))
+ {
+ throw new ValidatorException( new FacesMessage("Password is not valid."));
+ }
+
+ }
+}
Modified: trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/EmailValidator.java
===================================================================
--- trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/EmailValidator.java 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/validators/EmailValidator.java 2007-08-13 20:48:38 UTC (rev 7903)
@@ -50,6 +50,8 @@
throw new ValidatorException( new FacesMessage("Invalid EMail Address"));
}
+ } else {
+ throw new ValidatorException( new FacesMessage("Required"));
}
}
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/classes/Identity.properties
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/classes/Identity.properties (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/classes/Identity.properties 2007-08-13 20:48:38 UTC (rev 7903)
@@ -0,0 +1,74 @@
+################################################################################
+# 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. #
+################################################################################
+
+IDENTITY_WELCOME=Welcome
+IDENTITY_REGISTER=Register
+IDENTITY_LOST_PASSWORD=Lost Password
+IDENTITY_NOT_LOGGED_IN=You are currently not logged in.
+IDENTITY_CREATE_ACCOUNT=You can create an account.
+IDENTITY_SUCCESS_TITLE=Your account has been sucessfully created.
+IDENTITY_BUTTON_SUBMIT=Submit
+IDENTITY_BUTTON_EDIT=Edit
+
+IDENTITY_REGISTER_TITLE=Basic user information
+IDENTITY_REGISTER_TITLE_CONFIRM=Confirmation
+IDENTITY_REGISTER_PASSWORD_CONFIRM=Confirm Password
+
+IDENTITY_LOST_PASSWORD_TITLE=Forgot your login data?
+IDENTITY_LOST_PASSWORD_DESCRIPTION=Please enter your username or email address.
+
+IDENTITY_EDIT_PASSWORD_TITLE=Change your password
+IDENTITY_EDIT_PASSWORD_CURRENT=Current Password
+
+IDENTITY_EDIT_EMAIL_TITLE=Change your email address
+IDENTITY_EDIT_EMAIL_NEW=New email address
+
+IDENTITY_EDIT_PROFILE_TITLE=Change your profile
+
+IDENTITY_USERNAME=Username
+IDENTITY_PASSWORD=Password
+IDENTITY_EMAIL=E-Mail
+IDENTITY_GIVENNAME=Firstname
+IDENTITY_FAMILYNAME=Lastname
+IDENTITY_SKYPE=Skype ID
+IDENTITY_LOCATION=Location
+IDENTITY_OCCUPATION=Occupation
+IDENTITY_EXTRA=Extra
+IDENTITY_SIGNATURE=Signature
+IDENTITY_INTERESTS=Interests
+IDENTITY_LOCALE=Locale
+IDENTITY_ICQ=Icq ID
+IDENTITY_AIM=Aim ID
+IDENTITY_MSNM= MSN messenger ID
+IDENTITY_YIM=Yahoo ID
+IDENTITY_XMMP=Xmmp ID
+IDENTITY_HOMEPAGE=Homepage
+IDENTITY_TIMEZONE=Time zone offset
+IDENTITY_THEME=Theme
+IDENTITY_SECURITY_QUESTION=Security Question
+IDENTITY_SECURITY_ANSWER=Security Answer
+IDENTITY_LAST_LOGIN=Last login
+IDENTITY_REIGSTRATION_DATE=Registration Date
+IDENTITY_ENABLED=Enabled
+
+
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/classes/Identity_de.properties
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/classes/Identity_de.properties (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/classes/Identity_de.properties 2007-08-13 20:48:38 UTC (rev 7903)
@@ -0,0 +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. #
+################################################################################
+
+IDENTITY_WELCOME=Willkommen
+
\ No newline at end of file
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/faces-config.xml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -30,14 +30,7 @@
<application>
<property-resolver>org.jboss.portal.faces.el.DelegatingPropertyResolver</property-resolver>
<view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler>
- <locale-config>
- <default-locale>en</default-locale>
- <supported-locale>fr</supported-locale>
- </locale-config>
- <message-bundle>
-
- </message-bundle>
- </application>
+ </application>
<managed-bean>
<managed-bean-name>metadataservice</managed-bean-name>
@@ -74,6 +67,15 @@
</managed-property>
</managed-bean>
<managed-bean>
+ <managed-bean-name>editprofilebean</managed-bean-name>
+ <managed-bean-class>org.jboss.portal.core.identity.ui.actions.EditProfileBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>identityUserBean</property-name>
+ <value>#{identityusermgr}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
<managed-bean-name>userregistermgr</managed-bean-name>
<managed-bean-class>org.jboss.portal.core.identity.ui.actions.UserRegisterBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
@@ -83,14 +85,23 @@
</managed-property>
</managed-bean>
<managed-bean>
- <managed-bean-name>profilebean</managed-bean-name>
- <managed-bean-class>org.jboss.portal.core.identity.ui.common.ProfileBean</managed-bean-class>
+ <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>userModule</property-name>
- <value>#{applicationScope.UserModule}</value>
+ <property-name>identityUserBean</property-name>
+ <value>#{identityusermgr}</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>identityUserBean</property-name>
+ <value>#{identityusermgr}</value>
+ </managed-property>
+ </managed-bean>
<validator>
<validator-id>EmailValidator</validator-id>
@@ -104,6 +115,10 @@
<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>
<navigation-rule>
<navigation-case>
@@ -154,11 +169,86 @@
</navigation-case>
</navigation-rule>
<navigation-rule>
+ <from-view-id>/WEB-INF/jsf/index.xhtml</from-view-id>
<navigation-case>
<from-outcome>editProfile</from-outcome>
<to-view-id>/WEB-INF/jsf/profile/editProfile.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
+ <navigation-rule>
+ <from-view-id>/WEB-INF/jsf/admin/*</from-view-id>
+ <navigation-case>
+ <from-outcome>userAdmin</from-outcome>
+ <to-view-id>/WEB-INF/jsf/admin/index.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/WEB-INF/jsf/admin/*</from-view-id>
+ <navigation-case>
+ <from-outcome>roleAdmin</from-outcome>
+ <to-view-id>/WEB-INF/jsf/admin/roles.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/WEB-INF/jsf/admin/index.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>create</from-outcome>
+ <to-view-id>/WEB-INF/jsf/admin/register.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/WEB-INF/jsf/admin/*</from-view-id>
+ <navigation-case>
+ <from-action>#{useradministrationbean.editProfile}</from-action>
+ <from-outcome>editProfile</from-outcome>
+ <to-view-id>/WEB-INF/jsf/admin/editProfile.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/WEB-INF/jsf/admin/*</from-view-id>
+ <navigation-case>
+ <from-action>#{useradministrationbean.viewRoles}</from-action>
+ <from-outcome>viewRoles</from-outcome>
+ <to-view-id>/WEB-INF/jsf/admin/assignRoles.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/WEB-INF/jsf/admin/register.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>register</from-outcome>
+ <to-view-id>/WEB-INF/jsf/admin/assignRoles.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/WEB-INF/jsf/admin/assignRoles.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>register</from-outcome>
+ <to-view-id>/WEB-INF/jsf/admin/confirm.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/WEB-INF/jsf/admin/confirm.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>revise</from-outcome>
+ <to-view-id>/WEB-INF/jsf/admin/register.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/WEB-INF/jsf/admin/roles.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>editRole</from-outcome>
+ <to-view-id>/WEB-INF/jsf/admin/roles/editRole.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/WEB-INF/jsf/admin/roles.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>viewMembers</from-outcome>
+ <to-view-id>/WEB-INF/jsf/admin/roles/roleMembers.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+
</faces-config>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jboss-portlet.xml 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jboss-portlet.xml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -38,6 +38,18 @@
<link rel="stylesheet" type="text/css" href="/style.css" media="screen"/>
</header-content>
</portlet>
+ <portlet>
+ <portlet-name>CoreIdentityAdminPortlet</portlet-name>
+ <ajax>
+ <partial-refresh>false</partial-refresh>
+ </ajax>
+ <transaction>
+ <trans-attribute>Required</trans-attribute>
+ </transaction>
+ <header-content>
+ <link rel="stylesheet" type="text/css" href="/style.css" media="screen"/>
+ </header-content>
+ </portlet>
<!-- Injecting of required services into the portlet context. -->
<service>
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/adminTemplate.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/adminTemplate.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/adminTemplate.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -0,0 +1,31 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+ <f:loadBundle var="bundle" basename="Identity" />
+
+ <h:form>
+ <ul class="topnav">
+ <li>
+ <h:commandLink action="userAdmin">User Management</h:commandLink>
+ </li>
+ <li>
+ <h:commandLink action="roleAdmin">Role Management</h:commandLink>
+ </li>
+ </ul>
+ </h:form>
+
+ <!-- Status message -->
+ <h:message infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+
+ <!-- Title -->
+ <h4><ui:insert name="title">Title</ui:insert></h4>
+
+ <!-- Content -->
+ <ui:insert name="content">Content</ui:insert>
+
+</div>
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/assignRoles.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/assignRoles.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/assignRoles.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -0,0 +1,24 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+<ui:composition template="/WEB-INF/jsf/admin/adminTemplate.xhtml">
+
+<ui:define name="title">
+ title
+</ui:define>
+
+<ui:define name="content">
+<h:form>
+<h:selectManyCheckbox id="roles" value="#{userregistermgr.roles}">
+ <f:selectItems value="#{rolemanagementbean.roleSelectItems}" />
+</h:selectManyCheckbox>
+<h:commandButton value="Submit" action="register"/>
+</h:form>
+</ui:define>
+</ui:composition>
+</div>
\ No newline at end of file
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/confirm.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/confirm.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/confirm.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -0,0 +1,41 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+<ui:composition template="/WEB-INF/jsf/admin/adminTemplate.xhtml">
+
+
+<ui:define name="title">#{bundle.IDENTITY_REGISTER_TITLE_CONFIRM}</ui:define>
+<ui:define name="content">
+<h:form>
+ <h:panelGrid columns="2">
+ <h:outputText for="username" value="#{bundle.IDENTITY_USERNAME}"/>
+ <h:outputText id="username" value="#{userregistermgr.uiUser.username}"/>
+
+ <h:outputText for="email" value="#{bundle.IDENTITY_EMAIL}"/>
+ <h:outputText id="email" value="#{userregistermgr.uiUser.attribute.email}"/>
+
+ <h:outputText for="password" value="#{bundle.IDENTITY_PASSWORD}"/>
+ <h:outputText id="password">******</h:outputText>
+ </h:panelGrid>
+ <br/>Assigned Roles:<br/>
+ <h:dataTable id="roleslist" value="#{userregistermgr.roles}" var="role">
+ <h:column>
+ <h:outputText value="#{role}"/>
+ </h:column>
+ </h:dataTable>
+
+ <h:messages />
+ <hr/>
+ <h:commandButton value="#{bundle.IDENTITY_BUTTON_EDIT}" action="revise" styleClass="portlet-form-button"/>
+ <h:commandButton value="#{bundle.IDENTITY_BUTTON_SUBMIT}" action="#{userregistermgr.register}" styleClass="portlet-form-button"/>
+</h:form>
+
+
+</ui:define>
+</ui:composition>
+</div>
\ No newline at end of file
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/editProfile.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/editProfile.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/editProfile.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -0,0 +1,24 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+<ui:composition template="/WEB-INF/jsf/admin/adminTemplate.xhtml">
+
+<ui:define name="title">
+ asdf
+</ui:define>
+
+<ui:define name="content">
+
+ <ui:decorate template="/WEB-INF/jsf/common/profile.xhtml">
+ <ui:param name="manager" value="#{useradministrationbean}"/>
+ </ui:decorate>
+
+</ui:define>
+
+</ui:composition>
+</div>
\ No newline at end of file
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/index.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/index.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/index.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -0,0 +1,49 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+<ui:composition template="/WEB-INF/jsf/admin/adminTemplate.xhtml">
+<ui:define name="title">
+ User Management
+</ui:define>
+
+<ui:define name="content">
+ <h:form>
+ <h:outputText for="searchString">Search Users:</h:outputText>
+ <h:inputText id="searchString" value="#{useradministrationbean.searchString}" />
+ <h:commandButton value="Search" action="#{useradministrationbean.searchUsers}" styleClass="portlet-form-button"/>
+ </h:form>
+
+ <h:dataTable id="userlist" value="#{useradministrationbean.userList}" var="uiUser" rendered="#{useradministrationbean.userList.rowCount > 0}">
+ <h:column>
+ <f:facet name="header">
+ <h:outputText>Username</h:outputText>
+ </f:facet>
+ <h:outputText value="#{uiUser.username}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText>Actions</h:outputText>
+ </f:facet>
+ <h:commandLink action="#{useradministrationbean.editProfile}">
+ <h:outputText value="Edit Profile"/>
+ <f:param name="uiUser" value="#{uiUser}"/>
+ </h:commandLink>
+
+ | <h:commandLink action="#{useradministrationbean.viewRoles}">
+ <h:outputText value="Roles"/>
+ <f:param name="uiUser" value="#{uiUser}"/>
+ </h:commandLink> | <h:commandLink>delete</h:commandLink>
+ </h:column>
+ </h:dataTable>
+<hr/>
+ <h:messages />
+ <h:commandLink value="create User Account" action="create"/>
+</ui:define>
+
+</ui:composition>
+</div>
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/register.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/register.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/register.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -0,0 +1,24 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+<ui:composition template="/WEB-INF/jsf/admin/adminTemplate.xhtml">
+
+<ui:define name="title">
+ #{bundle.IDENTITY_REGISTER_TITLE}
+</ui:define>
+
+<ui:define name="content">
+
+ <ui:decorate template="/WEB-INF/jsf/common/register.xhtml">
+ <ui:param name="manager" value="#{userregistermgr}"/>
+ </ui:decorate>
+
+</ui:define>
+
+</ui:composition>
+</div>
\ No newline at end of file
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/registerRoles.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/registerRoles.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/registerRoles.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -0,0 +1,22 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+<ui:composition template="/WEB-INF/jsf/admin/adminTemplate.xhtml">
+
+<ui:define name="title">
+ Define Membership
+</ui:define>
+
+<ui:define name="content">
+
+ ...
+
+</ui:define>
+
+</ui:composition>
+</div>
\ No newline at end of file
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles/editRole.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles/editRole.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles/editRole.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -0,0 +1,24 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+<ui:composition template="/WEB-INF/jsf/admin/adminTemplate.xhtml">
+
+<ui:define name="title">
+ Edit Role
+</ui:define>
+
+<ui:define name="content">
+<h:form>
+ <h:outputText value="#{rolemanagementbean.role.name}" /><br/>
+ DisplayName: <h:inputText value="#{rolemanagementbean.role.displayName}"/>
+
+ <h:commandButton value="Submit" action="rolemanagementbean.updateRole"/>
+</h:form>
+</ui:define>
+</ui:composition>
+</div>
\ No newline at end of file
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles/roleMembers.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles/roleMembers.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles/roleMembers.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -0,0 +1,28 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+<ui:composition template="/WEB-INF/jsf/admin/adminTemplate.xhtml">
+
+<ui:define name="title">
+ Edit Role
+</ui:define>
+
+<ui:define name="content">
+<h:form>
+ <h:dataTable value="#{rolemanagementbean.roleMembers}" var="uiUser">
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Username" />
+ </f:facet>
+ <h:outputText value="#{uiUser.username}"/>
+ </h:column>
+ </h:dataTable>
+</h:form>
+</ui:define>
+</ui:composition>
+</div>
\ No newline at end of file
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/admin/roles.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -0,0 +1,42 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+<ui:composition template="/WEB-INF/jsf/admin/adminTemplate.xhtml">
+<ui:define name="title">
+ role Management
+</ui:define>
+
+<ui:define name="content">
+<h:form>
+ <h:dataTable id="userlist" value="#{rolemanagementbean.roleList}" var="role">
+ <h:column>
+ <f:facet name="header">
+ <h:outputText>Role Name</h:outputText>
+ </f:facet>
+ <h:outputText value="#{role.name}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText>Actions</h:outputText>
+ </f:facet>
+ <h:commandLink action="#{rolemanagementbean.editRole}">
+ <h:outputText>Edit Role</h:outputText>
+ <f:param name="role" value="#{role}"/>
+ </h:commandLink>
+ | <h:commandLink action="#{rolemanagementbean.viewRoleMembers}">
+ <h:outputText value="Members" />
+ <f:param name="role" value="#{role}"/>
+ </h:commandLink>
+ | Delete
+ </h:column>
+ </h:dataTable>
+ </h:form>
+</ui:define>
+
+</ui:composition>
+</div>
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/profile.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/profile.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/profile.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -0,0 +1,83 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+
+ <ul class="topnav">
+ <li id="currentTab"><b>#{bundle.IDENTITY_EDIT_PROFILE_TITLE}</b></li>
+ </ul>
+
+ <h:outputText for="username" value="#{bundle.IDENTITY_USERNAME}"/>:
+ <h:outputText id="username" value="#{manager.uiUser.username}"/>
+ <br/>
+ <h:outputText for="email" value="#{bundle.IDENTITY_EMAIL}"/>:
+ <h:outputText id="email" value="#{manager.uiUser.attribute.email}"/>
+ <br/>
+
+ <ul class="topnav">
+ <li id="currentTab">Personal Information</li>
+ </ul>
+
+ <h:form>
+ <h:panelGrid columns="3" cellpadding="3">
+ <h:outputText for="givenname" value="#{bundle.IDENTITY_GIVENNAME}"/>
+ <h:inputText id="givenname" value="#{manager.uiUser.attribute.givenname}"/>
+ <h:message for="givenname" />
+
+ <h:outputText for="lastname" value="#{bundle.IDENTITY_FAMILYNAME}"/>
+ <h:inputText id="lastname" value="#{manager.uiUser.attribute.familyname}"/>
+ <h:message for="lastname"/>
+
+ <h:outputText for="homepage" value="#{bundle.IDENTITY_HOMEPAGE}"/>
+ <h:inputText id="homepage" value="#{manager.uiUser.attribute.homepage}"/>
+ <h:message for="homepage"/>
+ </h:panelGrid>
+
+ <ul class="topnav">
+ <li id="currentTab">Instant Message Identities</li>
+ </ul>
+
+ <h:panelGrid columns="3" cellpadding="3">
+ <h:outputText for="skype" value="#{bundle.IDENTITY_SKYPE}"/>
+ <h:inputText id="skype" value="#{manager.uiUser.attribute.skype}"/>
+ <h:message for="skype"/>
+
+ <h:outputText for="icq" value="#{bundle.IDENTITY_ICQ}"/>
+ <h:inputText id="icq" value="#{manager.uiUser.attribute.icq}"/>
+ <h:message for="icq"/>
+
+ <h:outputText for="aim" value="#{bundle.IDENTITY_AIM}"/>
+ <h:inputText id="aim" value="#{manager.uiUser.attribute.aim}"/>
+ <h:message for="aim"/>
+
+ <h:outputText for="msnm" value="#{bundle.IDENTITY_MSNM}"/>
+ <h:inputText id="msnm" value="#{manager.uiUser.attribute.msnm}"/>
+ <h:message for="msnm"/>
+ </h:panelGrid>
+
+ <ul class="topnav">
+ <li id="currentTab">Additional User Information</li>
+ </ul>
+
+ <h:panelGrid columns="3" cellpadding="3">
+ <h:outputText for="location" value="#{bundle.IDENTITY_LOCATION}"/>
+ <h:inputText id="location" value="#{manager.uiUser.attribute.location}"/>
+ <h:message for="location"/>
+
+ <h:outputText for="occupation" value="#{bundle.IDENTITY_OCCUPATION}"/>
+ <h:inputText id="occupation" value="#{manager.uiUser.attribute.occupation}"/>
+ <h:message for="occupation"/>
+
+ <h:outputText for="interests" value="#{bundle.IDENTITY_INTERESTS}"/>
+ <h:inputText id="interests" value="#{manager.uiUser.attribute.interests}"/>
+ <h:message for="interests"/>
+
+ </h:panelGrid>
+ <hr/>
+ <h:commandButton value="#{bundle.IDENTITY_BUTTON_SUBMIT}" action="#{manager.updateProfile}" styleClass="portlet-form-button"/>
+ </h:form>
+ </div>
\ No newline at end of file
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/register.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/register.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/common/register.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -0,0 +1,39 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+ <h:form>
+ <h:panelGrid columns="3" cellpadding="3">
+
+ <h:outputText for="username" value="#{bundle.IDENTITY_USERNAME}"/>
+ <h:inputText id="username" value="#{manager.uiUser.username}" required="true">
+ <f:validator validatorId="UsernameValidator"/>
+ </h:inputText>
+ <h:message for="username"/>
+
+ <h:outputText for="#{metadataservice.email.name}" value="#{bundle.IDENTITY_EMAIL}"/>
+ <h:inputText id="#{metadataservice.email.name}" value="#{manager.uiUser.attribute.email}" required="#{metadataservice.email.required}">
+ <f:validator validatorId="#{metadataservice.email.validator}"/>
+ </h:inputText>
+ <h:message for="#{metadataservice.email.name}"/>
+
+ <h:outputText for="password" value="#{bundle.IDENTITY_PASSWORD}"/>
+ <h:inputSecret id="password" value="#{manager.uiUser.password}" required="true">
+ <f:validateLength minimum="6"/>
+ </h:inputSecret>
+ <h:message for="password"/>
+
+ <h:outputText for="passwordCheck" value="#{bundle.IDENTITY_REGISTER_PASSWORD_CONFIRM}"/>
+ <h:inputSecret id="passwordCheck" required="true">
+ <f:validator validatorId="PasswordValidator"/>
+ </h:inputSecret>
+ <h:message for="passwordCheck"/>
+ </h:panelGrid>
+ <hr/>
+ <h:commandButton id="submit" action="register" value="#{bundle.IDENTITY_BUTTON_SUBMIT}" styleClass="portlet-form-button"/>
+ </h:form>
+ </div>
\ No newline at end of file
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/lost.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/lost.xhtml 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/lost.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -5,26 +5,28 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
class="identity-ui">
+
+<ui:composition template="/WEB-INF/jsf/register/registerTemplate.xhtml">
- <h:form>
- <ul class="topnav">
- <li>
- <h:commandLink value="Welcome" action="start"/>
- </li>
- <li>
- <h:commandLink value="Register" action="register"/>
- </li>
- <li id="currentTab">Lost Password</li>
- </ul>
- </h:form>
+<ui:define name="title">
+ #{bundle.IDENTITY_LOST_PASSWORD_TITLE}
+</ui:define>
+<ui:define name="content">
+<h:form>
+ <p>#{bundle.IDENTITY_LOST_PASSWORD_DESCRIPTION}</p>
+ <h:panelGrid columns="3" cellpadding="3">
+ <h:outputText for="username" value="#{bundle.IDENTITY_USERNAME}"/>
+ <h:inputText id="username" />
+ <h:message for="username" />
-<h:form>
-<h4>Forgot your login data?</h4>
-<p>Please enter your username or the email address.</p>
-Username: <h:inputText />
-or E-Mail address: <h:inputText />
-<hr/>
-<h:commandButton value="Submit" styleClass="portlet-form-button"/>
+ <h:outputText for="email" value="#{bundle.IDENTITY_EMAIL}"/>
+ <h:inputText id="username" />
+ <h:message for="email"/>
+ </h:panelGrid>
+ <hr/>
+ <h:commandButton value="#{bundle.IDENTITY_BUTTON_SUBMIT}" styleClass="portlet-form-button"/>
</h:form>
+</ui:define>
+</ui:composition>
+</div>
-</div>
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/lostPassword/status.xhtml
===================================================================
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changeEmail.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changeEmail.xhtml 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changeEmail.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -5,7 +5,7 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
class="identity-ui">
-
+ <f:loadBundle var="bundle" basename="Identity" />
<h:form>
<ul class="topnav">
<li>
@@ -23,8 +23,19 @@
<h:form>
<h4>Change your email address</h4>
- Current password: <h:inputSecret /><br/>
- New email address: <h:inputText />
+ <h:panelGrid columns="3" cellpadding="3">
+ <h:outputText for="currentPassword" value="#{bundle.IDENTITY_EDIT_PASSWORD_CURRENT}"/>
+ <h:inputSecret id="currentPassword" value="currentPassword" required="true">
+ <f:validator validatorId="CurrentPasswordValidator"/>
+ </h:inputSecret>
+ <h:message for="currentPassword" />
+
+ <h:outputText for="email">New email address</h:outputText>
+ <h:inputText id="email" value="#{editprofilebean.password}" required="true">
+ <f:validator validatorId="EmailValidator" />
+ </h:inputText>
+ <h:message for="email" />
+ </h:panelGrid>
<hr/>
<h:commandButton value="Submit" styleClass="portlet-form-button"/>
</h:form>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changePassword.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changePassword.xhtml 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/changePassword.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -5,7 +5,7 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
class="identity-ui">
-
+ <f:loadBundle var="bundle" basename="Identity" />
<h:form>
<ul class="topnav">
<li>
@@ -22,12 +22,28 @@
</h:form>
<h:form>
- <h4>Change your password</h4>
- Current password: <h:inputSecret /><br/>
- New password: <h:inputText /><br/>
- Retype password: <h:inputText />
+ <h4>#{bundle.IDENTITY_EDIT_PASSWORD_TITLE}</h4>
+ <h:panelGrid columns="3" cellpadding="3">
+ <h:outputText for="currentPassword" value="#{bundle.IDENTITY_EDIT_PASSWORD_CURRENT}"/>
+ <h:inputSecret id="currentPassword" value="currentPassword" required="true">
+ <f:validator validatorId="CurrentPasswordValidator"/>
+ </h:inputSecret>
+ <h:message for="currentPassword" />
+
+ <h:outputText for="password" value="#{bundle.IDENTITY_PASSWORD}"/>
+ <h:inputSecret id="password" required="true" value="#{editprofilebean.password}">
+ <f:validateLength minimum="6"/>
+ </h:inputSecret>
+ <h:message for="password"/>
+
+ <h:outputText for="passwordCheck" value="#{bundle.IDENTITY_REGISTER_PASSWORD_CONFIRM}"/>
+ <h:inputSecret id="passwordCheck" required="true">
+ <f:validator validatorId="PasswordValidator"/>
+ </h:inputSecret>
+ <h:message for="passwordCheck"/>
+ </h:panelGrid>
+
<hr/>
<h:commandButton value="Submit" styleClass="portlet-form-button"/>
</h:form>
-
</div>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/editProfile.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/editProfile.xhtml 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/editProfile.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -6,6 +6,8 @@
xmlns:c="http://java.sun.com/jstl/core"
class="identity-ui">
+ <f:loadBundle var="bundle" basename="Identity" />
+
<h:form>
<ul class="topnav">
<li>
@@ -21,33 +23,9 @@
</ul>
</h:form>
- <h:form>
- <h4>Change your profile</h4>
-
- <h:outputText for="username">Username</h:outputText>
- <h:outputText value="#{profilebean.user.userName}"/>
- <br/>
+ <ui:decorate template="/WEB-INF/jsf/common/profile.xhtml">
+ <ui:param name="manager" value="#{editprofilebean}"/>
+ </ui:decorate>
- <ul class="topnav">
- <li id="currentTab">Personal Information</li>
- </ul>
- <br/>
-
- <h:outputText for="firstname">Firstname</h:outputText>
- <h:inputText id="firstname" />
- <h:message for="firstname"/>
- <br/>
- <h:outputText for="lastname">Lastname</h:outputText>
- <h:inputText id="lastname" />
- <h:message for="lastname"/>
- <br/>
- <ul class="topnav">
- <li id="currentTab">Contact Information</li>
- </ul>
- <br/>
- ....
-
- <hr/>
- <h:commandButton value="Submit" styleClass="portlet-form-button"/>
- </h:form>
+
</div>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/viewProfile.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/viewProfile.xhtml 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/profile/viewProfile.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -6,6 +6,8 @@
xmlns:c="http://java.sun.com/jstl/core"
class="identity-ui">
+ <f:loadBundle var="bundle" basename="Identity" />
+
<h:form>
<ul class="topnav">
<li id="currentTab">View profile</li>
@@ -22,6 +24,9 @@
</h:form>
<h4>User profile</h4>
- Username: #{profilebean.user.userName}
+ #{bundle.IDENTITY_USERNAME}: #{editprofilebean.currentUser}<br/>
+ #{bundle.IDENTITY_EMAIL}: #{editprofilebean.currentUser}<br/>
+ #{bundle.IDENTITY_GIVENNAME}: #{editprofilebean.uiUser.attribute.givenname}<br/>
+ #{bundle.IDENTITY_FAMILYNAME}: #{editprofilebean.uiUser.attribute.familyname}
</div>
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/confirm.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/confirm.xhtml 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/confirm.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -2,38 +2,34 @@
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
class="identity-ui">
- <h:form>
- <ul class="topnav">
- <li>
- <h:commandLink value="Welcome" action="start"/>
- </li>
- <li id="currentTab">Register</li>
- <li>
- <h:commandLink value="Lost Password" action="lostPassword"/>
- </li>
- </ul>
- </h:form>
+<ui:composition template="/WEB-INF/jsf/register/registerTemplate.xhtml">
+
+<ui:define name="title">#{bundle.IDENTITY_REGISTER_TITLE_CONFIRM}</ui:define>
+<ui:define name="content">
<h:form>
- <h4>Confirmation</h4>
<h:panelGrid columns="2">
- <h:outputText for="username">Username</h:outputText>
+ <h:outputText for="username" value="#{bundle.IDENTITY_USERNAME}"/>
<h:outputText id="username" value="#{userregistermgr.uiUser.username}"/>
- <h:outputText for="email">EMail</h:outputText>
+ <h:outputText for="email" value="#{bundle.IDENTITY_EMAIL}"/>
<h:outputText id="email" value="#{userregistermgr.uiUser.attribute.email}"/>
- <h:outputText for="password">Password</h:outputText>
- <h:outputText id="password">secret</h:outputText>
+ <h:outputText for="password" value="#{bundle.IDENTITY_PASSWORD}"/>
+ <h:outputText id="password">******</h:outputText>
</h:panelGrid>
<h:messages />
<hr/>
- <h:commandButton value="Edit" action="revise" styleClass="portlet-form-button"/>
- <h:commandButton value="Confirm" action="#{userregistermgr.register}" styleClass="portlet-form-button"/>
+ <h:commandButton value="#{bundle.IDENTITY_BUTTON_EDIT}" action="revise" styleClass="portlet-form-button"/>
+ <h:commandButton value="#{bundle.IDENTITY_BUTTON_SUBMIT}" action="#{userregistermgr.register}" styleClass="portlet-form-button"/>
</h:form>
-</div>
+
+</ui:define>
+</ui:composition>
+</div>
\ No newline at end of file
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/overview.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/overview.xhtml 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/overview.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -5,19 +5,14 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jstl/core"
class="identity-ui">
+
+<ui:composition template="/WEB-INF/jsf/register/registerTemplate.xhtml">
- <h:form>
- <ul class="topnav">
- <li id="currentTab">Welcome</li>
- <li>
- <h:commandLink value="Register" action="register"/>
- </li>
- <li>
- <h:commandLink value="Lost Password" action="lostPassword"/>
- </li>
- </ul>
- </h:form>
-
- <h4>You are currently not logged in.</h4>
- <h:commandLink action="register">You can create an account.</h:commandLink>
-</div>
+<ui:define name="title">
+ #{bundle.IDENTITY_NOT_LOGGED_IN}
+</ui:define>
+<ui:define name="content">
+ <h:commandLink value="#{bundle.IDENTITY_CREATE_ACCOUNT}" action="register"/>
+</ui:define>
+</ui:composition>
+</div>
\ No newline at end of file
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/register.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/register.xhtml 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/register.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -6,48 +6,19 @@
xmlns:c="http://java.sun.com/jstl/core"
class="identity-ui">
- <h:form>
- <ul class="topnav">
- <li>
- <h:commandLink value="Welcome" action="start"/>
- </li>
- <li id="currentTab">Register</li>
- <li>
- <h:commandLink value="Lost Password" action="lostPassword"/>
- </li>
- </ul>
- </h:form>
+<ui:composition template="/WEB-INF/jsf/register/registerTemplate.xhtml">
- <h:form>
- <h4>Basic user Information</h4>
- <h:panelGrid columns="3">
-
- <h:outputText for="username">Username</h:outputText>
- <h:inputText id="username" value="#{userregistermgr.uiUser.username}" required="true">
- <f:validator validatorId="UsernameValidator"/>
- </h:inputText>
- <h:message for="username"/>
-
- <h:outputText for="#{metadataservice.email.name}">E-Mail</h:outputText>
- <h:inputText id="#{metadataservice.email.name}" value="#{userregistermgr.uiUser.attribute.email}" required="#{metadataservice.email.required}">
- <f:validator validatorId="#{metadataservice.email.validator}"/>
- </h:inputText>
- <h:message for="#{metadataservice.email.name}"/>
-
- <h:outputText for="password">Password</h:outputText>
- <h:inputSecret id="password" value="#{userregistermgr.uiUser.password}" required="true">
- <f:validateLength minimum="6"/>
- </h:inputSecret>
- <h:message for="password"/>
+<ui:define name="title">
+ #{bundle.IDENTITY_REGISTER_TITLE}
+</ui:define>
- <h:outputText for="passwordCheck">Confirm Password</h:outputText>
- <h:inputSecret id="passwordCheck" required="true">
- <f:validator validatorId="PasswordValidator"/>
- </h:inputSecret>
- <h:message for="passwordCheck"/>
- </h:panelGrid>
- <hr/>
- <h:commandButton id="submit" action="register" value="Register" styleClass="portlet-form-button"/>
- </h:form>
+<ui:define name="content">
+ <ui:decorate template="/WEB-INF/jsf/common/register.xhtml">
+ <ui:param name="manager" value="#{userregistermgr}"/>
+ </ui:decorate>
+
+</ui:define>
+
+</ui:composition>
</div>
\ No newline at end of file
Added: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/registerTemplate.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/registerTemplate.xhtml (rev 0)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/registerTemplate.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -0,0 +1,33 @@
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
+
+ <f:loadBundle var="bundle" basename="Identity" />
+
+ <h:form>
+ <ul class="topnav">
+ <li>
+ <h:commandLink value="#{bundle.IDENTITY_WELCOME}" action="start"/>
+ </li>
+ <li>
+ <h:commandLink value="#{bundle.IDENTITY_REGISTER}" action="register"/>
+ </li>
+ <li>
+ <h:commandLink value="#{bundle.IDENTITY_LOST_PASSWORD}" action="lostPassword"/>
+ </li>
+ </ul>
+ </h:form>
+
+ <!-- Status message -->
+ <h:message infoClass="portlet-msg-success" errorClass="portlet-msg-error" fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+
+ <!-- Title -->
+ <h4><ui:insert name="title">Title</ui:insert></h4>
+
+ <!-- Content -->
+ <ui:insert name="content">Content</ui:insert>
+</div>
\ No newline at end of file
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/success.xhtml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/success.xhtml 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/jsf/register/success.xhtml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -3,9 +3,16 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
- xmlns:c="http://java.sun.com/jstl/core">
+ xmlns:c="http://java.sun.com/jstl/core"
+ class="identity-ui">
- <p>Thank you for registering!</p>
- you may now proceed to the login...
+<ui:composition template="/WEB-INF/jsf/register/registerTemplate.xhtml">
-</div>
+<ui:define name="title">
+ #{bundle.IDENTITY_SUCCESS_TITLE}
+</ui:define>
+<ui:define name="content">
+
+</ui:define>
+</ui:composition>
+</div>
\ No newline at end of file
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet-instances.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet-instances.xml 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet-instances.xml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -33,4 +33,10 @@
<portlet-ref>CoreIdentityUserPortlet</portlet-ref>
</instance>
</deployment>
+ <deployment>
+ <instance>
+ <instance-id>CoreIdentityAdminPortletInstance</instance-id>
+ <portlet-ref>CoreIdentityAdminPortlet</portlet-ref>
+ </instance>
+ </deployment>
</deployments>
\ No newline at end of file
Modified: trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml
===================================================================
--- trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml 2007-08-13 14:56:17 UTC (rev 7902)
+++ trunk/core-identity/src/resources/portal-identity-war/WEB-INF/portlet.xml 2007-08-13 20:48:38 UTC (rev 7903)
@@ -54,4 +54,24 @@
<keywords>management,user</keywords>
</portlet-info>
</portlet>
+
+ <portlet>
+ <description>Core Identity Admin Portlet</description>
+ <portlet-name>CoreIdentityAdminPortlet</portlet-name>
+ <display-name>Core Identity Admin Portlet</display-name>
+ <portlet-class>org.jboss.portal.faces.loader.FacesPortlet</portlet-class>
+ <init-param>
+ <name>default-view</name>
+ <value>/WEB-INF/jsf/admin/index.xhtml</value>
+ </init-param>
+ <expiration-cache>-1</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Core Identity Admin Portlet</title>
+ <keywords>management,admin</keywords>
+ </portlet-info>
+ </portlet>
</portlet-app>
18 years, 8 months
JBoss Portal SVN: r7902 - in trunk: core/src/main/org/jboss/portal/core/model/portal and 4 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-08-13 10:56:17 -0400 (Mon, 13 Aug 2007)
New Revision: 7902
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml
trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
trunk/core/src/main/org/jboss/portal/core/model/portal/DefaultPortalCommandFactory.java
trunk/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java
Log:
- Fixed default portal / default page behavior
- JBPORTAL-1324: Multiple portals / custom url : set the default portal name
- JBPORTAL-1616: Portal link should redirect to the default page of the default portal
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2007-08-13 14:51:23 UTC (rev 7901)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2007-08-13 14:56:17 UTC (rev 7902)
@@ -42,6 +42,7 @@
import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.Portal;
import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.PortalObjectContainer;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.PortalObjectPermission;
import org.jboss.portal.core.model.portal.PortalObjectPath;
@@ -80,7 +81,7 @@
private static Logger log = Logger.getLogger(PageCustomizerInterceptor.class);
/** . */
- private static final PortalObjectId defaultPortalId = PortalObjectId.parse("/default/default", PortalObjectPath.CANONICAL_FORMAT);
+ private static final PortalObjectId defaultPortalId = PortalObjectId.parse("/", PortalObjectPath.CANONICAL_FORMAT);
/** . */
private static PortalObjectId adminPortalId = PortalObjectId.parse("/admin", PortalObjectPath.CANONICAL_FORMAT);
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/DefaultPortalCommandFactory.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/DefaultPortalCommandFactory.java 2007-08-13 14:51:23 UTC (rev 7901)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/DefaultPortalCommandFactory.java 2007-08-13 14:56:17 UTC (rev 7902)
@@ -39,9 +39,6 @@
{
/** . */
- private PortalObjectId defaultPortalPath = PortalObjectId.parse("/default", PortalObjectPath.CANONICAL_FORMAT);
-
- /** . */
private CommandFactory nextFactory;
/** . */
@@ -72,7 +69,7 @@
ControllerCommand cmd = nextFactory.doMapping(controllerContext, invocation, host, contextPath, requestPath);
if (cmd == null)
{
- Portal portal = (Portal)container.getObject(defaultPortalPath);
+ Portal portal = (Portal)container.getContext().getDefaultPortal();
if (portal == null)
{
throw new IllegalStateException("Default portal does not exist");
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java 2007-08-13 14:51:23 UTC (rev 7901)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java 2007-08-13 14:56:17 UTC (rev 7902)
@@ -174,6 +174,13 @@
RoleSecurityBinding binding = new RoleSecurityBinding(PortalObjectPermission.VIEW_RECURSIVE_ACTION, SecurityConstants.UNCHECKED_ROLE_NAME);
securityConstraints.getConstraints().add(binding);
}
+ else if (this instanceof ContextMetaData)
+ {
+ // Default is view
+ securityConstraints = new SecurityConstraintsMetaData();
+ RoleSecurityBinding binding = new RoleSecurityBinding(PortalObjectPermission.VIEW_ACTION, SecurityConstants.UNCHECKED_ROLE_NAME);
+ securityConstraints.getConstraints().add(binding);
+ }
}
else
{
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-08-13 14:51:23 UTC (rev 7901)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-08-13 14:56:17 UTC (rev 7902)
@@ -131,6 +131,9 @@
private SelectItem[] portalPageItems;
/** . */
+ private SelectItem[] portalItems;
+
+ /** . */
private List selectedObjectPath;
/** . */
@@ -331,6 +334,11 @@
return portalPageItems;
}
+ public SelectItem[] getPortalItems()
+ {
+ return portalItems;
+ }
+
public List getSelectedObjectPath()
{
return selectedObjectPath;
@@ -491,6 +499,7 @@
propertyAction = null;
instanceItems = null;
portalPageItems = null;
+ portalItems = null;
selectedObjectPath = null;
selectedObject = null;
selectedProperties = null;
@@ -525,6 +534,18 @@
theme = new ThemeBean(selectedObject);
//
+ Collection portals = getSelectedObject().getChildren(PortalObject.PORTAL_MASK);
+ ArrayList portalList = new ArrayList(portals.size() + 1);
+ for (Iterator iterator = portals.iterator(); iterator.hasNext();)
+ {
+ PortalObject o = (PortalObject)iterator.next();
+ SelectItem item = new SelectItem(o.getName());
+ portalList.add(item);
+ }
+ portalList.add(new SelectItem("", "no selection"));
+ portalItems = (SelectItem[])portalList.toArray(new SelectItem[portalList.size()]);
+
+ //
Collection pages = getSelectedObject().getChildren(PortalObject.PAGE_MASK);
ArrayList list = new ArrayList(pages.size() + 1);
for (Iterator iterator = pages.iterator(); iterator.hasNext();)
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java 2007-08-13 14:51:23 UTC (rev 7901)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java 2007-08-13 14:56:17 UTC (rev 7902)
@@ -86,18 +86,18 @@
this.portalName = portalName;
}
- public String getDefaultPageName()
+ public String getDefaultObjectName()
{
return pomgr.getSelectedObject().getDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME);
}
- public void setDefaultPageName(String defaultPageName)
+ public void setDefaultObjectName(String defaultObjectName)
{
- if (defaultPageName != null && !defaultPageName.equals(""))
+ if (defaultObjectName != null && !defaultObjectName.equals(""))
{
- pomgr.getSelectedObject().setDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME, defaultPageName);
+ pomgr.getSelectedObject().setDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME, defaultObjectName);
}
- else if (defaultPageName == null || defaultPageName.equals(""))
+ else if (defaultObjectName == null || defaultObjectName.equals(""))
{
pomgr.getSelectedObject().setDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME, null);
}
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml 2007-08-13 14:51:23 UTC (rev 7901)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml 2007-08-13 14:56:17 UTC (rev 7902)
@@ -17,14 +17,32 @@
<!-- Sub page addition -->
<div style="padding:1em 0 0 0">
- <h:form id="portal_form">
- <span class="portlet-font">Create a portal:</span>
- <span style="padding:1em 0 1em 0">
- <h:inputText id="name" value="#{portalAction.portalName}" styleClass="portlet-form-input-field" required="true"/>
- <h:commandButton action="#{portalAction.addPortal}" value="Add portal" styleClass="portlet-form-button"/>
- <h:message for="name" errorClass="portlet-msg-error"/>
- </span>
- </h:form>
+ <table>
+ <tr>
+ <h:form id="portal_form">
+ <td><span class="portlet-font">Create a portal:</span></td>
+ <td><h:inputText id="name" value="#{portalAction.portalName}" styleClass="portlet-form-input-field" required="true"/></td>
+ <td><h:commandButton action="#{portalAction.addPortal}" value="Add portal" styleClass="portlet-form-button"/></td>
+ <td><h:message for="name" errorClass="portlet-msg-error"/></td>
+ </h:form>
+ </tr>
+ <!-- Default portal -->
+ <tr>
+ <h:form>
+ <td>
+ <span class="portlet-font">Default portal:</span>
+ </td>
+ <td>
+ <h:selectOneMenu id="name" styleClass="portlet-form-field" value="#{portalAction.defaultObjectName}">
+ <f:selectItems value="#{portalobjectmgr.portalItems}" />
+ </h:selectOneMenu>
+ </td>
+ <td colspan="2">
+ <h:commandButton styleClass="portlet-form-button" value="Update" action="objects"/>
+ </td>
+ </h:form>
+ </tr>
+ </table>
</div>
<!-- Separation -->
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml 2007-08-13 14:51:23 UTC (rev 7901)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml 2007-08-13 14:56:17 UTC (rev 7902)
@@ -50,13 +50,14 @@
</h:form>
</tr>
<!-- Default page -->
+ <h:panelGroup rendered="#{portalobjectmgr.selectedObject.type == PortalObject.TYPE_PORTAL}">
<tr>
<h:form>
<td>
<span class="portlet-font">Default page:</span>
</td>
<td>
- <h:selectOneMenu id="name" styleClass="portlet-form-field" value="#{portalAction.defaultPageName}">
+ <h:selectOneMenu id="name" styleClass="portlet-form-field" value="#{portalAction.defaultObjectName}">
<f:selectItems value="#{portalobjectmgr.portalPageItems}" />
</h:selectOneMenu>
</td>
@@ -65,6 +66,7 @@
</td>
</h:form>
</tr>
+ </h:panelGroup>
</table>
</div>
18 years, 8 months
JBoss Portal SVN: r7901 - in branches/JBoss_Portal_Branch_2_6: core/src/main/org/jboss/portal/core/model/portal and 5 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-08-13 10:51:23 -0400 (Mon, 13 Aug 2007)
New Revision: 7901
Modified:
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml
branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/DefaultPortalCommandFactory.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
- Fixed default portal / default page behavior
- JBPORTAL-1324: Multiple portals / custom url : set the default portal name
- JBPORTAL-1616: Portal link should redirect to the default page of the default portal
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2007-08-13 07:45:45 UTC (rev 7900)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2007-08-13 14:51:23 UTC (rev 7901)
@@ -42,6 +42,7 @@
import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.Portal;
import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.PortalObjectContainer;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.PortalObjectPermission;
import org.jboss.portal.core.model.portal.PortalObjectPath;
@@ -80,7 +81,7 @@
private static Logger log = Logger.getLogger(PageCustomizerInterceptor.class);
/** . */
- private static final PortalObjectId defaultPortalId = PortalObjectId.parse("/default/default", PortalObjectPath.CANONICAL_FORMAT);
+ private static final PortalObjectId defaultPortalId = PortalObjectId.parse("/", PortalObjectPath.CANONICAL_FORMAT);
/** . */
private static PortalObjectId adminPortalId = PortalObjectId.parse("/admin", PortalObjectPath.CANONICAL_FORMAT);
@@ -103,6 +104,9 @@
/** . */
private PortalAuthorizationManagerFactory portalAuthorizationManagerFactory;
+ /** . */
+ private PortalObjectContainer portalObjectContainer;
+
public PortalAuthorizationManagerFactory getPortalAuthorizationManagerFactory()
{
return portalAuthorizationManagerFactory;
@@ -113,6 +117,16 @@
this.portalAuthorizationManagerFactory = portalAuthorizationManagerFactory;
}
+ public PortalObjectContainer getPortalObjectContainer()
+ {
+ return portalObjectContainer;
+ }
+
+ public void setPortalObjectContainer(PortalObjectContainer portalObjectContainer)
+ {
+ this.portalObjectContainer = portalObjectContainer;
+ }
+
public ControllerResponse invoke(ControllerCommand cmd) throws Exception
{
ControllerResponse resp = (ControllerResponse)cmd.invokeNext();
@@ -280,7 +294,9 @@
if (admin || isDashboard)
{
// Link to default page of default portal
- ViewPageCommand vpc = new ViewPageCommand(defaultPortalId);
+ // Cannot use defaultPortalId in 2.6.x because the default context doesn't have the view right.
+ // Upgrading from 2.6.1 to 2.6.2 would break.
+ ViewPageCommand vpc = new ViewPageCommand(portalObjectContainer.getContext().getDefaultPortal().getId());
rd.setAttribute("org.jboss.portal.header.DEFAULT_PORTAL_URL", new PortalURLImpl(vpc, controllerCtx, null, null));
}
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/DefaultPortalCommandFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/DefaultPortalCommandFactory.java 2007-08-13 07:45:45 UTC (rev 7900)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/DefaultPortalCommandFactory.java 2007-08-13 14:51:23 UTC (rev 7901)
@@ -39,9 +39,6 @@
{
/** . */
- private PortalObjectId defaultPortalPath = PortalObjectId.parse("/default", PortalObjectPath.CANONICAL_FORMAT);
-
- /** . */
private CommandFactory nextFactory;
/** . */
@@ -72,7 +69,7 @@
ControllerCommand cmd = nextFactory.doMapping(controllerContext, invocation, host, contextPath, requestPath);
if (cmd == null)
{
- Portal portal = (Portal)container.getObject(defaultPortalPath);
+ Portal portal = (Portal)container.getContext().getDefaultPortal();
if (portal == null)
{
throw new IllegalStateException("Default portal does not exist");
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java 2007-08-13 07:45:45 UTC (rev 7900)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/metadata/PortalObjectMetaData.java 2007-08-13 14:51:23 UTC (rev 7901)
@@ -174,6 +174,13 @@
RoleSecurityBinding binding = new RoleSecurityBinding(PortalObjectPermission.VIEW_RECURSIVE_ACTION, SecurityConstants.UNCHECKED_ROLE_NAME);
securityConstraints.getConstraints().add(binding);
}
+ else if (this instanceof ContextMetaData)
+ {
+ // Default is view
+ securityConstraints = new SecurityConstraintsMetaData();
+ RoleSecurityBinding binding = new RoleSecurityBinding(PortalObjectPermission.VIEW_ACTION, SecurityConstants.UNCHECKED_ROLE_NAME);
+ securityConstraints.getConstraints().add(binding);
+ }
}
else
{
Modified: branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-08-13 07:45:45 UTC (rev 7900)
+++ branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-08-13 14:51:23 UTC (rev 7901)
@@ -227,6 +227,10 @@
<depends
optional-attribute-name="PortalAuthorizationManagerFactory"
proxy-type="attribute">portal:service=PortalAuthorizationManagerFactory</depends>
+ <depends
+ optional-attribute-name="PortalObjectContainer"
+ proxy-type="attribute">portal:container=PortalObject</depends>
+
</mbean>
<mbean
code="org.jboss.portal.core.aspects.controller.node.EventBroadcasterInterceptor"
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-08-13 07:45:45 UTC (rev 7900)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-08-13 14:51:23 UTC (rev 7901)
@@ -131,6 +131,9 @@
private SelectItem[] portalPageItems;
/** . */
+ private SelectItem[] portalItems;
+
+ /** . */
private List selectedObjectPath;
/** . */
@@ -331,6 +334,11 @@
return portalPageItems;
}
+ public SelectItem[] getPortalItems()
+ {
+ return portalItems;
+ }
+
public List getSelectedObjectPath()
{
return selectedObjectPath;
@@ -491,6 +499,7 @@
propertyAction = null;
instanceItems = null;
portalPageItems = null;
+ portalItems = null;
selectedObjectPath = null;
selectedObject = null;
selectedProperties = null;
@@ -525,6 +534,18 @@
theme = new ThemeBean(selectedObject);
//
+ Collection portals = getSelectedObject().getChildren(PortalObject.PORTAL_MASK);
+ ArrayList portalList = new ArrayList(portals.size() + 1);
+ for (Iterator iterator = portals.iterator(); iterator.hasNext();)
+ {
+ PortalObject o = (PortalObject)iterator.next();
+ SelectItem item = new SelectItem(o.getName());
+ portalList.add(item);
+ }
+ portalList.add(new SelectItem("", "no selection"));
+ portalItems = (SelectItem[])portalList.toArray(new SelectItem[portalList.size()]);
+
+ //
Collection pages = getSelectedObject().getChildren(PortalObject.PAGE_MASK);
ArrayList list = new ArrayList(pages.size() + 1);
for (Iterator iterator = pages.iterator(); iterator.hasNext();)
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java 2007-08-13 07:45:45 UTC (rev 7900)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java 2007-08-13 14:51:23 UTC (rev 7901)
@@ -86,18 +86,18 @@
this.portalName = portalName;
}
- public String getDefaultPageName()
+ public String getDefaultObjectName()
{
return pomgr.getSelectedObject().getDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME);
}
- public void setDefaultPageName(String defaultPageName)
+ public void setDefaultObjectName(String defaultObjectName)
{
- if (defaultPageName != null && !defaultPageName.equals(""))
+ if (defaultObjectName != null && !defaultObjectName.equals(""))
{
- pomgr.getSelectedObject().setDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME, defaultPageName);
+ pomgr.getSelectedObject().setDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME, defaultObjectName);
}
- else if (defaultPageName == null || defaultPageName.equals(""))
+ else if (defaultObjectName == null || defaultObjectName.equals(""))
{
pomgr.getSelectedObject().setDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME, null);
}
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml 2007-08-13 07:45:45 UTC (rev 7900)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml 2007-08-13 14:51:23 UTC (rev 7901)
@@ -17,14 +17,32 @@
<!-- Sub page addition -->
<div style="padding:1em 0 0 0">
- <h:form id="portal_form">
- <span class="portlet-font">Create a portal:</span>
- <span style="padding:1em 0 1em 0">
- <h:inputText id="name" value="#{portalAction.portalName}" styleClass="portlet-form-input-field" required="true"/>
- <h:commandButton action="#{portalAction.addPortal}" value="Add portal" styleClass="portlet-form-button"/>
- <h:message for="name" errorClass="portlet-msg-error"/>
- </span>
- </h:form>
+ <table>
+ <tr>
+ <h:form id="portal_form">
+ <td><span class="portlet-font">Create a portal:</span></td>
+ <td><h:inputText id="name" value="#{portalAction.portalName}" styleClass="portlet-form-input-field" required="true"/></td>
+ <td><h:commandButton action="#{portalAction.addPortal}" value="Add portal" styleClass="portlet-form-button"/></td>
+ <td><h:message for="name" errorClass="portlet-msg-error"/></td>
+ </h:form>
+ </tr>
+ <!-- Default portal -->
+ <tr>
+ <h:form>
+ <td>
+ <span class="portlet-font">Default portal:</span>
+ </td>
+ <td>
+ <h:selectOneMenu id="name" styleClass="portlet-form-field" value="#{portalAction.defaultObjectName}">
+ <f:selectItems value="#{portalobjectmgr.portalItems}" />
+ </h:selectOneMenu>
+ </td>
+ <td colspan="2">
+ <h:commandButton styleClass="portlet-form-button" value="Update" action="objects"/>
+ </td>
+ </h:form>
+ </tr>
+ </table>
</div>
<!-- Separation -->
Modified: branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml 2007-08-13 07:45:45 UTC (rev 7900)
+++ branches/JBoss_Portal_Branch_2_6/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml 2007-08-13 14:51:23 UTC (rev 7901)
@@ -50,13 +50,14 @@
</h:form>
</tr>
<!-- Default page -->
+ <h:panelGroup rendered="#{portalobjectmgr.selectedObject.type == PortalObject.TYPE_PORTAL}">
<tr>
<h:form>
<td>
<span class="portlet-font">Default page:</span>
</td>
<td>
- <h:selectOneMenu id="name" styleClass="portlet-form-field" value="#{portalAction.defaultPageName}">
+ <h:selectOneMenu id="name" styleClass="portlet-form-field" value="#{portalAction.defaultObjectName}">
<f:selectItems value="#{portalobjectmgr.portalPageItems}" />
</h:selectOneMenu>
</td>
@@ -65,6 +66,7 @@
</td>
</h:form>
</tr>
+ </h:panelGroup>
</table>
</div>
18 years, 8 months
JBoss Portal SVN: r7900 - trunk/faces/src/main/org/jboss/portal/test/faces/el.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-08-13 03:45:45 -0400 (Mon, 13 Aug 2007)
New Revision: 7900
Added:
trunk/faces/src/main/org/jboss/portal/test/faces/el/TestBeanSuperClass.java
Modified:
trunk/faces/src/main/org/jboss/portal/test/faces/el/DelegatingPropertyResolverTestCase.java
trunk/faces/src/main/org/jboss/portal/test/faces/el/TestBean.java
Log:
Test case for Delegating property resolver bug fix (Check superclass for attribute)
Modified: trunk/faces/src/main/org/jboss/portal/test/faces/el/DelegatingPropertyResolverTestCase.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/test/faces/el/DelegatingPropertyResolverTestCase.java 2007-08-13 07:44:14 UTC (rev 7899)
+++ trunk/faces/src/main/org/jboss/portal/test/faces/el/DelegatingPropertyResolverTestCase.java 2007-08-13 07:45:45 UTC (rev 7900)
@@ -53,6 +53,9 @@
private TestBeanDecorator testBeanInterfaceSuperInterfaceDecorator;
/** . */
+ private TestBeanDecorator testBeanSuperClassDecorator;
+
+ /** . */
private TestDynamicBean testDynamicBean;
/** . */
@@ -66,11 +69,13 @@
testBeanDecorator = new TestBeanDecorator(testBean.property);
testBeanInterfaceDecorator = new TestBeanDecorator(testBean.interfaceProperty);
testBeanInterfaceSuperInterfaceDecorator = new TestBeanDecorator(testBean.interfaceSuperInterfaceProperty);
+ testBeanSuperClassDecorator = new TestBeanDecorator(testBean.superClassProperty);
testDynamicBean = new TestDynamicBean();
resolver = new DelegatingPropertyResolver();
resolver.registerDecorator(TestBean.class, testBeanDecorator);
resolver.registerDecorator(TestBeanInterface.class, testBeanInterfaceDecorator);
resolver.registerDecorator(TestBeanInterfaceSuperInterface.class, testBeanInterfaceSuperInterfaceDecorator);
+ resolver.registerDecorator(TestBeanSuperClass.class, testBeanSuperClassDecorator);
}
public void testGetType()
@@ -96,6 +101,7 @@
assertEquals(Value.class, resolver.getType(testBean, testBeanDecorator.property.name));
assertEquals(Value.class, resolver.getType(testBean, testBeanInterfaceDecorator.property.name));
assertEquals(Value.class, resolver.getType(testBean, testBeanInterfaceSuperInterfaceDecorator.property.name));
+ assertEquals(Value.class, resolver.getType(testBean, testBeanSuperClassDecorator.property.name));
//
try
@@ -144,6 +150,7 @@
assertEquals(testBean.property.value, resolver.getValue(testBean, testBeanDecorator.property.name));
assertEquals(testBeanInterfaceDecorator.property.value, resolver.getValue(testBean, testBeanInterfaceDecorator.property.name));
assertEquals(testBeanInterfaceSuperInterfaceDecorator.property.value, resolver.getValue(testBean, testBeanInterfaceSuperInterfaceDecorator.property.name));
+ assertEquals(testBeanSuperClassDecorator.property.value, resolver.getValue(testBean, testBeanSuperClassDecorator.property.name));
//
try
@@ -186,6 +193,9 @@
Value interfaceSuperInterfacePropertyExpectedValue = new Value();
resolver.setValue(testBean, testBeanInterfaceSuperInterfaceDecorator.property.name, interfaceSuperInterfacePropertyExpectedValue);
assertEquals(interfaceSuperInterfacePropertyExpectedValue, testBeanInterfaceSuperInterfaceDecorator.property.value);
+ Value superClassPropertyExpectedValue = new Value();
+ resolver.setValue(testBean, testBeanSuperClassDecorator.property.name, superClassPropertyExpectedValue);
+ assertEquals(superClassPropertyExpectedValue, testBeanSuperClassDecorator.property.value);
//
try
Modified: trunk/faces/src/main/org/jboss/portal/test/faces/el/TestBean.java
===================================================================
--- trunk/faces/src/main/org/jboss/portal/test/faces/el/TestBean.java 2007-08-13 07:44:14 UTC (rev 7899)
+++ trunk/faces/src/main/org/jboss/portal/test/faces/el/TestBean.java 2007-08-13 07:45:45 UTC (rev 7900)
@@ -26,7 +26,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class TestBean implements TestBeanInterface
+public class TestBean extends TestBeanSuperClass implements TestBeanInterface
{
/** . */
@@ -38,11 +38,15 @@
/** . */
Property interfaceSuperInterfaceProperty;
+ /** . */
+ Property superClassProperty;
+
public TestBean()
{
this.property = new Property();
this.interfaceProperty = new Property();
this.interfaceSuperInterfaceProperty = new Property();
+ this.superClassProperty = new Property();
}
public class Property
Copied: trunk/faces/src/main/org/jboss/portal/test/faces/el/TestBeanSuperClass.java (from rev 7899, branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/TestBeanSuperClass.java)
===================================================================
--- trunk/faces/src/main/org/jboss/portal/test/faces/el/TestBeanSuperClass.java (rev 0)
+++ trunk/faces/src/main/org/jboss/portal/test/faces/el/TestBeanSuperClass.java 2007-08-13 07:45:45 UTC (rev 7900)
@@ -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. *
+ ******************************************************************************/
+package org.jboss.portal.test.faces.el;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class TestBeanSuperClass
+{
+
+}
+
18 years, 8 months
JBoss Portal SVN: r7899 - branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-08-13 03:44:14 -0400 (Mon, 13 Aug 2007)
New Revision: 7899
Added:
branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/TestBeanSuperClass.java
Modified:
branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/DelegatingPropertyResolverTestCase.java
branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/TestBean.java
Log:
Test case for Delegating property resolver bug fix (Check superclass for attribute)
Modified: branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/DelegatingPropertyResolverTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/DelegatingPropertyResolverTestCase.java 2007-08-10 22:50:33 UTC (rev 7898)
+++ branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/DelegatingPropertyResolverTestCase.java 2007-08-13 07:44:14 UTC (rev 7899)
@@ -53,6 +53,9 @@
private TestBeanDecorator testBeanInterfaceSuperInterfaceDecorator;
/** . */
+ private TestBeanDecorator testBeanSuperClassDecorator;
+
+ /** . */
private TestDynamicBean testDynamicBean;
/** . */
@@ -66,11 +69,13 @@
testBeanDecorator = new TestBeanDecorator(testBean.property);
testBeanInterfaceDecorator = new TestBeanDecorator(testBean.interfaceProperty);
testBeanInterfaceSuperInterfaceDecorator = new TestBeanDecorator(testBean.interfaceSuperInterfaceProperty);
+ testBeanSuperClassDecorator = new TestBeanDecorator(testBean.superClassProperty);
testDynamicBean = new TestDynamicBean();
resolver = new DelegatingPropertyResolver();
resolver.registerDecorator(TestBean.class, testBeanDecorator);
resolver.registerDecorator(TestBeanInterface.class, testBeanInterfaceDecorator);
resolver.registerDecorator(TestBeanInterfaceSuperInterface.class, testBeanInterfaceSuperInterfaceDecorator);
+ resolver.registerDecorator(TestBeanSuperClass.class, testBeanSuperClassDecorator);
}
public void testGetType()
@@ -96,6 +101,7 @@
assertEquals(Value.class, resolver.getType(testBean, testBeanDecorator.property.name));
assertEquals(Value.class, resolver.getType(testBean, testBeanInterfaceDecorator.property.name));
assertEquals(Value.class, resolver.getType(testBean, testBeanInterfaceSuperInterfaceDecorator.property.name));
+ assertEquals(Value.class, resolver.getType(testBean, testBeanSuperClassDecorator.property.name));
//
try
@@ -144,6 +150,7 @@
assertEquals(testBean.property.value, resolver.getValue(testBean, testBeanDecorator.property.name));
assertEquals(testBeanInterfaceDecorator.property.value, resolver.getValue(testBean, testBeanInterfaceDecorator.property.name));
assertEquals(testBeanInterfaceSuperInterfaceDecorator.property.value, resolver.getValue(testBean, testBeanInterfaceSuperInterfaceDecorator.property.name));
+ assertEquals(testBeanSuperClassDecorator.property.value, resolver.getValue(testBean, testBeanSuperClassDecorator.property.name));
//
try
@@ -186,6 +193,9 @@
Value interfaceSuperInterfacePropertyExpectedValue = new Value();
resolver.setValue(testBean, testBeanInterfaceSuperInterfaceDecorator.property.name, interfaceSuperInterfacePropertyExpectedValue);
assertEquals(interfaceSuperInterfacePropertyExpectedValue, testBeanInterfaceSuperInterfaceDecorator.property.value);
+ Value superClassPropertyExpectedValue = new Value();
+ resolver.setValue(testBean, testBeanSuperClassDecorator.property.name, superClassPropertyExpectedValue);
+ assertEquals(superClassPropertyExpectedValue, testBeanSuperClassDecorator.property.value);
//
try
Modified: branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/TestBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/TestBean.java 2007-08-10 22:50:33 UTC (rev 7898)
+++ branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/TestBean.java 2007-08-13 07:44:14 UTC (rev 7899)
@@ -26,7 +26,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class TestBean implements TestBeanInterface
+public class TestBean extends TestBeanSuperClass implements TestBeanInterface
{
/** . */
@@ -38,11 +38,15 @@
/** . */
Property interfaceSuperInterfaceProperty;
+ /** . */
+ Property superClassProperty;
+
public TestBean()
{
this.property = new Property();
this.interfaceProperty = new Property();
this.interfaceSuperInterfaceProperty = new Property();
+ this.superClassProperty = new Property();
}
public class Property
Added: branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/TestBeanSuperClass.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/TestBeanSuperClass.java (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/test/faces/el/TestBeanSuperClass.java 2007-08-13 07:44:14 UTC (rev 7899)
@@ -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. *
+ ******************************************************************************/
+package org.jboss.portal.test.faces.el;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class TestBeanSuperClass
+{
+
+}
+
18 years, 8 months