[jboss-cvs] Picketlink SVN: r953 - in idm/trunk/example: idm-servlet and 19 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed May 18 04:57:31 EDT 2011


Author: bdaw
Date: 2011-05-18 04:57:30 -0400 (Wed, 18 May 2011)
New Revision: 953

Added:
   idm/trunk/example/idm-servlet/
   idm/trunk/example/idm-servlet/jboss-idm-servlet.iml
   idm/trunk/example/idm-servlet/pom.xml
   idm/trunk/example/idm-servlet/readme.txt
   idm/trunk/example/idm-servlet/src/
   idm/trunk/example/idm-servlet/src/main/
   idm/trunk/example/idm-servlet/src/main/java/
   idm/trunk/example/idm-servlet/src/main/java/org/
   idm/trunk/example/idm-servlet/src/main/java/org/jboss/
   idm/trunk/example/idm-servlet/src/main/java/org/jboss/jbossidmservlet/
   idm/trunk/example/idm-servlet/src/main/java/org/jboss/jbossidmservlet/bean/
   idm/trunk/example/idm-servlet/src/main/java/org/jboss/jbossidmservlet/bean/GroupBean.java
   idm/trunk/example/idm-servlet/src/main/java/org/jboss/jbossidmservlet/bean/UserBean.java
   idm/trunk/example/idm-servlet/src/main/java/org/jboss/jbossidmservlet/processor/
   idm/trunk/example/idm-servlet/src/main/java/org/jboss/jbossidmservlet/processor/IdmProcessor.java
   idm/trunk/example/idm-servlet/src/main/java/org/jboss/picketlink/
   idm/trunk/example/idm-servlet/src/main/java/org/jboss/picketlink/idm/
   idm/trunk/example/idm-servlet/src/main/java/org/jboss/picketlink/idm/IdmServlet.java
   idm/trunk/example/idm-servlet/src/main/resources/
   idm/trunk/example/idm-servlet/src/main/resources/hibernate.cfg.xml
   idm/trunk/example/idm-servlet/src/main/resources/picketlink-config.xml
   idm/trunk/example/idm-servlet/src/main/webapp/
   idm/trunk/example/idm-servlet/src/main/webapp/WEB-INF/
   idm/trunk/example/idm-servlet/src/main/webapp/WEB-INF/idm.tld
   idm/trunk/example/idm-servlet/src/main/webapp/WEB-INF/web.xml
   idm/trunk/example/idm-servlet/src/main/webapp/css/
   idm/trunk/example/idm-servlet/src/main/webapp/css/main.css
   idm/trunk/example/idm-servlet/src/main/webapp/img/
   idm/trunk/example/idm-servlet/src/main/webapp/img/accessories-text-editor.png
   idm/trunk/example/idm-servlet/src/main/webapp/img/contact-new.png
   idm/trunk/example/idm-servlet/src/main/webapp/img/document-new.png
   idm/trunk/example/idm-servlet/src/main/webapp/img/folder-new.png
   idm/trunk/example/idm-servlet/src/main/webapp/img/folder.png
   idm/trunk/example/idm-servlet/src/main/webapp/img/gr_db.png
   idm/trunk/example/idm-servlet/src/main/webapp/img/gr_lb.png
   idm/trunk/example/idm-servlet/src/main/webapp/img/gr_lb2.png
   idm/trunk/example/idm-servlet/src/main/webapp/img/gr_w.png
   idm/trunk/example/idm-servlet/src/main/webapp/img/gr_w2.png
   idm/trunk/example/idm-servlet/src/main/webapp/img/list-add.png
   idm/trunk/example/idm-servlet/src/main/webapp/img/list-remove.png
   idm/trunk/example/idm-servlet/src/main/webapp/img/picketlink_icon_16x.png
   idm/trunk/example/idm-servlet/src/main/webapp/img/picketlink_logo_200x.png
   idm/trunk/example/idm-servlet/src/main/webapp/img/picketlink_logo_450x.png
   idm/trunk/example/idm-servlet/src/main/webapp/img/process-stop.png
   idm/trunk/example/idm-servlet/src/main/webapp/img/system-users.png
   idm/trunk/example/idm-servlet/src/main/webapp/img/text-x-generic.png
   idm/trunk/example/idm-servlet/src/main/webapp/main.jsp
   idm/trunk/example/idm-servlet/src/test/
   idm/trunk/example/idm-servlet/src/test/java/
   idm/trunk/example/idm-servlet/src/test/java/org/
   idm/trunk/example/idm-servlet/src/test/java/org/jboss/
   idm/trunk/example/idm-servlet/src/test/java/org/jboss/jbossidmservlet/
Log:
- adding idm-servlet


Added: idm/trunk/example/idm-servlet/jboss-idm-servlet.iml
===================================================================
--- idm/trunk/example/idm-servlet/jboss-idm-servlet.iml	                        (rev 0)
+++ idm/trunk/example/idm-servlet/jboss-idm-servlet.iml	2011-05-18 08:57:30 UTC (rev 953)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
+  <component name="FacetManager">
+    <facet type="web" name="Web">
+      <configuration>
+        <descriptors>
+          <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/main/webapp/WEB-INF/web.xml" />
+        </descriptors>
+        <webroots>
+          <root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
+          <root url="file://$MODULE_DIR$/src/main/resources" relative="/" />
+        </webroots>
+      </configuration>
+    </facet>
+  </component>
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
+    <output url="file://$MODULE_DIR$/target/classes" />
+    <output-test url="file://$MODULE_DIR$/target/test-classes" />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/target/generated-sources/annotations" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: javax:javaee-web-api:6.0" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: taglibs:standard:1.1.2" level="project" />
+    <orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.2" level="project" />
+    <orderEntry type="module" module-name="picketlink-idm-api" scope="PROVIDED" />
+    <orderEntry type="module" module-name="picketlink-idm-common" scope="PROVIDED" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: log4j:log4j:1.2.14" level="project" />
+    <orderEntry type="module" module-name="picketlink-idm-core" scope="PROVIDED" />
+    <orderEntry type="module" module-name="picketlink-idm-spi" scope="PROVIDED" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: com.sun.xml.bind:jaxb-impl:2.1.8" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: javax.xml.bind:jaxb-api:2.1" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: javax.xml.stream:stax-api:1.0-2" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: javax.activation:activation:1.1" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.staxnav:staxnav.core:0.9.0" level="project" />
+    <orderEntry type="module" module-name="picketlink-idm-hibernate" scope="PROVIDED" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.hibernate:hibernate-core:3.3.2.GA" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: antlr:antlr:2.7.6" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: commons-collections:commons-collections:3.1" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: dom4j:dom4j:1.6.1" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: xml-apis:xml-apis:1.0.b2" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: javax.transaction:jta:1.1" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.hibernate:hibernate-annotations:3.4.0.GA" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.hibernate:ejb3-persistence:1.0.2.GA" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.hibernate:hibernate-commons-annotations:3.1.0.GA" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: javassist:javassist:3.8.0.GA" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.hibernate:hibernate-cglib-repack:2.1_3" level="project" />
+    <orderEntry type="module" module-name="picketlink-idm-ldap" scope="PROVIDED" />
+    <orderEntry type="module" module-name="picketlink-idm-cache" scope="PROVIDED" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.cache:jbosscache-core:3.2.1.GA" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: jgroups:jgroups:2.6.13.GA" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.javaee:jboss-transaction-api:1.0.1.GA" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss:jboss-common-core:2.2.14.GA" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.jboss.logging:jboss-logging-spi:2.0.5.GA" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: mysql:mysql-connector-java:5.1.6" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: net.sf.ehcache:ehcache:1.2.3" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.hibernate:hibernate-ehcache:3.3.2.GA" level="project" />
+    <orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.commons:commons-io:1.3.2" level="project" />
+  </component>
+</module>
+

