Author: emuckenhuber
Date: 2007-09-14 11:28:02 -0400 (Fri, 14 Sep 2007)
New Revision: 8268
Added:
trunk/core-identity/src/main/org/jboss/portal/test/core/identity/metadata/
trunk/core-identity/src/main/org/jboss/portal/test/core/identity/metadata/ConfigurationTestCase.java
trunk/core-identity/src/main/org/jboss/portal/test/core/identity/mock/
trunk/core-identity/src/main/org/jboss/portal/test/core/identity/mock/MockProfileInfo.java
trunk/core-identity/src/main/org/jboss/portal/test/core/identity/mock/MockPropertyInfo.java
trunk/core-identity/src/main/org/jboss/portal/test/core/identity/mock/MockUserProfileModule.java
trunk/core-identity/src/resources/test/
trunk/core-identity/src/resources/test/conf/
trunk/core-identity/src/resources/test/conf/configuration1.xml
trunk/core-identity/src/resources/test/conf/schema/
trunk/core-identity/src/resources/test/conf/schema/identity-ui-configuration.xsd
Modified:
trunk/core-identity/build.xml
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java
trunk/core-identity/src/main/org/jboss/portal/test/core/identity/
trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xml
Log:
- configuration parsing test case
Modified: trunk/core-identity/build.xml
===================================================================
--- trunk/core-identity/build.xml 2007-09-14 14:37:36 UTC (rev 8267)
+++ trunk/core-identity/build.xml 2007-09-14 15:28:02 UTC (rev 8268)
@@ -84,6 +84,8 @@
<property name="jboss-junit-configuration" value=""/>
<property name="junit.formatter.usefile" value="true"/>
+ <property name="test.reports"
value="${module.output}/tests"/>
+
<!-- Configure thirdparty libraries -->
&libraries;
@@ -218,6 +220,7 @@
<copy todir="${build.resources}/portal-identity-war">
<fileset dir="${source.bin}/portal-identity-war"/>
</copy>
+
<!-- portal-identity.sar -->
<copy todir="${build.resources}/portal-identity.sar">
<fileset dir="${build.resources}/portal-identity-sar"/>
@@ -231,7 +234,6 @@
<copy
todir="${build.resources}/portal-identity.sar/portal-identity.war">
<fileset dir="${build.resources}/portal-identity-war"/>
</copy>
-
</target>
<target name="output" depends="artifacts">
@@ -295,9 +297,46 @@
<delete
file="${jboss.home}/server/${portal.deploy.dir}/portal-identity.sar"/>
</target>
- <target name="package-tests"/>
+ <!--
+ | Tests
+ -->
+
+ <target name="package-tests" depends="init, clean-tests">
-
+ <jar jarfile="${build.lib}/portal-core-identity-test-lib.jar">
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/test/**"/>
+ </jar>
+
+ </target>
+
+ <target name="clean-tests" description="cleans the output from the
package-test command">
+
+ </target>
+
+ <target name="tests" depends="init, package-tests"
description="Runs the core-identity tests">
+ <mkdir dir="${test.reports}"/>
+
+ <execute-tests>
+ <x-test>
+ <test todir="${test.reports}"
name="org.jboss.portal.test.core.identity.metadata.ConfigurationTestCase"/>
+ </x-test>
+ <x-classpath>
+ <path refid="junit.junit.classpath"/>
+ <path refid="jboss.jbossxb.classpath"/>
+ <path refid="jbossas/core.libs.classpath"/>
+ <path refid="jboss.portal-jems.classpath"/>
+ <path refid="jboss.portal-identity.classpath"/>
+ <path refid="oswego.concurrent.classpath" />
+ <path refid="apache.xerces.classpath"/>
+ <pathelement
location="${build.lib}/portal-core-identity-ui-lib.jar"/>
+ <pathelement
location="${build.lib}/portal-core-identity-services-lib.jar"/>
+ <pathelement
location="${build.lib}/portal-core-identity-test-lib.jar"/>
+ <pathelement location="${build.resources}/test"/>
+ </x-classpath>
+ </execute-tests>
+
+ </target>
+
<!--
Some convenience build targets to help deployment during development
-->
@@ -307,4 +346,5 @@
<require file="${jboss.home}/server/${portal-ha.deploy.dir}"/>
<copy file="${build.lib}/portal-identity.sar"
todir="${jboss.home}/server/${portal-ha.deploy.dir}"
overwrite="true"/>
</target>
+
</project>
Modified:
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java
===================================================================
---
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java 2007-09-14
14:37:36 UTC (rev 8267)
+++
trunk/core-identity/src/main/org/jboss/portal/core/identity/services/metadata/IdentityUIConfigurationServiceImpl.java 2007-09-14
15:28:02 UTC (rev 8268)
@@ -341,7 +341,7 @@
}
catch (Exception e)
{
- throw new CoreIdentityConfigurationException("Could not parse configuration
file. If you run JBoss Portal with JBoss AS 4.0.5 or less please check the reference
Guide.");
+ throw new CoreIdentityConfigurationException("Could not parse configuration
file. If you run JBoss Portal with JBoss AS 4.0.5 or minor please check the wiki.");
}
}
Modified:
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 2007-09-14
14:37:36 UTC (rev 8267)
+++
trunk/core-identity/src/main/org/jboss/portal/core/identity/ui/admin/UserAdministrationBean.java 2007-09-14
15:28:02 UTC (rev 8268)
@@ -293,7 +293,7 @@
public List getPendingUsers()
{
- if ( this.registrationService != null )
+ if ( this.registrationService != null && this.pendingUsers == null)
this.pendingUsers = this.registrationService.getPendingUsers(displayNode);
return pendingUsers;
}
Property changes on: trunk/core-identity/src/main/org/jboss/portal/test/core/identity
___________________________________________________________________
Name: svn:ignore
+ validators
Added:
trunk/core-identity/src/main/org/jboss/portal/test/core/identity/metadata/ConfigurationTestCase.java
===================================================================
---
trunk/core-identity/src/main/org/jboss/portal/test/core/identity/metadata/ConfigurationTestCase.java
(rev 0)
+++
trunk/core-identity/src/main/org/jboss/portal/test/core/identity/metadata/ConfigurationTestCase.java 2007-09-14
15:28:02 UTC (rev 8268)
@@ -0,0 +1,161 @@
+/******************************************************************************
+ * 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.core.identity.metadata;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.portal.core.identity.services.metadata.IdentityUIConfiguration;
+import
org.jboss.portal.core.identity.services.metadata.IdentityUIConfigurationServiceImpl;
+import org.jboss.portal.core.identity.services.metadata.UIComponentConfiguration;
+import org.jboss.portal.test.core.identity.mock.MockPropertyInfo;
+import org.jboss.portal.test.core.identity.mock.MockUserProfileModule;
+
+import junit.framework.TestCase;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
+ * @version $Revision$
+ */
+public class ConfigurationTestCase extends TestCase
+{
+ /** The (mock) userProfileModule */
+ MockUserProfileModule userProfileModule;
+
+ protected void setUp()
+ {
+ this.userProfileModule = new MockUserProfileModule();
+
+ // Creating PropertyInfo Objects
+ MockPropertyInfo mpi1 = new MockPropertyInfo("user.name.given");
+ mpi1.setAccessMode("read-only");
+ MockPropertyInfo mpi2 = new MockPropertyInfo("user.name.family");
+ mpi2.setUsage("mandatory");
+ MockPropertyInfo mpi3 = new
MockPropertyInfo("user.business-info.online.email");
+ MockPropertyInfo mpi4 = new MockPropertyInfo("portal.user.locale");
+ MockPropertyInfo mpi5 = new MockPropertyInfo("portal.user.interests");
+
+ // Feed the (mock) userProfileModule with information
+ this.userProfileModule.setPropertyInfo(mpi1.getName(), mpi1);
+ this.userProfileModule.setPropertyInfo(mpi2.getName(), mpi2);
+ this.userProfileModule.setPropertyInfo(mpi3.getName(), mpi3);
+ this.userProfileModule.setPropertyInfo(mpi4.getName(), mpi4);
+ this.userProfileModule.setPropertyInfo(mpi5.getName(), mpi5);
+ }
+
+ public void testBasicConfiguration()
+ {
+ // Create configuration service with conf/configuration1.xml
+ IdentityUIConfigurationServiceImpl cfs = new IdentityUIConfigurationServiceImpl(){
+ protected InputStream getResource(String path) throws IOException
+ {
+ path = "conf/configuration1.xml";
+ return super.getResource(path);
+ }
+ };
+ assertNotNull(cfs);
+
+ // Set MockUserProfileModule
+ cfs.setUserProfileModule(this.userProfileModule);
+
+ try
+ {
+ cfs.startService();
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace();
+ fail("could not start configuration service ... ");
+ }
+ assertNotNull(cfs);
+
+ // Check basic configuration values
+ IdentityUIConfiguration cf = cfs.getConfiguration();
+ assertNotNull(cf);
+ assertEquals("automatic", cf.getSubscriptionMode());
+ // admin subscription mode
+ assertEquals("automatic", cf.getAdminSubscriptionMode());
+ assertEquals(false, cf.isOverwriteWorkflow());
+ assertEquals("jboss.org", cf.getEmailDomain());
+ assertEquals("do-no-reply(a)jboss.com", cf.getEmailFrom());
+ assertEquals("testCharacters", cf.getPasswordGenerationCharacters());
+
+ List defaultRoles = cf.getDefaultRoles();
+ assertNotNull(defaultRoles);
+ assertEquals(2, defaultRoles.size());
+ assertEquals("User", defaultRoles.get(0));
+ assertEquals("Admin", defaultRoles.get(1));
+
+ // Check givenname
+ UIComponentConfiguration givenname =
(UIComponentConfiguration)cf.getUiComponents().get("givenname");
+ assertNotNull(givenname);
+ assertEquals("givenname", givenname.getName());
+ assertEquals(false, givenname.isRequired());
+ // Must be overwritten from the mock property info
+ assertEquals(true, givenname.isReadOnly());
+ try
+ {
+ assertEquals(String.class, givenname.getPropertyClass());
+ }
+ catch (ClassNotFoundException e)
+ {
+ e.printStackTrace();
+ fail();
+ }
+
+ // Check familyname - converter
+ UIComponentConfiguration familyname =
(UIComponentConfiguration)cf.getUiComponents().get("familyname");
+ assertNotNull(familyname);
+ assertEquals("familyname", familyname.getName());
+ assertEquals("FamilyNameConverter", familyname.getConverter());
+ // Value from the xml must be overwritten from the mock property info
+ assertEquals(true, familyname.isRequired());
+ assertEquals(false, familyname.isReadOnly());
+
+ // Check locale and predefined map values
+ UIComponentConfiguration locale =
(UIComponentConfiguration)cf.getUiComponents().get("locale");
+ assertNotNull(locale);
+ assertEquals("locale", locale.getName());
+ assertEquals("org.jboss.portal.core.identity.locale",
locale.getPredefinedMapValues());
+ assertEquals(false, locale.isRequired());
+
+ // Check email - required - validator
+ UIComponentConfiguration email =
(UIComponentConfiguration)cf.getUiComponents().get("email");
+ assertNotNull(email);
+ assertEquals("email", email.getName());
+ assertEquals("EmailValidator", email.getValidator());
+ assertEquals("EmailValidator", email.getValidators().get(0));
+ assertEquals(true, email.isRequired());
+
+ UIComponentConfiguration interests =
(UIComponentConfiguration)cf.getUiComponents().get("interests");
+ assertNotNull(interests);
+ Map values = interests.getValues();
+ assertEquals("snowboarding", (String) values.get("board"));
+ assertEquals("skiing", (String) values.get("ski"));
+ assertEquals("sledging", (String) values.get("sledge"));
+
+ }
+
+}
Added:
trunk/core-identity/src/main/org/jboss/portal/test/core/identity/mock/MockProfileInfo.java
===================================================================
---
trunk/core-identity/src/main/org/jboss/portal/test/core/identity/mock/MockProfileInfo.java
(rev 0)
+++
trunk/core-identity/src/main/org/jboss/portal/test/core/identity/mock/MockProfileInfo.java 2007-09-14
15:28:02 UTC (rev 8268)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.core.identity.mock;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.portal.identity.info.ProfileInfo;
+import org.jboss.portal.identity.info.PropertyInfo;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
+ * @version $Revision$
+ */
+public class MockProfileInfo implements ProfileInfo
+{
+ Map properties = new HashMap();
+
+ public Map getPropertiesInfo()
+ {
+ return properties;
+ }
+
+ public PropertyInfo getPropertyInfo(String name)
+ {
+ return (PropertyInfo) properties.get(name);
+ }
+
+ public void setPropertyInfo(String id, PropertyInfo propertyInfo)
+ {
+ this.properties.put(id, propertyInfo);
+ }
+
+}
+
Added:
trunk/core-identity/src/main/org/jboss/portal/test/core/identity/mock/MockPropertyInfo.java
===================================================================
---
trunk/core-identity/src/main/org/jboss/portal/test/core/identity/mock/MockPropertyInfo.java
(rev 0)
+++
trunk/core-identity/src/main/org/jboss/portal/test/core/identity/mock/MockPropertyInfo.java 2007-09-14
15:28:02 UTC (rev 8268)
@@ -0,0 +1,147 @@
+/******************************************************************************
+ * 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.core.identity.mock;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.identity.info.PropertyInfo;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
+ * @version $Revision$
+ */
+public class MockPropertyInfo implements PropertyInfo
+{
+ /** The name */
+ private String name;
+
+ /** The type - default a String */
+ private String type = "java.lang.String";
+
+ /** The accessMode - default read-write */
+ private String accessMode = "read-write";
+
+ /** The usage - default optional */
+ private String usage = "optional";
+
+ /** The displayName - not used */
+ private LocalizedString displayName;
+
+ /** The description - not used */
+ private LocalizedString description;
+
+ /** The mappingDBType - not used */
+ private String mappingDBType;
+
+ /** The mappingDBValue - not used */
+ private String mappingDBValue;
+
+ /** The mappingLDAPValue - not used */
+ private String mappingLDAPValue;
+
+ /** The mappedLDAP - not used */
+ private boolean mappedLDAP;
+
+ /** The mappedDB - not used */
+ private boolean mappedDB;
+
+ public MockPropertyInfo(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public void setType(String type)
+ {
+ this.type = type;
+ }
+
+ public String getAccessMode()
+ {
+ return accessMode;
+ }
+
+ public void setAccessMode(String accessMode)
+ {
+ this.accessMode = accessMode;
+ }
+
+ public String getUsage()
+ {
+ return usage;
+ }
+
+ public void setUsage(String usage)
+ {
+ this.usage = usage;
+ }
+
+ public LocalizedString getDisplayName()
+ {
+ return displayName;
+ }
+
+ public LocalizedString getDescription()
+ {
+ return description;
+ }
+
+ public String getMappingDBType()
+ {
+ return mappingDBType;
+ }
+
+ public String getMappingDBValue()
+ {
+ return mappingDBValue;
+ }
+
+ public String getMappingLDAPValue()
+ {
+ return mappingLDAPValue;
+ }
+
+ public boolean isMappedLDAP()
+ {
+ return mappedLDAP;
+ }
+
+ public boolean isMappedDB()
+ {
+ return mappedDB;
+ }
+
+}
Added:
trunk/core-identity/src/main/org/jboss/portal/test/core/identity/mock/MockUserProfileModule.java
===================================================================
---
trunk/core-identity/src/main/org/jboss/portal/test/core/identity/mock/MockUserProfileModule.java
(rev 0)
+++
trunk/core-identity/src/main/org/jboss/portal/test/core/identity/mock/MockUserProfileModule.java 2007-09-14
15:28:02 UTC (rev 8268)
@@ -0,0 +1,79 @@
+/******************************************************************************
+ * 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.core.identity.mock;
+
+import java.util.Map;
+
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.identity.UserProfileModule;
+import org.jboss.portal.identity.info.ProfileInfo;
+import org.jboss.portal.identity.info.PropertyInfo;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
+ * @version $Revision$
+ */
+public class MockUserProfileModule implements UserProfileModule
+{
+
+ MockProfileInfo profileInfo = new MockProfileInfo();
+
+ /**
+ *
+ * Used to set a MockPropertyInfo directly
+ *
+ * @param propertyInfo.getName()
+ * @param propertyInfo
+ */
+ public void setPropertyInfo(String id, PropertyInfo propertyInfo)
+ {
+ this.profileInfo.setPropertyInfo(id, propertyInfo);
+ }
+
+ public ProfileInfo getProfileInfo() throws IdentityException
+ {
+ return profileInfo;
+ }
+
+ /**
+ * Not implemented Methods
+ */
+
+ public Map getProperties(User user) throws IdentityException,
IllegalArgumentException
+ {
+ throw new IllegalArgumentException("Mock method not yet implemented");
+ }
+
+ public Object getProperty(User user, String propertyName) throws IdentityException,
IllegalArgumentException
+ {
+ throw new IllegalArgumentException("Mock method not yet implemented");
+ }
+
+ public void setProperty(User user, String name, Object property) throws
IdentityException, IllegalArgumentException
+ {
+ throw new IllegalArgumentException("Mock method not yet implemented");
+ }
+
+}
+
Modified:
trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xml
===================================================================
---
trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xml 2007-09-14
14:37:36 UTC (rev 8267)
+++
trunk/core-identity/src/resources/portal-identity-sar/conf/identity-ui-configuration.xml 2007-09-14
15:28:02 UTC (rev 8268)
@@ -30,7 +30,7 @@
- jbp_identity_validation_workflow: Email verification, No admin approval
- jbp_identity_validation_approval_workflow: Email verification, Admin approval
-->
- <subscription-mode>automatic</subscription-mode>
+ <subscription-mode>jbp_identity_validation_approval_workflow</subscription-mode>
<!--
overwrite-workflow: overwrites existing process definitions
-->
Added: trunk/core-identity/src/resources/test/conf/configuration1.xml
===================================================================
--- trunk/core-identity/src/resources/test/conf/configuration1.xml
(rev 0)
+++ trunk/core-identity/src/resources/test/conf/configuration1.xml 2007-09-14 15:28:02 UTC
(rev 8268)
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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-ui-configuration>
+ <subscription-mode>automatic</subscription-mode>
+ <overwrite-workflow>false</overwrite-workflow>
+ <email-domain>jboss.org</email-domain>
+ <email-from>do-no-reply(a)jboss.com</email-from>
+ <password-generation-characters>testCharacters</password-generation-characters>
+ <default-roles>
+ <role>User</role>
+ <role>Admin</role>
+ </default-roles>
+
+ <ui-components>
+ <ui-component name="givenname">
+ <property-ref>user.name.given</property-ref>
+ </ui-component>
+ <ui-component name="familyname">
+ <property-ref>user.name.family</property-ref>
+ <converter>FamilyNameConverter</converter>
+ <required>false</required>
+ </ui-component>
+ <ui-component name="email">
+ <property-ref>user.business-info.online.email</property-ref>
+ <required>true</required>
+ <validators>
+ <validator>EmailValidator</validator>
+ </validators>
+ </ui-component>
+ <ui-component name="locale">
+ <property-ref>portal.user.locale</property-ref>
+ <values>
+ <value key="org.jboss.portal.core.identity.locale" />
+ </values>
+ </ui-component>
+ <ui-component name="interests">
+ <property-ref>portal.user.interests</property-ref>
+ <values>
+ <value key="board">snowboarding</value>
+ <value key="ski">skiing</value>
+ <value key="sledge">sledging</value>
+ </values>
+ </ui-component>
+ </ui-components>
+</identity-ui-configuration>
\ No newline at end of file
Added: trunk/core-identity/src/resources/test/conf/schema/identity-ui-configuration.xsd
===================================================================
--- trunk/core-identity/src/resources/test/conf/schema/identity-ui-configuration.xsd
(rev 0)
+++
trunk/core-identity/src/resources/test/conf/schema/identity-ui-configuration.xsd 2007-09-14
15:28:02 UTC (rev 8268)
@@ -0,0 +1,146 @@
+<?xml version="1.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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:jbxb="http://www.jboss.org/xml/ns/jbxb"
+ elementFormDefault="qualified">
+
+<xsd:element name="identity-ui-configuration">
+ <xsd:complexType>
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class
impl="org.jboss.portal.core.identity.services.metadata.IdentityUIConfiguration"/>
+ </xsd:appinfo>
+ </xsd:annotation>
+
+ <xsd:choice>
+ <!-- User portlet and user management portlet preferences -->
+ <xsd:element name="subscription-mode" type="subscriptionMode"
default="jbp_identity_validation_workflow"/>
+ <xsd:element name="admin-subscription-mode"
type="subscriptionMode" default="automatic"/>
+ <xsd:element name="overwrite-workflow" type="xsd:boolean"
default="false"/>
+ <xsd:element name="email-domain" minOccurs="1"
maxOccurs="1" type="xsd:string" default="example.com" />
+ <xsd:element name="email-from" minOccurs="1"
maxOccurs="1" type="xsd:string"
default="no-reply(a)example.com" />
+ <xsd:element name="password-generation-characters"
minOccurs="1" maxOccurs="1" type="xsd:string"/>
+ <xsd:element name="default-roles" type="defaultRoles"
minOccurs="1" maxOccurs="1"/>
+
+ <!-- user interface components -->
+ <xsd:element name="ui-components">
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class impl="java.util.HashMap"/>
+ </xsd:appinfo>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="ui-component" minOccurs="1"
maxOccurs="unbounded" type="UIComponent" />
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <!-- end: user interface components -->
+ </xsd:choice>
+ </xsd:complexType>
+</xsd:element>
+
+<!-- restictions for subscription-modes -->
+
+<xsd:simpleType name="subscriptionMode">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="custom" />
+ <xsd:enumeration value="automatic" />
+ <xsd:enumeration value="jbp_identity_validation_workflow" />
+ <xsd:enumeration value="jbp_identity_validation_approval_workflow" />
+ </xsd:restriction>
+</xsd:simpleType>
+
+<xsd:complexType name="defaultRoles">
+ <xsd:sequence>
+ <xsd:element name="role" minOccurs="1"
type="xsd:string" maxOccurs="unbounded"/>
+ </xsd:sequence>
+</xsd:complexType>
+
+<xsd:complexType name="validators">
+ <xsd:sequence>
+ <xsd:element name="validator" minOccurs="1"
type="xsd:string" maxOccurs="unbounded"/>
+ </xsd:sequence>
+</xsd:complexType>
+
+<xsd:complexType name="componentValues">
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:mapEntry nonNullValue="true"/>
+ </xsd:appinfo>
+ </xsd:annotation>
+ <xsd:choice minOccurs="1" maxOccurs="1">
+ <xsd:element name="value" maxOccurs="unbounded">
+ <xsd:complexType>
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:mapEntry/>
+ <jbxb:characters>
+ <jbxb:mapEntryValue/>
+ </jbxb:characters>
+ </xsd:appinfo>
+ </xsd:annotation>
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attribute name="key"
type="xsd:string">
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:mapEntryKey/>
+ </xsd:appinfo>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+</xsd:complexType>
+
+<xsd:complexType name="UIComponent">
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:mapEntry
impl="org.jboss.portal.core.identity.services.metadata.UIComponentConfiguration"
getKeyMethod="getName" setKeyMethod="setName" />
+ </xsd:appinfo>
+ </xsd:annotation>
+ <xsd:choice>
+ <xsd:element name="property-ref" maxOccurs="1"
minOccurs="1" type="xsd:string" />
+ <xsd:element name="localization-bundle" type="xsd:string"
minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="validators" type="validators" />
+ <xsd:element name="converter" type="xsd:string" />
+ <xsd:element name="required" type="xsd:boolean"
default="false"/>
+ <xsd:element name="read-only" type="xsd:boolean"
default="false" />
+ <xsd:element name="values" type="componentValues">
+ <xsd:annotation>
+ <xsd:appinfo>
+ <jbxb:class impl="java.util.HashMap"/>
+ </xsd:appinfo>
+ </xsd:annotation>
+ </xsd:element>
+ </xsd:choice>
+ <!-- attribute name -->
+ <xsd:attribute name="name" type="xsd:string"
use="required" />
+</xsd:complexType>
+
+</xsd:schema>