Added: idm/trunk/example/idm-servlet/pom.xml
===================================================================
--- idm/trunk/example/idm-servlet/pom.xml	                        (rev 0)
+++ idm/trunk/example/idm-servlet/pom.xml	2011-05-18 08:57:30 UTC (rev 953)
@@ -0,0 +1,208 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.jboss</groupId>
+    <artifactId>jboss-idm-servlet</artifactId>
+    <packaging>war</packaging>
+    <version>1.3.0.Alpha01-SNAPSHOT</version>
+    <name>JBoss Picketlink IDM servlet</name>
+    <url>http://maven.apache.org</url>
+
+  <repositories>
+    <repository>
+      <id>java.net2</id>
+      <name>Repository hosting the jee6 artifacts</name>
+      <url>http://download.java.net/maven/2</url>
+    </repository>
+    <repository>
+      <id>repository.jboss.org</id>
+      <name>JBoss Repository</name>
+      <layout>default</layout>
+      <url>http://repository.jboss.org/maven2/</url>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+    </repository>
+  </repositories>
+  <dependencies>
+    <dependency>
+      <groupId>javax</groupId>
+      <artifactId>javaee-web-api</artifactId>
+      <version>6.0</version>
+      <scope>provided</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>taglibs</groupId>
+      <artifactId>standard</artifactId>
+      <version>1.1.2</version>
+      <scope>provided</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.2</version>
+      <scope>test</scope>
+    </dependency>
+    <!-- Picketlink -->
+    <dependency>
+      <groupId>org.picketlink.idm</groupId>
+      <artifactId>picketlink-idm-api</artifactId>
+      <version>${project.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.picketlink.idm</groupId>
+      <artifactId>picketlink-idm-core</artifactId>
+      <version>${project.version}</version>
+            
+      <scope>provided</scope>
+            
+    </dependency>
+    <dependency>
+      <groupId>org.picketlink.idm</groupId>
+      <artifactId>picketlink-idm-hibernate</artifactId>
+      <version>${project.version}</version>
+            
+      <scope>provided</scope>
+            
+      <exclusions>
+        <exclusion>
+          <groupId>org.slf4j</groupId>
+          <artifactId>slf4j-log4j12</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.slf4j</groupId>
+          <artifactId>slf4j-api</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>log4j</groupId>
+          <artifactId>log4j</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.picketlink.idm</groupId>
+      <artifactId>picketlink-idm-ldap</artifactId>
+      <version>${project.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.picketlink.idm</groupId>
+      <artifactId>picketlink-idm-common</artifactId>
+      <version>${project.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.picketlink.idm</groupId>
+      <artifactId>picketlink-idm-cache</artifactId>
+      <version>${project.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.picketlink.idm</groupId>
+      <artifactId>picketlink-idm-spi</artifactId>
+      <version>${project.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>mysql</groupId>
+      <artifactId>mysql-connector-java</artifactId>
+      <version>5.1.6</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>net.sf.ehcache</groupId>
+      <artifactId>ehcache</artifactId>
+      <version>1.2.3</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.hibernate</groupId>
+      <artifactId>hibernate-ehcache</artifactId>
+      <version>3.3.2.GA</version>
+      <exclusions>
+        <exclusion>
+          <groupId>org.slf4j</groupId>
+          <artifactId>slf4j-api</artifactId>
+        </exclusion>
+      </exclusions>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-io</artifactId>
+      <version>1.3.2</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>commons-collections</groupId>
+      <artifactId>commons-collections</artifactId>
+      <version>3.1</version>
+      <scope>provided</scope>
+    </dependency>
+
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+                
+        <configuration>
+          <source>1.6</source>
+          <target>1.6</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-war-plugin</artifactId>
+        <configuration>
+          <!--<packagingExcludes>WEB-INF/lib/xml-apis-1.0.b2.jar</packagingExcludes>-->
+          <packagingExcludes>WEB-INF/lib/xml-apis-1.0.b2.jar</packagingExcludes>
+          <failOnMissingWebXml>false</failOnMissingWebXml>
+          <webResources>
+            <resource>
+              <!-- this is relative to the pom.xml directory -->
+              <directory>src/main/resources</directory>
+            </resource>
+          </webResources>
+
+        </configuration>
+      </plugin>
+    </plugins>
+    <finalName>jboss-idm-servlet</finalName>
+  </build>
+
+  <profiles>
+    <profile>
+      <id>deploy</id>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>deploy</id>
+                <phase>package</phase>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+                <configuration>
+                  <tasks>
+                    <copy
+                      file="${project.build.directory}/${project.build.finalName}.war"
+                      tofile="${portal.deploy.dir}/jboss-idm-servlet.war">
+                    </copy>
+                  </tasks>
+                </configuration>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+</project>
+

Added: idm/trunk/example/idm-servlet/readme.txt
===================================================================
--- idm/trunk/example/idm-servlet/readme.txt	                        (rev 0)
+++ idm/trunk/example/idm-servlet/readme.txt	2011-05-18 08:57:30 UTC (rev 953)
@@ -0,0 +1,10 @@
+JBoss Picketlink IDM servlet
+
+Install
+
+Build and deploy with maven. Minimal required java version is 1.6. Using the deploy profile, it is able to build and deploy the portlet using the command:
+mvn clean install -Pdeploy -Dportal.deploy.dir=$GATEIN_DEPLOY_DIR
+
+Usage
+
+Application is accesible on http://localhost:8080/jboss-idm-servlet/ after deployment.

Added: idm/trunk/example/idm-servlet/src/main/java/org/jboss/jbossidmservlet/bean/GroupBean.java
===================================================================
--- idm/trunk/example/idm-servlet/src/main/java/org/jboss/jbossidmservlet/bean/GroupBean.java	                        (rev 0)
+++ idm/trunk/example/idm-servlet/src/main/java/org/jboss/jbossidmservlet/bean/GroupBean.java	2011-05-18 08:57:30 UTC (rev 953)
@@ -0,0 +1,68 @@
+/*
+ * (C) Copyright 2007 Hewlett-Packard Development Company, LP
+ * 
+ * This library 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 library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * 
+ * For more information: www.smartfrog.org
+ */
+
+
+package org.jboss.jbossidmservlet.bean;
+
+import java.util.Collection;
+import javax.persistence.Transient;
+import org.picketlink.idm.api.Group;
+import org.picketlink.idm.api.Role;
+
+/**
+ *
+ * @author vrockai
+ */
+public class GroupBean {
+
+    @Transient
+    private Group group;
+
+    public Group getGroup() {
+        return group;
+    }
+
+    public void setGroup(Group group) {
+        this.group = group;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public Collection<Role> getRoleList() {
+        return roleList;
+    }
+
+    public void setRoleList(Collection<Role> roleList) {
+        this.roleList = roleList;
+    }
+    private String name;
+    private Collection<Role> roleList;
+
+    public GroupBean(Group group){
+        this.name=group.getName();
+    }
+
+}

Added: idm/trunk/example/idm-servlet/src/main/java/org/jboss/jbossidmservlet/bean/UserBean.java
===================================================================
--- idm/trunk/example/idm-servlet/src/main/java/org/jboss/jbossidmservlet/bean/UserBean.java	                        (rev 0)
+++ idm/trunk/example/idm-servlet/src/main/java/org/jboss/jbossidmservlet/bean/UserBean.java	2011-05-18 08:57:30 UTC (rev 953)
@@ -0,0 +1,80 @@
+/*
+ * (C) Copyright 2007 Hewlett-Packard Development Company, LP
+ * 
+ * This library 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 library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * 
+ * For more information: www.smartfrog.org
+ */
+
+
+package org.jboss.jbossidmservlet.bean;
+
+import java.util.Collection;
+import javax.persistence.Transient;
+import org.picketlink.idm.api.Attribute;
+import org.picketlink.idm.api.Group;
+import org.picketlink.idm.api.User;
+
+
+/**
+ *
+ * @author vrockai
+ */
+public class UserBean {
+
+    @Transient
+    private User user;
+
+    public UserBean(User user){
+        this.userId = user.getId();
+    }
+
+    public Collection<Group> getAssociatedGroups() {
+        return associatedGroups;
+    }
+
+    public void setAssociatedGroups(Collection<Group> associatedGroups) {
+        this.associatedGroups = associatedGroups;
+    }
+
+    public User getUser() {
+        return user;
+    }
+
+    public void setUser(User user) {
+        this.user = user;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+
+    private Collection<Attribute> attributes;
+
+    public Collection<Attribute> getAttributes() {
+        return attributes;
+    }
+
+    public void setAttributes(Collection<Attribute> attributes) {
+        this.attributes = attributes;
+    }
+    private Collection<Group> associatedGroups;
+    private String userId;
+
+}

Added: idm/trunk/example/idm-servlet/src/main/java/org/jboss/jbossidmservlet/processor/IdmProcessor.java
===================================================================
--- idm/trunk/example/idm-servlet/src/main/java/org/jboss/jbossidmservlet/processor/IdmProcessor.java	                        (rev 0)
+++ idm/trunk/example/idm-servlet/src/main/java/org/jboss/jbossidmservlet/processor/IdmProcessor.java	2011-05-18 08:57:30 UTC (rev 953)
@@ -0,0 +1,420 @@
+/*
+ * (C) Copyright 2007 Hewlett-Packard Development Company, LP
+ * 
+ * This library 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 library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * 
+ * For more information: www.smartfrog.org
+ */
+package org.jboss.jbossidmservlet.processor;
+
+import java.util.logging.Level;
+import org.picketlink.idm.api.Attribute;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Map;
+import org.apache.log4j.Logger;
+import org.jboss.jbossidmservlet.bean.GroupBean;
+import org.jboss.jbossidmservlet.bean.UserBean;
+import org.picketlink.idm.api.AttributesManager;
+import org.picketlink.idm.api.Group;
+import org.picketlink.idm.api.IdentitySearchCriteria;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.api.IdentitySessionFactory;
+import org.picketlink.idm.api.IdentityType;
+import org.picketlink.idm.api.Role;
+import org.picketlink.idm.api.RoleManager;
+import org.picketlink.idm.api.RoleType;
+import org.picketlink.idm.api.User;
+import org.picketlink.idm.common.exception.FeatureNotSupportedException;
+import org.picketlink.idm.common.exception.IdentityConfigurationException;
+import org.picketlink.idm.common.exception.IdentityException;
+import org.picketlink.idm.impl.api.SimpleAttribute;
+import org.picketlink.idm.impl.configuration.IdentityConfigurationImpl;
+import org.picketlink.idm.spi.model.IdentityObject;
+
+/**
+ *
+ * @author vrockai
+ */
+public class IdmProcessor {
+
+    private IdentitySessionFactory identitySessionFactory = null;
+    private IdentitySession identitySession = null;
+    private String GROUP = "GROUP";
+
+    public IdmProcessor() throws IdentityConfigurationException, IdentityException {
+        identitySessionFactory = new IdentityConfigurationImpl().configure("picketlink-config.xml").buildIdentitySessionFactory();
+        init();
+    }
+
+    private void init() throws IdentityException {
+        identitySession = identitySessionFactory.createIdentitySession("idm_realm");
+    }
+
+    public void initializeDB() {
+        try {
+            identitySession.beginTransaction();
+            identitySession.getPersistenceManager().createUser("John Doe");
+            User usr1 = identitySession.getPersistenceManager().createUser("Viliam Rockai");
+            identitySession.getPersistenceManager().createUser("Prabhat Jha");
+            identitySession.getPersistenceManager().createGroup("grupa1", GROUP);
+            Group grp1 = identitySession.getPersistenceManager().createGroup("grupa2", GROUP);
+            identitySession.getPersistenceManager().createGroup("pogrup", GROUP);
+            identitySession.getRelationshipManager().associateUser(grp1, usr1);
+            identitySession.getTransaction().commit();
+            identitySession.close();
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).warn(ex);
+        }
+
+    }
+
+    public Collection<Group> getAssignedGroups(String username) {
+        Collection<Group> groups = new ArrayList<Group>();
+        try {
+            identitySession.beginTransaction();
+            User user = identitySession.getPersistenceManager().findUser(username);
+            groups = identitySession.getRelationshipManager().findAssociatedGroups(user);
+            identitySession.getTransaction().commit();
+            identitySession.close();
+        } catch (IdentityConfigurationException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        }
+        return groups;
+    }
+
+    public Collection<UserBean> getAllUsers() {
+
+        Collection<UserBean> userBeanList = new ArrayList<UserBean>();
+        Collection<User> users = new ArrayList<User>();
+        try {
+            identitySession.beginTransaction();
+            users = identitySession.getPersistenceManager().findUser((IdentitySearchCriteria) null);
+            identitySession.getTransaction().commit();
+            identitySession.close();
+        } catch (IdentityConfigurationException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        }
+
+        for (User u : users) {
+            UserBean ub = new UserBean(u);
+            ub.setAttributes(getAttributes(u));
+            userBeanList.add(ub);
+            ub.setAssociatedGroups(getAssignedGroups(u.getId()));
+        }
+
+        return userBeanList;
+
+    }
+
+    private Collection<Attribute> getAttributes(IdentityType it) {
+        Collection<Attribute> attList = new ArrayList<Attribute>();
+
+        try {
+            identitySession.beginTransaction();
+            AttributesManager attManager = identitySession.getAttributesManager();
+
+            Map<String, Attribute> attributes = attManager.getAttributes(it);
+            attList = attributes.values();
+
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        }
+
+        return attList;
+    }
+
+    public Collection<GroupBean> getAllGroups() {
+
+        Collection<GroupBean> groups = new ArrayList<GroupBean>();
+        try {
+
+            identitySession.beginTransaction();
+            Collection<Group> groupList = identitySession.getPersistenceManager().findGroup(GROUP, (IdentitySearchCriteria) null);
+
+            for(Group g: groupList){
+                GroupBean gb = new GroupBean(g);
+
+                Collection<Role> rc = new ArrayList<Role>();
+                try {
+                    for (RoleType rt : identitySession.getRoleManager().findRoleTypes()) {
+                        rc.addAll(identitySession.getRoleManager().findRoles(g, rt));
+                    }
+                } catch (FeatureNotSupportedException ex) {
+                    java.util.logging.Logger.getLogger(IdmProcessor.class.getName()).log(Level.SEVERE, null, ex);
+                }
+
+                gb.setRoleList(rc);
+                groups.add(gb);
+            }
+
+            identitySession.getTransaction().commit();
+            identitySession.close();
+        } catch (IdentityConfigurationException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        }
+        return groups;
+    }
+
+    public User createUser(String username) {
+        User user = null;
+        try {
+            identitySession.beginTransaction();
+            user = identitySession.getPersistenceManager().createUser(username);
+            identitySession.getTransaction().commit();
+            identitySession.close();
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        }
+
+        return user;
+    }
+
+    public Group createGroup(String groupname) {
+        Group group = null;
+        try {
+            identitySession.beginTransaction();
+            group = identitySession.getPersistenceManager().createGroup(groupname, GROUP);
+            identitySession.getTransaction().commit();
+            identitySession.close();
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        }
+
+        return group;
+    }
+
+    public void deleteUser(String username) {
+
+        try {
+            identitySession.beginTransaction();
+            identitySession.getPersistenceManager().removeUser(username, true);
+            identitySession.getTransaction().commit();
+            identitySession.close();
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        }
+    }
+
+    public void deleteGroup(String groupName) {
+
+        try {
+            identitySession.beginTransaction();
+
+            Group group = identitySession.getPersistenceManager().findGroup(groupName, GROUP);
+
+            identitySession.getPersistenceManager().removeGroup(group, true);
+            identitySession.getTransaction().commit();
+            identitySession.close();
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        }
+    }
+
+    public User renameUser(String username, String newusername) {
+        User user = null;
+        try {
+            identitySession.beginTransaction();
+            user = identitySession.getPersistenceManager().findUser(username);
+            IdentityObject io = (IdentityObject) user;
+
+            identitySession.getTransaction().commit();
+            identitySession.close();
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        }
+
+        return user;
+    }
+
+    public void associateUser(String userId, String groupId) {
+
+        try {
+            identitySession.beginTransaction();
+            User user = identitySession.getPersistenceManager().findUser(userId);
+            Group group = identitySession.getPersistenceManager().findGroup(groupId, GROUP);
+            if (!identitySession.getRelationshipManager().isAssociated(group, user)) {
+                identitySession.getRelationshipManager().associateUser(group, user);
+            }
+            identitySession.getTransaction().commit();
+            identitySession.close();
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        }
+    }
+
+    public void deassociateUser(String userId, String groupId) {
+        try {
+            identitySession.beginTransaction();
+
+            User user = identitySession.getPersistenceManager().findUser(userId);
+            System.out.println(user.getId());
+            Group group = identitySession.getPersistenceManager().findGroup(groupId, GROUP);
+            System.out.println(groupId + "/" + group);
+
+            identitySession.getRelationshipManager().disassociateUsers(Arrays.asList(group), Arrays.asList(user));
+            identitySession.getTransaction().commit();
+            identitySession.close();
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        }
+    }
+
+    public void createAttribute(String userId, String attName, String attVal) {
+        try {
+            identitySession.beginTransaction();
+            AttributesManager attManager = identitySession.getAttributesManager();
+            User user = identitySession.getPersistenceManager().findUser(userId);
+            attManager.addAttribute(user, attName, attVal);
+            identitySession.getTransaction().commit();
+            identitySession.close();
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        }
+    }
+
+    public void renameAttribute(String userId, String attName, String attVal) {
+        try {
+            identitySession.beginTransaction();
+            AttributesManager attManager = identitySession.getAttributesManager();
+            User user = identitySession.getPersistenceManager().findUser(userId);
+            Attribute[] attribute = new Attribute[]{
+                new SimpleAttribute(attName, attVal),};
+            attManager.updateAttributes(user, attribute);
+            identitySession.getTransaction().commit();
+            identitySession.close();
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        }
+    }
+
+    public void deleteAttribute(String userId, String attName, String attVal) {
+        try {
+            identitySession.beginTransaction();
+            AttributesManager attManager = identitySession.getAttributesManager();
+            User user = identitySession.getPersistenceManager().findUser(userId);
+            String[] atts = {attName};
+            attManager.removeAttributes(user, atts);
+            identitySession.getTransaction().commit();
+            identitySession.close();
+
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        }
+    }
+
+    public RoleType createRoletype(String name) {
+        RoleType roletype = null;
+        try {
+            identitySession.beginTransaction();
+            RoleManager roleManager = identitySession.getRoleManager();
+            roletype = roleManager.createRoleType(name);
+            identitySession.getTransaction().commit();
+            identitySession.close();
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        } catch (FeatureNotSupportedException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        }
+        return roletype;
+    }
+
+    public void deleteRoletype(String name) {
+        try {
+            identitySession.beginTransaction();
+            RoleManager roleManager = identitySession.getRoleManager();
+            roleManager.removeRoleType(name);
+            identitySession.getTransaction().commit();
+            identitySession.close();
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        } catch (FeatureNotSupportedException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        }
+    }
+
+    public void associateRole(String roletype, String userId, String groupName) {
+        try {
+            identitySession.beginTransaction();
+            RoleManager roleManager = identitySession.getRoleManager();
+
+            RoleType rt = identitySession.getRoleManager().getRoleType(roletype);
+            User u = identitySession.getPersistenceManager().findUser(userId);
+            Group g = identitySession.getPersistenceManager().findGroup(groupName, GROUP);
+            roleManager.createRole(rt, u, g);
+            identitySession.getTransaction().commit();
+            identitySession.close();
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        } catch (FeatureNotSupportedException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        }
+
+    }
+
+    public void deassociateRole(String roletype, String userId, String groupName) {
+        try {
+            identitySession.beginTransaction();
+            RoleManager roleManager = identitySession.getRoleManager();
+            RoleType rt = identitySession.getRoleManager().getRoleType(roletype);
+            User u = identitySession.getPersistenceManager().findUser(userId);
+            Group g = identitySession.getPersistenceManager().findGroup(groupName, GROUP);
+            roleManager.removeRole(rt, u, g);
+            identitySession.getTransaction().commit();
+            identitySession.close();
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        } catch (FeatureNotSupportedException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        }
+    }
+
+    public Collection<RoleType> getAllRoletypes() {
+        Collection<RoleType> roletypeList = new ArrayList<RoleType>();
+         try {
+            identitySession.beginTransaction();
+            RoleManager roleManager = identitySession.getRoleManager();
+            roletypeList = roleManager.findRoleTypes();
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        } catch (FeatureNotSupportedException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        }
+
+        return roletypeList;
+    }
+
+    public Collection<Role> getAllRoles(Group grp) {
+         Collection<Role> roleList = new ArrayList<Role>();
+         try {
+            identitySession.beginTransaction();
+            RoleManager roleManager = identitySession.getRoleManager();
+            roleList = roleManager.findRoles(GROUP, GROUP);
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        } catch (FeatureNotSupportedException ex) {
+            Logger.getLogger(IdmProcessor.class.getName()).error(ex);
+        }
+
+        return roleList;
+    }
+}

Added: idm/trunk/example/idm-servlet/src/main/java/org/jboss/picketlink/idm/IdmServlet.java
===================================================================
--- idm/trunk/example/idm-servlet/src/main/java/org/jboss/picketlink/idm/IdmServlet.java	                        (rev 0)
+++ idm/trunk/example/idm-servlet/src/main/java/org/jboss/picketlink/idm/IdmServlet.java	2011-05-18 08:57:30 UTC (rev 953)
@@ -0,0 +1,228 @@
+/*
+ * (C) Copyright 2007 Hewlett-Packard Development Company, LP
+ * 
+ * This library 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 library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * 
+ * For more information: www.smartfrog.org
+ */
+package org.jboss.picketlink.idm;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.logging.Level;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.log4j.Logger;
+import org.jboss.jbossidmservlet.bean.GroupBean;
+import org.jboss.jbossidmservlet.bean.UserBean;
+import org.jboss.jbossidmservlet.processor.IdmProcessor;
+import org.picketlink.idm.api.Group;
+import org.picketlink.idm.api.RoleType;
+import org.picketlink.idm.api.User;
+import org.picketlink.idm.common.exception.IdentityConfigurationException;
+import org.picketlink.idm.common.exception.IdentityException;
+
+/**
+ *
+ * @author vrockai
+ */
+public class IdmServlet extends HttpServlet {
+
+    private static final long serialVersionUID = 33141L;
+    //IdmProcessor idmProc;
+
+    @Override
+    public void init() throws ServletException {
+        try {
+            IdmProcessor idmProc = new IdmProcessor();
+            idmProc.initializeDB();
+        } catch (IdentityConfigurationException ex) {
+            Logger.getLogger(IdmServlet.class.getName()).error(ex);
+        } catch (IdentityException ex) {
+            Logger.getLogger(IdmServlet.class.getName()).error(ex);
+        }
+    }
+
+    private IdmProcessor getIdmProcessor(HttpServletRequest request) {
+        IdmProcessor idmProc = null;
+
+        idmProc = (IdmProcessor) request.getAttribute("idmProc");
+        if (idmProc == null) {
+            try {
+                idmProc = new IdmProcessor();
+                request.setAttribute("idmProc", idmProc);
+            } catch (IdentityConfigurationException ex) {
+                java.util.logging.Logger.getLogger(IdmServlet.class.getName()).log(Level.SEVERE, null, ex);
+            } catch (IdentityException ex) {
+                java.util.logging.Logger.getLogger(IdmServlet.class.getName()).log(Level.SEVERE, null, ex);
+            }
+        }
+
+        return idmProc;
+    }
+
+    @Override
+    public void doGet(HttpServletRequest request,
+            HttpServletResponse response)
+            throws ServletException, IOException {
+
+        IdmProcessor idmProc = getIdmProcessor(request);
+
+        Collection<UserBean> userList = idmProc.getAllUsers();
+        Collection<GroupBean> groupList = idmProc.getAllGroups();
+        Collection<RoleType> roletypeList = idmProc.getAllRoletypes();
+
+        request.getSession().setAttribute("userList", userList);
+        request.getSession().setAttribute("groupList", groupList);
+
+        request.getSession().setAttribute("roletypeList", roletypeList);
+        request.getRequestDispatcher("main.jsp").forward(request, response);
+    }
+
+    @Override
+    public void doPost(HttpServletRequest request,
+            HttpServletResponse response)
+            throws ServletException, IOException {
+
+        String method = request.getServletPath().substring(1);
+        try {
+            Method postMethod = getClass().getMethod(method, HttpServletRequest.class, HttpServletResponse.class);
+            postMethod.invoke(this, request, response);
+        } catch (IllegalAccessException ex) {
+            Logger.getLogger(IdmServlet.class.getName()).error(ex);
+        } catch (IllegalArgumentException ex) {
+            Logger.getLogger(IdmServlet.class.getName()).error(ex);
+        } catch (InvocationTargetException ex) {
+            Logger.getLogger(IdmServlet.class.getName()).error(ex);
+        } catch (NoSuchMethodException ex) {
+            Logger.getLogger(IdmServlet.class.getName()).error(ex);
+        } catch (SecurityException ex) {
+            Logger.getLogger(IdmServlet.class.getName()).error(ex);
+        }
+
+        doGet(request, response);
+    }
+
+    public Group createGroup(HttpServletRequest request, HttpServletResponse response) {
+        IdmProcessor idmProc = getIdmProcessor(request);
+
+        String groupName = request.getParameter("groupId");
+        Group newGroup = idmProc.createGroup(groupName);
+        return newGroup;
+    }
+
+    public User createUser(HttpServletRequest request, HttpServletResponse response) {
+        IdmProcessor idmProc = getIdmProcessor(request);
+
+        String userId = request.getParameter("userId");
+        User user = idmProc.createUser(userId);
+        return user;
+    }
+
+    public void deleteGroup(HttpServletRequest request, HttpServletResponse response) {
+        IdmProcessor idmProc = getIdmProcessor(request);
+
+        String groupName = request.getParameter("groupId");
+        idmProc.deleteGroup(groupName);
+
+    }
+
+    public void deleteUser(HttpServletRequest request, HttpServletResponse response) {
+        IdmProcessor idmProc = getIdmProcessor(request);
+
+        String userId = request.getParameter("userId");
+        idmProc.deleteUser(userId);
+    }
+
+    public void assignGroup(HttpServletRequest request, HttpServletResponse response) {
+        IdmProcessor idmProc = getIdmProcessor(request);
+
+        String groupId = request.getParameter("groupId");
+        String userId = request.getParameter("userId");
+        idmProc.associateUser(userId, groupId);
+    }
+
+    public void deassignGroup(HttpServletRequest request, HttpServletResponse response) {
+        IdmProcessor idmProc = getIdmProcessor(request);
+
+        String groupId = request.getParameter("groupId");
+        String userId = request.getParameter("userId");
+        idmProc.deassociateUser(userId, groupId);
+    }
+
+    public void createAttribute(HttpServletRequest request, HttpServletResponse response) {
+        IdmProcessor idmProc = getIdmProcessor(request);
+
+        String userId = request.getParameter("userId");
+        String attName = request.getParameter("attName");
+        String attVal = request.getParameter("attVal");
+        idmProc.createAttribute(userId, attName, attVal);
+    }
+
+    public void deleteAttribute(HttpServletRequest request, HttpServletResponse response) {
+        IdmProcessor idmProc = getIdmProcessor(request);
+
+        String userId = request.getParameter("userId");
+        String attName = request.getParameter("attName");
+        String attVal = request.getParameter("attVal");
+        idmProc.deleteAttribute(userId, attName, attVal);
+    }
+
+    public void renameAttribute(HttpServletRequest request, HttpServletResponse response) {
+        IdmProcessor idmProc = getIdmProcessor(request);
+
+        String userId = request.getParameter("userId");
+        String attName = request.getParameter("attName");
+        String attVal = request.getParameter("attVal");
+        System.out.println(userId + "/" + attName + "/" + attVal);
+        idmProc.renameAttribute(userId, attName, attVal);
+    }
+
+    public void createRoletype(HttpServletRequest request, HttpServletResponse response) {
+        IdmProcessor idmProc = getIdmProcessor(request);
+
+        String roletypeId = request.getParameter("roletypeId");
+        idmProc.createRoletype(roletypeId);
+    }
+
+    public void deleteRoletype(HttpServletRequest request, HttpServletResponse response) {
+        IdmProcessor idmProc = getIdmProcessor(request);
+
+        String roletypeId = request.getParameter("roletypeId");
+        idmProc.deleteRoletype(roletypeId);
+    }
+
+    public void associateRole(HttpServletRequest request, HttpServletResponse response) {
+        IdmProcessor idmProc = getIdmProcessor(request);
+
+        String roletypeId = request.getParameter("roletypeId");
+        String userId = request.getParameter("userId");
+        String groupName = request.getParameter("groupName");
+        idmProc.associateRole(roletypeId, userId, groupName);
+    }
+
+    public void deassociateRole(HttpServletRequest request, HttpServletResponse response) {
+        IdmProcessor idmProc = getIdmProcessor(request);
+
+        String roletypeId = request.getParameter("roletypeId");
+        String userId = request.getParameter("userId");
+        String groupName = request.getParameter("groupName");
+        idmProc.deassociateRole(roletypeId, userId, groupName);
+    }
+}

Added: idm/trunk/example/idm-servlet/src/main/resources/hibernate.cfg.xml
===================================================================
--- idm/trunk/example/idm-servlet/src/main/resources/hibernate.cfg.xml	                        (rev 0)
+++ idm/trunk/example/idm-servlet/src/main/resources/hibernate.cfg.xml	2011-05-18 08:57:30 UTC (rev 953)
@@ -0,0 +1,58 @@
+<?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.                  ~
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE hibernate-configuration PUBLIC
+   "-//Hibernate/Hibernate Configuration DTD//EN"
+   "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+    <session-factory>
+        <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
+        <property name="show_sql">false</property>
+        <property name="cache.use_second_level_cache">true</property>
+        <property name="cache.use_query_cache">true</property>
+<!--
+      <property name="current_session_context_class">thread</property>
+
+      <property name="hibernate.connection.url">jdbc:hsqldb:mem:jbossidm</property>
+      <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
+      <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
+      <property name="hibernate.connection.username">sa</property>
+      <property name="hibernate.connection.password"></property>
+             <property name="hibernate.hbm2ddl.auto">create-drop</property>
+-->
+
+        <property name="current_session_context_class">thread</property>
+        <property name="hibernate.connection.url">
+        jdbc:mysql://localhost/idm-browse?jdbcCompliantTruncation=false
+        </property>
+        <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
+        <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
+        <property name="hibernate.hbm2ddl.auto">create-drop</property>
+
+        <property name="hibernate.hbm2ddl.auto">update</property>
+        <property name="hibernate.connection.username">root</property>
+        <property name="hibernate.connection.password">****</property>
+
+    </session-factory>
+</hibernate-configuration>

Added: idm/trunk/example/idm-servlet/src/main/resources/picketlink-config.xml
===================================================================
--- idm/trunk/example/idm-servlet/src/main/resources/picketlink-config.xml	                        (rev 0)
+++ idm/trunk/example/idm-servlet/src/main/resources/picketlink-config.xml	2011-05-18 08:57:30 UTC (rev 953)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-identity xmlns="urn:picketlink:idm:config:v1_0_0_ga"
+                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                xsi:schemaLocation="urn:picketlink:idm:config:v1_0_0_ga identity-config.xsd">
+  <realms>
+    <realm>
+      <id>idm_realm</id>
+      <repository-id-ref>DefaultRepository</repository-id-ref>
+      <identity-type-mappings>
+        <user-mapping>USER</user-mapping>
+      </identity-type-mappings>
+      <options>
+        <option>
+          <name>template</name>
+          <value>true</value>
+        </option>
+      </options>
+    </realm>
+  </realms>
+  <repositories>
+    <repository>
+      <id>DefaultRepository</id>
+      <class>org.picketlink.idm.impl.repository.WrapperIdentityStoreRepository</class>
+      <external-config/>
+      <default-identity-store-id>HibernateStore</default-identity-store-id>
+      <default-attribute-store-id>HibernateStore</default-attribute-store-id>
+    </repository>
+  </repositories>
+  <stores>
+    <attribute-stores/>
+    <identity-stores>
+      <identity-store>
+        <id>HibernateStore</id>
+        <class>org.picketlink.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+        <external-config/>
+        <supported-relationship-types>
+          <relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
+          <relationship-type>JBOSS_IDENTITY_ROLE</relationship-type>
+        </supported-relationship-types>
+        <supported-identity-object-types>
+          <identity-object-type>
+            <name>USER</name>
+            <relationships/>
+            <credentials>
+              <credential-type>PASSWORD</credential-type>
+            </credentials>
+            <attributes/>
+            <options/>
+          </identity-object-type>
+        </supported-identity-object-types>
+        <options>
+          <option>
+            <name>hibernateConfiguration</name>
+            <value>hibernate.cfg.xml</value>
+          </option>
+          <option>
+            <name>populateRelationshipTypes</name>
+            <value>true</value>
+          </option>
+          <option>
+            <name>populateIdentityObjectTypes</name>
+            <value>true</value>
+          </option>
+          <option>
+            <name>allowNotDefinedIdentityObjectTypes</name>
+            <value>true</value>
+          </option>
+          <option>
+            <name>allowNotDefinedAttributes</name>
+            <value>true</value>
+          </option>
+          <option>
+            <name>isRealmAware</name>
+            <value>true</value>
+          </option>
+        </options>
+      </identity-store>
+    </identity-stores>
+  </stores>
+  <options>
+      <option>
+         <name>defaultTemplate</name>
+         <value>idm_realm</value>
+      </option>
+  </options>
+</jboss-identity>
\ No newline at end of file

Added: idm/trunk/example/idm-servlet/src/main/webapp/WEB-INF/idm.tld
===================================================================
--- idm/trunk/example/idm-servlet/src/main/webapp/WEB-INF/idm.tld	                        (rev 0)
+++ idm/trunk/example/idm-servlet/src/main/webapp/WEB-INF/idm.tld	2011-05-18 08:57:30 UTC (rev 953)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
+
+<!-- a tab library descriptor -->
+<taglib>
+  <tlib-version>1.0</tlib-version>
+  <jsp-version>1.2</jsp-version>
+  <short-name>Java2s Simple Tags</short-name>
+  <!-- this tag manipulates its body content by converting it to upper case
+    -->
+  <tag>
+    <name>bodyContentTag</name>
+    <tag-class>org.jboss.picketlink.idm.BodyContentTag</tag-class>
+    <body-content>JSP</body-content>
+    <attribute>
+      <name>howMany</name>
+    </attribute>
+  </tag>
+</taglib>

Added: idm/trunk/example/idm-servlet/src/main/webapp/WEB-INF/web.xml
===================================================================
--- idm/trunk/example/idm-servlet/src/main/webapp/WEB-INF/web.xml	                        (rev 0)
+++ idm/trunk/example/idm-servlet/src/main/webapp/WEB-INF/web.xml	2011-05-18 08:57:30 UTC (rev 953)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+version="2.5">
+
+    <servlet>
+        <servlet-name>IdmServlet</servlet-name>
+        <servlet-class>org.jboss.picketlink.idm.IdmServlet</servlet-class>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>IdmServlet</servlet-name>
+        <url-pattern>/</url-pattern>
+    </servlet-mapping>
+  
+    <servlet-mapping>
+        <servlet-name>default</servlet-name>
+        <url-pattern>/static/*</url-pattern>
+    </servlet-mapping>
+
+    <jsp-config>
+        <taglib>
+            <taglib-uri>/WEB-INF/idm.tld</taglib-uri>
+            <taglib-location>/WEB-INF/idm.tld</taglib-location>
+        </taglib>
+    </jsp-config>
+</web-app>
+

Added: idm/trunk/example/idm-servlet/src/main/webapp/css/main.css
===================================================================
--- idm/trunk/example/idm-servlet/src/main/webapp/css/main.css	                        (rev 0)
+++ idm/trunk/example/idm-servlet/src/main/webapp/css/main.css	2011-05-18 08:57:30 UTC (rev 953)
@@ -0,0 +1,173 @@
+body {
+    font-family: verdana, sans-serif;
+    margin: 10px auto 10px auto;
+    width: 800px;
+    background: #fff url('../img/gr_w2.png') repeat-x top;
+}
+
+div.main {
+    padding-top: 80px;
+    background: url('../img/picketlink_logo_450x.png') no-repeat top right;
+}
+
+div.main>div>ul, form.header {
+    padding: 10px;
+}
+
+div.main>div>ul {
+    border: 2px #000 solid;
+    background: #fff url('../img/gr_w.png') repeat-x bottom;
+}
+
+form.header {
+    border: 2px #000 solid;
+    border-bottom: none;    
+    background: #a5bbcd url('../img/gr_db.png') repeat-x;
+}
+
+ul.attribute {
+    border: 1px #000 solid;
+    padding: 5px;
+}
+
+form.headeralt{
+    border: 1px #000 solid;    
+    background: #ccd8d8 url('../img/gr_lb.png') repeat-x;
+    border-bottom: none;
+    font-size: 14px;
+    padding: 5px;
+}
+
+.op-form {
+    display: inline;
+    border-left: 4px #b5cbdd solid;
+    padding-left: 8px;
+    margin:0px;
+}
+
+.op-formalt {
+    display: inline;    
+    padding-left: 8px;
+    margin:0px;
+}
+
+h1 {
+    display: none;
+    margin: 0px 0px 0px auto;
+    font-family: Trebuchet, verdana, sans-serif;
+    text-transform: uppercase;
+    font-style: italic;
+    font-size: 32px;
+}
+
+h2 {
+    font-family: Trebuchet, verdana, sans-serif;
+    font-variant: small-caps;
+    font-style: italic;
+    font-size: 18px;
+    margin-bottom:3px
+}
+
+h3 {
+    display: block;
+    font-family: Trebuchet, verdana, sans-serif;
+    text-transform: uppercase;
+    font-style: italic;
+    font-size: 14px;
+    margin-bottom:0px;
+}
+
+.idm-button {
+    padding-left:16px;
+    display: inline;
+    border: none;
+    text-decoration: overline;
+    cursor: pointer;    
+}
+
+.idm-delbutton {
+    background: left no-repeat url('../img/process-stop.png');
+}
+
+.idm-addgrp {
+    background: left no-repeat url('../img/folder-new.png');
+}
+
+.idm-adduser {
+    background: left no-repeat url('../img/document-new.png');
+}
+
+.idm-add {
+    background: left no-repeat url('../img/list-add.png');
+}
+
+.idm-rename {
+    background: left no-repeat url('../img/accessories-text-editor.png');
+}
+
+.idm-remove {
+    background: left no-repeat url('../img/list-remove.png');
+}
+
+.idm-associate {
+    background: left no-repeat url('../img/contact-new.png');
+}
+
+.idm-name {
+    width: 200px;
+    color: #000;    
+}
+
+ul{
+    margin: 0px;
+    padding: 0px;
+    list-style-type: none;
+    display: block;
+}
+
+ul>li {    
+    padding: 5px;    
+    list-style-position: inside;
+}
+
+ul.user>li{
+    font-size: 22px;
+}
+
+li.user {
+    list-style-image: url('../img/system-users.png');    
+}
+
+ul.group>li {
+    list-style-image: url('../img/folder.png');
+}
+
+.att-div {
+    margin-top: 10px;
+    margin-left: 26px;
+}
+
+ul.attribute>li {
+    list-style-image: url('../img/text-x-generic.png');
+    font-size: 12px;    
+}
+
+idm-att-name {
+    width: 200px;
+}
+
+ul.alternate>li:nth-child(even) {
+    background: #e1eeee;
+}
+
+ul.attribute>li:nth-child(even) {
+    background: #e1eeee;
+}
+
+.idm-toolbar {
+    float:right;
+}
+
+span.bold {
+    font-weight: bold;
+}
\ No newline at end of file

Added: idm/trunk/example/idm-servlet/src/main/webapp/img/accessories-text-editor.png
===================================================================
(Binary files differ)


Property changes on: idm/trunk/example/idm-servlet/src/main/webapp/img/accessories-text-editor.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: idm/trunk/example/idm-servlet/src/main/webapp/img/contact-new.png
===================================================================
(Binary files differ)


Property changes on: idm/trunk/example/idm-servlet/src/main/webapp/img/contact-new.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: idm/trunk/example/idm-servlet/src/main/webapp/img/document-new.png
===================================================================
(Binary files differ)


Property changes on: idm/trunk/example/idm-servlet/src/main/webapp/img/document-new.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: idm/trunk/example/idm-servlet/src/main/webapp/img/folder-new.png
===================================================================
(Binary files differ)


Property changes on: idm/trunk/example/idm-servlet/src/main/webapp/img/folder-new.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: idm/trunk/example/idm-servlet/src/main/webapp/img/folder.png
===================================================================
(Binary files differ)


Property changes on: idm/trunk/example/idm-servlet/src/main/webapp/img/folder.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: idm/trunk/example/idm-servlet/src/main/webapp/img/gr_db.png
===================================================================
(Binary files differ)


Property changes on: idm/trunk/example/idm-servlet/src/main/webapp/img/gr_db.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: idm/trunk/example/idm-servlet/src/main/webapp/img/gr_lb.png
===================================================================
(Binary files differ)


Property changes on: idm/trunk/example/idm-servlet/src/main/webapp/img/gr_lb.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: idm/trunk/example/idm-servlet/src/main/webapp/img/gr_lb2.png
===================================================================
(Binary files differ)


Property changes on: idm/trunk/example/idm-servlet/src/main/webapp/img/gr_lb2.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: idm/trunk/example/idm-servlet/src/main/webapp/img/gr_w.png
===================================================================
(Binary files differ)


Property changes on: idm/trunk/example/idm-servlet/src/main/webapp/img/gr_w.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: idm/trunk/example/idm-servlet/src/main/webapp/img/gr_w2.png
===================================================================
(Binary files differ)


Property changes on: idm/trunk/example/idm-servlet/src/main/webapp/img/gr_w2.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: idm/trunk/example/idm-servlet/src/main/webapp/img/list-add.png
===================================================================
(Binary files differ)


Property changes on: idm/trunk/example/idm-servlet/src/main/webapp/img/list-add.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: idm/trunk/example/idm-servlet/src/main/webapp/img/list-remove.png
===================================================================
(Binary files differ)


Property changes on: idm/trunk/example/idm-servlet/src/main/webapp/img/list-remove.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: idm/trunk/example/idm-servlet/src/main/webapp/img/picketlink_icon_16x.png
===================================================================
(Binary files differ)


Property changes on: idm/trunk/example/idm-servlet/src/main/webapp/img/picketlink_icon_16x.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: idm/trunk/example/idm-servlet/src/main/webapp/img/picketlink_logo_200x.png
===================================================================
(Binary files differ)


Property changes on: idm/trunk/example/idm-servlet/src/main/webapp/img/picketlink_logo_200x.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: idm/trunk/example/idm-servlet/src/main/webapp/img/picketlink_logo_450x.png
===================================================================
(Binary files differ)


Property changes on: idm/trunk/example/idm-servlet/src/main/webapp/img/picketlink_logo_450x.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: idm/trunk/example/idm-servlet/src/main/webapp/img/process-stop.png
===================================================================
(Binary files differ)


Property changes on: idm/trunk/example/idm-servlet/src/main/webapp/img/process-stop.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: idm/trunk/example/idm-servlet/src/main/webapp/img/system-users.png
===================================================================
(Binary files differ)


Property changes on: idm/trunk/example/idm-servlet/src/main/webapp/img/system-users.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: idm/trunk/example/idm-servlet/src/main/webapp/img/text-x-generic.png
===================================================================
(Binary files differ)


Property changes on: idm/trunk/example/idm-servlet/src/main/webapp/img/text-x-generic.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: idm/trunk/example/idm-servlet/src/main/webapp/main.jsp
===================================================================
--- idm/trunk/example/idm-servlet/src/main/webapp/main.jsp	                        (rev 0)
+++ idm/trunk/example/idm-servlet/src/main/webapp/main.jsp	2011-05-18 08:57:30 UTC (rev 953)
@@ -0,0 +1,200 @@
+<%@page import="org.jboss.jbossidmservlet.bean.UserBean"%>
+<%@page import="org.jboss.jbossidmservlet.processor.IdmProcessor"%>
+<%@page import="org.picketlink.idm.api.Group"%>
+<%@page import="org.picketlink.idm.api.Role"%>
+<%@page import="java.util.List"%>
+<%@page import="org.picketlink.idm.api.IdentitySearchCriteria"%>
+<%@page import="org.picketlink.idm.api.User"%>
+<%@page import="java.util.Collection"%>
+<%@page import="java.util.ArrayList"%>
+<%@page import="org.picketlink.idm.api.IdentitySession"%>
+<%@page import="org.picketlink.idm.impl.configuration.IdentityConfigurationImpl"%>
+<%@page import="org.picketlink.idm.api.IdentitySessionFactory"%>
+<%@page import="java.io.File"%>
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+<%@taglib uri="/WEB-INF/idm.tld" prefix="idm" %>
+<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+    "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+        <title>Picketlink IDM webapp</title>
+        <LINK REL=StyleSheet HREF="${pageContext.request.contextPath}/static/css/main.css" TYPE="text/css" MEDIA=screen>
+        <link rel="icon" href="${pageContext.request.contextPath}/static/img/picketlink_icon_16x.png" type="image/PNG">
+    </head>
+
+    <body>
+        <div class="main">
+            <h1>Picketlink IDM standalone webapp</h1>
+            <div class="user-div">
+                <h2>User list:</h2>
+                <form class="header" method="POST" action="createUser">
+                    <label for="userId">new user name:</label><input type="text" name="userId" value="name"/>
+                    <input type="submit" value="create new user" class="idm-button idm-adduser"/>
+                </form>
+                <ul class="user">
+                    <c:forEach var="user" items="${userList}">
+                        <li class="user">
+                            <span class="idm-name">${user.userId}</span>
+                            <span class="idm-toolbar">
+                                <form  method="POST" action="deleteUser" class="op-form">
+                                    <input type="hidden" name="userId" value="${user.userId}"/>
+                                    <input type="submit" value="delete" class="idm-button idm-delbutton"/>
+                                </form>
+                                <form class="op-form" method="POST" action="deassignGroup">
+                                    <input type="hidden" name="userId" value="${user.userId}"/>
+                                    <select name="groupId">
+                                        <c:forEach var="userGroup" items="${user.associatedGroups}">
+                                            <option>${userGroup.name}</option>
+                                        </c:forEach>
+                                    </select>
+                                    <input type="submit" value="deassign" class="idm-button idm-remove"/>
+                                </form>
+                                <form class="op-form" method="POST" action="assignGroup">
+                                    <input type="hidden" name="userId" value="${user.userId}"/>
+                                    <select name="groupId">
+                                        <c:forEach var="group" items="${groupList}">
+                                            <option value="${group.name}">${group.name}</option>
+                                        </c:forEach>
+                                    </select>
+                                    <input type="submit" value="assign" class="idm-button idm-add"/>
+                                </form>
+                            </span>
+
+                            <div class="att-div">
+                                <form class="headeralt" method="POST" action="createAttribute">
+                                    <input type="hidden" name="userId" value="${user.userId}"/>
+                                    <label for="attName">name:</label><input type="text" name="attName" value="name"/>
+                                    <label for="attVal">value:</label><input type="text" name="attVal" value="value"/>
+                                    <input type="submit" value="add attribute" class="idm-button idm-adduser"/>
+                                </form>
+                                <ul class="attribute">
+                                    <c:forEach var="attribute" items="${user.attributes}">
+                                        <li><span class="idm-att-name">${attribute.name}</span>
+                                            
+                                            <form class="op-formalt" method="POST" action="renameAttribute">
+                                                <input type="hidden" name="userId" value="${user.userId}"/>
+                                                <input type="hidden" name="attName" value="${attribute.name}"/>
+                                                <input type="text" name="attVal" value="${attribute.value}"/>
+                                                <input type="submit" value="change value" class="idm-button idm-rename"/>
+                                            </form>
+                                                <span class="idm-toolbar">
+                                            <form class="op-form"  method="POST" action="deleteAttribute" class="op-form">
+                                                <input type="hidden" name="userId" value="${user.userId}"/>
+                                                <input type="hidden" name="attName" value="${attribute.name}"/>
+                                                <input type="submit" value="delete" class="idm-button idm-delbutton"/>
+                                            </form>
+                                                </span>
+                                        </li>
+                                    </c:forEach>
+                                </ul>
+                            </div>
+
+                        </li>
+                    </c:forEach>
+                </ul>
+            </div>
+
+            <h2>Roles:</h2>
+            <div class="grp-div">
+                <form class="header" method="POST" action="associateRole">
+                    <label for="roletypeId">role type:</label>
+                    <select name="roletypeId">
+                        <c:forEach var="roletype" items="${roletypeList}">
+                            <option value="${roletype.name}">${roletype.name}</option>
+                        </c:forEach>
+                    </select>
+                    <label for="userId">user ID:</label>
+                    <select name="userId">
+                        <c:forEach var="user" items="${userList}">
+                            <option value="${user.userId}">${user.userId}</option>
+                        </c:forEach>
+                    </select>
+                    <label for="groupName">group name:</label>
+                    <select name="groupName">
+                        <c:forEach var="group" items="${groupList}">
+                            <option value="${group.name}">${group.name}</option>
+                        </c:forEach>
+                    </select>
+                    <input type="submit" value="associate role" class="idm-button idm-associate"/>
+                </form>
+                <ul class="alternate">
+                    <c:forEach var="group" items="${groupList}">
+                        <c:forEach var="role" items="${group.roleList}">
+                            <li class="user">
+                                <span class="bold">${role.user.id}</span>
+                                is
+                                <span class="bold">${role.roleType.name}</span>
+                                in 
+                                <span class="bold">${group.name}</span>                                
+                                <span class="idm-toolbar">
+                                    <form method="POST" action="deassociateRole" class="op-form">
+                                        <input type="hidden" name="groupId" value="${group.name}"/>
+                                        <input type="submit" value="delete" class="idm-button idm-delbutton"/>
+                                    </form>
+                                </span>
+                            </li>
+                        </c:forEach>
+                    </c:forEach>
+                </ul>
+            </div>
+
+            <h2>Group list:</h2>
+            <div class="grp-div">
+                <form class="header" method="POST" action="createGroup">
+                    <label for="groupId">new group name:</label><input type="text" name="groupId" value="name"/>
+                    <input type="submit" value="create new group" class="idm-button idm-addgrp"/>
+                </form>
+                <ul class="group alternate">
+                    <c:forEach var="group" items="${groupList}">
+                        <li>
+                            <span class="idm-name">${group.name}</span>
+                            <span class="idm-toolbar">
+                                <form method="POST" action="deleteGroup" class="op-form">
+                                    <input type="hidden" name="groupId" value="${group.name}"/>
+                                    <input type="submit" value="delete" class="idm-button idm-delbutton"/>
+                                </form>
+                                    <!--
+                                <form method="POST" action="RoleGroup" class="op-form">
+                                    <label for="roleId">role:</label>
+                                    <input type="hidden" name="groupId" value="${group.name}"/>
+                                    <select name="userId">
+                                        <c:forEach var="user" items="${userList}">
+                                            <option value="${user.userId}">${user.userId}</option>
+                                        </c:forEach>
+                                    </select>
+                                    <input type="submit" value="deassociate" class="idm-button idm-addgrp"/>
+                                </form>
+                                    -->
+                            </span>
+                        </li>
+                    </c:forEach>
+                </ul>
+            </div>
+
+            <h2>Role types:</h2>
+            <div class="grp-div alternate">
+                <form class="header" method="POST" action="createRoletype">
+                    <label for="groupId">new role type:</label><input type="text" name="roletypeId" value="name"/>
+                    <input type="submit" value="create new role type" class="idm-button idm-addgrp"/>
+                </form>
+                <ul class="group">
+                    <c:forEach var="roletype" items="${roletypeList}">
+                        <li>
+                            <span class="idm-name">${roletype.name}</span>
+                            <span class="idm-toolbar">
+                                <form method="POST" action="deleteRoletype" class="op-form">
+                                    <input type="hidden" name="roletypeId" value="${roletype.name}"/>
+                                    <input type="submit" value="delete" class="idm-button idm-delbutton"/>
+                                </form>
+                            </span>
+                        </li>
+                    </c:forEach>
+                </ul>
+            </div>
+
+        </div>
+    </body>
+</html>



More information about the jboss-cvs-commits mailing list