gatein SVN: r815 - portal/trunk.
by do-not-reply@jboss.org
Author: aheritier
Date: 2009-11-26 08:41:45 -0500 (Thu, 26 Nov 2009)
New Revision: 815
Modified:
portal/trunk/pom.xml
Log:
Renaming 'sample' to 'examples' - fix module name in reactor
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2009-11-26 12:45:12 UTC (rev 814)
+++ portal/trunk/pom.xml 2009-11-26 13:41:45 UTC (rev 815)
@@ -81,7 +81,7 @@
<module>portlet</module>
<module>web</module>
<module>server</module>
- <module>sample</module>
+ <module>examples</module>
<module>starter</module>
<module>packaging</module>
</modules>
15 years, 1 month
gatein SVN: r814 - in portal/trunk/examples/portlets: jsphellouser and 1 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-11-26 07:45:12 -0500 (Thu, 26 Nov 2009)
New Revision: 814
Removed:
portal/trunk/examples/portlets/jsfhellouser/.classpath
portal/trunk/examples/portlets/jsfhellouser/.project
portal/trunk/examples/portlets/jsfhellouser/.settings/
portal/trunk/examples/portlets/jsphellouser/.classpath
portal/trunk/examples/portlets/jsphellouser/.project
portal/trunk/examples/portlets/jsphellouser/.settings/
portal/trunk/examples/portlets/simplesthelloworld/.classpath
portal/trunk/examples/portlets/simplesthelloworld/.project
portal/trunk/examples/portlets/simplesthelloworld/.settings/
Log:
Deleting Eclipse files (This time it was not intended)
Deleted: portal/trunk/examples/portlets/jsfhellouser/.classpath
===================================================================
--- portal/trunk/examples/portlets/jsfhellouser/.classpath 2009-11-26 12:37:35 UTC (rev 813)
+++ portal/trunk/examples/portlets/jsfhellouser/.classpath 2009-11-26 12:45:12 UTC (rev 814)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
- <attributes>
- <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
- <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
Deleted: portal/trunk/examples/portlets/jsfhellouser/.project
===================================================================
--- portal/trunk/examples/portlets/jsfhellouser/.project 2009-11-26 12:37:35 UTC (rev 813)
+++ portal/trunk/examples/portlets/jsfhellouser/.project 2009-11-26 12:45:12 UTC (rev 814)
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>JSFHelloUser</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.wst.common.project.facet.core.builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
- <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
- <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
- </natures>
-</projectDescription>
Deleted: portal/trunk/examples/portlets/jsphellouser/.classpath
===================================================================
--- portal/trunk/examples/portlets/jsphellouser/.classpath 2009-11-26 12:37:35 UTC (rev 813)
+++ portal/trunk/examples/portlets/jsphellouser/.classpath 2009-11-26 12:45:12 UTC (rev 814)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
- <attributes>
- <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
- <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
Deleted: portal/trunk/examples/portlets/jsphellouser/.project
===================================================================
--- portal/trunk/examples/portlets/jsphellouser/.project 2009-11-26 12:37:35 UTC (rev 813)
+++ portal/trunk/examples/portlets/jsphellouser/.project 2009-11-26 12:45:12 UTC (rev 814)
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>JSPHelloUser</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.wst.common.project.facet.core.builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
- <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
- <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
- </natures>
-</projectDescription>
Deleted: portal/trunk/examples/portlets/simplesthelloworld/.classpath
===================================================================
--- portal/trunk/examples/portlets/simplesthelloworld/.classpath 2009-11-26 12:37:35 UTC (rev 813)
+++ portal/trunk/examples/portlets/simplesthelloworld/.classpath 2009-11-26 12:45:12 UTC (rev 814)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="target/classes" path="src/main/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
- <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
- <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
- <attributes>
- <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
- </attributes>
- </classpathentry>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
Deleted: portal/trunk/examples/portlets/simplesthelloworld/.project
===================================================================
--- portal/trunk/examples/portlets/simplesthelloworld/.project 2009-11-26 12:37:35 UTC (rev 813)
+++ portal/trunk/examples/portlets/simplesthelloworld/.project 2009-11-26 12:45:12 UTC (rev 814)
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>SimplestHelloWorld</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.wst.common.project.facet.core.builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
- <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
- <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
- </natures>
-</projectDescription>
15 years, 1 month
gatein SVN: r813 - in portal/trunk/examples: portlets and 45 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-11-26 07:37:35 -0500 (Thu, 26 Nov 2009)
New Revision: 813
Added:
portal/trunk/examples/portlets/
portal/trunk/examples/portlets/jsfhellouser/
portal/trunk/examples/portlets/jsfhellouser/.classpath
portal/trunk/examples/portlets/jsfhellouser/.project
portal/trunk/examples/portlets/jsfhellouser/.settings/
portal/trunk/examples/portlets/jsfhellouser/.settings/org.eclipse.jdt.core.prefs
portal/trunk/examples/portlets/jsfhellouser/.settings/org.eclipse.wst.common.component
portal/trunk/examples/portlets/jsfhellouser/.settings/org.eclipse.wst.common.project.facet.core.xml
portal/trunk/examples/portlets/jsfhellouser/.settings/org.maven.ide.eclipse.prefs
portal/trunk/examples/portlets/jsfhellouser/pom.xml
portal/trunk/examples/portlets/jsfhellouser/src/
portal/trunk/examples/portlets/jsfhellouser/src/main/
portal/trunk/examples/portlets/jsfhellouser/src/main/java/
portal/trunk/examples/portlets/jsfhellouser/src/main/java/org/
portal/trunk/examples/portlets/jsfhellouser/src/main/java/org/jboss/
portal/trunk/examples/portlets/jsfhellouser/src/main/java/org/jboss/portal/
portal/trunk/examples/portlets/jsfhellouser/src/main/java/org/jboss/portal/portlet/
portal/trunk/examples/portlets/jsfhellouser/src/main/java/org/jboss/portal/portlet/samples/
portal/trunk/examples/portlets/jsfhellouser/src/main/java/org/jboss/portal/portlet/samples/jsf/
portal/trunk/examples/portlets/jsfhellouser/src/main/java/org/jboss/portal/portlet/samples/jsf/UserBean.java
portal/trunk/examples/portlets/jsfhellouser/src/main/resources/
portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/
portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/META-INF/
portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/META-INF/MANIFEST.MF
portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/WEB-INF/
portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/WEB-INF/faces-config.xml
portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/WEB-INF/lib/
portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/WEB-INF/portlet.xml
portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/WEB-INF/web.xml
portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/jsf/
portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/jsf/edit.jsp
portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/jsf/hello.jsp
portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/jsf/help.jsp
portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/jsf/welcome.jsp
portal/trunk/examples/portlets/jsfhellouser/src/test/
portal/trunk/examples/portlets/jsfhellouser/src/test/java/
portal/trunk/examples/portlets/jsfhellouser/src/test/resources/
portal/trunk/examples/portlets/jsphellouser/
portal/trunk/examples/portlets/jsphellouser/.classpath
portal/trunk/examples/portlets/jsphellouser/.project
portal/trunk/examples/portlets/jsphellouser/.settings/
portal/trunk/examples/portlets/jsphellouser/.settings/org.eclipse.jdt.core.prefs
portal/trunk/examples/portlets/jsphellouser/.settings/org.eclipse.wst.common.component
portal/trunk/examples/portlets/jsphellouser/.settings/org.eclipse.wst.common.project.facet.core.xml
portal/trunk/examples/portlets/jsphellouser/.settings/org.maven.ide.eclipse.prefs
portal/trunk/examples/portlets/jsphellouser/pom.xml
portal/trunk/examples/portlets/jsphellouser/src/
portal/trunk/examples/portlets/jsphellouser/src/main/
portal/trunk/examples/portlets/jsphellouser/src/main/java/
portal/trunk/examples/portlets/jsphellouser/src/main/java/org/
portal/trunk/examples/portlets/jsphellouser/src/main/java/org/jboss/
portal/trunk/examples/portlets/jsphellouser/src/main/java/org/jboss/portal/
portal/trunk/examples/portlets/jsphellouser/src/main/java/org/jboss/portal/portlet/
portal/trunk/examples/portlets/jsphellouser/src/main/java/org/jboss/portal/portlet/samples/
portal/trunk/examples/portlets/jsphellouser/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java
portal/trunk/examples/portlets/jsphellouser/src/main/resources/
portal/trunk/examples/portlets/jsphellouser/src/main/webapp/
portal/trunk/examples/portlets/jsphellouser/src/main/webapp/META-INF/
portal/trunk/examples/portlets/jsphellouser/src/main/webapp/META-INF/MANIFEST.MF
portal/trunk/examples/portlets/jsphellouser/src/main/webapp/WEB-INF/
portal/trunk/examples/portlets/jsphellouser/src/main/webapp/WEB-INF/lib/
portal/trunk/examples/portlets/jsphellouser/src/main/webapp/WEB-INF/portlet.xml
portal/trunk/examples/portlets/jsphellouser/src/main/webapp/WEB-INF/web.xml
portal/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/
portal/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/edit.jsp
portal/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/hello.jsp
portal/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/help.jsp
portal/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/welcome.jsp
portal/trunk/examples/portlets/jsphellouser/src/test/
portal/trunk/examples/portlets/jsphellouser/src/test/java/
portal/trunk/examples/portlets/jsphellouser/src/test/resources/
portal/trunk/examples/portlets/pom.xml
portal/trunk/examples/portlets/simplesthelloworld/
portal/trunk/examples/portlets/simplesthelloworld/.classpath
portal/trunk/examples/portlets/simplesthelloworld/.project
portal/trunk/examples/portlets/simplesthelloworld/.settings/
portal/trunk/examples/portlets/simplesthelloworld/.settings/org.eclipse.jdt.core.prefs
portal/trunk/examples/portlets/simplesthelloworld/.settings/org.eclipse.wst.common.component
portal/trunk/examples/portlets/simplesthelloworld/.settings/org.eclipse.wst.common.project.facet.core.xml
portal/trunk/examples/portlets/simplesthelloworld/.settings/org.maven.ide.eclipse.prefs
portal/trunk/examples/portlets/simplesthelloworld/pom.xml
portal/trunk/examples/portlets/simplesthelloworld/src/
portal/trunk/examples/portlets/simplesthelloworld/src/main/
portal/trunk/examples/portlets/simplesthelloworld/src/main/java/
portal/trunk/examples/portlets/simplesthelloworld/src/main/java/org/
portal/trunk/examples/portlets/simplesthelloworld/src/main/java/org/jboss/
portal/trunk/examples/portlets/simplesthelloworld/src/main/java/org/jboss/portal/
portal/trunk/examples/portlets/simplesthelloworld/src/main/java/org/jboss/portal/portlet/
portal/trunk/examples/portlets/simplesthelloworld/src/main/java/org/jboss/portal/portlet/samples/
portal/trunk/examples/portlets/simplesthelloworld/src/main/java/org/jboss/portal/portlet/samples/SimplestHelloWorldPortlet.java
portal/trunk/examples/portlets/simplesthelloworld/src/main/resources/
portal/trunk/examples/portlets/simplesthelloworld/src/main/webapp/
portal/trunk/examples/portlets/simplesthelloworld/src/main/webapp/META-INF/
portal/trunk/examples/portlets/simplesthelloworld/src/main/webapp/META-INF/MANIFEST.MF
portal/trunk/examples/portlets/simplesthelloworld/src/main/webapp/WEB-INF/
portal/trunk/examples/portlets/simplesthelloworld/src/main/webapp/WEB-INF/lib/
portal/trunk/examples/portlets/simplesthelloworld/src/main/webapp/WEB-INF/portlet.xml
portal/trunk/examples/portlets/simplesthelloworld/src/main/webapp/WEB-INF/web.xml
portal/trunk/examples/portlets/simplesthelloworld/src/test/
portal/trunk/examples/portlets/simplesthelloworld/src/test/java/
portal/trunk/examples/portlets/simplesthelloworld/src/test/resources/
Modified:
portal/trunk/examples/pom.xml
Log:
Adding portlet examples
Modified: portal/trunk/examples/pom.xml
===================================================================
--- portal/trunk/examples/pom.xml 2009-11-26 12:33:12 UTC (rev 812)
+++ portal/trunk/examples/pom.xml 2009-11-26 12:37:35 UTC (rev 813)
@@ -37,6 +37,7 @@
<modules>
<module>extension</module>
<module>portal</module>
+ <module>portlets</module>
</modules>
</project>
Added: portal/trunk/examples/portlets/jsfhellouser/.classpath
===================================================================
--- portal/trunk/examples/portlets/jsfhellouser/.classpath (rev 0)
+++ portal/trunk/examples/portlets/jsfhellouser/.classpath 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
+ <attributes>
+ <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: portal/trunk/examples/portlets/jsfhellouser/.project
===================================================================
--- portal/trunk/examples/portlets/jsfhellouser/.project (rev 0)
+++ portal/trunk/examples/portlets/jsfhellouser/.project 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>JSFHelloUser</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ </natures>
+</projectDescription>
Added: portal/trunk/examples/portlets/jsfhellouser/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- portal/trunk/examples/portlets/jsfhellouser/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ portal/trunk/examples/portlets/jsfhellouser/.settings/org.eclipse.jdt.core.prefs 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,7 @@
+#Tue Jul 08 18:28:17 CEST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.source=1.3
Added: portal/trunk/examples/portlets/jsfhellouser/.settings/org.eclipse.wst.common.component
===================================================================
--- portal/trunk/examples/portlets/jsfhellouser/.settings/org.eclipse.wst.common.component (rev 0)
+++ portal/trunk/examples/portlets/jsfhellouser/.settings/org.eclipse.wst.common.component 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+<wb-module deploy-name="HelloWorld">
+<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
+<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
+<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
+<wb-resource deploy-path="/" source-path="/src/test/java"/>
+<wb-resource deploy-path="/" source-path="/src/test/resources"/>
+<property name="context-root" value="HelloWorld"/>
+<property name="java-output-path" value="build/classes"/>
+</wb-module>
+</project-modules>
Added: portal/trunk/examples/portlets/jsfhellouser/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
--- portal/trunk/examples/portlets/jsfhellouser/.settings/org.eclipse.wst.common.project.facet.core.xml (rev 0)
+++ portal/trunk/examples/portlets/jsfhellouser/.settings/org.eclipse.wst.common.project.facet.core.xml 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <installed facet="jst.java" version="1.4"/>
+ <installed facet="jst.web" version="2.3"/>
+</faceted-project>
Added: portal/trunk/examples/portlets/jsfhellouser/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- portal/trunk/examples/portlets/jsfhellouser/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ portal/trunk/examples/portlets/jsfhellouser/.settings/org.maven.ide.eclipse.prefs 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,8 @@
+#Tue Jul 08 18:28:14 CEST 2008
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+version=1
Added: portal/trunk/examples/portlets/jsfhellouser/pom.xml
===================================================================
--- portal/trunk/examples/portlets/jsfhellouser/pom.xml (rev 0)
+++ portal/trunk/examples/portlets/jsfhellouser/pom.xml 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+
+ <!--
+ the parent isn't required, you can drop it if you add a groupId
+ and version
+ -->
+ <parent>
+ <groupId>org.gatein.portal.examples.portlets</groupId>
+ <artifactId>parent</artifactId>
+ <version>3.0.0-Beta03-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>gatein-jsf-hellouser</artifactId>
+ <packaging>war</packaging>
+ <name>GateIn Portal Examples - JSF Hello User Portlet</name>
+ <description />
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>2.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.portletbridge</groupId>
+ <artifactId>portletbridge-api</artifactId>
+ <version>2.0.0.BETA</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.portletbridge</groupId>
+ <artifactId>portletbridge-impl</artifactId>
+ <version>2.0.0.BETA</version>
+ </dependency>
+
+ </dependencies>
+
+ <repositories>
+ <repository>
+ <id>JBoss repository</id>
+ <url>http://repository.jboss.com/maven2</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+
+ </repositories>
+
+</project>
Added: portal/trunk/examples/portlets/jsfhellouser/src/main/java/org/jboss/portal/portlet/samples/jsf/UserBean.java
===================================================================
--- portal/trunk/examples/portlets/jsfhellouser/src/main/java/org/jboss/portal/portlet/samples/jsf/UserBean.java (rev 0)
+++ portal/trunk/examples/portlets/jsfhellouser/src/main/java/org/jboss/portal/portlet/samples/jsf/UserBean.java 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.portlet.samples.jsf;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class UserBean
+{
+
+ private String userName;
+
+ public String getUserName()
+ {
+ return userName;
+ }
+
+ public void setUserName(String userName)
+ {
+ this.userName = userName;
+ }
+
+}
+
Added: portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/META-INF/MANIFEST.MF (rev 0)
+++ portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/META-INF/MANIFEST.MF 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/WEB-INF/faces-config.xml 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,33 @@
+<faces-config 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-facesconfig_1_2.xsd"
+ version="1.2">
+
+ <application>
+ <view-handler>org.jboss.portletbridge.application.PortletViewHandler</view-handler>
+ <state-manager>org.jboss.portletbridge.application.PortletStateManager</state-manager>
+ </application>
+
+ <managed-bean>
+ <managed-bean-name>user</managed-bean-name>
+ <managed-bean-class>
+ org.jboss.portal.portlet.samples.jsf.UserBean
+ </managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>sayHello</from-outcome>
+ <to-view-id>/jsf/hello.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>back</from-outcome>
+ <to-view-id>/jsf/welcome.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+</faces-config>
\ No newline at end of file
Added: portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/WEB-INF/portlet.xml (rev 0)
+++ portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/WEB-INF/portlet.xml 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+version="2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
+ http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
+ <portlet>
+ <portlet-name>JSFHelloUserPortlet</portlet-name>
+ <portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>view</portlet-mode>
+ <portlet-mode>edit</portlet-mode>
+ <portlet-mode>help</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>JSF Hello User Portlet</title>
+ </portlet-info>
+
+ <init-param>
+ <name>javax.portlet.faces.defaultViewId.view</name>
+ <value>/jsf/welcome.jsp</value>
+ </init-param>
+
+ <init-param>
+ <name>javax.portlet.faces.defaultViewId.edit</name>
+ <value>/jsf/edit.jsp</value>
+ </init-param>
+
+ <init-param>
+ <name>javax.portlet.faces.defaultViewId.help</name>
+ <value>/jsf/help.jsp</value>
+ </init-param>
+
+ </portlet>
+</portlet-app>
\ No newline at end of file
Added: portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/WEB-INF/web.xml
===================================================================
--- portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/WEB-INF/web.xml 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.5">
+
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.jsp</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>javax.portlet.faces.renderPolicy</param-name>
+ <param-value>NEVER_DELEGATE</param-value>
+ </context-param>
+
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.resource</url-pattern>
+ </servlet-mapping>
+
+
+</web-app>
Added: portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/jsf/edit.jsp
===================================================================
--- portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/jsf/edit.jsp (rev 0)
+++ portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/jsf/edit.jsp 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,7 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+
+<f:view>
+<div class="portlet-section-header"><h:outputText value="Edit mode"/></div>
+<div class="portlet-section-body">This is the edit mode, a convenient place to let the user change his portlet preferences.</div>
+</f:view>
\ No newline at end of file
Added: portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/jsf/hello.jsp
===================================================================
--- portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/jsf/hello.jsp (rev 0)
+++ portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/jsf/hello.jsp 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,14 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<f:view>
+<portlet:defineObjects/>
+
+<div class="portlet-section-header">Remember we love you: <h:outputText value="#{user.userName}"/></div>
+
+<br/>
+<h:form>
+ <h:commandLink action="back">
+ <h:outputText value="Ask Me Again"/>
+ </h:commandLink>
+</h:form>
+</f:view>
\ No newline at end of file
Added: portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/jsf/help.jsp
===================================================================
--- portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/jsf/help.jsp (rev 0)
+++ portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/jsf/help.jsp 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,6 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<f:view>
+<div class="portlet-section-header">Help mode</div>
+<div class="portlet-section-body">This is the help mode, a convenient place to give the user some help information.</div>
+</f:view>
\ No newline at end of file
Added: portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/jsf/welcome.jsp
===================================================================
--- portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/jsf/welcome.jsp (rev 0)
+++ portal/trunk/examples/portlets/jsfhellouser/src/main/webapp/jsf/welcome.jsp 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,20 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+
+<f:view>
+
+<div class="portlet-section-header">Welcome !</div>
+
+<br/>
+
+<div class="portlet-font">Welcome on the JSP Hello User portlet,
+my name is JBoss Portal. What's yours ?</div>
+
+<br/>
+
+<h:form>
+ <h:inputText value="#{user.userName}"/>
+ <h:commandButton action="sayHello" value="Say Hello"/>
+</h:form>
+
+</f:view>
\ No newline at end of file
Added: portal/trunk/examples/portlets/jsphellouser/.classpath
===================================================================
--- portal/trunk/examples/portlets/jsphellouser/.classpath (rev 0)
+++ portal/trunk/examples/portlets/jsphellouser/.classpath 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
+ <attributes>
+ <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: portal/trunk/examples/portlets/jsphellouser/.project
===================================================================
--- portal/trunk/examples/portlets/jsphellouser/.project (rev 0)
+++ portal/trunk/examples/portlets/jsphellouser/.project 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>JSPHelloUser</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ </natures>
+</projectDescription>
Added: portal/trunk/examples/portlets/jsphellouser/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- portal/trunk/examples/portlets/jsphellouser/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ portal/trunk/examples/portlets/jsphellouser/.settings/org.eclipse.jdt.core.prefs 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,7 @@
+#Tue Jul 08 18:28:17 CEST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.source=1.3
Added: portal/trunk/examples/portlets/jsphellouser/.settings/org.eclipse.wst.common.component
===================================================================
--- portal/trunk/examples/portlets/jsphellouser/.settings/org.eclipse.wst.common.component (rev 0)
+++ portal/trunk/examples/portlets/jsphellouser/.settings/org.eclipse.wst.common.component 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+<wb-module deploy-name="HelloWorld">
+<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
+<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
+<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
+<wb-resource deploy-path="/" source-path="/src/test/java"/>
+<wb-resource deploy-path="/" source-path="/src/test/resources"/>
+<property name="context-root" value="HelloWorld"/>
+<property name="java-output-path" value="build/classes"/>
+</wb-module>
+</project-modules>
Added: portal/trunk/examples/portlets/jsphellouser/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
--- portal/trunk/examples/portlets/jsphellouser/.settings/org.eclipse.wst.common.project.facet.core.xml (rev 0)
+++ portal/trunk/examples/portlets/jsphellouser/.settings/org.eclipse.wst.common.project.facet.core.xml 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <installed facet="jst.java" version="1.4"/>
+ <installed facet="jst.web" version="2.3"/>
+</faceted-project>
Added: portal/trunk/examples/portlets/jsphellouser/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- portal/trunk/examples/portlets/jsphellouser/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ portal/trunk/examples/portlets/jsphellouser/.settings/org.maven.ide.eclipse.prefs 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,8 @@
+#Tue Jul 08 18:28:14 CEST 2008
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+version=1
Added: portal/trunk/examples/portlets/jsphellouser/pom.xml
===================================================================
--- portal/trunk/examples/portlets/jsphellouser/pom.xml (rev 0)
+++ portal/trunk/examples/portlets/jsphellouser/pom.xml 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+
+ <!--
+ the parent isn't required, you can drop it if you add a groupId
+ and version
+ -->
+ <parent>
+ <groupId>org.gatein.portal.examples.portlets</groupId>
+ <artifactId>parent</artifactId>
+ <version>3.0.0-Beta03-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>gatein-jsp-hellouser</artifactId>
+ <packaging>war</packaging>
+ <name>GateIn Portal Examples - JSP Hello User Portlet</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>2.0</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: portal/trunk/examples/portlets/jsphellouser/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java
===================================================================
--- portal/trunk/examples/portlets/jsphellouser/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java (rev 0)
+++ portal/trunk/examples/portlets/jsphellouser/src/main/java/org/jboss/portal/portlet/samples/JSPHelloUserPortlet.java 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,78 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.portlet.samples;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.UnavailableException;
+
+public class JSPHelloUserPortlet extends GenericPortlet
+{
+
+ public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException
+ {
+ String sYourName = (String) request.getParameter("yourname");
+ if (sYourName != null)
+ {
+ PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/hello.jsp");
+ prd.include(request, response);
+ }
+ else
+ {
+ PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/welcome.jsp");
+ prd.include(request, response);
+ }
+ }
+
+ protected void doHelp(RenderRequest rRequest, RenderResponse rResponse) throws PortletException, IOException,
+ UnavailableException
+ {
+ rResponse.setContentType("text/html");
+ PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/help.jsp");
+ prd.include(rRequest, rResponse);
+ }
+
+ protected void doEdit(RenderRequest rRequest, RenderResponse rResponse) throws PortletException, IOException,
+ UnavailableException
+ {
+ rResponse.setContentType("text/html");
+ PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/edit.jsp");
+ prd.include(rRequest, rResponse);
+ }
+
+ public void processAction(ActionRequest aRequest, ActionResponse aResponse) throws PortletException, IOException,
+ UnavailableException
+ {
+ String sYourname = (String) aRequest.getParameter("yourname");
+ aResponse.setRenderParameter("yourname", sYourname);
+ }
+
+
+}
Added: portal/trunk/examples/portlets/jsphellouser/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- portal/trunk/examples/portlets/jsphellouser/src/main/webapp/META-INF/MANIFEST.MF (rev 0)
+++ portal/trunk/examples/portlets/jsphellouser/src/main/webapp/META-INF/MANIFEST.MF 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: portal/trunk/examples/portlets/jsphellouser/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portal/trunk/examples/portlets/jsphellouser/src/main/webapp/WEB-INF/portlet.xml (rev 0)
+++ portal/trunk/examples/portlets/jsphellouser/src/main/webapp/WEB-INF/portlet.xml 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+version="2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
+ http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
+ <portlet>
+ <portlet-name>JSPHelloUserPortlet</portlet-name>
+ <portlet-class>org.jboss.portal.portlet.samples.JSPHelloUserPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>view</portlet-mode>
+ <portlet-mode>edit</portlet-mode>
+ <portlet-mode>help</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>JSP Hello User Portlet</title>
+ </portlet-info>
+ </portlet>
+</portlet-app>
\ No newline at end of file
Added: portal/trunk/examples/portlets/jsphellouser/src/main/webapp/WEB-INF/web.xml
===================================================================
--- portal/trunk/examples/portlets/jsphellouser/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ portal/trunk/examples/portlets/jsphellouser/src/main/webapp/WEB-INF/web.xml 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.5">
+</web-app>
Added: portal/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/edit.jsp
===================================================================
--- portal/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/edit.jsp (rev 0)
+++ portal/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/edit.jsp 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,2 @@
+<div class="portlet-section-header">Edit mode</div>
+<div class="portlet-section-body">This is the edit mode, a convenient place to let the user change his portlet preferences.</div>
\ No newline at end of file
Added: portal/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/hello.jsp
===================================================================
--- portal/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/hello.jsp (rev 0)
+++ portal/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/hello.jsp 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,9 @@
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
+
+<portlet:defineObjects/>
+
+<div class="portlet-section-header">Remember we love you: <%= renderRequest.getParameter("yourname") %></div>
+
+<portlet:renderURL var="myRenderURL"/>
+<br/>
+<a href="<%= myRenderURL %>">Ask me again</a>
Added: portal/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/help.jsp
===================================================================
--- portal/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/help.jsp (rev 0)
+++ portal/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/help.jsp 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,2 @@
+<div class="portlet-section-header">Help mode</div>
+<div class="portlet-section-body">This is the help mode, a convenient place to give the user some help information.</div>
\ No newline at end of file
Added: portal/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/welcome.jsp
===================================================================
--- portal/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/welcome.jsp (rev 0)
+++ portal/trunk/examples/portlets/jsphellouser/src/main/webapp/jsp/welcome.jsp 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,35 @@
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
+
+<div class="portlet-section-header">Welcome !</div>
+
+<br/>
+
+<div class="portlet-font">Welcome on the JSP Hello User portlet,
+my name is JBoss Portal. What's yours ?</div>
+
+<br/>
+
+<div class="portlet-font">Method 1: We simply pass the parameter to the render phase:<br/>
+<a href="<portlet:renderURL><portlet:param name="yourname" value="John Doe"/></portlet:renderURL>">John Doe</a></div>
+
+<br/>
+
+<div class="portlet-font">Method 2: We pass the parameter to the render phase, using valid markup:
+Please check the source code to see the difference with Method 1.
+<portlet:renderURL var="myRenderURL">
+ <portlet:param name="yourname" value='John Doe'/>
+</portlet:renderURL>
+<br/>
+<a href="<%= myRenderURL %>">John Doe</a></div>
+
+<br/>
+
+<div class="portlet-font">Method 3: We use a form:<br/>
+
+<portlet:actionURL var="myActionURL"/>
+<form action="<%= myActionURL %>" method="POST">
+ <span class="portlet-form-field-label">Name:</span>
+ <input class="portlet-form-input-field" type="text" name="yourname"/>
+ <input class="portlet-form-button" type="Submit"/>
+</form>
+</div>
Added: portal/trunk/examples/portlets/pom.xml
===================================================================
--- portal/trunk/examples/portlets/pom.xml (rev 0)
+++ portal/trunk/examples/portlets/pom.xml 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+
+ <parent>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.parent</artifactId>
+ <version>3.0.0-Beta03-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.gatein.portal.examples.portlets</groupId>
+ <artifactId>parent</artifactId>
+ <packaging>pom</packaging>
+ <name>GateIn Portal Examples - Portlets</name>
+
+ <modules>
+ <module>jsfhellouser</module>
+ <module>jsphellouser</module>
+ <module>simplesthelloworld</module>
+ </modules>
+
+</project>
Added: portal/trunk/examples/portlets/simplesthelloworld/.classpath
===================================================================
--- portal/trunk/examples/portlets/simplesthelloworld/.classpath (rev 0)
+++ portal/trunk/examples/portlets/simplesthelloworld/.classpath 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
+ <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
+ <attributes>
+ <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: portal/trunk/examples/portlets/simplesthelloworld/.project
===================================================================
--- portal/trunk/examples/portlets/simplesthelloworld/.project (rev 0)
+++ portal/trunk/examples/portlets/simplesthelloworld/.project 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>SimplestHelloWorld</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ </natures>
+</projectDescription>
Added: portal/trunk/examples/portlets/simplesthelloworld/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- portal/trunk/examples/portlets/simplesthelloworld/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ portal/trunk/examples/portlets/simplesthelloworld/.settings/org.eclipse.jdt.core.prefs 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,7 @@
+#Tue Jul 08 18:28:17 CEST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.source=1.3
Added: portal/trunk/examples/portlets/simplesthelloworld/.settings/org.eclipse.wst.common.component
===================================================================
--- portal/trunk/examples/portlets/simplesthelloworld/.settings/org.eclipse.wst.common.component (rev 0)
+++ portal/trunk/examples/portlets/simplesthelloworld/.settings/org.eclipse.wst.common.component 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-modules id="moduleCoreId" project-version="1.5.0">
+<wb-module deploy-name="SimplestHelloWorldPortlet">
+<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
+<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
+<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
+<wb-resource deploy-path="/" source-path="/src/test/java"/>
+<wb-resource deploy-path="/" source-path="/src/test/resources"/>
+<property name="java-output-path" value="build/classes"/>
+<property name="context-root" value="SimplestHelloWorldPortlet"/>
+</wb-module>
+</project-modules>
Added: portal/trunk/examples/portlets/simplesthelloworld/.settings/org.eclipse.wst.common.project.facet.core.xml
===================================================================
--- portal/trunk/examples/portlets/simplesthelloworld/.settings/org.eclipse.wst.common.project.facet.core.xml (rev 0)
+++ portal/trunk/examples/portlets/simplesthelloworld/.settings/org.eclipse.wst.common.project.facet.core.xml 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faceted-project>
+ <installed facet="jst.java" version="1.4"/>
+ <installed facet="jst.web" version="2.3"/>
+</faceted-project>
Added: portal/trunk/examples/portlets/simplesthelloworld/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- portal/trunk/examples/portlets/simplesthelloworld/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ portal/trunk/examples/portlets/simplesthelloworld/.settings/org.maven.ide.eclipse.prefs 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,8 @@
+#Tue Jul 08 18:28:14 CEST 2008
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+version=1
Added: portal/trunk/examples/portlets/simplesthelloworld/pom.xml
===================================================================
--- portal/trunk/examples/portlets/simplesthelloworld/pom.xml (rev 0)
+++ portal/trunk/examples/portlets/simplesthelloworld/pom.xml 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>
+
+ <!--
+ the parent isn't required, you can drop it if you add a groupId
+ and version
+ -->
+ <parent>
+ <groupId>org.gatein.portal.examples.portlets</groupId>
+ <artifactId>parent</artifactId>
+ <version>3.0.0-Beta03-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>gatein-simplest-helloworld</artifactId>
+ <packaging>war</packaging>
+ <name>GateIn Portal Examples - Simplest Hello World Portlet</name>
+ <description />
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>2.0</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: portal/trunk/examples/portlets/simplesthelloworld/src/main/java/org/jboss/portal/portlet/samples/SimplestHelloWorldPortlet.java
===================================================================
--- portal/trunk/examples/portlets/simplesthelloworld/src/main/java/org/jboss/portal/portlet/samples/SimplestHelloWorldPortlet.java (rev 0)
+++ portal/trunk/examples/portlets/simplesthelloworld/src/main/java/org/jboss/portal/portlet/samples/SimplestHelloWorldPortlet.java 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,41 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.portlet.samples;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+public class SimplestHelloWorldPortlet extends GenericPortlet
+{
+ public void doView(RenderRequest request, RenderResponse response) throws IOException
+ {
+ PrintWriter writer = response.getWriter();
+ writer.write("Hello World !");
+ writer.close();
+ }
+}
+
Added: portal/trunk/examples/portlets/simplesthelloworld/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- portal/trunk/examples/portlets/simplesthelloworld/src/main/webapp/META-INF/MANIFEST.MF (rev 0)
+++ portal/trunk/examples/portlets/simplesthelloworld/src/main/webapp/META-INF/MANIFEST.MF 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: portal/trunk/examples/portlets/simplesthelloworld/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portal/trunk/examples/portlets/simplesthelloworld/src/main/webapp/WEB-INF/portlet.xml (rev 0)
+++ portal/trunk/examples/portlets/simplesthelloworld/src/main/webapp/WEB-INF/portlet.xml 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+version="2.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
+ http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
+ <portlet>
+ <portlet-name>SimplestHelloWorldPortlet</portlet-name>
+ <portlet-class>
+ org.jboss.portal.portlet.samples.SimplestHelloWorldPortlet
+ </portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Simplest Hello World Portlet</title>
+ </portlet-info>
+ </portlet>
+</portlet-app>
\ No newline at end of file
Added: portal/trunk/examples/portlets/simplesthelloworld/src/main/webapp/WEB-INF/web.xml
===================================================================
--- portal/trunk/examples/portlets/simplesthelloworld/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ portal/trunk/examples/portlets/simplesthelloworld/src/main/webapp/WEB-INF/web.xml 2009-11-26 12:37:35 UTC (rev 813)
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.5">
+</web-app>
15 years, 1 month
gatein SVN: r811 - portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2009-11-26 06:38:50 -0500 (Thu, 26 Nov 2009)
New Revision: 811
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java
Log:
GTNPORTAL-295: Duplicated portal name when create many portals
Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java 2009-11-26 11:10:15 UTC (rev 810)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/tasks/SearchTask.java 2009-11-26 11:38:50 UTC (rev 811)
@@ -222,11 +222,12 @@
String ownerType = q.getOwnerType();
ObjectType<Site> siteType = ownerType == null ? ObjectType.PORTAL_SITE : Mapper.parseSiteType(ownerType);
final Collection<? extends Site> portals = workspace.getSites(siteType);
+ final Iterator<? extends Site> iterator = portals.iterator();
ListAccess<PortalData> la = new ListAccess<PortalData>()
{
public PortalData[] load(int index, int length) throws Exception, IllegalArgumentException
{
- Iterator<? extends Site> iterator = portals.iterator();
+ //Iterator<? extends Site> iterator = portals.iterator();
Mapper mapper = new Mapper(session);
PortalData[] result = new PortalData[length];
for (int i = 0; i < length; i++)
15 years, 1 month
gatein SVN: r810 - in portal/trunk: portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component and 2 other directories.
by do-not-reply@jboss.org
Author: truong.le
Date: 2009-11-26 06:10:15 -0500 (Thu, 26 Nov 2009)
New Revision: 810
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component/UISiteManagement.gtmpl
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
Log:
GTNPORTAL-298: The modification in group navigation seems to not be really saved to DB
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java 2009-11-26 09:56:54 UTC (rev 809)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java 2009-11-26 11:10:15 UTC (rev 810)
@@ -216,8 +216,7 @@
else
{
uiPortalApp.addMessage(new ApplicationMessage("UISiteManagement.msg.portal-not-exist",
- new String[]{portalName}));
- ;
+ new String[]{portalName}));
return;
}
@@ -251,11 +250,18 @@
String portalName = event.getRequestContext().getRequestParameter(OBJECTID);
UserPortalConfigService service = uicomp.getApplicationComponent(UserPortalConfigService.class);
PortalRequestContext prContext = Util.getPortalRequestContext();
+ UIPortalApplication portalApp = (UIPortalApplication)prContext.getUIApplication();
UserPortalConfig userConfig = service.getUserPortalConfig(portalName, prContext.getRemoteUser());
+
+ if(userConfig == null)
+ {
+ portalApp.addMessage(new ApplicationMessage("UISiteManagement.msg.portal-not-exist",
+ new String[]{portalName}));
+ return;
+ }
PortalConfig portalConfig = userConfig.getPortalConfig();
- UIPortalApplication portalApp = (UIPortalApplication)prContext.getUIApplication();
UserACL userACL = portalApp.getApplicationComponent(UserACL.class);
if (!userACL.hasEditPermission(portalConfig))
{
@@ -306,6 +312,12 @@
UIApplication uiApplication = context.getUIApplication();
UserPortalConfig userConfig = service.getUserPortalConfig(portalName, prContext.getRemoteUser());
+ if(userConfig == null)
+ {
+ uiApplication.addMessage(new ApplicationMessage("UISiteManagement.msg.portal-not-exist",
+ new String[]{portalName}));
+ return;
+ }
PortalConfig portalConfig = userConfig.getPortalConfig();
UserACL userACL = uicomp.getApplicationComponent(UserACL.class);
@@ -314,7 +326,7 @@
uiApplication.addMessage(new ApplicationMessage("UISiteManagement.msg.Invalid-editPermission", null));
;
return;
- }
+ }
UIPopupWindow popUp = uicomp.getChild(UIPopupWindow.class);
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component/UISiteManagement.gtmpl
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component/UISiteManagement.gtmpl 2009-11-26 09:56:54 UTC (rev 809)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/groovy/navigation/webui/component/UISiteManagement.gtmpl 2009-11-26 11:10:15 UTC (rev 810)
@@ -22,7 +22,7 @@
<td class="ActionBlock">
<a href="<%=uicomponent.event("EditPortalLayout", portalConfig.getName());%>" class="EditLayoutIcon"><%=_ctx.appRes("UISiteManagement.label.editLayout")%></a>
<a href="<%=uicomponent.event("EditNavigation", portalConfig.getName());%>" class="EditNavIcon"><%=_ctx.appRes("UISiteManagement.label.editNav")%></a>
- <a href="javascript:ajaxGet(eXo.env.server.createPortalURL('UIPortal', 'EditPortalProperties', true, ['<%=portalConfig.getName()%>']))" class="EditNavIcon"><%=_ctx.appRes("UISiteManagement.label.editPortalProp")%></a>
+ <a href="javascript:ajaxGet(eXo.env.server.createPortalURL('UIPortal', 'EditPortalProperties', true, [{name:'portalName',value:'<%=portalConfig.getName()%>'}]))" class="EditNavIcon"><%=_ctx.appRes("UISiteManagement.label.editPortalProp")%></a>
<a href="<%=uicomponent.url("DeletePortal", portalConfig.getName());%>" class="DeleteIcon"><%=_ctx.appRes("UISiteManagement.label.deletePortal")%></a>
</td>
</tr>
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java 2009-11-26 09:56:54 UTC (rev 809)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java 2009-11-26 11:10:15 UTC (rev 810)
@@ -19,8 +19,11 @@
package org.exoplatform.portal.webui.navigation;
+import org.exoplatform.portal.application.PortalRequestContext;
+import org.exoplatform.portal.config.UserPortalConfig;
import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.webui.page.UIPageNodeForm2;
import org.exoplatform.portal.webui.portal.UIPortal;
import org.exoplatform.portal.webui.util.Util;
@@ -95,19 +98,28 @@
UserPortalConfigService portalConfigService =
uiManagement.getApplicationComponent(UserPortalConfigService.class);
PageNavigation navigation = uiNodeSelector.getSelectedNavigation();
- List<String> allPortalNames = portalConfigService.getAllPortalNames();
- if(allPortalNames.contains(navigation.getOwnerId()))
+ PortalRequestContext prContext = Util.getPortalRequestContext();
+ if(navigation.getOwnerType() == PortalConfig.PORTAL_TYPE)
{
+ UserPortalConfig portalConfig = portalConfigService.getUserPortalConfig(navigation.getOwnerId(), prContext.getRemoteUser());
+ if(portalConfig != null)
+ {
+ portalConfigService.update(navigation);
+ }
+
+ }
+ else
+ {
portalConfigService.update(navigation);
- }
+ }
UIPortal uiPortal = Util.getUIPortal();
setNavigation(uiPortal.getNavigations(), navigation);
UIPopupWindow uiPopup = uiManagement.getParent();
uiPopup.setShow(false);
UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
- Util.getPortalRequestContext().addUIComponentToUpdateByAjax(uiWorkingWS);
- Util.getPortalRequestContext().setFullRender(true);
+ prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
+ prContext.setFullRender(true);
}
private void setNavigation(List<PageNavigation> navs, PageNavigation nav)
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2009-11-26 09:56:54 UTC (rev 809)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2009-11-26 11:10:15 UTC (rev 810)
@@ -24,6 +24,7 @@
import org.exoplatform.commons.utils.PageList;
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.UserACL;
+import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.config.model.CloneApplicationState;
import org.exoplatform.portal.config.model.Container;
@@ -508,10 +509,15 @@
public void execute(Event<UIPortal> event) throws Exception
{
String portalName = event.getRequestContext().getRequestParameter("portalName");
-
UIPortal uiPortal = Util.getUIPortal();
- UIPortalApplication uiApp = uiPortal.getAncestorOfType(UIPortalApplication.class);
-
+ UIPortalApplication uiApp = uiPortal.getAncestorOfType(UIPortalApplication.class);
+ UserPortalConfigService service = uiApp.getApplicationComponent(UserPortalConfigService.class);
+ if(portalName !=null && service.getUserPortalConfig(portalName, event.getRequestContext().getRemoteUser()) == null)
+ {
+ uiApp.addMessage(new ApplicationMessage("UISiteManagement.msg.portal-not-exist",new String[]{portalName}));
+ return;
+ }
+
UIMaskWorkspace uiMaskWS = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
UIPortalForm portalForm = uiMaskWS.createUIComponent(UIPortalForm.class, null, "UIPortalForm");
portalForm.setPortalOwner(portalName);
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2009-11-26 09:56:54 UTC (rev 809)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2009-11-26 11:10:15 UTC (rev 810)
@@ -161,7 +161,13 @@
PortalConfig portalConfig = (PortalConfig)PortalDataMapper.buildModelObject(editPortal);
UserPortalConfigService configService = getApplicationComponent(UserPortalConfigService.class);
- configService.update(portalConfig);
+
+ List<String> allPortalNames = configService.getAllPortalNames();
+ if(allPortalNames.contains(portalConfig.getName()))
+ {
+ configService.update(portalConfig);
+ }
+
uiPortalApp.getUserPortalConfig().setPortal(portalConfig);
String remoteUser = prContext.getRemoteUser();
String ownerUser = prContext.getPortalOwner();
15 years, 1 month
gatein SVN: r809 - portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal.
by do-not-reply@jboss.org
Author: liem_nguyen
Date: 2009-11-26 04:56:54 -0500 (Thu, 26 Nov 2009)
New Revision: 809
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
Log:
GTNPORTAL-228 Change content of message when portal not-exist
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2009-11-26 08:15:43 UTC (rev 808)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2009-11-26 09:56:54 UTC (rev 809)
@@ -1343,6 +1343,14 @@
PopupPageSelector2.title.SelectPage=Select Page
############################################################################
+ # org.exoplatform.navigation.webui.component.UISiteManagement #
+ ############################################################################
+
+UISiteManagement.msg.Invalid-deletePermission=This user doesn't have permission to delete this portal
+UISiteManagement.msg.portal-not-exist=The portal is not existed or may be deleted
+UISiteManagement.msg.Invalid-editPermission=This user doesn't have permission to edit this portal
+
+ ############################################################################
# org.exoplatform.navigation.webui.component.UIGroupNavigationManagement #
############################################################################
15 years, 1 month
gatein SVN: r808 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application.
by do-not-reply@jboss.org
Author: liem_nguyen
Date: 2009-11-26 03:15:43 -0500 (Thu, 26 Nov 2009)
New Revision: 808
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestHandler.java
Log:
GTNPORTAL-242 IllegalArgumentException when input invalid URL of portal
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestHandler.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestHandler.java 2009-11-26 05:01:55 UTC (rev 807)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestHandler.java 2009-11-26 08:15:43 UTC (rev 808)
@@ -82,7 +82,10 @@
res.setHeader("Cache-Control", "no-cache");
PortalApplication app = controller.getApplication(PortalApplication.PORTAL_APPLICATION_ID);
- WebuiRequestContext context = new PortalRequestContext(app, req, res);
+ PortalRequestContext context = new PortalRequestContext(app, req, res);
+ if (context.getPortalOwner().isEmpty()) {
+ res.sendRedirect(req.getContextPath());
+ }
WebuiRequestContext.setCurrentInstance(context);
List<ApplicationLifecycle> lifecycles = app.getApplicationLifecycle();
try
15 years, 1 month
gatein SVN: r807 - portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component.
by do-not-reply@jboss.org
Author: liem_nguyen
Date: 2009-11-26 00:01:55 -0500 (Thu, 26 Nov 2009)
New Revision: 807
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationOrganizer.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UICategorySelector.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetInfo.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java
Log:
GTNPORTAL-283 Should page break when so many choose a category to add the gadget into category in Gadget item
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationOrganizer.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationOrganizer.java 2009-11-26 04:31:46 UTC (rev 806)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationOrganizer.java 2009-11-26 05:01:55 UTC (rev 807)
@@ -84,6 +84,13 @@
setSelectedCategory(categories.get(0));
}
+ if (getParent() != null)
+ {
+ UIGadgetManagement gadgetManager = getParent().findFirstComponentOfType(UIGadgetManagement.class);
+ if (gadgetManager != null)
+ gadgetManager.reload();
+ }
+
PortalRequestContext portalContext = org.exoplatform.portal.webui.util.Util.getPortalRequestContext();
UIPortal uiPortal = org.exoplatform.portal.webui.util.Util.getUIPortal();
MonitorEvent<UIPortal> pnevent = new MonitorEvent<UIPortal>(uiPortal, "ChangeApplicationList", portalContext);
@@ -122,7 +129,8 @@
{
selectedCategory = category;
ApplicationRegistryService service = getApplicationComponent(ApplicationRegistryService.class);
- applications = service.getApplications(selectedCategory, new Util.ApplicationComparator(), new ApplicationType[0]);
+ applications =
+ service.getApplications(selectedCategory, new Util.ApplicationComparator(), new ApplicationType[0]);
if (applications == null || applications.isEmpty())
{
setSelectedApplication(null);
@@ -196,7 +204,7 @@
}
}
}
-
+
public boolean isShowImport()
{
PortletRequestContext pcontext = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
@@ -239,7 +247,7 @@
{
UIApplicationOrganizer uiOrganizer = event.getSource();
ApplicationRegistryService service = uiOrganizer.getApplicationComponent(ApplicationRegistryService.class);
-
+
service.importAllPortlets();
service.importExoGadgets();
uiOrganizer.reload();
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UICategorySelector.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UICategorySelector.java 2009-11-26 04:31:46 UTC (rev 806)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UICategorySelector.java 2009-11-26 05:01:55 UTC (rev 807)
@@ -3,8 +3,7 @@
import org.exoplatform.application.registry.Application;
import org.exoplatform.application.registry.ApplicationCategory;
import org.exoplatform.application.registry.ApplicationRegistryService;
-import org.exoplatform.applicationregistry.webui.Util;
-import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.commons.utils.LazyPageList;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
@@ -15,7 +14,7 @@
import org.exoplatform.webui.form.UIFormCheckBoxInput;
import org.exoplatform.webui.form.UIFormInputInfo;
import org.exoplatform.webui.form.UIFormInputSet;
-import org.exoplatform.webui.form.UIFormTableInputSet;
+import org.exoplatform.webui.form.UIFormPageIterator;
import java.util.ArrayList;
import java.util.List;
@@ -30,49 +29,41 @@
@EventConfig(listeners = UICategorySelector.CancelActionListener.class, phase = Phase.DECODE)})
public class UICategorySelector extends UIForm
{
- private List<ApplicationCategory> categories;
-
private Application application;
private final static String[] ACTIONS = new String[]{"Save", "Cancel"};
private final static String[] TABLE_COLUMNS = {"choose", "categoryName"};
- public UICategorySelector()
+ public UICategorySelector() throws Exception
{
+ init();
}
- @Override
- public boolean isRendered()
+ public List<ApplicationCategory> getAllCategories()
{
- ApplicationRegistryService appRegService = getApplicationComponent(ApplicationRegistryService.class);
- List<ApplicationCategory> categories;
try
{
- categories = appRegService.getApplicationCategories();
+ ApplicationRegistryService appRegService = getApplicationComponent(ApplicationRegistryService.class);
+ List<ApplicationCategory> categories = appRegService.getApplicationCategories();
+ categories = categories != null ? categories : new ArrayList<ApplicationCategory>();
+ return categories;
}
catch (Exception e)
{
throw new RuntimeException(e);
}
- categories = categories != null ? categories : new ArrayList<ApplicationCategory>();
- if (categories.isEmpty())
- return false;
- return super.isRendered();
}
- /**
- * @see Refresh each render time
- */
@Override
- public void processRender(WebuiRequestContext context) throws Exception
+ public boolean isRendered()
{
- setChildren(null);
- ApplicationRegistryService appRegService = getApplicationComponent(ApplicationRegistryService.class);
- List<ApplicationCategory> categories = appRegService.getApplicationCategories(new Util.CategoryComparator());
- categories = categories != null ? categories : new ArrayList<ApplicationCategory>();
+ return (getAllCategories().size() > 0 && super.isRendered());
+ }
- UIFormTableInputSet uiTableInputSet = createUIComponent(UIFormTableInputSet.class, null, null);
+ public void init() throws Exception
+ {
+ UIFormTableIteratorInputSet uiTableInputSet = createUIComponent(UIFormTableIteratorInputSet.class, null, null);
uiTableInputSet.setName(getClass().getSimpleName());
uiTableInputSet.setId(getClass().getSimpleName());
uiTableInputSet.setColumns(TABLE_COLUMNS);
@@ -81,6 +72,9 @@
UIFormInputSet uiInputSet;
UIFormCheckBoxInput<Boolean> checkBoxInput;
UIFormInputInfo uiInfo;
+ ApplicationRegistryService appRegService = getApplicationComponent(ApplicationRegistryService.class);
+ List<ApplicationCategory> categories = getAllCategories();
+ List<UIFormInputSet> uiInputSetList = new ArrayList<UIFormInputSet>();
for (ApplicationCategory category : categories)
{
uiInputSet = new UIFormInputSet(category.getName());
@@ -88,23 +82,26 @@
if (application != null)
{
String definitionName = application.getDisplayName().replace(' ', '_');
- defaultValue =
- appRegService.getApplication(category.getName(), definitionName) != null;
+ defaultValue = appRegService.getApplication(category.getName(), definitionName) != null;
}
checkBoxInput = new UIFormCheckBoxInput<Boolean>("category_" + category.getName(), null, defaultValue);
uiInfo = new UIFormInputInfo("categoryName", null, category.getDisplayName());
uiInputSet.addChild(checkBoxInput);
uiInputSet.addChild(uiInfo);
uiTableInputSet.addChild(uiInputSet);
+ uiInputSetList.add(uiInputSet);
}
-
- super.processRender(context);
+
+ UIFormPageIterator uiIterator = uiTableInputSet.getChild(UIFormPageIterator.class);
+ LazyPageList<UIFormInputSet> pageList =
+ new LazyPageList<UIFormInputSet>(new FormInputSetListAccess(uiInputSetList), 5);
+ uiIterator.setPageList(pageList);
}
public String[] getActions()
{
return ACTIONS;
- }
+ }
public void setApplication(Application app)
{
@@ -124,7 +121,7 @@
ApplicationRegistryService appRegService = selector.getApplicationComponent(ApplicationRegistryService.class);
List<ApplicationCategory> categories = appRegService.getApplicationCategories();
categories = categories != null ? categories : new ArrayList<ApplicationCategory>();
- UIFormCheckBoxInput<Boolean> chkInput;
+ UIFormCheckBoxInput<Boolean> chkInput;
for (ApplicationCategory category : categories)
{
chkInput = selector.getUIInput("category_" + category.getName());
@@ -163,4 +160,17 @@
}
+ static public class ShowPageActionListener extends EventListener<UICategorySelector>
+ {
+ public void execute(Event<UICategorySelector> event) throws Exception
+ {
+ UICategorySelector selector = event.getSource();
+ int page = Integer.parseInt(event.getRequestContext().getRequestParameter(OBJECTID));
+ UIFormTableIteratorInputSet inputSet = selector.getChild(UIFormTableIteratorInputSet.class);
+ inputSet.getUIFormPageIterator().setCurrentPage(page);
+ selector.init();
+ event.getRequestContext().addUIComponentToUpdateByAjax(selector);
+ }
+ }
+
}
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetInfo.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetInfo.java 2009-11-26 04:31:46 UTC (rev 806)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetInfo.java 2009-11-26 05:01:55 UTC (rev 807)
@@ -226,8 +226,8 @@
}
Gadget gadget = gadgetInfo.getGadget();
- UICategorySelector selector = gadgetInfo.getChild(UICategorySelector.class);
-
+ gadgetInfo.removeChild(UICategorySelector.class);
+ UICategorySelector selector = gadgetInfo.addChild(UICategorySelector.class, null, null);
Application app = new Application();
app.setApplicationName(gadget.getName());
app.setType(ApplicationType.GADGET);
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java 2009-11-26 04:31:46 UTC (rev 806)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java 2009-11-26 05:01:55 UTC (rev 807)
@@ -121,12 +121,8 @@
public void setSelectedGadget(Gadget gadget) throws Exception
{
selectedGadget_ = gadget;
- UIGadgetInfo uiGadgetInfo = getChild(UIGadgetInfo.class);
- if (uiGadgetInfo == null)
- {
- getChildren().clear();
- uiGadgetInfo = addChild(UIGadgetInfo.class, null, null);
- }
+ getChildren().clear();
+ UIGadgetInfo uiGadgetInfo = addChild(UIGadgetInfo.class, null, null);
uiGadgetInfo.setGadget(selectedGadget_);
uiGadgetInfo.getChild(UICategorySelector.class).setRendered(false);
}
15 years, 1 month
gatein SVN: r806 - portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config.
by do-not-reply@jboss.org
Author: tan_pham_dinh
Date: 2009-11-25 23:31:46 -0500 (Wed, 25 Nov 2009)
New Revision: 806
Modified:
portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestOrganization.java
Log:
GTNPORTAL-280: Write TestCase for OrganizationService
Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestOrganization.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestOrganization.java 2009-11-26 01:03:34 UTC (rev 805)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestOrganization.java 2009-11-26 04:31:46 UTC (rev 806)
@@ -82,4 +82,24 @@
System.out.println(a.getUserName());
}
}
+
+ public void testFindUserByUserName() throws Exception
+ {
+ UserHandler uHandler = organizationService.getUserHandler();
+ User user = uHandler.findUserByName("root");
+ assertNotNull(user);
+ assertEquals("gtn", user.getPassword());
+
+ // Test changing password
+ user.setPassword("newPassword");
+ uHandler.saveUser(user, false);
+ user = uHandler.findUserByName("root");
+ assertNotNull(user);
+ assertEquals("newPassword", user.getPassword());
+
+ // Reset to default password
+ user.setPassword("gtn");
+ uHandler.saveUser(user, false);
+
+ }
}
15 years, 1 month
gatein SVN: r805 - in portal/branches/wsrp-integration: component/application-registry/src/main/java/org/exoplatform/application/registry/mop and 66 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-11-25 20:03:34 -0500 (Wed, 25 Nov 2009)
New Revision: 805
Added:
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMService.java
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java
portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/config/PortalMOPService.java
portal/branches/wsrp-integration/docs/testing/
portal/branches/wsrp-integration/docs/testing/GateIn_v3.0_BasicPortlets_TestDefinition.ods
portal/branches/wsrp-integration/docs/testing/GateIn_v3.0_MainFucntions_TestDefinition.ods
portal/branches/wsrp-integration/docs/testing/GateIn_v3.0_SniffTests.ods
portal/branches/wsrp-integration/docs/testing/selenium-suite.zip
portal/branches/wsrp-integration/docs/user-guide/en/modules/SSO.xml
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/background/BgEvenRow.gif
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/background/BgOddRow.gif
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/background/Button.gif
Removed:
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMService.java
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java
portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/jbidm/
portal/branches/wsrp-integration/docs/testing/GateIn_v3.0_BasicPortlets_TestDefinition.ods
portal/branches/wsrp-integration/docs/testing/GateIn_v3.0_MainFucntions_TestDefinition.ods
portal/branches/wsrp-integration/docs/testing/GateIn_v3.0_SniffTests.ods
portal/branches/wsrp-integration/docs/testing/selenium-suite.zip
portal/branches/wsrp-integration/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetEditMode.java
portal/branches/wsrp-integration/server/jboss/patch/
Modified:
portal/branches/wsrp-integration/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/MOPApplicationRegistryService.java
portal/branches/wsrp-integration/component/application-registry/src/test/java/conf/portal/idm-configuration.xml
portal/branches/wsrp-integration/component/identity/pom.xml
portal/branches/wsrp-integration/component/identity/src/main/java/conf/portal/hibernate-jbidm.cfg.xml
portal/branches/wsrp-integration/component/identity/src/main/java/conf/portal/idm-config.xml
portal/branches/wsrp-integration/component/identity/src/main/java/conf/portal/jboss-idm-configuration.xml
portal/branches/wsrp-integration/component/identity/src/test/java/conf/portal/idm-configuration.xml
portal/branches/wsrp-integration/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java
portal/branches/wsrp-integration/component/pc/pom.xml
portal/branches/wsrp-integration/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java
portal/branches/wsrp-integration/component/portal/pom.xml
portal/branches/wsrp-integration/component/portal/src/main/java/conf/portal/portal-nodetypes.xml
portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/config/RemoveGroupPortalConfigListener.java
portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/config/RemoveUserPortalConfigListener.java
portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java
portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java
portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/spi/gadget/GadgetContentProvider.java
portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/spi/portlet/PortletContentProvider.java
portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp/WSRPContentProvider.java
portal/branches/wsrp-integration/component/portal/src/test/java/conf/portal/database-configuration.xml
portal/branches/wsrp-integration/component/portal/src/test/java/conf/portal/idm-configuration.xml
portal/branches/wsrp-integration/component/portal/src/test/java/conf/portal/jcr-configuration.xml
portal/branches/wsrp-integration/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java
portal/branches/wsrp-integration/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
portal/branches/wsrp-integration/component/scripting/pom.xml
portal/branches/wsrp-integration/docs/user-guide/
portal/branches/wsrp-integration/docs/user-guide/en/master.xml
portal/branches/wsrp-integration/packaging/module/pom.xml
portal/branches/wsrp-integration/packaging/module/src/main/javascript/portal.packaging.module.js
portal/branches/wsrp-integration/packaging/pkg/pom.xml
portal/branches/wsrp-integration/packaging/pom.xml
portal/branches/wsrp-integration/packaging/product/pom.xml
portal/branches/wsrp-integration/pom.xml
portal/branches/wsrp-integration/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java
portal/branches/wsrp-integration/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java
portal/branches/wsrp-integration/portlet/dashboard/src/main/webapp/WEB-INF/portlet.xml
portal/branches/wsrp-integration/portlet/dashboard/src/main/webapp/groovy/dashboard/webui/component/UITabPaneDashboard.gtmpl
portal/branches/wsrp-integration/portlet/dashboard/src/main/webapp/groovy/gadget/webui/component/UIGadgetPortlet.gtmpl
portal/branches/wsrp-integration/portlet/dashboard/src/main/webapp/skin/gadget/webui/component/UIGadgetPortlet/DefaultStylesheet.css
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationOrganizer.java
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetInfo.java
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/DefaultStylesheet.css
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/background/GroupImage.png
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/background/LineBg.gif
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/background/MiniIcon.gif
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/register/webui/component/DefaultStylesheet.css
portal/branches/wsrp-integration/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UILogoEditMode.java
portal/branches/wsrp-integration/server/jboss/patch-ear/src/main/jboss/server/default/deployers/jbossweb.deployer/web.xml
portal/branches/wsrp-integration/server/jboss/pom.xml
portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/javascript/eXo/webui/UITabbedDashboard.js
portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPage/Stylesheet.css
portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIToolbarContainer/Stylesheet.css
portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIToolbarContainer/background/ToolbarContainer.gif
portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIForms/UIFormWithTitle/Stylesheet.css
portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIForms/UIFormWithTitle/background/TitleBG1x20.gif
portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIToolbar/Stylesheet.css
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ru.properties
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_uk.properties
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/database/database-configuration.xml
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-config.xml
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/classic/pages.xml
portal/branches/wsrp-integration/web/portal/src/main/webapp/groovy/webui/core/UIWizard.gtmpl
portal/branches/wsrp-integration/web/portal/src/main/webapp/templates/groovy/webui/component/UIHomePagePortlet.gtmpl
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/application/ApplicationStatistic.java
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/application/ApplicationStatisticService.java
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ModelAdapter.java
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationNodeSelector.java
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
Log:
- Merged changes from trunk up to revision 804.
Modified: portal/branches/wsrp-integration/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/MOPApplicationRegistryService.java
===================================================================
--- portal/branches/wsrp-integration/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/MOPApplicationRegistryService.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/MOPApplicationRegistryService.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -29,6 +29,7 @@
import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.pom.config.POMSession;
import org.exoplatform.portal.pom.config.POMSessionManager;
+import org.exoplatform.portal.pom.config.POMTask;
import org.exoplatform.portal.pom.registry.CategoryDefinition;
import org.exoplatform.portal.pom.registry.ContentDefinition;
import org.exoplatform.portal.pom.registry.ContentRegistry;
@@ -48,8 +49,13 @@
import java.util.Comparator;
import java.util.List;
import java.util.Set;
+import java.util.concurrent.atomic.AtomicReference;
/**
+ * The fundamental reason that motives to use tasks is because of the JMX access that does not
+ * setup a context and therefore the task either reuse the existing context setup by the portal
+ * or create a temporary context when accessed by JMX.
+ *
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
@@ -83,27 +89,34 @@
}
public List<ApplicationCategory> getApplicationCategories(
- Comparator<ApplicationCategory> sortComparator,
+ final Comparator<ApplicationCategory> sortComparator,
String accessUser,
- ApplicationType<?>... appTypes) throws Exception
+ final ApplicationType<?>... appTypes) throws Exception
{
- POMSession session = POMSessionManager.getSession();
- ContentRegistry registry = session.getContentRegistry();
+ final List<ApplicationCategory> categories = new ArrayList<ApplicationCategory>();
//
- List<ApplicationCategory> categories = new ArrayList<ApplicationCategory>();
- for (CategoryDefinition categoryDef : registry.getCategoryList())
+ pomMGr.execute(new POMTask()
{
- ApplicationCategory category = load(categoryDef, appTypes);
- categories.add(category);
- }
+ public void run(POMSession session) throws Exception
+ {
+ ContentRegistry registry = session.getContentRegistry();
- //
- if (sortComparator != null)
- {
- Collections.sort(categories, sortComparator);
- }
+ //
+ for (CategoryDefinition categoryDef : registry.getCategoryList())
+ {
+ ApplicationCategory category = load(categoryDef, appTypes);
+ categories.add(category);
+ }
+ //
+ if (sortComparator != null)
+ {
+ Collections.sort(categories, sortComparator);
+ }
+ }
+ });
+
//
return categories;
}
@@ -123,53 +136,69 @@
return getApplicationCategories(sortComparator, null);
}
- public ApplicationCategory getApplicationCategory(String name) throws Exception
+ public ApplicationCategory getApplicationCategory(final String name) throws Exception
{
- POMSession session = POMSessionManager.getSession();
- ContentRegistry registry = session.getContentRegistry();
+ final AtomicReference<ApplicationCategory> a = new AtomicReference<ApplicationCategory>();
//
- CategoryDefinition categoryDef = registry.getCategory(name);
- if (categoryDef != null)
+ pomMGr.execute(new POMTask()
{
- return load(categoryDef);
- }
- else
- {
- return null;
- }
- }
+ public void run(POMSession session) throws Exception
+ {
+ ContentRegistry registry = session.getContentRegistry();
- public void save(ApplicationCategory category) throws Exception
- {
- POMSession session = POMSessionManager.getSession();
- ContentRegistry registry = session.getContentRegistry();
+ //
+ CategoryDefinition categoryDef = registry.getCategory(name);
+ if (categoryDef != null)
+ {
+ ApplicationCategory applicationCategory = load(categoryDef);
+ a.set(applicationCategory);
+ }
+ }
+ });
//
- String categoryName = category.getName();
+ return a.get();
+ }
- //
- CategoryDefinition categoryDef = registry.getCategory(categoryName);
- if (categoryDef == null)
+ public void save(final ApplicationCategory category) throws Exception
+ {
+ pomMGr.execute(new POMTask()
{
- categoryDef = registry.createCategory(categoryName);
- }
+ public void run(POMSession session) throws Exception
+ {
+ ContentRegistry registry = session.getContentRegistry();
- //
- categoryDef.setDisplayName(category.getDisplayName());
- categoryDef.setCreationDate(category.getCreatedDate());
- categoryDef.setLastModificationDate(category.getModifiedDate());
- categoryDef.setDescription(category.getDescription());
- categoryDef.setAccessPermissions(category.getAccessPermissions());
+ //
+ String categoryName = category.getName();
+
+ //
+ CategoryDefinition categoryDef = registry.getCategory(categoryName);
+ if (categoryDef == null)
+ {
+ categoryDef = registry.createCategory(categoryName);
+ }
+
+ //
+ categoryDef.setDisplayName(category.getDisplayName());
+ categoryDef.setCreationDate(category.getCreatedDate());
+ categoryDef.setLastModificationDate(category.getModifiedDate());
+ categoryDef.setDescription(category.getDescription());
+ categoryDef.setAccessPermissions(category.getAccessPermissions());
+ }
+ });
}
- public void remove(ApplicationCategory category) throws Exception
+ public void remove(final ApplicationCategory category) throws Exception
{
- POMSession session = POMSessionManager.getSession();
- ContentRegistry registry = session.getContentRegistry();
-
- //
- registry.getCategoryMap().remove(category.getName());
+ pomMGr.execute(new POMTask()
+ {
+ public void run(POMSession session) throws Exception
+ {
+ ContentRegistry registry = session.getContentRegistry();
+ registry.getCategoryMap().remove(category.getName());
+ }
+ });
}
public List<Application> getApplications(ApplicationCategory category, ApplicationType<?>... appTypes) throws Exception
@@ -178,25 +207,36 @@
}
public List<Application> getApplications(
- ApplicationCategory category,
- Comparator<Application> sortComparator,
- ApplicationType<?>... appTypes) throws Exception
+ final ApplicationCategory category,
+ final Comparator<Application> sortComparator,
+ final ApplicationType<?>... appTypes) throws Exception
{
- POMSession session = POMSessionManager.getSession();
- ContentRegistry registry = session.getContentRegistry();
+ final AtomicReference<List<Application>> ref = new AtomicReference<List<Application>>();
//
- CategoryDefinition categoryDef = registry.getCategory(category.getName());
- List<Application> applications = load(categoryDef, appTypes).getApplications();
-
- //
- if (sortComparator != null)
+ pomMGr.execute(new POMTask()
{
- Collections.sort(applications, sortComparator);
- }
+ public void run(POMSession session) throws Exception
+ {
+ ContentRegistry registry = session.getContentRegistry();
+ //
+ CategoryDefinition categoryDef = registry.getCategory(category.getName());
+ List<Application> applications = load(categoryDef, appTypes).getApplications();
+
+ //
+ if (sortComparator != null)
+ {
+ Collections.sort(applications, sortComparator);
+ }
+
+ //
+ ref.set(applications);
+ }
+ });
+
//
- return applications;
+ return ref.get();
}
public List<Application> getAllApplications() throws Exception
@@ -220,90 +260,108 @@
return getApplication(fragments[0], fragments[1]);
}
- public Application getApplication(String category, String name) throws Exception
+ public Application getApplication(final String category, final String name) throws Exception
{
- POMSession session = POMSessionManager.getSession();
- ContentRegistry registry = session.getContentRegistry();
+ final AtomicReference<Application> ref = new AtomicReference<Application>();
//
- CategoryDefinition categoryDef = registry.getCategory(category);
- if (categoryDef != null)
+ pomMGr.execute(new POMTask()
{
- ContentDefinition contentDef = categoryDef.getContentMap().get(name);
- if (contentDef != null)
+ public void run(POMSession session) throws Exception
{
- return load(contentDef);
+ ContentRegistry registry = session.getContentRegistry();
+
+ //
+ CategoryDefinition categoryDef = registry.getCategory(category);
+ if (categoryDef != null)
+ {
+ ContentDefinition contentDef = categoryDef.getContentMap().get(name);
+ if (contentDef != null)
+ {
+ ref.set(load(contentDef));
+ }
+ }
}
- }
+ });
//
- return null;
+ return ref.get();
}
- public void save(ApplicationCategory category, Application application) throws Exception
+ public void save(final ApplicationCategory category, final Application application) throws Exception
{
- POMSession session = POMSessionManager.getSession();
- ContentRegistry registry = session.getContentRegistry();
-
- //
- String categoryName = category.getName();
- CategoryDefinition categoryDef = registry.getCategory(categoryName);
- if (categoryDef == null)
+ pomMGr.execute(new POMTask()
{
- categoryDef = registry.createCategory(categoryName);
- save(category, categoryDef);
- }
+ public void run(POMSession session) throws Exception
+ {
+ ContentRegistry registry = session.getContentRegistry();
- //
- ContentDefinition contentDef = null;
- CategoryDefinition applicationCategoryDef = registry.getCategory(application.getCategoryName());
- String applicationName = application.getApplicationName();
- if (applicationCategoryDef != null)
- {
- contentDef = applicationCategoryDef.getContentMap().get(applicationName);
- }
- if (contentDef == null)
- {
- String contentId = application.getContentId();
- ContentType<?> contentType = application.getType().getContentType();
- String definitionName = application.getDisplayName().replace(' ', '_');
- contentDef = categoryDef.createContent(definitionName, contentType, contentId);
- }
- else
- {
- // A JCR move actually
- categoryDef.getContentList().add(contentDef);
- }
+ //
+ String categoryName = category.getName();
+ CategoryDefinition categoryDef = registry.getCategory(categoryName);
+ if (categoryDef == null)
+ {
+ categoryDef = registry.createCategory(categoryName);
+ save(category, categoryDef);
+ }
- // Update state
- save(application, contentDef);
+ //
+ ContentDefinition contentDef = null;
+ CategoryDefinition applicationCategoryDef = registry.getCategory(application.getCategoryName());
+ String applicationName = application.getApplicationName();
+ if (applicationCategoryDef != null)
+ {
+ contentDef = applicationCategoryDef.getContentMap().get(applicationName);
+ }
+ if (contentDef == null)
+ {
+ String contentId = application.getContentId();
+ ContentType<?> contentType = application.getType().getContentType();
+ String definitionName = application.getApplicationName();
+ contentDef = categoryDef.createContent(definitionName, contentType, contentId);
+ }
+ else
+ {
+ // A JCR move actually
+ categoryDef.getContentList().add(contentDef);
+ }
+
+ // Update state
+ save(application, contentDef);
+ }
+ });
}
- public void update(Application application) throws Exception
+ public void update(final Application application) throws Exception
{
- POMSession session = POMSessionManager.getSession();
- ContentRegistry registry = session.getContentRegistry();
-
- //
- String categoryName = application.getCategoryName();
- CategoryDefinition categoryDef = registry.getCategory(categoryName);
- if (categoryDef == null)
+ pomMGr.execute(new POMTask()
{
- throw new IllegalStateException();
- }
+ public void run(POMSession session) throws Exception
+ {
+ ContentRegistry registry = session.getContentRegistry();
- //
- ContentDefinition contentDef = categoryDef.getContentMap().get(application.getApplicationName());
- if (contentDef == null)
- {
- throw new IllegalStateException();
- }
+ //
+ String categoryName = application.getCategoryName();
+ CategoryDefinition categoryDef = registry.getCategory(categoryName);
+ if (categoryDef == null)
+ {
+ throw new IllegalStateException();
+ }
- // Update state
- save(application, contentDef);
+ //
+ ContentDefinition contentDef = categoryDef.getContentMap().get(application.getApplicationName());
+ if (contentDef == null)
+ {
+ throw new IllegalStateException();
+ }
+
+ // Update state
+ save(application, contentDef);
+ }
+ });
}
- public void remove(Application app) throws Exception
+ public void remove(final Application app) throws Exception
{
if (app == null)
{
@@ -311,154 +369,169 @@
}
//
- POMSession session = POMSessionManager.getSession();
- ContentRegistry registry = session.getContentRegistry();
+ pomMGr.execute(new POMTask()
+ {
+ public void run(POMSession session) throws Exception
+ {
+ ContentRegistry registry = session.getContentRegistry();
- //
- String categoryName = app.getCategoryName();
- CategoryDefinition categoryDef = registry.getCategory(categoryName);
+ //
+ String categoryName = app.getCategoryName();
+ CategoryDefinition categoryDef = registry.getCategory(categoryName);
- //
- if (categoryDef != null)
- {
+ //
+ if (categoryDef != null)
+ {
- String contentName = app.getApplicationName();
- categoryDef.getContentMap().remove(contentName);
- }
+ String contentName = app.getApplicationName();
+ categoryDef.getContentMap().remove(contentName);
+ }
+ }
+ });
}
public void importExoGadgets() throws Exception
{
- POMSession session = POMSessionManager.getSession();
- ContentRegistry registry = session.getContentRegistry();
+ pomMGr.execute(new POMTask()
+ {
+ public void run(POMSession session) throws Exception
+ {
+ ContentRegistry registry = session.getContentRegistry();
- //
- ExoContainer container = ExoContainerContext.getCurrentContainer();
- GadgetRegistryService gadgetService = (GadgetRegistryService)container.getComponentInstanceOfType(GadgetRegistryService.class);
- List<Gadget> eXoGadgets = gadgetService.getAllGadgets();
+ //
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+ GadgetRegistryService gadgetService = (GadgetRegistryService)container.getComponentInstanceOfType(GadgetRegistryService.class);
+ List<Gadget> eXoGadgets = gadgetService.getAllGadgets();
- //
- if (eXoGadgets != null)
- {
- ArrayList<String> permissions = new ArrayList<String>();
- permissions.add(UserACL.EVERYONE);
- String categoryName = "Gadgets";
+ //
+ if (eXoGadgets != null)
+ {
+ ArrayList<String> permissions = new ArrayList<String>();
+ permissions.add(UserACL.EVERYONE);
+ String categoryName = "Gadgets";
- //
- CategoryDefinition category = registry.getCategory(categoryName);
- if (category == null)
- {
- category = registry.createCategory(categoryName);
- category.setDisplayName(categoryName);
- category.setDescription(categoryName);
- category.setAccessPermissions(permissions);
- }
+ //
+ CategoryDefinition category = registry.getCategory(categoryName);
+ if (category == null)
+ {
+ category = registry.createCategory(categoryName);
+ category.setDisplayName(categoryName);
+ category.setDescription(categoryName);
+ category.setAccessPermissions(permissions);
+ }
- //
- for (Gadget ele : eXoGadgets)
- {
- ContentDefinition app = category.getContentMap().get(ele.getName());
- if (app == null)
- {
- app = category.createContent(ele.getName(), org.exoplatform.portal.pom.spi.gadget.Gadget.CONTENT_TYPE, ele.getName());
- app.setDisplayName(ele.getTitle());
- app.setDescription(ele.getDescription());
- app.setAccessPermissions(permissions);
+ //
+ for (Gadget ele : eXoGadgets)
+ {
+ ContentDefinition app = category.getContentMap().get(ele.getName());
+ if (app == null)
+ {
+ app = category.createContent(ele.getName(), org.exoplatform.portal.pom.spi.gadget.Gadget.CONTENT_TYPE, ele.getName());
+ app.setDisplayName(ele.getTitle());
+ app.setDescription(ele.getDescription());
+ app.setAccessPermissions(permissions);
+ }
+ }
}
}
- }
+ });
}
public void importAllPortlets() throws Exception
{
- POMSession session = POMSessionManager.getSession();
- ContentRegistry registry = session.getContentRegistry();
-
- //
- ExoContainer manager = ExoContainerContext.getCurrentContainer();
- PortletInvoker portletInvoker = (PortletInvoker)manager.getComponentInstance(PortletInvoker.class);
- Set<org.gatein.pc.api.Portlet> portlets = portletInvoker.getPortlets();
-
- //
- for (org.gatein.pc.api.Portlet portlet : portlets)
+ pomMGr.execute(new POMTask()
{
- PortletInfo info = portlet.getInfo();
- String portletApplicationName = info.getApplicationName();
- String portletName = info.getName();
-
- // Need to sanitize portlet and application names in case they contain characters that would
- // cause an improper Application name
- portletApplicationName = portletApplicationName.replace('/', '_');
- portletName = portletName.replace('/', '_');
-
- LocalizedString keywordsLS = info.getMeta().getMetaValue(MetaInfo.KEYWORDS);
-
- String[] categoryNames = null;
- if (keywordsLS != null)
+ public void run(POMSession session) throws Exception
{
- String keywords = keywordsLS.getDefaultString();
- if (keywords != null && keywords.length() != 0)
- {
- categoryNames = keywords.split(",");
- }
- }
+ ContentRegistry registry = session.getContentRegistry();
- if (categoryNames == null || categoryNames.length == 0)
- {
- categoryNames = new String[]{portletApplicationName};
- }
-
- if (portlet.isRemote())
- {
- categoryNames = Tools.appendTo(categoryNames, REMOTE_CATEGORY_NAME);
- }
-
- //
- for (String categoryName : categoryNames)
- {
- categoryName = categoryName.trim();
-
//
- CategoryDefinition category = registry.getCategory(categoryName);
+ ExoContainer manager = ExoContainerContext.getCurrentContainer();
+ PortletInvoker portletInvoker = (PortletInvoker)manager.getComponentInstance(PortletInvoker.class);
+ Set<org.gatein.pc.api.Portlet> portlets = portletInvoker.getPortlets();
//
- if (category == null)
+ for (org.gatein.pc.api.Portlet portlet : portlets)
{
- category = registry.createCategory(categoryName);
- category.setDisplayName(categoryName);
- }
+ PortletInfo info = portlet.getInfo();
+ String portletApplicationName = info.getApplicationName();
+ String portletName = info.getName();
- //
- ContentDefinition app = category.getContentMap().get(portletName);
- if (app == null)
- {
- LocalizedString descriptionLS = portlet.getInfo().getMeta().getMetaValue(MetaInfo.DESCRIPTION);
- LocalizedString displayNameLS = portlet.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
+ // Need to sanitize portlet and application names in case they contain characters that would
+ // cause an improper Application name
+ portletApplicationName = portletApplicationName.replace('/', '_');
+ portletName = portletName.replace('/', '_');
- // julien: ????
- // getLocalizedStringValue(descriptionLS, portletName);
+ LocalizedString keywordsLS = info.getMeta().getMetaValue(MetaInfo.KEYWORDS);
- ContentType<?> contentType;
- String contentId;
- if (portlet.isRemote())
+ String[] categoryNames = null;
+ if (keywordsLS != null)
{
- contentType = WSRP.CONTENT_TYPE;
- contentId = portlet.getContext().getId();
+ String keywords = keywordsLS.getDefaultString();
+ if (keywords != null && keywords.length() != 0)
+ {
+ categoryNames = keywords.split(",");
+ }
}
- else
+
+ if (categoryNames == null || categoryNames.length == 0)
{
- contentType = Portlet.CONTENT_TYPE;
- contentId = info.getApplicationName() + "/" + info.getName();
+ categoryNames = new String[]{portletApplicationName};
}
+ if (portlet.isRemote())
+ {
+ categoryNames = Tools.appendTo(categoryNames, REMOTE_CATEGORY_NAME);
+ }
//
- app = category.createContent(portletName, contentType, contentId);
- app.setDisplayName(getLocalizedStringValue(displayNameLS, portletName));
- app.setDescription(getLocalizedStringValue(descriptionLS, portletName));
+ for (String categoryName : categoryNames)
+ {
+ categoryName = categoryName.trim();
+
+ //
+ CategoryDefinition category = registry.getCategory(categoryName);
+
+ //
+ if (category == null)
+ {
+ category = registry.createCategory(categoryName);
+ category.setDisplayName(categoryName);
+ }
+
+ //
+ ContentDefinition app = category.getContentMap().get(portletName);
+ if (app == null)
+ {
+ LocalizedString descriptionLS = portlet.getInfo().getMeta().getMetaValue(MetaInfo.DESCRIPTION);
+ LocalizedString displayNameLS = portlet.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
+
+ // julien: ????
+ // getLocalizedStringValue(descriptionLS, portletName);
+
+ ContentType<?> contentType;
+ String contentId;
+ if (portlet.isRemote())
+ {
+ contentType = WSRP.CONTENT_TYPE;
+ contentId = portlet.getContext().getId();
+ }
+ else
+ {
+ contentType = Portlet.CONTENT_TYPE;
+ contentId = info.getApplicationName() + "/" + info.getName();
+ }
+
+
+ //
+ app = category.createContent(portletName, contentType, contentId);
+ app.setDisplayName(getLocalizedStringValue(displayNameLS, portletName));
+ app.setDescription(getLocalizedStringValue(descriptionLS, portletName));
+ }
+ }
}
}
- }
+ });
}
private boolean isApplicationType(Application app, ApplicationType<?>... appTypes)
Modified: portal/branches/wsrp-integration/component/application-registry/src/test/java/conf/portal/idm-configuration.xml
===================================================================
--- portal/branches/wsrp-integration/component/application-registry/src/test/java/conf/portal/idm-configuration.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/application-registry/src/test/java/conf/portal/idm-configuration.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -25,52 +25,44 @@
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
<component>
- <key>org.exoplatform.services.organization.jbidm.JBossIDMService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</type>
+ <key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
<init-params>
<value-param>
<name>config</name>
<value>war:/conf/organization/idm-config.xml</value>
</value-param>
- <values-param>
- <name>hibernate.annotations</name>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
- </values-param>
- <properties-param>
- <name>hibernate.properties</name>
- <property name="hibernate.hbm2ddl.auto" value="update"/>
- <property name="hibernate.current_session_context_class" value="thread"/>
- <property name="hibernate.show_sql" value="false"/>
- <property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
- <property name="hibernate.connection.url" value="jdbc:hsqldb:file:../temp/data/exodb"/>
- <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
- <property name="hibernate.connection.autocommit" value="true"/>
- <property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value=""/>
- <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
- <property name="hibernate.c3p0.min_size" value="5"/>
- <property name="hibernate.c3p0.max_size" value="20"/>
- <property name="hibernate.c3p0.timeout" value="1800"/>
- <property name="hibernate.c3p0.max_statements" value="50"/>
- </properties-param>
-
</init-params>
</component>
<component>
<key>org.exoplatform.services.organization.OrganizationService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</type>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
</component>
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.database.HibernateService</target-component>
+ <component-plugin>
+ <name>add.hibernate.mapping</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
+ <init-params>
+ <values-param>
+ <name>hibernate.mapping</name>
+ <value>mappings/HibernateRealm.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObject.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredential.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
</configuration>
Modified: portal/branches/wsrp-integration/component/identity/pom.xml
===================================================================
--- portal/branches/wsrp-integration/component/identity/pom.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/identity/pom.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -55,24 +55,24 @@
</dependency>
<dependency>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-core</artifactId>
- <version>${org.jboss.identity.idm}</version>
+ <groupId>org.picketlink.idm</groupId>
+ <artifactId>picketlink-idm-core</artifactId>
+ <version>${org.picketlink.idm}</version>
</dependency>
<dependency>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-hibernate</artifactId>
- <version>${org.jboss.identity.idm}</version>
+ <groupId>org.picketlink.idm</groupId>
+ <artifactId>picketlink-idm-hibernate</artifactId>
+ <version>${org.picketlink.idm}</version>
</dependency>
<dependency>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-ldap</artifactId>
- <version>${org.jboss.identity.idm}</version>
+ <groupId>org.picketlink.idm</groupId>
+ <artifactId>picketlink-idm-ldap</artifactId>
+ <version>${org.picketlink.idm}</version>
</dependency>
<dependency>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-cache</artifactId>
- <version>${org.jboss.identity.idm}</version>
+ <groupId>org.picketlink.idm</groupId>
+ <artifactId>picketlink-idm-cache</artifactId>
+ <version>${org.picketlink.idm}</version>
</dependency>
<!--To use instead of outdated version from xdoclet-->
Modified: portal/branches/wsrp-integration/component/identity/src/main/java/conf/portal/hibernate-jbidm.cfg.xml
===================================================================
--- portal/branches/wsrp-integration/component/identity/src/main/java/conf/portal/hibernate-jbidm.cfg.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/conf/portal/hibernate-jbidm.cfg.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -41,19 +41,5 @@
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password"></property>
- <!-- Mapping classes -->
- <!-- all nessesary mappings are added programatically to the configuration -->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateRealm"/>-->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject"/>-->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential"/>-->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType"/>-->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute"/>-->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute"/>-->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute"/>-->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType"/>-->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship"/>-->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType"/>-->
- <!--<mapping class="org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName"/>-->
-
</session-factory>
</hibernate-configuration>
\ No newline at end of file
Modified: portal/branches/wsrp-integration/component/identity/src/main/java/conf/portal/idm-config.xml
===================================================================
--- portal/branches/wsrp-integration/component/identity/src/main/java/conf/portal/idm-config.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/conf/portal/idm-config.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -20,9 +20,9 @@
-->
-<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_beta"
+<jboss-identity xmlns="urn:picketlink:idm:config:v1_0_0_cr1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha identity-config.xsd">
+ xsi:schemaLocation="urn:picketlink:idm:config:v1_0_0_cr1 identity-config.xsd">
<realms>
<realm>
<id>PortalRealm</id>
@@ -35,7 +35,7 @@
<repositories>
<repository>
<id>PortalRepository</id>
- <class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
+ <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>
@@ -46,7 +46,7 @@
<identity-stores>
<identity-store>
<id>HibernateStore</id>
- <class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+ <class>org.picketlink.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
<external-config/>
<supported-relationship-types>
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
Modified: portal/branches/wsrp-integration/component/identity/src/main/java/conf/portal/jboss-idm-configuration.xml
===================================================================
--- portal/branches/wsrp-integration/component/identity/src/main/java/conf/portal/jboss-idm-configuration.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/conf/portal/jboss-idm-configuration.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -25,8 +25,8 @@
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
<component>
- <key>org.exoplatform.services.organization.jbidm.JBossIDMService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</type>
+ <key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
<init-params>
<value-param>
<name>config</name>
@@ -41,7 +41,7 @@
<component>
<key>org.exoplatform.services.organization.OrganizationService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</type>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
</component>
<external-component-plugins>
@@ -52,19 +52,18 @@
<type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
<init-params>
<values-param>
- <name>hibernate.annotations</name>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
+ <name>hibernate.mapping</name>
+ <value>mappings/HibernateRealm.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObject.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredential.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
</values-param>
</init-params>
</component-plugin>
Copied: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm (from rev 804, portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm)
Property changes on: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm
___________________________________________________________________
Name: svn:ignore
+ *.iml
.idea
Deleted: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -1,459 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.services.organization.idm;
-
-import org.exoplatform.services.organization.Group;
-import org.exoplatform.services.organization.GroupEventListener;
-import org.exoplatform.services.organization.GroupHandler;
-import org.exoplatform.services.organization.impl.GroupImpl;
-import org.picketlink.idm.api.Attribute;
-import org.picketlink.idm.api.IdentitySession;
-import org.picketlink.idm.impl.api.SimpleAttribute;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-public class GroupDAOImpl implements GroupHandler
-{
-
- public static final String GROUP_LABEL = "label";
-
- public static final String GROUP_DESCRIPTION = "description";
-
- private PicketLinkIDMService service_;
-
- private List<GroupEventListener> listeners_;
-
- private PicketLinkIDMOrganizationServiceImpl orgService;
-
- public GroupDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service)
- {
- service_ = service;
- this.orgService = orgService;
- listeners_ = new ArrayList<GroupEventListener>();
- }
-
- public void addGroupEventListener(GroupEventListener listener)
- {
- listeners_.add(listener);
- }
-
- final public Group createGroupInstance()
- {
- return new GroupImpl();
- }
-
- public void createGroup(Group group, boolean broadcast) throws Exception
- {
- addChild(null, group, broadcast);
- }
-
- public void addChild(Group parent, Group child, boolean broadcast) throws Exception
- {
- org.picketlink.idm.api.Group parentGroup = null;
-
- if (parent != null)
- {
- parentGroup =
- getIdentitySession().getPersistenceManager().findGroup(parent.getGroupName(), orgService.getGtnGroupType());
- ((GroupImpl)child).setId(parent.getId() + "/" + child.getGroupName());
-
- }
- else
- {
- ((GroupImpl)child).setId("/" + child.getGroupName());
- }
-
- if (broadcast)
- {
- preSave(child, true);
- }
-
- org.picketlink.idm.api.Group childGroup = persistGroup(child);
-
- if (parentGroup != null)
- {
- getIdentitySession().getRelationshipManager().associateGroups(parentGroup, childGroup);
- ((GroupImpl)child).setParentId(parent.getId());
-
- }
- else
- {
- getIdentitySession().getRelationshipManager().associateGroups(getRootGroup(), childGroup);
- }
-
- if (broadcast)
- {
- postSave(child, true);
- }
-
- }
-
- public void saveGroup(Group group, boolean broadcast) throws Exception
- {
- if (broadcast)
- {
- preSave(group, false);
- }
- persistGroup(group);
- if (broadcast)
- {
- postSave(group, false);
- }
- }
-
- public Group removeGroup(Group group, boolean broadcast) throws Exception
- {
- if (broadcast)
- {
- preDelete(group);
- }
-
- org.picketlink.idm.api.Group jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(group.getGroupName(), orgService.getGtnGroupType());
-
- if (jbidGroup == null)
- {
- return group;
- }
-
- // MembershipDAOImpl.removeMembershipEntriesOfGroup(group, getIdentitySession());
-
- Collection<org.picketlink.idm.api.Group> oneLevelChilds =
- getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
- true, false);
-
- Collection<org.picketlink.idm.api.Group> allChilds =
- getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
- true, true);
-
- getIdentitySession().getRelationshipManager().disassociateGroups(jbidGroup, oneLevelChilds);
-
- for (org.picketlink.idm.api.Group child : allChilds)
- {
- //TODO: impl force in IDM
- getIdentitySession().getPersistenceManager().removeGroup(child, true);
- }
-
- getIdentitySession().getPersistenceManager().removeGroup(jbidGroup, true);
-
- if (broadcast)
- {
- postDelete(group);
- }
- return group;
- }
-
- public Collection findGroupByMembership(String userName, String membershipType) throws Exception
- {
- Collection<org.picketlink.idm.api.Role> allRoles =
- getIdentitySession().getRoleManager().findRoles(userName, membershipType);
-
- Set<Group> exoGroups = new HashSet<Group>();
-
- for (org.picketlink.idm.api.Role role : allRoles)
- {
- exoGroups.add(convertGroup(role.getGroup()));
-
- }
-
- return exoGroups;
- }
-
- //
- public Group findGroupById(String groupId) throws Exception
- {
-
- org.picketlink.idm.api.Group jbidGroup = orgService.getJBIDMGroup(groupId);
-
- if (jbidGroup == null)
- {
- return null;
- }
-
- return convertGroup(jbidGroup);
- }
-
- public Collection findGroups(Group parent) throws Exception
- {
- org.picketlink.idm.api.Group jbidGroup = null;
-
- if (parent == null)
- {
- jbidGroup = getRootGroup();
- }
- else
- {
- jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(parent.getGroupName(), orgService.getGtnGroupType());
- }
-
- if (jbidGroup == null)
- {
- return Collections.emptyList();
- }
-
- Collection<org.picketlink.idm.api.Group> allGroups =
- getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
- true, false);
-
- List<Group> exoGroups = new LinkedList<Group>();
-
- for (org.picketlink.idm.api.Group group : allGroups)
- {
- exoGroups.add(convertGroup(group));
-
- }
-
- return exoGroups;
-
- }
-
- public Collection findGroupsOfUser(String user) throws Exception
- {
-
- if (user == null)
- {
- // julien : integration bug
- // need to look at that later
- //
- // Caused by: java.lang.IllegalArgumentException: User name cannot be null
- // at org.picketlink.idm.impl.api.session.managers.AbstractManager.checkNotNullArgument(AbstractManager.java:267)
- // at org.picketlink.idm.impl.api.session.managers.RelationshipManagerImpl.findRelatedGroups(RelationshipManagerImpl.java:753)
- // at org.exoplatform.services.organization.idm.GroupDAOImpl.findGroupsOfUser(GroupDAOImpl.java:225)
- // at org.exoplatform.organization.webui.component.GroupManagement.isMemberOfGroup(GroupManagement.java:72)
- // at org.exoplatform.organization.webui.component.GroupManagement.isAdministrator(GroupManagement.java:125)
- // at org.exoplatform.organization.webui.component.UIGroupExplorer.<init>(UIGroupExplorer.java:57)
- return Collections.emptyList();
- }
-
- Collection<org.picketlink.idm.api.Group> allGroups =
- getIdentitySession().getRelationshipManager().findRelatedGroups(user, orgService.getGtnGroupType(), null);
-
- List<Group> exoGroups = new LinkedList<Group>();
-
- for (org.picketlink.idm.api.Group group : allGroups)
- {
- exoGroups.add(convertGroup(group));
-
- }
-
- return exoGroups;
- }
-
- public Collection getAllGroups() throws Exception
- {
- Collection<org.picketlink.idm.api.Group> allGroups =
- getIdentitySession().getPersistenceManager().findGroup(orgService.getGtnGroupType());
-
- List<Group> exoGroups = new LinkedList<Group>();
-
- for (org.picketlink.idm.api.Group group : allGroups)
- {
- if (!orgService.getGtnGroupType().equals(orgService.getGtnRootGroupType())
- || !group.getName().equals(orgService.getExoRootGroupName()))
- {
- exoGroups.add(convertGroup(group));
- }
-
- }
-
- return exoGroups;
- }
-
- private void preSave(Group group, boolean isNew) throws Exception
- {
- for (GroupEventListener listener : listeners_)
- {
- listener.preSave(group, isNew);
- }
- }
-
- private void postSave(Group group, boolean isNew) throws Exception
- {
- for (GroupEventListener listener : listeners_)
- {
- listener.postSave(group, isNew);
- }
- }
-
- private void preDelete(Group group) throws Exception
- {
- for (GroupEventListener listener : listeners_)
- {
- listener.preDelete(group);
- }
- }
-
- private void postDelete(Group group) throws Exception
- {
- for (GroupEventListener listener : listeners_)
- {
- listener.postDelete(group);
- }
- }
-
- public Group getGroup(String groupName) throws Exception
- {
- org.picketlink.idm.api.Group jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(groupName, orgService.getGtnGroupType());
-
- if (jbidGroup == null)
- {
- return null;
- }
-
- return convertGroup(jbidGroup);
-
- }
-
- private Group convertGroup(org.picketlink.idm.api.Group jbidGroup) throws Exception
- {
- Map<String, Attribute> attrs = getIdentitySession().getAttributesManager().getAttributes(jbidGroup);
-
- GroupImpl exoGroup = new GroupImpl(jbidGroup.getName());
-
- if (attrs.containsKey(GROUP_DESCRIPTION) && attrs.get(GROUP_DESCRIPTION).getValue() != null)
- {
- exoGroup.setDescription(attrs.get(GROUP_DESCRIPTION).getValue().toString());
- }
- if (attrs.containsKey(GROUP_LABEL) && attrs.get(GROUP_LABEL).getValue() != null)
- {
- exoGroup.setLabel(attrs.get(GROUP_LABEL).getValue().toString());
- }
-
- // Resolve full ID
- String id = getGroupId(jbidGroup.getName());
-
- exoGroup.setId(id);
-
- if (id.length() == jbidGroup.getName().length() + 1)
- {
- exoGroup.setParentId(null);
- }
- else
- {
- exoGroup.setParentId(id.substring(0, id.length() - jbidGroup.getName().length() - 1));
- }
-
- return exoGroup;
- }
-
- private String getGroupId(String groupName) throws Exception
- {
- if (groupName.equals(orgService.getExoRootGroupName()))
- {
- return "";
- }
-
- org.picketlink.idm.api.Group jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(groupName, orgService.getGtnGroupType());
-
- Collection<org.picketlink.idm.api.Group> parents =
- getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
- false, false);
-
- if (parents.size() > 1)
- {
- throw new IllegalStateException("Group has more than one parent: " + groupName);
- }
-
- if (parents.size() == 0)
- {
- //As there is special root group this shouldn't happen:
- throw new IllegalStateException("Group present that is not connected to the root: " + groupName);
-
- // This group is at the root
- //return "/" + groupName;
- }
-
- String parentGroupId = getGroupId(((org.picketlink.idm.api.Group)parents.iterator().next()).getName());
-
- return parentGroupId + "/" + groupName;
-
- }
-
- private org.picketlink.idm.api.Group persistGroup(Group exoGroup) throws Exception
- {
-
- org.picketlink.idm.api.Group jbidGroup =
- getIdentitySession().getPersistenceManager().findGroup(exoGroup.getGroupName(), orgService.getGtnGroupType());
-
- if (jbidGroup == null)
- {
- jbidGroup =
- getIdentitySession().getPersistenceManager().createGroup(exoGroup.getGroupName(),
- orgService.getGtnGroupType());
- }
-
- String description = exoGroup.getDescription();
- String label = exoGroup.getLabel();
-
- List<Attribute> attrsList = new ArrayList<Attribute>();
- if (description != null)
- {
- attrsList.add(new SimpleAttribute(GROUP_DESCRIPTION, description));
- }
-
- if (label != null)
- {
- attrsList.add(new SimpleAttribute(GROUP_LABEL, label));
- }
-
- if (attrsList.size() > 0)
- {
- Attribute[] attrs = new Attribute[attrsList.size()];
-
- attrs = attrsList.toArray(attrs);
-
- getIdentitySession().getAttributesManager().addAttributes(jbidGroup, attrs);
-
- }
-
- return jbidGroup;
- }
-
- private IdentitySession getIdentitySession() throws Exception
- {
- return service_.getIdentitySession();
- }
-
- private org.picketlink.idm.api.Group getRootGroup() throws Exception
- {
- org.picketlink.idm.api.Group rootGroup =
- getIdentitySession().getPersistenceManager().findGroup(orgService.getExoRootGroupName(),
- orgService.getGtnRootGroupType());
-
- if (rootGroup == null)
- {
- rootGroup =
- getIdentitySession().getPersistenceManager().createGroup(orgService.getExoRootGroupName(),
- orgService.getGtnRootGroupType());
- }
-
- return rootGroup;
- }
-}
Copied: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java (from rev 804, portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java)
===================================================================
--- portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java (rev 0)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -0,0 +1,459 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.services.organization.idm;
+
+import org.exoplatform.services.organization.Group;
+import org.exoplatform.services.organization.GroupEventListener;
+import org.exoplatform.services.organization.GroupHandler;
+import org.exoplatform.services.organization.impl.GroupImpl;
+import org.picketlink.idm.api.Attribute;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.impl.api.SimpleAttribute;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+public class GroupDAOImpl implements GroupHandler
+{
+
+ public static final String GROUP_LABEL = "label";
+
+ public static final String GROUP_DESCRIPTION = "description";
+
+ private PicketLinkIDMService service_;
+
+ private List<GroupEventListener> listeners_;
+
+ private PicketLinkIDMOrganizationServiceImpl orgService;
+
+ public GroupDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service)
+ {
+ service_ = service;
+ this.orgService = orgService;
+ listeners_ = new ArrayList<GroupEventListener>();
+ }
+
+ public void addGroupEventListener(GroupEventListener listener)
+ {
+ listeners_.add(listener);
+ }
+
+ final public Group createGroupInstance()
+ {
+ return new GroupImpl();
+ }
+
+ public void createGroup(Group group, boolean broadcast) throws Exception
+ {
+ addChild(null, group, broadcast);
+ }
+
+ public void addChild(Group parent, Group child, boolean broadcast) throws Exception
+ {
+ org.picketlink.idm.api.Group parentGroup = null;
+
+ if (parent != null)
+ {
+ parentGroup =
+ getIdentitySession().getPersistenceManager().findGroup(parent.getGroupName(), orgService.getGtnGroupType());
+ ((GroupImpl)child).setId(parent.getId() + "/" + child.getGroupName());
+
+ }
+ else
+ {
+ ((GroupImpl)child).setId("/" + child.getGroupName());
+ }
+
+ if (broadcast)
+ {
+ preSave(child, true);
+ }
+
+ org.picketlink.idm.api.Group childGroup = persistGroup(child);
+
+ if (parentGroup != null)
+ {
+ getIdentitySession().getRelationshipManager().associateGroups(parentGroup, childGroup);
+ ((GroupImpl)child).setParentId(parent.getId());
+
+ }
+ else
+ {
+ getIdentitySession().getRelationshipManager().associateGroups(getRootGroup(), childGroup);
+ }
+
+ if (broadcast)
+ {
+ postSave(child, true);
+ }
+
+ }
+
+ public void saveGroup(Group group, boolean broadcast) throws Exception
+ {
+ if (broadcast)
+ {
+ preSave(group, false);
+ }
+ persistGroup(group);
+ if (broadcast)
+ {
+ postSave(group, false);
+ }
+ }
+
+ public Group removeGroup(Group group, boolean broadcast) throws Exception
+ {
+ if (broadcast)
+ {
+ preDelete(group);
+ }
+
+ org.picketlink.idm.api.Group jbidGroup =
+ getIdentitySession().getPersistenceManager().findGroup(group.getGroupName(), orgService.getGtnGroupType());
+
+ if (jbidGroup == null)
+ {
+ return group;
+ }
+
+ // MembershipDAOImpl.removeMembershipEntriesOfGroup(group, getIdentitySession());
+
+ Collection<org.picketlink.idm.api.Group> oneLevelChilds =
+ getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
+ true, false);
+
+ Collection<org.picketlink.idm.api.Group> allChilds =
+ getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
+ true, true);
+
+ getIdentitySession().getRelationshipManager().disassociateGroups(jbidGroup, oneLevelChilds);
+
+ for (org.picketlink.idm.api.Group child : allChilds)
+ {
+ //TODO: impl force in IDM
+ getIdentitySession().getPersistenceManager().removeGroup(child, true);
+ }
+
+ getIdentitySession().getPersistenceManager().removeGroup(jbidGroup, true);
+
+ if (broadcast)
+ {
+ postDelete(group);
+ }
+ return group;
+ }
+
+ public Collection findGroupByMembership(String userName, String membershipType) throws Exception
+ {
+ Collection<org.picketlink.idm.api.Role> allRoles =
+ getIdentitySession().getRoleManager().findRoles(userName, membershipType);
+
+ Set<Group> exoGroups = new HashSet<Group>();
+
+ for (org.picketlink.idm.api.Role role : allRoles)
+ {
+ exoGroups.add(convertGroup(role.getGroup()));
+
+ }
+
+ return exoGroups;
+ }
+
+ //
+ public Group findGroupById(String groupId) throws Exception
+ {
+
+ org.picketlink.idm.api.Group jbidGroup = orgService.getJBIDMGroup(groupId);
+
+ if (jbidGroup == null)
+ {
+ return null;
+ }
+
+ return convertGroup(jbidGroup);
+ }
+
+ public Collection findGroups(Group parent) throws Exception
+ {
+ org.picketlink.idm.api.Group jbidGroup = null;
+
+ if (parent == null)
+ {
+ jbidGroup = getRootGroup();
+ }
+ else
+ {
+ jbidGroup =
+ getIdentitySession().getPersistenceManager().findGroup(parent.getGroupName(), orgService.getGtnGroupType());
+ }
+
+ if (jbidGroup == null)
+ {
+ return Collections.emptyList();
+ }
+
+ Collection<org.picketlink.idm.api.Group> allGroups =
+ getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
+ true, false);
+
+ List<Group> exoGroups = new LinkedList<Group>();
+
+ for (org.picketlink.idm.api.Group group : allGroups)
+ {
+ exoGroups.add(convertGroup(group));
+
+ }
+
+ return exoGroups;
+
+ }
+
+ public Collection findGroupsOfUser(String user) throws Exception
+ {
+
+ if (user == null)
+ {
+ // julien : integration bug
+ // need to look at that later
+ //
+ // Caused by: java.lang.IllegalArgumentException: User name cannot be null
+ // at org.picketlink.idm.impl.api.session.managers.AbstractManager.checkNotNullArgument(AbstractManager.java:267)
+ // at org.picketlink.idm.impl.api.session.managers.RelationshipManagerImpl.findRelatedGroups(RelationshipManagerImpl.java:753)
+ // at org.exoplatform.services.organization.idm.GroupDAOImpl.findGroupsOfUser(GroupDAOImpl.java:225)
+ // at org.exoplatform.organization.webui.component.GroupManagement.isMemberOfGroup(GroupManagement.java:72)
+ // at org.exoplatform.organization.webui.component.GroupManagement.isAdministrator(GroupManagement.java:125)
+ // at org.exoplatform.organization.webui.component.UIGroupExplorer.<init>(UIGroupExplorer.java:57)
+ return Collections.emptyList();
+ }
+
+ Collection<org.picketlink.idm.api.Group> allGroups =
+ getIdentitySession().getRelationshipManager().findRelatedGroups(user, orgService.getGtnGroupType(), null);
+
+ List<Group> exoGroups = new LinkedList<Group>();
+
+ for (org.picketlink.idm.api.Group group : allGroups)
+ {
+ exoGroups.add(convertGroup(group));
+
+ }
+
+ return exoGroups;
+ }
+
+ public Collection getAllGroups() throws Exception
+ {
+ Collection<org.picketlink.idm.api.Group> allGroups =
+ getIdentitySession().getPersistenceManager().findGroup(orgService.getGtnGroupType());
+
+ List<Group> exoGroups = new LinkedList<Group>();
+
+ for (org.picketlink.idm.api.Group group : allGroups)
+ {
+ if (!orgService.getGtnGroupType().equals(orgService.getGtnRootGroupType())
+ || !group.getName().equals(orgService.getExoRootGroupName()))
+ {
+ exoGroups.add(convertGroup(group));
+ }
+
+ }
+
+ return exoGroups;
+ }
+
+ private void preSave(Group group, boolean isNew) throws Exception
+ {
+ for (GroupEventListener listener : listeners_)
+ {
+ listener.preSave(group, isNew);
+ }
+ }
+
+ private void postSave(Group group, boolean isNew) throws Exception
+ {
+ for (GroupEventListener listener : listeners_)
+ {
+ listener.postSave(group, isNew);
+ }
+ }
+
+ private void preDelete(Group group) throws Exception
+ {
+ for (GroupEventListener listener : listeners_)
+ {
+ listener.preDelete(group);
+ }
+ }
+
+ private void postDelete(Group group) throws Exception
+ {
+ for (GroupEventListener listener : listeners_)
+ {
+ listener.postDelete(group);
+ }
+ }
+
+ public Group getGroup(String groupName) throws Exception
+ {
+ org.picketlink.idm.api.Group jbidGroup =
+ getIdentitySession().getPersistenceManager().findGroup(groupName, orgService.getGtnGroupType());
+
+ if (jbidGroup == null)
+ {
+ return null;
+ }
+
+ return convertGroup(jbidGroup);
+
+ }
+
+ private Group convertGroup(org.picketlink.idm.api.Group jbidGroup) throws Exception
+ {
+ Map<String, Attribute> attrs = getIdentitySession().getAttributesManager().getAttributes(jbidGroup);
+
+ GroupImpl exoGroup = new GroupImpl(jbidGroup.getName());
+
+ if (attrs.containsKey(GROUP_DESCRIPTION) && attrs.get(GROUP_DESCRIPTION).getValue() != null)
+ {
+ exoGroup.setDescription(attrs.get(GROUP_DESCRIPTION).getValue().toString());
+ }
+ if (attrs.containsKey(GROUP_LABEL) && attrs.get(GROUP_LABEL).getValue() != null)
+ {
+ exoGroup.setLabel(attrs.get(GROUP_LABEL).getValue().toString());
+ }
+
+ // Resolve full ID
+ String id = getGroupId(jbidGroup.getName());
+
+ exoGroup.setId(id);
+
+ if (id.length() == jbidGroup.getName().length() + 1)
+ {
+ exoGroup.setParentId(null);
+ }
+ else
+ {
+ exoGroup.setParentId(id.substring(0, id.length() - jbidGroup.getName().length() - 1));
+ }
+
+ return exoGroup;
+ }
+
+ private String getGroupId(String groupName) throws Exception
+ {
+ if (groupName.equals(orgService.getExoRootGroupName()))
+ {
+ return "";
+ }
+
+ org.picketlink.idm.api.Group jbidGroup =
+ getIdentitySession().getPersistenceManager().findGroup(groupName, orgService.getGtnGroupType());
+
+ Collection<org.picketlink.idm.api.Group> parents =
+ getIdentitySession().getRelationshipManager().findAssociatedGroups(jbidGroup, orgService.getGtnGroupType(),
+ false, false);
+
+ if (parents.size() > 1)
+ {
+ throw new IllegalStateException("Group has more than one parent: " + groupName);
+ }
+
+ if (parents.size() == 0)
+ {
+ //As there is special root group this shouldn't happen:
+ throw new IllegalStateException("Group present that is not connected to the root: " + groupName);
+
+ // This group is at the root
+ //return "/" + groupName;
+ }
+
+ String parentGroupId = getGroupId(((org.picketlink.idm.api.Group)parents.iterator().next()).getName());
+
+ return parentGroupId + "/" + groupName;
+
+ }
+
+ private org.picketlink.idm.api.Group persistGroup(Group exoGroup) throws Exception
+ {
+
+ org.picketlink.idm.api.Group jbidGroup =
+ getIdentitySession().getPersistenceManager().findGroup(exoGroup.getGroupName(), orgService.getGtnGroupType());
+
+ if (jbidGroup == null)
+ {
+ jbidGroup =
+ getIdentitySession().getPersistenceManager().createGroup(exoGroup.getGroupName(),
+ orgService.getGtnGroupType());
+ }
+
+ String description = exoGroup.getDescription();
+ String label = exoGroup.getLabel();
+
+ List<Attribute> attrsList = new ArrayList<Attribute>();
+ if (description != null)
+ {
+ attrsList.add(new SimpleAttribute(GROUP_DESCRIPTION, description));
+ }
+
+ if (label != null)
+ {
+ attrsList.add(new SimpleAttribute(GROUP_LABEL, label));
+ }
+
+ if (attrsList.size() > 0)
+ {
+ Attribute[] attrs = new Attribute[attrsList.size()];
+
+ attrs = attrsList.toArray(attrs);
+
+ getIdentitySession().getAttributesManager().addAttributes(jbidGroup, attrs);
+
+ }
+
+ return jbidGroup;
+ }
+
+ private IdentitySession getIdentitySession() throws Exception
+ {
+ return service_.getIdentitySession();
+ }
+
+ private org.picketlink.idm.api.Group getRootGroup() throws Exception
+ {
+ org.picketlink.idm.api.Group rootGroup =
+ getIdentitySession().getPersistenceManager().findGroup(orgService.getExoRootGroupName(),
+ orgService.getGtnRootGroupType());
+
+ if (rootGroup == null)
+ {
+ rootGroup =
+ getIdentitySession().getPersistenceManager().createGroup(orgService.getExoRootGroupName(),
+ orgService.getGtnRootGroupType());
+ }
+
+ return rootGroup;
+ }
+}
Deleted: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -1,83 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.services.organization.idm;
-
-import org.exoplatform.commons.utils.ListAccess;
-import org.exoplatform.services.organization.User;
-import org.picketlink.idm.api.query.UserQuery;
-import org.picketlink.idm.api.query.UserQueryBuilder;
-
-import java.util.List;
-
-public class IDMUserListAccess implements ListAccess<User>
-{
- private final UserDAOImpl userDAO;
-
- private final PicketLinkIDMService idmService;
-
- private final UserQueryBuilder userQueryBuilder;
-
- private final int pageSize;
-
- private final boolean countAll;
-
- public IDMUserListAccess(UserDAOImpl userDAO, PicketLinkIDMService idmService, UserQueryBuilder userQueryBuilder,
- int pageSize, boolean countAll)
- {
- this.userDAO = userDAO;
- this.idmService = idmService;
- this.userQueryBuilder = userQueryBuilder;
- this.pageSize = pageSize;
- this.countAll = countAll;
- }
-
- public User[] load(int index, int length) throws Exception, IllegalArgumentException
- {
- userQueryBuilder.page(index, length);
- UserQuery query = userQueryBuilder.createQuery();
- List<org.picketlink.idm.api.User> users = idmService.getIdentitySession().list(query);
-
- User[] exoUsers = new User[users.size()];
-
- for (int i = 0; i < users.size(); i++)
- {
- org.picketlink.idm.api.User user = users.get(i);
-
- exoUsers[i] = UserDAOImpl.getPopulatedUser(user.getId(), idmService.getIdentitySession());
- }
-
- return exoUsers;
- }
-
- public int getSize() throws Exception
- {
- if (countAll)
- {
- return idmService.getIdentitySession().getPersistenceManager().getUserCount();
- }
- else
- {
- userQueryBuilder.page(0, 0);
- UserQuery query = userQueryBuilder.createQuery();
- return idmService.getIdentitySession().execute(query).size();
- }
-
- }
-}
Copied: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java (from rev 804, portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java)
===================================================================
--- portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java (rev 0)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/IDMUserListAccess.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -0,0 +1,83 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.services.organization.idm;
+
+import org.exoplatform.commons.utils.ListAccess;
+import org.exoplatform.services.organization.User;
+import org.picketlink.idm.api.query.UserQuery;
+import org.picketlink.idm.api.query.UserQueryBuilder;
+
+import java.util.List;
+
+public class IDMUserListAccess implements ListAccess<User>
+{
+ private final UserDAOImpl userDAO;
+
+ private final PicketLinkIDMService idmService;
+
+ private final UserQueryBuilder userQueryBuilder;
+
+ private final int pageSize;
+
+ private final boolean countAll;
+
+ public IDMUserListAccess(UserDAOImpl userDAO, PicketLinkIDMService idmService, UserQueryBuilder userQueryBuilder,
+ int pageSize, boolean countAll)
+ {
+ this.userDAO = userDAO;
+ this.idmService = idmService;
+ this.userQueryBuilder = userQueryBuilder;
+ this.pageSize = pageSize;
+ this.countAll = countAll;
+ }
+
+ public User[] load(int index, int length) throws Exception, IllegalArgumentException
+ {
+ userQueryBuilder.page(index, length);
+ UserQuery query = userQueryBuilder.createQuery();
+ List<org.picketlink.idm.api.User> users = idmService.getIdentitySession().list(query);
+
+ User[] exoUsers = new User[users.size()];
+
+ for (int i = 0; i < users.size(); i++)
+ {
+ org.picketlink.idm.api.User user = users.get(i);
+
+ exoUsers[i] = UserDAOImpl.getPopulatedUser(user.getId(), idmService.getIdentitySession());
+ }
+
+ return exoUsers;
+ }
+
+ public int getSize() throws Exception
+ {
+ if (countAll)
+ {
+ return idmService.getIdentitySession().getPersistenceManager().getUserCount();
+ }
+ else
+ {
+ userQueryBuilder.page(0, 0);
+ UserQuery query = userQueryBuilder.createQuery();
+ return idmService.getIdentitySession().execute(query).size();
+ }
+
+ }
+}
Deleted: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -1,394 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.services.organization.idm;
-
-import org.exoplatform.commons.utils.ListenerStack;
-import org.exoplatform.services.organization.Group;
-import org.exoplatform.services.organization.Membership;
-import org.exoplatform.services.organization.MembershipEventListener;
-import org.exoplatform.services.organization.MembershipHandler;
-import org.exoplatform.services.organization.MembershipType;
-import org.exoplatform.services.organization.User;
-import org.picketlink.idm.api.IdentitySession;
-import org.picketlink.idm.api.Role;
-import org.picketlink.idm.api.RoleType;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.naming.InvalidNameException;
-
-/**
- */
-public class MembershipDAOImpl implements MembershipHandler
-{
-
- private PicketLinkIDMService service_;
-
- private List listeners_;
-
- private PicketLinkIDMOrganizationServiceImpl orgService;
-
- public MembershipDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service)
- {
- service_ = service;
- listeners_ = new ListenerStack(5);
- this.orgService = orgService;
- }
-
- public void addMembershipEventListener(MembershipEventListener listener)
- {
- listeners_.add(listener);
- }
-
- final public Membership createMembershipInstance()
- {
- return new MembershipImpl();
- }
-
- public void createMembership(Membership m, boolean broadcast) throws Exception
- {
-
- if (broadcast)
- {
- preSave(m, true);
- }
-
- saveMembership(m, false);
-
- if (broadcast)
- {
- postSave(m, true);
- }
-
- }
-
- public void linkMembership(User user, Group g, MembershipType mt, boolean broadcast) throws Exception
- {
- if (g == null)
- {
- throw new InvalidNameException("Can not create membership record for " + user.getUserName()
- + " because group is null");
- }
-
- if (mt == null)
- {
- throw new InvalidNameException("Can not create membership record for " + user.getUserName()
- + " because membership type is null");
- }
-
- if (getIdentitySession().getRoleManager().getRoleType(mt.getName()) == null)
- {
- getIdentitySession().getRoleManager().createRoleType(mt.getName());
- }
-
- String groupId =
- getIdentitySession().getPersistenceManager().createGroupKey(g.getGroupName(), orgService.getGtnGroupType());
-
- if (getIdentitySession().getRoleManager().hasRole(user.getUserName(), groupId, mt.getName()))
- {
- return;
- }
-
- MembershipImpl membership = new MembershipImpl();
- membership.setMembershipType(mt.getName());
- membership.setUserName(user.getUserName());
- membership.setGroupId(g.getId());
-
- if (broadcast)
- {
- preSave(membership, true);
- }
-
- getIdentitySession().getRoleManager().createRole(mt.getName(), user.getUserName(), groupId);
-
- if (broadcast)
- {
- postSave(membership, true);
- }
-
- }
-
- public void saveMembership(Membership m, boolean broadcast) throws Exception
- {
- String groupId =
- getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
- orgService.getGtnGroupType());
-
- if (getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId, m.getMembershipType()))
- {
- return;
- }
-
- if (broadcast)
- {
- preSave(m, false);
- }
-
- getIdentitySession().getRoleManager().createRole(m.getMembershipType(), m.getUserName(), groupId);
-
- if (broadcast)
- {
- postSave(m, false);
- }
- }
-
- public Membership removeMembership(String id, boolean broadcast) throws Exception
- {
-
- Membership m = new MembershipImpl(id);
-
- String groupId =
- getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
- orgService.getGtnGroupType());
-
- if (!getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId, m.getMembershipType()))
- {
- return m;
- }
-
- if (broadcast)
- {
- preDelete(m);
- }
-
- getIdentitySession().getRoleManager().removeRole(m.getMembershipType(), m.getUserName(), groupId);
-
- if (broadcast)
- {
- postDelete(m);
- }
- return m;
- }
-
- public Collection removeMembershipByUser(String userName, boolean broadcast) throws Exception
- {
-
- Collection<Role> roles = getIdentitySession().getRoleManager().findRoles(userName, null);
-
- //TODO: Exo UI has hardcoded casts to List
- List<Membership> memberships = new LinkedList<Membership>();
-
- for (Role role : roles)
- {
- MembershipImpl m = new MembershipImpl();
- Group g = ((GroupDAOImpl)orgService.getGroupHandler()).getGroup(role.getGroup().getName());
- m.setGroupId(g.getId());
- m.setUserName(role.getUser().getId());
- m.setMembershipType(role.getRoleType().getName());
- memberships.add(m);
-
- if (broadcast)
- {
- preDelete(m);
- }
-
- getIdentitySession().getRoleManager().removeRole(role);
-
- if (broadcast)
- {
- postDelete(m);
- }
-
- }
-
- return memberships;
-
- }
-
- public Membership findMembershipByUserGroupAndType(String userName, String groupId, String type) throws Exception
- {
- String gid =
- getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
- orgService.getGtnGroupType());
-
- Role role = getIdentitySession().getRoleManager().getRole(type, userName, gid);
-
- if (role == null)
- {
- return null;
- }
-
- MembershipImpl m = new MembershipImpl();
- m.setGroupId(groupId);
- m.setUserName(userName);
- m.setMembershipType(type);
-
- return m;
- }
-
- public Collection findMembershipsByUserAndGroup(String userName, String groupId) throws Exception
- {
- if (userName == null)
- {
- // julien fix : if user name is null, need to check if we do need to return a special group
- return Collections.emptyList();
- }
-
- String gid =
- getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
- orgService.getGtnGroupType());
-
- Collection<RoleType> roleTypes = getIdentitySession().getRoleManager().findRoleTypes(userName, gid, null);
-
- //TODO: Exo UI has hardcoded casts to List
- List<Membership> memberships = new LinkedList<Membership>();
-
- for (RoleType roleType : roleTypes)
- {
- MembershipImpl m = new MembershipImpl();
- m.setGroupId(groupId);
- m.setUserName(userName);
- m.setMembershipType(roleType.getName());
- memberships.add(m);
- }
-
- return memberships;
- }
-
- public Collection findMembershipsByUser(String userName) throws Exception
- {
- Collection<Role> roles = getIdentitySession().getRoleManager().findRoles(userName, null);
-
- //TODO: Exo UI has hardcoded casts to List
- List<Membership> memberships = new LinkedList<Membership>();
-
- for (Role role : roles)
- {
- MembershipImpl m = new MembershipImpl();
- Group g = ((GroupDAOImpl)orgService.getGroupHandler()).getGroup(role.getGroup().getName());
- m.setGroupId(g.getId());
- m.setUserName(role.getUser().getId());
- m.setMembershipType(role.getRoleType().getName());
- memberships.add(m);
- }
-
- return memberships;
- }
-
- static void removeMembershipEntriesOfGroup(PicketLinkIDMOrganizationServiceImpl orgService, Group group,
- IdentitySession session) throws Exception
- {
- String gid = session.getPersistenceManager().createGroupKey(group.getGroupName(), orgService.getGtnGroupType());
-
- Collection<Role> roles = session.getRoleManager().findRoles(gid, null);
-
- for (Role role : roles)
- {
- session.getRoleManager().removeRole(role);
- }
- }
-
- public Collection findMembershipsByGroup(Group group) throws Exception
- {
- return findMembershipsByGroupId(group.getId());
- }
-
- public Collection findMembershipsByGroupId(String groupId) throws Exception
- {
- String gid =
- getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
- orgService.getGtnGroupType());
-
- Collection<Role> roles = getIdentitySession().getRoleManager().findRoles(gid, null);
-
- //TODO: Exo UI has hardcoded casts to List
- List<Membership> memberships = new LinkedList<Membership>();
-
- for (Role role : roles)
- {
- MembershipImpl m = new MembershipImpl();
- Group g = ((GroupDAOImpl)orgService.getGroupHandler()).getGroup(role.getGroup().getName());
- m.setGroupId(g.getId());
- m.setUserName(role.getUser().getId());
- m.setMembershipType(role.getRoleType().getName());
- memberships.add(m);
- }
-
- return memberships;
-
- }
-
- public Membership findMembership(String id) throws Exception
- {
- Membership m = new MembershipImpl(id);
-
- String groupId =
- getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
- orgService.getGtnGroupType());
-
- if (getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId, m.getMembershipType()))
- {
- return m;
- }
-
- return null;
- }
-
- private void preSave(Membership membership, boolean isNew) throws Exception
- {
- for (int i = 0; i < listeners_.size(); i++)
- {
- MembershipEventListener listener = (MembershipEventListener)listeners_.get(i);
- listener.preSave(membership, isNew);
- }
- }
-
- private void postSave(Membership membership, boolean isNew) throws Exception
- {
- for (int i = 0; i < listeners_.size(); i++)
- {
- MembershipEventListener listener = (MembershipEventListener)listeners_.get(i);
- listener.postSave(membership, isNew);
- }
- }
-
- private void preDelete(Membership membership) throws Exception
- {
- for (int i = 0; i < listeners_.size(); i++)
- {
- MembershipEventListener listener = (MembershipEventListener)listeners_.get(i);
- listener.preDelete(membership);
- }
- }
-
- private void postDelete(Membership membership) throws Exception
- {
- for (int i = 0; i < listeners_.size(); i++)
- {
- MembershipEventListener listener = (MembershipEventListener)listeners_.get(i);
- listener.postDelete(membership);
- }
- }
-
- private IdentitySession getIdentitySession() throws Exception
- {
- return service_.getIdentitySession();
- }
-
- private String getGroupNameFromId(String groupId)
- {
- String[] ids = groupId.split("/");
-
- return ids[ids.length - 1];
- }
-}
Copied: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java (from rev 804, portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java)
===================================================================
--- portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java (rev 0)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipDAOImpl.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -0,0 +1,393 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.services.organization.idm;
+
+import org.exoplatform.commons.utils.ListenerStack;
+import org.exoplatform.services.organization.Group;
+import org.exoplatform.services.organization.Membership;
+import org.exoplatform.services.organization.MembershipEventListener;
+import org.exoplatform.services.organization.MembershipHandler;
+import org.exoplatform.services.organization.MembershipType;
+import org.exoplatform.services.organization.User;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.api.Role;
+import org.picketlink.idm.api.RoleType;
+
+import javax.naming.InvalidNameException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ */
+public class MembershipDAOImpl implements MembershipHandler
+{
+
+ private PicketLinkIDMService service_;
+
+ private List listeners_;
+
+ private PicketLinkIDMOrganizationServiceImpl orgService;
+
+ public MembershipDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service)
+ {
+ service_ = service;
+ listeners_ = new ListenerStack(5);
+ this.orgService = orgService;
+ }
+
+ public void addMembershipEventListener(MembershipEventListener listener)
+ {
+ listeners_.add(listener);
+ }
+
+ final public Membership createMembershipInstance()
+ {
+ return new MembershipImpl();
+ }
+
+ public void createMembership(Membership m, boolean broadcast) throws Exception
+ {
+
+ if (broadcast)
+ {
+ preSave(m, true);
+ }
+
+ saveMembership(m, false);
+
+ if (broadcast)
+ {
+ postSave(m, true);
+ }
+
+ }
+
+ public void linkMembership(User user, Group g, MembershipType mt, boolean broadcast) throws Exception
+ {
+ if (g == null)
+ {
+ throw new InvalidNameException("Can not create membership record for " + user.getUserName()
+ + " because group is null");
+ }
+
+ if (mt == null)
+ {
+ throw new InvalidNameException("Can not create membership record for " + user.getUserName()
+ + " because membership type is null");
+ }
+
+ if (getIdentitySession().getRoleManager().getRoleType(mt.getName()) == null)
+ {
+ getIdentitySession().getRoleManager().createRoleType(mt.getName());
+ }
+
+ String groupId =
+ getIdentitySession().getPersistenceManager().createGroupKey(g.getGroupName(), orgService.getGtnGroupType());
+
+ if (getIdentitySession().getRoleManager().hasRole(user.getUserName(), groupId, mt.getName()))
+ {
+ return;
+ }
+
+ MembershipImpl membership = new MembershipImpl();
+ membership.setMembershipType(mt.getName());
+ membership.setUserName(user.getUserName());
+ membership.setGroupId(g.getId());
+
+ if (broadcast)
+ {
+ preSave(membership, true);
+ }
+
+ getIdentitySession().getRoleManager().createRole(mt.getName(), user.getUserName(), groupId);
+
+ if (broadcast)
+ {
+ postSave(membership, true);
+ }
+
+ }
+
+ public void saveMembership(Membership m, boolean broadcast) throws Exception
+ {
+ String groupId =
+ getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
+ orgService.getGtnGroupType());
+
+ if (getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId, m.getMembershipType()))
+ {
+ return;
+ }
+
+ if (broadcast)
+ {
+ preSave(m, false);
+ }
+
+ getIdentitySession().getRoleManager().createRole(m.getMembershipType(), m.getUserName(), groupId);
+
+ if (broadcast)
+ {
+ postSave(m, false);
+ }
+ }
+
+ public Membership removeMembership(String id, boolean broadcast) throws Exception
+ {
+
+ Membership m = new MembershipImpl(id);
+
+ String groupId =
+ getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
+ orgService.getGtnGroupType());
+
+ if (!getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId, m.getMembershipType()))
+ {
+ return m;
+ }
+
+ if (broadcast)
+ {
+ preDelete(m);
+ }
+
+ getIdentitySession().getRoleManager().removeRole(m.getMembershipType(), m.getUserName(), groupId);
+
+ if (broadcast)
+ {
+ postDelete(m);
+ }
+ return m;
+ }
+
+ public Collection removeMembershipByUser(String userName, boolean broadcast) throws Exception
+ {
+
+ Collection<Role> roles = getIdentitySession().getRoleManager().findRoles(userName, null);
+
+ //TODO: Exo UI has hardcoded casts to List
+ List<Membership> memberships = new LinkedList<Membership>();
+
+ for (Role role : roles)
+ {
+ MembershipImpl m = new MembershipImpl();
+ Group g = ((GroupDAOImpl)orgService.getGroupHandler()).getGroup(role.getGroup().getName());
+ m.setGroupId(g.getId());
+ m.setUserName(role.getUser().getId());
+ m.setMembershipType(role.getRoleType().getName());
+ memberships.add(m);
+
+ if (broadcast)
+ {
+ preDelete(m);
+ }
+
+ getIdentitySession().getRoleManager().removeRole(role);
+
+ if (broadcast)
+ {
+ postDelete(m);
+ }
+
+ }
+
+ return memberships;
+
+ }
+
+ public Membership findMembershipByUserGroupAndType(String userName, String groupId, String type) throws Exception
+ {
+ String gid =
+ getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
+ orgService.getGtnGroupType());
+
+ Role role = getIdentitySession().getRoleManager().getRole(type, userName, gid);
+
+ if (role == null)
+ {
+ return null;
+ }
+
+ MembershipImpl m = new MembershipImpl();
+ m.setGroupId(groupId);
+ m.setUserName(userName);
+ m.setMembershipType(type);
+
+ return m;
+ }
+
+ public Collection findMembershipsByUserAndGroup(String userName, String groupId) throws Exception
+ {
+ if (userName == null)
+ {
+ // julien fix : if user name is null, need to check if we do need to return a special group
+ return Collections.emptyList();
+ }
+
+ String gid =
+ getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
+ orgService.getGtnGroupType());
+
+ Collection<RoleType> roleTypes = getIdentitySession().getRoleManager().findRoleTypes(userName, gid, null);
+
+ //TODO: Exo UI has hardcoded casts to List
+ List<Membership> memberships = new LinkedList<Membership>();
+
+ for (RoleType roleType : roleTypes)
+ {
+ MembershipImpl m = new MembershipImpl();
+ m.setGroupId(groupId);
+ m.setUserName(userName);
+ m.setMembershipType(roleType.getName());
+ memberships.add(m);
+ }
+
+ return memberships;
+ }
+
+ public Collection findMembershipsByUser(String userName) throws Exception
+ {
+ Collection<Role> roles = getIdentitySession().getRoleManager().findRoles(userName, null);
+
+ //TODO: Exo UI has hardcoded casts to List
+ List<Membership> memberships = new LinkedList<Membership>();
+
+ for (Role role : roles)
+ {
+ MembershipImpl m = new MembershipImpl();
+ Group g = ((GroupDAOImpl)orgService.getGroupHandler()).getGroup(role.getGroup().getName());
+ m.setGroupId(g.getId());
+ m.setUserName(role.getUser().getId());
+ m.setMembershipType(role.getRoleType().getName());
+ memberships.add(m);
+ }
+
+ return memberships;
+ }
+
+ static void removeMembershipEntriesOfGroup(PicketLinkIDMOrganizationServiceImpl orgService, Group group,
+ IdentitySession session) throws Exception
+ {
+ String gid = session.getPersistenceManager().createGroupKey(group.getGroupName(), orgService.getGtnGroupType());
+
+ Collection<Role> roles = session.getRoleManager().findRoles(gid, null);
+
+ for (Role role : roles)
+ {
+ session.getRoleManager().removeRole(role);
+ }
+ }
+
+ public Collection findMembershipsByGroup(Group group) throws Exception
+ {
+ return findMembershipsByGroupId(group.getId());
+ }
+
+ public Collection findMembershipsByGroupId(String groupId) throws Exception
+ {
+ String gid =
+ getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(groupId),
+ orgService.getGtnGroupType());
+
+ Collection<Role> roles = getIdentitySession().getRoleManager().findRoles(gid, null);
+
+ //TODO: Exo UI has hardcoded casts to List
+ List<Membership> memberships = new LinkedList<Membership>();
+
+ for (Role role : roles)
+ {
+ MembershipImpl m = new MembershipImpl();
+ Group g = ((GroupDAOImpl)orgService.getGroupHandler()).getGroup(role.getGroup().getName());
+ m.setGroupId(g.getId());
+ m.setUserName(role.getUser().getId());
+ m.setMembershipType(role.getRoleType().getName());
+ memberships.add(m);
+ }
+
+ return memberships;
+
+ }
+
+ public Membership findMembership(String id) throws Exception
+ {
+ Membership m = new MembershipImpl(id);
+
+ String groupId =
+ getIdentitySession().getPersistenceManager().createGroupKey(getGroupNameFromId(m.getGroupId()),
+ orgService.getGtnGroupType());
+
+ if (getIdentitySession().getRoleManager().hasRole(m.getUserName(), groupId, m.getMembershipType()))
+ {
+ return m;
+ }
+
+ return null;
+ }
+
+ private void preSave(Membership membership, boolean isNew) throws Exception
+ {
+ for (int i = 0; i < listeners_.size(); i++)
+ {
+ MembershipEventListener listener = (MembershipEventListener)listeners_.get(i);
+ listener.preSave(membership, isNew);
+ }
+ }
+
+ private void postSave(Membership membership, boolean isNew) throws Exception
+ {
+ for (int i = 0; i < listeners_.size(); i++)
+ {
+ MembershipEventListener listener = (MembershipEventListener)listeners_.get(i);
+ listener.postSave(membership, isNew);
+ }
+ }
+
+ private void preDelete(Membership membership) throws Exception
+ {
+ for (int i = 0; i < listeners_.size(); i++)
+ {
+ MembershipEventListener listener = (MembershipEventListener)listeners_.get(i);
+ listener.preDelete(membership);
+ }
+ }
+
+ private void postDelete(Membership membership) throws Exception
+ {
+ for (int i = 0; i < listeners_.size(); i++)
+ {
+ MembershipEventListener listener = (MembershipEventListener)listeners_.get(i);
+ listener.postDelete(membership);
+ }
+ }
+
+ private IdentitySession getIdentitySession() throws Exception
+ {
+ return service_.getIdentitySession();
+ }
+
+ private String getGroupNameFromId(String groupId)
+ {
+ String[] ids = groupId.split("/");
+
+ return ids[ids.length - 1];
+ }
+}
Deleted: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -1,106 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.services.organization.idm;
-
-import org.exoplatform.services.organization.Membership;
-
-public class MembershipImpl implements Membership
-{
- private String membershipType = "member";
-
- private String userName = null;
-
- private String groupId = null;
-
- public MembershipImpl()
- {
- }
-
- public MembershipImpl(String id)
- {
- String[] fields = id.split(":");
-
- // Id can be pure "//" in some cases
- if (fields[0] != null)
- {
- membershipType = fields[0];
- }
- if (fields[1] != null)
- {
- userName = fields[1];
- }
- if (fields[2] != null)
- {
- groupId = fields[2];
- }
- }
-
- public String getId()
- {
- StringBuffer id = new StringBuffer();
-
- if (membershipType != null)
- {
- id.append(membershipType);
- }
- id.append(":");
- if (userName != null)
- {
- id.append(userName);
- }
- id.append(":");
- if (groupId != null)
- {
- id.append(groupId);
- }
-
- return id.toString();
- }
-
- public String getMembershipType()
- {
- return membershipType;
- }
-
- public void setMembershipType(String membershipType)
- {
- this.membershipType = membershipType;
- }
-
- public String getUserName()
- {
- return userName;
- }
-
- public void setUserName(String userName)
- {
- this.userName = userName;
- }
-
- public String getGroupId()
- {
- return groupId;
- }
-
- public void setGroupId(String groupId)
- {
- this.groupId = groupId;
- }
-}
Copied: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java (from rev 804, portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java)
===================================================================
--- portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java (rev 0)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipImpl.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -0,0 +1,106 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.services.organization.idm;
+
+import org.exoplatform.services.organization.Membership;
+
+public class MembershipImpl implements Membership
+{
+ private String membershipType = "member";
+
+ private String userName = null;
+
+ private String groupId = null;
+
+ public MembershipImpl()
+ {
+ }
+
+ public MembershipImpl(String id)
+ {
+ String[] fields = id.split(":");
+
+ // Id can be pure "//" in some cases
+ if (fields[0] != null)
+ {
+ membershipType = fields[0];
+ }
+ if (fields[1] != null)
+ {
+ userName = fields[1];
+ }
+ if (fields[2] != null)
+ {
+ groupId = fields[2];
+ }
+ }
+
+ public String getId()
+ {
+ StringBuffer id = new StringBuffer();
+
+ if (membershipType != null)
+ {
+ id.append(membershipType);
+ }
+ id.append(":");
+ if (userName != null)
+ {
+ id.append(userName);
+ }
+ id.append(":");
+ if (groupId != null)
+ {
+ id.append(groupId);
+ }
+
+ return id.toString();
+ }
+
+ public String getMembershipType()
+ {
+ return membershipType;
+ }
+
+ public void setMembershipType(String membershipType)
+ {
+ this.membershipType = membershipType;
+ }
+
+ public String getUserName()
+ {
+ return userName;
+ }
+
+ public void setUserName(String userName)
+ {
+ this.userName = userName;
+ }
+
+ public String getGroupId()
+ {
+ return groupId;
+ }
+
+ public void setGroupId(String groupId)
+ {
+ this.groupId = groupId;
+ }
+}
Deleted: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -1,178 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.services.organization.idm;
-
-import org.exoplatform.services.organization.MembershipType;
-import org.exoplatform.services.organization.MembershipTypeHandler;
-import org.exoplatform.services.organization.impl.MembershipTypeImpl;
-import org.picketlink.idm.api.IdentitySession;
-import org.picketlink.idm.api.RoleType;
-
-import java.text.DateFormat;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-public class MembershipTypeDAOImpl implements MembershipTypeHandler
-{
-
- public static final String MEMBERSHIP_DESCRIPTION = "description";
-
- public static final String MEMBERSHIP_OWNER = "owner";
-
- public static final String MEMBERSHIP_CREATE_DATE = "create_date";
-
- public static final String MEMBERSHIP_MODIFIED_DATE = "modified_date";
-
- public static final DateFormat dateFormat = DateFormat.getInstance();
-
- private PicketLinkIDMService service_;
-
- private PicketLinkIDMOrganizationServiceImpl orgService;
-
- public MembershipTypeDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service)
- {
- service_ = service;
- this.orgService = orgService;
- }
-
- final public MembershipType createMembershipTypeInstance()
- {
- return new MembershipTypeImpl();
- }
-
- public MembershipType createMembershipType(MembershipType mt, boolean broadcast) throws Exception
- {
- Date now = new Date();
- mt.setCreatedDate(now);
- mt.setModifiedDate(now);
-
- getIdentitySession().getRoleManager().createRoleType(mt.getName());
- updateMembershipType(mt);
-
- return mt;
- }
-
- public MembershipType saveMembershipType(MembershipType mt, boolean broadcast) throws Exception
- {
- Date now = new Date();
- mt.setModifiedDate(now);
- updateMembershipType(mt);
- return mt;
- }
-
- public MembershipType findMembershipType(String name) throws Exception
- {
- RoleType rt = getIdentitySession().getRoleManager().getRoleType(name);
-
- MembershipType mt = null;
-
- if (rt != null)
- {
- mt = new MembershipTypeImpl(name, null, null);
- populateMembershipType(mt);
- }
-
- return mt;
- }
-
- public MembershipType removeMembershipType(String name, boolean broadcast) throws Exception
- {
- MembershipType mt = findMembershipType(name);
-
- if (mt != null)
- {
- getIdentitySession().getRoleManager().removeRoleType(mt.getName());
- }
-
- return mt;
-
- }
-
- public Collection findMembershipTypes() throws Exception
- {
-
- Collection<RoleType> rts = getIdentitySession().getRoleManager().findRoleTypes();
-
- List<MembershipType> mts = new LinkedList<MembershipType>();
-
- for (RoleType rt : rts)
- {
- MembershipType mt = new MembershipTypeImpl(rt.getName(), null, null);
- populateMembershipType(mt);
- mts.add(mt);
- }
-
- return mts;
- }
-
- private IdentitySession getIdentitySession() throws Exception
- {
- return service_.getIdentitySession();
- }
-
- private void updateMembershipType(MembershipType mt) throws Exception
- {
-
- RoleType rt = getIdentitySession().getRoleManager().getRoleType(mt.getName());
-
- Map<String, String> props = new HashMap<String, String>();
-
- props.put(MEMBERSHIP_DESCRIPTION, mt.getDescription());
- props.put(MEMBERSHIP_CREATE_DATE, mt.getCreatedDate() == null ? null : dateFormat.format(mt.getCreatedDate()));
- props
- .put(MEMBERSHIP_MODIFIED_DATE, mt.getModifiedDate() == null ? null : dateFormat.format(mt.getModifiedDate()));
- props.put(MEMBERSHIP_OWNER, mt.getOwner());
-
- getIdentitySession().getRoleManager().setProperties(rt, props);
-
- return;
-
- }
-
- private void populateMembershipType(MembershipType mt) throws Exception
- {
- RoleType rt = getIdentitySession().getRoleManager().getRoleType(mt.getName());
-
- Map<String, String> props = getIdentitySession().getRoleManager().getProperties(rt);
-
- mt.setDescription(props.get(MEMBERSHIP_DESCRIPTION));
- mt.setOwner(props.get(MEMBERSHIP_OWNER));
-
- String cd = props.get(MEMBERSHIP_CREATE_DATE);
- String md = props.get(MEMBERSHIP_MODIFIED_DATE);
-
- if (cd != null)
- {
- mt.setCreatedDate(dateFormat.parse(cd));
- }
-
- if (md != null)
- {
- mt.setModifiedDate(dateFormat.parse(md));
- }
-
- return;
- }
-
-}
Copied: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java (from rev 804, portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java)
===================================================================
--- portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java (rev 0)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/MembershipTypeDAOImpl.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -0,0 +1,178 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.services.organization.idm;
+
+import org.exoplatform.services.organization.MembershipType;
+import org.exoplatform.services.organization.MembershipTypeHandler;
+import org.exoplatform.services.organization.impl.MembershipTypeImpl;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.api.RoleType;
+
+import java.text.DateFormat;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+public class MembershipTypeDAOImpl implements MembershipTypeHandler
+{
+
+ public static final String MEMBERSHIP_DESCRIPTION = "description";
+
+ public static final String MEMBERSHIP_OWNER = "owner";
+
+ public static final String MEMBERSHIP_CREATE_DATE = "create_date";
+
+ public static final String MEMBERSHIP_MODIFIED_DATE = "modified_date";
+
+ public static final DateFormat dateFormat = DateFormat.getInstance();
+
+ private PicketLinkIDMService service_;
+
+ private PicketLinkIDMOrganizationServiceImpl orgService;
+
+ public MembershipTypeDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service)
+ {
+ service_ = service;
+ this.orgService = orgService;
+ }
+
+ final public MembershipType createMembershipTypeInstance()
+ {
+ return new MembershipTypeImpl();
+ }
+
+ public MembershipType createMembershipType(MembershipType mt, boolean broadcast) throws Exception
+ {
+ Date now = new Date();
+ mt.setCreatedDate(now);
+ mt.setModifiedDate(now);
+
+ getIdentitySession().getRoleManager().createRoleType(mt.getName());
+ updateMembershipType(mt);
+
+ return mt;
+ }
+
+ public MembershipType saveMembershipType(MembershipType mt, boolean broadcast) throws Exception
+ {
+ Date now = new Date();
+ mt.setModifiedDate(now);
+ updateMembershipType(mt);
+ return mt;
+ }
+
+ public MembershipType findMembershipType(String name) throws Exception
+ {
+ RoleType rt = getIdentitySession().getRoleManager().getRoleType(name);
+
+ MembershipType mt = null;
+
+ if (rt != null)
+ {
+ mt = new MembershipTypeImpl(name, null, null);
+ populateMembershipType(mt);
+ }
+
+ return mt;
+ }
+
+ public MembershipType removeMembershipType(String name, boolean broadcast) throws Exception
+ {
+ MembershipType mt = findMembershipType(name);
+
+ if (mt != null)
+ {
+ getIdentitySession().getRoleManager().removeRoleType(mt.getName());
+ }
+
+ return mt;
+
+ }
+
+ public Collection findMembershipTypes() throws Exception
+ {
+
+ Collection<RoleType> rts = getIdentitySession().getRoleManager().findRoleTypes();
+
+ List<MembershipType> mts = new LinkedList<MembershipType>();
+
+ for (RoleType rt : rts)
+ {
+ MembershipType mt = new MembershipTypeImpl(rt.getName(), null, null);
+ populateMembershipType(mt);
+ mts.add(mt);
+ }
+
+ return mts;
+ }
+
+ private IdentitySession getIdentitySession() throws Exception
+ {
+ return service_.getIdentitySession();
+ }
+
+ private void updateMembershipType(MembershipType mt) throws Exception
+ {
+
+ RoleType rt = getIdentitySession().getRoleManager().getRoleType(mt.getName());
+
+ Map<String, String> props = new HashMap<String, String>();
+
+ props.put(MEMBERSHIP_DESCRIPTION, mt.getDescription());
+ props.put(MEMBERSHIP_CREATE_DATE, mt.getCreatedDate() == null ? null : dateFormat.format(mt.getCreatedDate()));
+ props
+ .put(MEMBERSHIP_MODIFIED_DATE, mt.getModifiedDate() == null ? null : dateFormat.format(mt.getModifiedDate()));
+ props.put(MEMBERSHIP_OWNER, mt.getOwner());
+
+ getIdentitySession().getRoleManager().setProperties(rt, props);
+
+ return;
+
+ }
+
+ private void populateMembershipType(MembershipType mt) throws Exception
+ {
+ RoleType rt = getIdentitySession().getRoleManager().getRoleType(mt.getName());
+
+ Map<String, String> props = getIdentitySession().getRoleManager().getProperties(rt);
+
+ mt.setDescription(props.get(MEMBERSHIP_DESCRIPTION));
+ mt.setOwner(props.get(MEMBERSHIP_OWNER));
+
+ String cd = props.get(MEMBERSHIP_CREATE_DATE);
+ String md = props.get(MEMBERSHIP_MODIFIED_DATE);
+
+ if (cd != null)
+ {
+ mt.setCreatedDate(dateFormat.parse(cd));
+ }
+
+ if (md != null)
+ {
+ mt.setModifiedDate(dateFormat.parse(md));
+ }
+
+ return;
+ }
+
+}
Deleted: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -1,175 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.services.organization.idm;
-
-import org.exoplatform.container.ExoContainer;
-import org.exoplatform.container.component.ComponentRequestLifecycle;
-import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.container.xml.ValueParam;
-import org.exoplatform.services.cache.CacheService;
-import org.exoplatform.services.organization.BaseOrganizationService;
-import org.picocontainer.Startable;
-
-public class PicketLinkIDMOrganizationServiceImpl extends BaseOrganizationService implements Startable,
- ComponentRequestLifecycle
-{
-
- // We may have several portal containers thus we need one PicketLinkIDMService per portal container
- // private static PicketLinkIDMService jbidmService_;
- private PicketLinkIDMService idmService_;
-
- public static final String GTN_GROUP_TYPE_OPTION = "gtnGroupTypeName";
-
- public static final String GTN_ROOT_GROUP_NAME_OPTION = "gtnRootGroupName";
-
- public static final String GTN_ROOT_GROUP_TYPE_NAME_OPTION = "gtnRootGroupTypeName";
-
- public static final String PASSWORD_AS_ATTRIBUTE_OPTION = "passwordAsAttribute";
-
- private String gtnGroupType = "GTN_GROUP_TYPE";
-
- private String gtnRootGroupName = "GTN_ROOT_GROUP";
-
- private String gtnRootGroupType = gtnGroupType;
-
- private boolean passwordAsAttribute = false;
-
- public PicketLinkIDMOrganizationServiceImpl(InitParams params, CacheService cservice, PicketLinkIDMService idmService)
- throws Exception
- {
- groupDAO_ = new GroupDAOImpl(this, idmService);
- userDAO_ = new UserDAOImpl(this, idmService, cservice);
- userProfileDAO_ = new UserProfileDAOImpl(this, idmService, cservice);
- membershipDAO_ = new MembershipDAOImpl(this, idmService);
- membershipTypeDAO_ = new MembershipTypeDAOImpl(this, idmService);
-
- idmService_ = idmService;
-
- if (params != null)
- {
- //Options
- ValueParam gtnGroupTypeNameParam = params.getValueParam(GTN_GROUP_TYPE_OPTION);
- ValueParam gtnRootGroupTypeNameParam = params.getValueParam(GTN_ROOT_GROUP_TYPE_NAME_OPTION);
- ValueParam gtnRootGroupNameParam = params.getValueParam(GTN_ROOT_GROUP_NAME_OPTION);
- ValueParam passwordAsAttributeParam = params.getValueParam(PASSWORD_AS_ATTRIBUTE_OPTION);
-
- if (gtnGroupTypeNameParam != null)
- {
- this.gtnGroupType = gtnGroupTypeNameParam.getValue();
- }
-
- if (gtnRootGroupNameParam != null)
- {
- this.gtnRootGroupName = gtnRootGroupNameParam.getValue();
- }
-
- if (gtnRootGroupTypeNameParam != null)
- {
- this.gtnRootGroupType = gtnRootGroupTypeNameParam.getValue();
- }
- else if (gtnRootGroupTypeNameParam != null)
- {
- this.gtnRootGroupType = this.gtnGroupType;
- }
-
- if (passwordAsAttributeParam != null && passwordAsAttributeParam.getValue().equalsIgnoreCase("true"))
- {
- this.passwordAsAttribute = true;
- }
- }
-
- }
-
- public final org.picketlink.idm.api.Group getJBIDMGroup(String groupId) throws Exception
- {
- String[] ids = groupId.split("/");
- String name = ids[ids.length - 1];
- return idmService_.getIdentitySession().getPersistenceManager().findGroup(name, getGtnGroupType());
- }
-
- @Override
- public void start()
- {
-
- try
- {
- // Wrap within transaction so all initializers can work
- idmService_.getIdentitySession().beginTransaction();
- super.start();
- idmService_.getIdentitySession().getTransaction().commit();
-
- }
- catch (Exception e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
-
- }
-
- @Override
- public void stop()
- {
- //toto
- }
-
- public void startRequest(ExoContainer container)
- {
- try
- {
- idmService_.getIdentitySession().beginTransaction();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- public void endRequest(ExoContainer container)
- {
- try
- {
- idmService_.getIdentitySession().getTransaction().commit();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- public String getGtnGroupType()
- {
- return gtnGroupType;
- }
-
- public String getExoRootGroupName()
- {
- return gtnRootGroupName;
- }
-
- public String getGtnRootGroupType()
- {
- return gtnRootGroupType;
- }
-
- public boolean isPasswordAsAttribute()
- {
- return passwordAsAttribute;
- }
-}
Copied: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java (from rev 804, portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java)
===================================================================
--- portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java (rev 0)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMOrganizationServiceImpl.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -0,0 +1,175 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.services.organization.idm;
+
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.component.ComponentRequestLifecycle;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.ValueParam;
+import org.exoplatform.services.cache.CacheService;
+import org.exoplatform.services.organization.BaseOrganizationService;
+import org.picocontainer.Startable;
+
+public class PicketLinkIDMOrganizationServiceImpl extends BaseOrganizationService implements Startable,
+ ComponentRequestLifecycle
+{
+
+ // We may have several portal containers thus we need one PicketLinkIDMService per portal container
+ // private static PicketLinkIDMService jbidmService_;
+ private PicketLinkIDMService idmService_;
+
+ public static final String GTN_GROUP_TYPE_OPTION = "gtnGroupTypeName";
+
+ public static final String GTN_ROOT_GROUP_NAME_OPTION = "gtnRootGroupName";
+
+ public static final String GTN_ROOT_GROUP_TYPE_NAME_OPTION = "gtnRootGroupTypeName";
+
+ public static final String PASSWORD_AS_ATTRIBUTE_OPTION = "passwordAsAttribute";
+
+ private String gtnGroupType = "GTN_GROUP_TYPE";
+
+ private String gtnRootGroupName = "GTN_ROOT_GROUP";
+
+ private String gtnRootGroupType = gtnGroupType;
+
+ private boolean passwordAsAttribute = false;
+
+ public PicketLinkIDMOrganizationServiceImpl(InitParams params, CacheService cservice, PicketLinkIDMService idmService)
+ throws Exception
+ {
+ groupDAO_ = new GroupDAOImpl(this, idmService);
+ userDAO_ = new UserDAOImpl(this, idmService, cservice);
+ userProfileDAO_ = new UserProfileDAOImpl(this, idmService, cservice);
+ membershipDAO_ = new MembershipDAOImpl(this, idmService);
+ membershipTypeDAO_ = new MembershipTypeDAOImpl(this, idmService);
+
+ idmService_ = idmService;
+
+ if (params != null)
+ {
+ //Options
+ ValueParam gtnGroupTypeNameParam = params.getValueParam(GTN_GROUP_TYPE_OPTION);
+ ValueParam gtnRootGroupTypeNameParam = params.getValueParam(GTN_ROOT_GROUP_TYPE_NAME_OPTION);
+ ValueParam gtnRootGroupNameParam = params.getValueParam(GTN_ROOT_GROUP_NAME_OPTION);
+ ValueParam passwordAsAttributeParam = params.getValueParam(PASSWORD_AS_ATTRIBUTE_OPTION);
+
+ if (gtnGroupTypeNameParam != null)
+ {
+ this.gtnGroupType = gtnGroupTypeNameParam.getValue();
+ }
+
+ if (gtnRootGroupNameParam != null)
+ {
+ this.gtnRootGroupName = gtnRootGroupNameParam.getValue();
+ }
+
+ if (gtnRootGroupTypeNameParam != null)
+ {
+ this.gtnRootGroupType = gtnRootGroupTypeNameParam.getValue();
+ }
+ else if (gtnRootGroupTypeNameParam != null)
+ {
+ this.gtnRootGroupType = this.gtnGroupType;
+ }
+
+ if (passwordAsAttributeParam != null && passwordAsAttributeParam.getValue().equalsIgnoreCase("true"))
+ {
+ this.passwordAsAttribute = true;
+ }
+ }
+
+ }
+
+ public final org.picketlink.idm.api.Group getJBIDMGroup(String groupId) throws Exception
+ {
+ String[] ids = groupId.split("/");
+ String name = ids[ids.length - 1];
+ return idmService_.getIdentitySession().getPersistenceManager().findGroup(name, getGtnGroupType());
+ }
+
+ @Override
+ public void start()
+ {
+
+ try
+ {
+ // Wrap within transaction so all initializers can work
+ idmService_.getIdentitySession().beginTransaction();
+ super.start();
+ idmService_.getIdentitySession().getTransaction().commit();
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ }
+
+ }
+
+ @Override
+ public void stop()
+ {
+ //toto
+ }
+
+ public void startRequest(ExoContainer container)
+ {
+ try
+ {
+ idmService_.getIdentitySession().beginTransaction();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void endRequest(ExoContainer container)
+ {
+ try
+ {
+ idmService_.getIdentitySession().getTransaction().commit();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public String getGtnGroupType()
+ {
+ return gtnGroupType;
+ }
+
+ public String getExoRootGroupName()
+ {
+ return gtnRootGroupName;
+ }
+
+ public String getGtnRootGroupType()
+ {
+ return gtnRootGroupType;
+ }
+
+ public boolean isPasswordAsAttribute()
+ {
+ return passwordAsAttribute;
+ }
+}
Deleted: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMService.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMService.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMService.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -1,34 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.services.organization.idm;
-
-import org.picketlink.idm.api.IdentitySession;
-import org.picketlink.idm.api.IdentitySessionFactory;
-
-public interface PicketLinkIDMService
-{
-
- IdentitySessionFactory getIdentitySessionFactory();
-
- IdentitySession getIdentitySession() throws Exception;
-
- IdentitySession getIdentitySession(String realm) throws Exception;
-
-}
Copied: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMService.java (from rev 804, portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMService.java)
===================================================================
--- portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMService.java (rev 0)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMService.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -0,0 +1,34 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.services.organization.idm;
+
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.api.IdentitySessionFactory;
+
+public interface PicketLinkIDMService
+{
+
+ IdentitySessionFactory getIdentitySessionFactory();
+
+ IdentitySession getIdentitySession() throws Exception;
+
+ IdentitySession getIdentitySession(String realm) throws Exception;
+
+}
Deleted: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -1,149 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.services.organization.idm;
-
-import org.exoplatform.container.configuration.ConfigurationManager;
-import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.container.xml.ValueParam;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.exoplatform.services.database.HibernateService;
-import org.picketlink.idm.api.IdentitySession;
-import org.picketlink.idm.api.IdentitySessionFactory;
-import org.picketlink.idm.api.cfg.IdentityConfiguration;
-import org.picketlink.idm.common.exception.IdentityConfigurationException;
-import org.picketlink.idm.impl.configuration.IdentityConfigurationImpl;
-import org.picketlink.idm.impl.configuration.jaxb2.JAXB2IdentityConfiguration;
-import org.picketlink.idm.spi.configuration.metadata.IdentityConfigurationMetaData;
-import org.picocontainer.Startable;
-
-import java.net.URL;
-
-import javax.naming.InitialContext;
-
-public class PicketLinkIDMServiceImpl implements PicketLinkIDMService, Startable
-{
-
- private static Log log_ = ExoLogger.getLogger(PicketLinkIDMServiceImpl.class);
-
- public static final String PARAM_CONFIG_OPTION = "config";
-
- public static final String PARAM_HIBERNATE_PROPS = "hibernate.properties";
-
- public static final String PARAM_HIBERNATE_MAPPINGS = "hibernate.mappings";
-
- public static final String PARAM_HIBERNATE_ANNOTATIONS = "hibernate.annotations";
-
- public static final String PARAM_JNDI_NAME_OPTION = "jndiName";
-
- public static final String DEFAULT_REALM_NAME_OPTION = "PortalRealm";
-
- // We may have several portal containers thus we need one indentitySessionFactory per portal container
- // private static IdentitySessionFactory identitySessionFactory;
- private IdentitySessionFactory identitySessionFactory;
-
- private String config;
-
- private String defaultRealmName = "PortalRealm";
-
- private IdentityConfiguration identityConfiguration;
-
- private PicketLinkIDMServiceImpl()
- {
- }
-
- public PicketLinkIDMServiceImpl(InitParams initParams, HibernateService hibernateService, ConfigurationManager confManager) throws Exception
- {
- ValueParam config = initParams.getValueParam(PARAM_CONFIG_OPTION);
- ValueParam jndiName = initParams.getValueParam(PARAM_JNDI_NAME_OPTION);
- ValueParam realmName = initParams.getValueParam(DEFAULT_REALM_NAME_OPTION);
-
- if (config == null && jndiName == null)
- {
- throw new IllegalStateException("Either '" + PARAM_CONFIG_OPTION + "' or '" + PARAM_JNDI_NAME_OPTION
- + "' parameter must " + "be specified");
- }
- if (realmName != null)
- {
- this.defaultRealmName = realmName.getValue();
- }
-
- if (config != null)
- {
- this.config = config.getValue();
- URL configURL = confManager.getURL(this.config);
-
- if (configURL == null)
- {
- throw new IllegalStateException("Cannot fine resource: " + this.config);
- }
-
- IdentityConfigurationMetaData configMD =
- JAXB2IdentityConfiguration.createConfigurationMetaData(confManager.getInputStream(this.config));
-
- identityConfiguration = new IdentityConfigurationImpl().configure(configMD);
-
- identityConfiguration.getIdentityConfigurationRegistry().register(hibernateService.getSessionFactory(), "hibernateSessionFactory");
- }
- else
- {
- identitySessionFactory = (IdentitySessionFactory)new InitialContext().lookup(jndiName.getValue());
- }
-
- }
-
- public void start()
- {
- if (identitySessionFactory == null)
- {
- try
- {
- identitySessionFactory = identityConfiguration.buildIdentitySessionFactory();
- }
- catch (IdentityConfigurationException e)
- {
- throw new RuntimeException(e);
- }
- }
- }
-
- public void stop()
- {
- }
-
- public IdentitySessionFactory getIdentitySessionFactory()
- {
- return identitySessionFactory; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public IdentitySession getIdentitySession() throws Exception
- {
- return getIdentitySessionFactory().getCurrentIdentitySession(defaultRealmName);
- }
-
- public IdentitySession getIdentitySession(String realm) throws Exception
- {
- if (realm == null)
- {
- throw new IllegalArgumentException("Realm name cannot be null");
- }
- return getIdentitySessionFactory().getCurrentIdentitySession(realm);
- }
-}
Copied: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java (from rev 804, portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java)
===================================================================
--- portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java (rev 0)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/PicketLinkIDMServiceImpl.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -0,0 +1,148 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.services.organization.idm;
+
+import org.exoplatform.container.configuration.ConfigurationManager;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.ValueParam;
+import org.exoplatform.services.database.HibernateService;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.api.IdentitySessionFactory;
+import org.picketlink.idm.api.cfg.IdentityConfiguration;
+import org.picketlink.idm.common.exception.IdentityConfigurationException;
+import org.picketlink.idm.impl.configuration.IdentityConfigurationImpl;
+import org.picketlink.idm.impl.configuration.jaxb2.JAXB2IdentityConfiguration;
+import org.picketlink.idm.spi.configuration.metadata.IdentityConfigurationMetaData;
+import org.picocontainer.Startable;
+
+import javax.naming.InitialContext;
+import java.net.URL;
+
+public class PicketLinkIDMServiceImpl implements PicketLinkIDMService, Startable
+{
+
+ private static Log log_ = ExoLogger.getLogger(PicketLinkIDMServiceImpl.class);
+
+ public static final String PARAM_CONFIG_OPTION = "config";
+
+ public static final String PARAM_HIBERNATE_PROPS = "hibernate.properties";
+
+ public static final String PARAM_HIBERNATE_MAPPINGS = "hibernate.mappings";
+
+ public static final String PARAM_HIBERNATE_ANNOTATIONS = "hibernate.annotations";
+
+ public static final String PARAM_JNDI_NAME_OPTION = "jndiName";
+
+ public static final String DEFAULT_REALM_NAME_OPTION = "PortalRealm";
+
+ // We may have several portal containers thus we need one indentitySessionFactory per portal container
+ // private static IdentitySessionFactory identitySessionFactory;
+ private IdentitySessionFactory identitySessionFactory;
+
+ private String config;
+
+ private String defaultRealmName = "PortalRealm";
+
+ private IdentityConfiguration identityConfiguration;
+
+ private PicketLinkIDMServiceImpl()
+ {
+ }
+
+ public PicketLinkIDMServiceImpl(InitParams initParams, HibernateService hibernateService, ConfigurationManager confManager) throws Exception
+ {
+ ValueParam config = initParams.getValueParam(PARAM_CONFIG_OPTION);
+ ValueParam jndiName = initParams.getValueParam(PARAM_JNDI_NAME_OPTION);
+ ValueParam realmName = initParams.getValueParam(DEFAULT_REALM_NAME_OPTION);
+
+ if (config == null && jndiName == null)
+ {
+ throw new IllegalStateException("Either '" + PARAM_CONFIG_OPTION + "' or '" + PARAM_JNDI_NAME_OPTION
+ + "' parameter must " + "be specified");
+ }
+ if (realmName != null)
+ {
+ this.defaultRealmName = realmName.getValue();
+ }
+
+ if (config != null)
+ {
+ this.config = config.getValue();
+ URL configURL = confManager.getURL(this.config);
+
+ if (configURL == null)
+ {
+ throw new IllegalStateException("Cannot fine resource: " + this.config);
+ }
+
+ IdentityConfigurationMetaData configMD =
+ JAXB2IdentityConfiguration.createConfigurationMetaData(confManager.getInputStream(this.config));
+
+ identityConfiguration = new IdentityConfigurationImpl().configure(configMD);
+
+ identityConfiguration.getIdentityConfigurationRegistry().register(hibernateService.getSessionFactory(), "hibernateSessionFactory");
+ }
+ else
+ {
+ identitySessionFactory = (IdentitySessionFactory)new InitialContext().lookup(jndiName.getValue());
+ }
+
+ }
+
+ public void start()
+ {
+ if (identitySessionFactory == null)
+ {
+ try
+ {
+ identitySessionFactory = identityConfiguration.buildIdentitySessionFactory();
+ }
+ catch (IdentityConfigurationException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ public void stop()
+ {
+ }
+
+ public IdentitySessionFactory getIdentitySessionFactory()
+ {
+ return identitySessionFactory; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public IdentitySession getIdentitySession() throws Exception
+ {
+ return getIdentitySessionFactory().getCurrentIdentitySession(defaultRealmName);
+ }
+
+ public IdentitySession getIdentitySession(String realm) throws Exception
+ {
+ if (realm == null)
+ {
+ throw new IllegalArgumentException("Realm name cannot be null");
+ }
+ return getIdentitySessionFactory().getCurrentIdentitySession(realm);
+ }
+}
Deleted: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -1,420 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.services.organization.idm;
-
-import org.exoplatform.commons.utils.LazyPageList;
-import org.exoplatform.services.cache.CacheService;
-import org.exoplatform.services.cache.ExoCache;
-import org.exoplatform.services.organization.Query;
-import org.exoplatform.services.organization.User;
-import org.exoplatform.services.organization.UserEventListener;
-import org.exoplatform.services.organization.UserHandler;
-import org.exoplatform.services.organization.impl.UserImpl;
-import org.picketlink.idm.api.Attribute;
-import org.picketlink.idm.api.AttributesManager;
-import org.picketlink.idm.api.IdentitySession;
-import org.picketlink.idm.api.query.UserQueryBuilder;
-import org.picketlink.idm.impl.api.SimpleAttribute;
-
-import java.text.DateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- */
-public class UserDAOImpl implements UserHandler
-{
-
- private final PicketLinkIDMService service_;
-
- private ExoCache cache_;
-
- private List<UserEventListener> listeners_ = new ArrayList<UserEventListener>(3);
-
- public static final String USER_PASSWORD = "password";
-
- public static final String USER_FIRST_NAME = "firstName";
-
- public static final String USER_LAST_NAME = "lastName";
-
- public static final String USER_EMAIL = "email";
-
- public static final String USER_CREATED_DATE = "createdDate";
-
- public static final String USER_LAST_LOGIN_TIME = "lastLoginTime";
-
- public static final String USER_ORGANIZATION_ID = "organizationId";
-
- public static final Set<String> USER_NON_PROFILE_KEYS;
-
- public static final DateFormat dateFormat = DateFormat.getInstance();
-
- private PicketLinkIDMOrganizationServiceImpl orgService;
-
- static
- {
- Set<String> keys = new HashSet<String>();
- keys.add(USER_PASSWORD);
- keys.add(USER_FIRST_NAME);
- keys.add(USER_LAST_NAME);
- keys.add(USER_EMAIL);
- keys.add(USER_CREATED_DATE);
- keys.add(USER_LAST_LOGIN_TIME);
- keys.add(USER_ORGANIZATION_ID);
-
- USER_NON_PROFILE_KEYS = Collections.unmodifiableSet(keys);
- }
-
- public UserDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService idmService, CacheService cservice)
- throws Exception
- {
- service_ = idmService;
- cache_ = cservice.getCacheInstance(UserImpl.class.getName());
- this.orgService = orgService;
- }
-
- final public List getUserEventListeners()
- {
- return listeners_;
- }
-
- public void addUserEventListener(UserEventListener listener)
- {
- listeners_.add(listener);
- }
-
- public User createUserInstance()
- {
- return new UserImpl();
- }
-
- public User createUserInstance(String username)
- {
- return new UserImpl(username);
- }
-
- public void createUser(User user, boolean broadcast) throws Exception
- {
- IdentitySession session = service_.getIdentitySession();
- if (broadcast)
- {
- preSave(user, true);
- }
-
- session.getPersistenceManager().createUser(user.getUserName());
-
- persistUserInfo(user, session);
-
- if (broadcast)
- {
- postSave(user, true);
- }
-
- }
-
- public void saveUser(User user, boolean broadcast) throws Exception
- {
- IdentitySession session = service_.getIdentitySession();
- if (broadcast)
- {
- preSave(user, false);
- }
-
- persistUserInfo(user, session);
-
- if (broadcast)
- {
- postSave(user, false);
- }
- cache_.put(user.getUserName(), user);
- }
-
- public User removeUser(String userName, boolean broadcast) throws Exception
- {
- IdentitySession session = service_.getIdentitySession();
-
- org.picketlink.idm.api.User foundUser = session.getPersistenceManager().findUser(userName);
-
- if (foundUser == null)
- {
- cache_.remove(userName);
- return null;
- }
-
- // Remove all memberships and profile first
- orgService.getMembershipHandler().removeMembershipByUser(userName, false);
- orgService.getUserProfileHandler().removeUserProfile(userName, false);
-
- User exoUser = getPopulatedUser(userName, session);
-
- if (broadcast)
- {
- preDelete(exoUser);
- }
-
- session.getPersistenceManager().removeUser(foundUser, true);
- if (broadcast)
- {
- postDelete(exoUser);
- }
- cache_.remove(userName);
- return exoUser;
- }
-
- //
- public User findUserByName(String userName) throws Exception
- {
- IdentitySession session = service_.getIdentitySession();
-
- User user = (User)cache_.get(userName);
- if (user != null)
- {
- return user;
- }
- user = getPopulatedUser(userName, session);
- if (user != null)
- {
- cache_.put(userName, user);
- }
- return user;
- }
-
- public LazyPageList getUserPageList(int pageSize) throws Exception
- {
- UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
-
- return new LazyPageList(new IDMUserListAccess(this, service_, qb, pageSize, true), pageSize);
- }
-
- //
- public boolean authenticate(String username, String password) throws Exception
- {
- User user = findUserByName(username);
- if (user == null)
- {
- return false;
- }
-
- boolean authenticated = false;
-
- if (orgService.isPasswordAsAttribute())
- {
- authenticated = user.getPassword().equals(password);
- }
- else
- {
- IdentitySession session = service_.getIdentitySession();
- org.picketlink.idm.api.User idmUser = session.getPersistenceManager().findUser(user.getUserName());
-
- authenticated = session.getAttributesManager().validatePassword(idmUser, password);
- }
-
- if (authenticated)
- {
- UserImpl userImpl = (UserImpl)user;
- userImpl.setLastLoginTime(Calendar.getInstance().getTime());
- saveUser(userImpl, false);
- }
- return authenticated;
- }
-
- public LazyPageList findUsers(Query q) throws Exception
- {
-
- UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
-
- if (q.getUserName() != null)
- {
- qb.idFilter(q.getUserName());
- }
- if (q.getEmail() != null)
- {
- qb.attributeValuesFilter(UserDAOImpl.USER_EMAIL, new String[]{q.getEmail()});
- }
- if (q.getFirstName() != null)
- {
- qb.attributeValuesFilter(UserDAOImpl.USER_FIRST_NAME, new String[]{q.getFirstName()});
- }
-
- //TODO: from/to login date
-
- if (q.getLastName() != null)
- {
- qb.attributeValuesFilter(UserDAOImpl.USER_LAST_NAME, new String[]{q.getLastName()});
- }
-
- return new LazyPageList(new IDMUserListAccess(this, service_, qb, 20, false), 20);
- }
-
- //
- public LazyPageList findUsersByGroup(String groupId) throws Exception
- {
- UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
-
- org.picketlink.idm.api.Group jbidGroup = orgService.getJBIDMGroup(groupId);
-
- qb.addRelatedGroup(jbidGroup);
-
- return new LazyPageList(new IDMUserListAccess(this, service_, qb, 20, false), 20);
- }
-
- //
-
- private void preSave(User user, boolean isNew) throws Exception
- {
- for (UserEventListener listener : listeners_)
- {
- listener.preSave(user, isNew);
- }
- }
-
- private void postSave(User user, boolean isNew) throws Exception
- {
- for (UserEventListener listener : listeners_)
- {
- listener.postSave(user, isNew);
- }
- }
-
- private void preDelete(User user) throws Exception
- {
- for (UserEventListener listener : listeners_)
- {
- listener.preDelete(user);
- }
- }
-
- private void postDelete(User user) throws Exception
- {
- for (UserEventListener listener : listeners_)
- {
- listener.postDelete(user);
- }
- }
-
- public void persistUserInfo(User user, IdentitySession session) throws Exception
- {
-
- AttributesManager am = session.getAttributesManager();
-
- ArrayList attributes = new ArrayList();
-
- if (user.getCreatedDate() != null)
- {
- attributes.add(new SimpleAttribute(USER_CREATED_DATE, dateFormat.format(user.getCreatedDate())));
- }
- if (user.getLastLoginTime() != null)
- {
- attributes.add(new SimpleAttribute(USER_LAST_LOGIN_TIME, dateFormat.format(user.getLastLoginTime())));
- }
- if (user.getEmail() != null)
- {
- attributes.add(new SimpleAttribute(USER_EMAIL, user.getEmail()));
- }
- if (user.getFirstName() != null)
- {
- attributes.add(new SimpleAttribute(USER_FIRST_NAME, user.getFirstName()));
- }
- if (user.getLastName() != null)
- {
- attributes.add(new SimpleAttribute(USER_LAST_NAME, user.getLastName()));
- }
- if (user.getOrganizationId() != null)
- {
- attributes.add(new SimpleAttribute(USER_ORGANIZATION_ID, user.getOrganizationId()));
- }
- if (user.getPassword() != null)
- {
- if (orgService.isPasswordAsAttribute())
- {
- attributes.add(new SimpleAttribute(USER_PASSWORD, user.getPassword()));
- }
- else
- {
- am.updatePassword(session.getPersistenceManager().findUser(user.getUserName()), user.getPassword());
- }
- }
-
- Attribute[] attrs = new Attribute[attributes.size()];
- attrs = (Attribute[])attributes.toArray(attrs);
- am.addAttributes(user.getUserName(), attrs);
- }
-
- public static User getPopulatedUser(String userName, IdentitySession session) throws Exception
- {
-
- if (session.getPersistenceManager().findUser(userName) == null)
- {
- return null;
- }
-
- AttributesManager am = session.getAttributesManager();
-
- Map<String, Attribute> attrs = am.getAttributes(userName);
-
- User user = new UserImpl(userName);
-
- if (attrs == null)
- {
-
- return user;
- }
- else
- {
- if (attrs.containsKey(USER_CREATED_DATE))
- {
- user.setCreatedDate(dateFormat.parse(attrs.get(USER_CREATED_DATE).getValue().toString()));
- }
- if (attrs.containsKey(USER_EMAIL))
- {
- user.setEmail(attrs.get(USER_EMAIL).getValue().toString());
- }
- if (attrs.containsKey(USER_FIRST_NAME))
- {
- user.setFirstName(attrs.get(USER_FIRST_NAME).getValue().toString());
- }
- if (attrs.containsKey(USER_LAST_LOGIN_TIME))
- {
- user.setLastLoginTime(dateFormat.parse(attrs.get(USER_LAST_LOGIN_TIME).getValue().toString()));
- }
- if (attrs.containsKey(USER_LAST_NAME))
- {
- user.setLastName(attrs.get(USER_LAST_NAME).getValue().toString());
- }
- if (attrs.containsKey(USER_ORGANIZATION_ID))
- {
- user.setOrganizationId(attrs.get(USER_ORGANIZATION_ID).getValue().toString());
- }
- if (attrs.containsKey(USER_PASSWORD))
- {
- user.setPassword(attrs.get(USER_PASSWORD).getValue().toString());
- }
- }
-
- return user;
-
- }
-
-}
Copied: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java (from rev 804, portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java)
===================================================================
--- portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java (rev 0)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserDAOImpl.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -0,0 +1,420 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.services.organization.idm;
+
+import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.services.cache.CacheService;
+import org.exoplatform.services.cache.ExoCache;
+import org.exoplatform.services.organization.Query;
+import org.exoplatform.services.organization.User;
+import org.exoplatform.services.organization.UserEventListener;
+import org.exoplatform.services.organization.UserHandler;
+import org.exoplatform.services.organization.impl.UserImpl;
+import org.picketlink.idm.api.Attribute;
+import org.picketlink.idm.api.AttributesManager;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.api.query.UserQueryBuilder;
+import org.picketlink.idm.impl.api.SimpleAttribute;
+
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ */
+public class UserDAOImpl implements UserHandler
+{
+
+ private final PicketLinkIDMService service_;
+
+ private ExoCache cache_;
+
+ private List<UserEventListener> listeners_ = new ArrayList<UserEventListener>(3);
+
+ public static final String USER_PASSWORD = "password";
+
+ public static final String USER_FIRST_NAME = "firstName";
+
+ public static final String USER_LAST_NAME = "lastName";
+
+ public static final String USER_EMAIL = "email";
+
+ public static final String USER_CREATED_DATE = "createdDate";
+
+ public static final String USER_LAST_LOGIN_TIME = "lastLoginTime";
+
+ public static final String USER_ORGANIZATION_ID = "organizationId";
+
+ public static final Set<String> USER_NON_PROFILE_KEYS;
+
+ public static final DateFormat dateFormat = DateFormat.getInstance();
+
+ private PicketLinkIDMOrganizationServiceImpl orgService;
+
+ static
+ {
+ Set<String> keys = new HashSet<String>();
+ keys.add(USER_PASSWORD);
+ keys.add(USER_FIRST_NAME);
+ keys.add(USER_LAST_NAME);
+ keys.add(USER_EMAIL);
+ keys.add(USER_CREATED_DATE);
+ keys.add(USER_LAST_LOGIN_TIME);
+ keys.add(USER_ORGANIZATION_ID);
+
+ USER_NON_PROFILE_KEYS = Collections.unmodifiableSet(keys);
+ }
+
+ public UserDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService idmService, CacheService cservice)
+ throws Exception
+ {
+ service_ = idmService;
+ cache_ = cservice.getCacheInstance(UserImpl.class.getName());
+ this.orgService = orgService;
+ }
+
+ final public List getUserEventListeners()
+ {
+ return listeners_;
+ }
+
+ public void addUserEventListener(UserEventListener listener)
+ {
+ listeners_.add(listener);
+ }
+
+ public User createUserInstance()
+ {
+ return new UserImpl();
+ }
+
+ public User createUserInstance(String username)
+ {
+ return new UserImpl(username);
+ }
+
+ public void createUser(User user, boolean broadcast) throws Exception
+ {
+ IdentitySession session = service_.getIdentitySession();
+ if (broadcast)
+ {
+ preSave(user, true);
+ }
+
+ session.getPersistenceManager().createUser(user.getUserName());
+
+ persistUserInfo(user, session);
+
+ if (broadcast)
+ {
+ postSave(user, true);
+ }
+
+ }
+
+ public void saveUser(User user, boolean broadcast) throws Exception
+ {
+ IdentitySession session = service_.getIdentitySession();
+ if (broadcast)
+ {
+ preSave(user, false);
+ }
+
+ persistUserInfo(user, session);
+
+ if (broadcast)
+ {
+ postSave(user, false);
+ }
+ cache_.put(user.getUserName(), user);
+ }
+
+ public User removeUser(String userName, boolean broadcast) throws Exception
+ {
+ IdentitySession session = service_.getIdentitySession();
+
+ org.picketlink.idm.api.User foundUser = session.getPersistenceManager().findUser(userName);
+
+ if (foundUser == null)
+ {
+ cache_.remove(userName);
+ return null;
+ }
+
+ // Remove all memberships and profile first
+ orgService.getMembershipHandler().removeMembershipByUser(userName, false);
+ orgService.getUserProfileHandler().removeUserProfile(userName, false);
+
+ User exoUser = getPopulatedUser(userName, session);
+
+ if (broadcast)
+ {
+ preDelete(exoUser);
+ }
+
+ session.getPersistenceManager().removeUser(foundUser, true);
+ if (broadcast)
+ {
+ postDelete(exoUser);
+ }
+ cache_.remove(userName);
+ return exoUser;
+ }
+
+ //
+ public User findUserByName(String userName) throws Exception
+ {
+ IdentitySession session = service_.getIdentitySession();
+
+ User user = (User)cache_.get(userName);
+ if (user != null)
+ {
+ return user;
+ }
+ user = getPopulatedUser(userName, session);
+ if (user != null)
+ {
+ cache_.put(userName, user);
+ }
+ return user;
+ }
+
+ public LazyPageList getUserPageList(int pageSize) throws Exception
+ {
+ UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
+
+ return new LazyPageList(new IDMUserListAccess(this, service_, qb, pageSize, true), pageSize);
+ }
+
+ //
+ public boolean authenticate(String username, String password) throws Exception
+ {
+ User user = findUserByName(username);
+ if (user == null)
+ {
+ return false;
+ }
+
+ boolean authenticated = false;
+
+ if (orgService.isPasswordAsAttribute())
+ {
+ authenticated = user.getPassword().equals(password);
+ }
+ else
+ {
+ IdentitySession session = service_.getIdentitySession();
+ org.picketlink.idm.api.User idmUser = session.getPersistenceManager().findUser(user.getUserName());
+
+ authenticated = session.getAttributesManager().validatePassword(idmUser, password);
+ }
+
+ if (authenticated)
+ {
+ UserImpl userImpl = (UserImpl)user;
+ userImpl.setLastLoginTime(Calendar.getInstance().getTime());
+ saveUser(userImpl, false);
+ }
+ return authenticated;
+ }
+
+ public LazyPageList findUsers(Query q) throws Exception
+ {
+
+ UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
+
+ if (q.getUserName() != null)
+ {
+ qb.idFilter(q.getUserName());
+ }
+ if (q.getEmail() != null)
+ {
+ qb.attributeValuesFilter(UserDAOImpl.USER_EMAIL, new String[]{q.getEmail()});
+ }
+ if (q.getFirstName() != null)
+ {
+ qb.attributeValuesFilter(UserDAOImpl.USER_FIRST_NAME, new String[]{q.getFirstName()});
+ }
+
+ //TODO: from/to login date
+
+ if (q.getLastName() != null)
+ {
+ qb.attributeValuesFilter(UserDAOImpl.USER_LAST_NAME, new String[]{q.getLastName()});
+ }
+
+ return new LazyPageList(new IDMUserListAccess(this, service_, qb, 20, false), 20);
+ }
+
+ //
+ public LazyPageList findUsersByGroup(String groupId) throws Exception
+ {
+ UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
+
+ org.picketlink.idm.api.Group jbidGroup = orgService.getJBIDMGroup(groupId);
+
+ qb.addRelatedGroup(jbidGroup);
+
+ return new LazyPageList(new IDMUserListAccess(this, service_, qb, 20, false), 20);
+ }
+
+ //
+
+ private void preSave(User user, boolean isNew) throws Exception
+ {
+ for (UserEventListener listener : listeners_)
+ {
+ listener.preSave(user, isNew);
+ }
+ }
+
+ private void postSave(User user, boolean isNew) throws Exception
+ {
+ for (UserEventListener listener : listeners_)
+ {
+ listener.postSave(user, isNew);
+ }
+ }
+
+ private void preDelete(User user) throws Exception
+ {
+ for (UserEventListener listener : listeners_)
+ {
+ listener.preDelete(user);
+ }
+ }
+
+ private void postDelete(User user) throws Exception
+ {
+ for (UserEventListener listener : listeners_)
+ {
+ listener.postDelete(user);
+ }
+ }
+
+ public void persistUserInfo(User user, IdentitySession session) throws Exception
+ {
+
+ AttributesManager am = session.getAttributesManager();
+
+ ArrayList attributes = new ArrayList();
+
+ if (user.getCreatedDate() != null)
+ {
+ attributes.add(new SimpleAttribute(USER_CREATED_DATE, dateFormat.format(user.getCreatedDate())));
+ }
+ if (user.getLastLoginTime() != null)
+ {
+ attributes.add(new SimpleAttribute(USER_LAST_LOGIN_TIME, dateFormat.format(user.getLastLoginTime())));
+ }
+ if (user.getEmail() != null)
+ {
+ attributes.add(new SimpleAttribute(USER_EMAIL, user.getEmail()));
+ }
+ if (user.getFirstName() != null)
+ {
+ attributes.add(new SimpleAttribute(USER_FIRST_NAME, user.getFirstName()));
+ }
+ if (user.getLastName() != null)
+ {
+ attributes.add(new SimpleAttribute(USER_LAST_NAME, user.getLastName()));
+ }
+ if (user.getOrganizationId() != null)
+ {
+ attributes.add(new SimpleAttribute(USER_ORGANIZATION_ID, user.getOrganizationId()));
+ }
+ if (user.getPassword() != null)
+ {
+ if (orgService.isPasswordAsAttribute())
+ {
+ attributes.add(new SimpleAttribute(USER_PASSWORD, user.getPassword()));
+ }
+ else
+ {
+ am.updatePassword(session.getPersistenceManager().findUser(user.getUserName()), user.getPassword());
+ }
+ }
+
+ Attribute[] attrs = new Attribute[attributes.size()];
+ attrs = (Attribute[])attributes.toArray(attrs);
+ am.addAttributes(user.getUserName(), attrs);
+ }
+
+ public static User getPopulatedUser(String userName, IdentitySession session) throws Exception
+ {
+
+ if (session.getPersistenceManager().findUser(userName) == null)
+ {
+ return null;
+ }
+
+ AttributesManager am = session.getAttributesManager();
+
+ Map<String, Attribute> attrs = am.getAttributes(userName);
+
+ User user = new UserImpl(userName);
+
+ if (attrs == null)
+ {
+
+ return user;
+ }
+ else
+ {
+ if (attrs.containsKey(USER_CREATED_DATE))
+ {
+ user.setCreatedDate(dateFormat.parse(attrs.get(USER_CREATED_DATE).getValue().toString()));
+ }
+ if (attrs.containsKey(USER_EMAIL))
+ {
+ user.setEmail(attrs.get(USER_EMAIL).getValue().toString());
+ }
+ if (attrs.containsKey(USER_FIRST_NAME))
+ {
+ user.setFirstName(attrs.get(USER_FIRST_NAME).getValue().toString());
+ }
+ if (attrs.containsKey(USER_LAST_LOGIN_TIME))
+ {
+ user.setLastLoginTime(dateFormat.parse(attrs.get(USER_LAST_LOGIN_TIME).getValue().toString()));
+ }
+ if (attrs.containsKey(USER_LAST_NAME))
+ {
+ user.setLastName(attrs.get(USER_LAST_NAME).getValue().toString());
+ }
+ if (attrs.containsKey(USER_ORGANIZATION_ID))
+ {
+ user.setOrganizationId(attrs.get(USER_ORGANIZATION_ID).getValue().toString());
+ }
+ if (attrs.containsKey(USER_PASSWORD))
+ {
+ user.setPassword(attrs.get(USER_PASSWORD).getValue().toString());
+ }
+ }
+
+ return user;
+
+ }
+
+}
Deleted: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -1,286 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.services.organization.idm;
-
-import org.exoplatform.services.cache.CacheService;
-import org.exoplatform.services.cache.ExoCache;
-import org.exoplatform.services.organization.UserProfile;
-import org.exoplatform.services.organization.UserProfileEventListener;
-import org.exoplatform.services.organization.UserProfileHandler;
-import org.exoplatform.services.organization.impl.UserProfileImpl;
-import org.picketlink.idm.api.Attribute;
-import org.picketlink.idm.api.IdentitySession;
-import org.picketlink.idm.impl.api.SimpleAttribute;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-public class UserProfileDAOImpl implements UserProfileHandler
-{
-
- static private UserProfile NOT_FOUND = new UserProfileImpl();
-
- private PicketLinkIDMService service_;
-
- private ExoCache cache_;
-
- private List<UserProfileEventListener> listeners_;
-
- private PicketLinkIDMOrganizationServiceImpl orgService;
-
- public UserProfileDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service, CacheService cservice)
- throws Exception
- {
- service_ = service;
- cache_ = cservice.getCacheInstance(getClass().getName());
- listeners_ = new ArrayList<UserProfileEventListener>(3);
- this.orgService = orgService;
- }
-
- public void addUserProfileEventListener(UserProfileEventListener listener)
- {
- listeners_.add(listener);
- }
-
- final public UserProfile createUserProfileInstance()
- {
- return new UserProfileImpl();
- }
-
- public UserProfile createUserProfileInstance(String userName)
- {
- return new UserProfileImpl(userName);
- }
-
- // void createUserProfileEntry(UserProfile up, IdentitySession session) throws Exception
- // {
- // UserProfileData upd = new UserProfileData();
- // upd.setUserProfile(up);
- // session.save(upd);
- // session.flush();
- // cache_.remove(up.getUserName());
- // }
-
- public void saveUserProfile(UserProfile profile, boolean broadcast) throws Exception
- {
-
- if (broadcast)
- {
- preSave(profile, true);
- }
-
- setProfile(profile.getUserName(), profile);
-
- if (broadcast)
- {
- postSave(profile, true);
- }
-
- cache_.put(profile.getUserName(), profile);
-
- }
-
- public UserProfile removeUserProfile(String userName, boolean broadcast) throws Exception
- {
- UserProfile profile = getProfile(userName);
-
- if (profile != null)
- {
- try
- {
- if (broadcast)
- {
- preDelete(profile);
- }
-
- removeProfile(userName, profile);
-
- if (broadcast)
- {
- postDelete(profile);
- }
- cache_.remove(userName);
- return profile;
- }
- catch (Exception exp)
- {
- return null;
- }
- }
- cache_.remove(userName);
- return null;
- }
-
- public UserProfile findUserProfileByName(String userName) throws Exception
- {
-
- org.picketlink.idm.api.User foundUser = getIdentitySession().getPersistenceManager().findUser(userName);
-
- if (foundUser == null)
- {
- return null;
- }
-
- UserProfile up = (UserProfile)cache_.get(userName);
- if (up == null)
- {
- up = getProfile(userName);
- }
-
- //
- if (up == null)
- {
- up = NOT_FOUND;
- }
-
- //
- cache_.put(userName, up);
-
- // Just to avoid to return a shared object between many threads
- // that would not be thread safe nor corrct
- if (up == NOT_FOUND)
- {
- // julien : integration bug fix
- // Return an empty profile to avoid NPE in portal
- // Should clarify what do do (maybe portal should care about returned value)
- UserProfileImpl profile = new UserProfileImpl();
- profile.setUserName(userName);
- return profile;
- }
- else
- {
- return up;
- }
- }
-
- public Collection findUserProfiles() throws Exception
- {
- return null;
- }
-
- private void preSave(UserProfile profile, boolean isNew) throws Exception
- {
- for (UserProfileEventListener listener : listeners_)
- {
- listener.preSave(profile, isNew);
- }
- }
-
- private void postSave(UserProfile profile, boolean isNew) throws Exception
- {
- for (UserProfileEventListener listener : listeners_)
- {
- listener.postSave(profile, isNew);
- }
- }
-
- private void preDelete(UserProfile profile) throws Exception
- {
- for (UserProfileEventListener listener : listeners_)
- {
- listener.preDelete(profile);
- }
- }
-
- private void postDelete(UserProfile profile) throws Exception
- {
- for (UserProfileEventListener listener : listeners_)
- {
- listener.postDelete(profile);
- }
- }
-
- public UserProfile getProfile(String userName) throws Exception
- {
- if (getIdentitySession().getPersistenceManager().findUser(userName) == null)
- {
- return null;
- }
-
- Map<String, Attribute> attrs = getIdentitySession().getAttributesManager().getAttributes(userName);
-
- if (attrs == null || attrs.isEmpty())
- {
- return null;
- }
-
- Map<String, String> filteredAttrs = new HashMap<String, String>();
-
- for (String key : attrs.keySet())
- {
- // Check if attribute is part of User interface data
- if (!UserDAOImpl.USER_NON_PROFILE_KEYS.contains(key))
- {
- filteredAttrs.put(key, attrs.get(key).getValue().toString());
- }
-
- }
-
- if (filteredAttrs.isEmpty())
- {
- return null;
- }
-
- UserProfile profile = new UserProfileImpl(userName, filteredAttrs);
-
- return profile;
-
- }
-
- public void setProfile(String userName, UserProfile profile) throws Exception
- {
-
- Map<String, String> profileAttrs = profile.getUserInfoMap();
-
- Set<Attribute> attrs = new HashSet<Attribute>();
-
- for (Map.Entry<String, String> entry : profileAttrs.entrySet())
- {
- attrs.add(new SimpleAttribute(entry.getKey(), entry.getValue()));
- }
-
- Attribute[] attrArray = new Attribute[attrs.size()];
- attrArray = attrs.toArray(attrArray);
-
- getIdentitySession().getAttributesManager().updateAttributes(userName, attrArray);
-
- }
-
- public void removeProfile(String userName, UserProfile profile) throws Exception
- {
- Map<String, String> profileAttrs = profile.getUserInfoMap();
-
- String[] attrKeys = new String[profileAttrs.keySet().size()];
-
- attrKeys = profileAttrs.keySet().toArray(attrKeys);
-
- getIdentitySession().getAttributesManager().removeAttributes(userName, attrKeys);
- }
-
- private IdentitySession getIdentitySession() throws Exception
- {
- return service_.getIdentitySession();
- }
-}
Copied: portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java (from rev 804, portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java)
===================================================================
--- portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java (rev 0)
+++ portal/branches/wsrp-integration/component/identity/src/main/java/org/exoplatform/services/organization/idm/UserProfileDAOImpl.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -0,0 +1,286 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.services.organization.idm;
+
+import org.exoplatform.services.cache.CacheService;
+import org.exoplatform.services.cache.ExoCache;
+import org.exoplatform.services.organization.UserProfile;
+import org.exoplatform.services.organization.UserProfileEventListener;
+import org.exoplatform.services.organization.UserProfileHandler;
+import org.exoplatform.services.organization.impl.UserProfileImpl;
+import org.picketlink.idm.api.Attribute;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.impl.api.SimpleAttribute;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+public class UserProfileDAOImpl implements UserProfileHandler
+{
+
+ static private UserProfile NOT_FOUND = new UserProfileImpl();
+
+ private PicketLinkIDMService service_;
+
+ private ExoCache cache_;
+
+ private List<UserProfileEventListener> listeners_;
+
+ private PicketLinkIDMOrganizationServiceImpl orgService;
+
+ public UserProfileDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service, CacheService cservice)
+ throws Exception
+ {
+ service_ = service;
+ cache_ = cservice.getCacheInstance(getClass().getName());
+ listeners_ = new ArrayList<UserProfileEventListener>(3);
+ this.orgService = orgService;
+ }
+
+ public void addUserProfileEventListener(UserProfileEventListener listener)
+ {
+ listeners_.add(listener);
+ }
+
+ final public UserProfile createUserProfileInstance()
+ {
+ return new UserProfileImpl();
+ }
+
+ public UserProfile createUserProfileInstance(String userName)
+ {
+ return new UserProfileImpl(userName);
+ }
+
+ // void createUserProfileEntry(UserProfile up, IdentitySession session) throws Exception
+ // {
+ // UserProfileData upd = new UserProfileData();
+ // upd.setUserProfile(up);
+ // session.save(upd);
+ // session.flush();
+ // cache_.remove(up.getUserName());
+ // }
+
+ public void saveUserProfile(UserProfile profile, boolean broadcast) throws Exception
+ {
+
+ if (broadcast)
+ {
+ preSave(profile, true);
+ }
+
+ setProfile(profile.getUserName(), profile);
+
+ if (broadcast)
+ {
+ postSave(profile, true);
+ }
+
+ cache_.put(profile.getUserName(), profile);
+
+ }
+
+ public UserProfile removeUserProfile(String userName, boolean broadcast) throws Exception
+ {
+ UserProfile profile = getProfile(userName);
+
+ if (profile != null)
+ {
+ try
+ {
+ if (broadcast)
+ {
+ preDelete(profile);
+ }
+
+ removeProfile(userName, profile);
+
+ if (broadcast)
+ {
+ postDelete(profile);
+ }
+ cache_.remove(userName);
+ return profile;
+ }
+ catch (Exception exp)
+ {
+ return null;
+ }
+ }
+ cache_.remove(userName);
+ return null;
+ }
+
+ public UserProfile findUserProfileByName(String userName) throws Exception
+ {
+
+ org.picketlink.idm.api.User foundUser = getIdentitySession().getPersistenceManager().findUser(userName);
+
+ if (foundUser == null)
+ {
+ return null;
+ }
+
+ UserProfile up = (UserProfile)cache_.get(userName);
+ if (up == null)
+ {
+ up = getProfile(userName);
+ }
+
+ //
+ if (up == null)
+ {
+ up = NOT_FOUND;
+ }
+
+ //
+ cache_.put(userName, up);
+
+ // Just to avoid to return a shared object between many threads
+ // that would not be thread safe nor corrct
+ if (up == NOT_FOUND)
+ {
+ // julien : integration bug fix
+ // Return an empty profile to avoid NPE in portal
+ // Should clarify what do do (maybe portal should care about returned value)
+ UserProfileImpl profile = new UserProfileImpl();
+ profile.setUserName(userName);
+ return profile;
+ }
+ else
+ {
+ return up;
+ }
+ }
+
+ public Collection findUserProfiles() throws Exception
+ {
+ return null;
+ }
+
+ private void preSave(UserProfile profile, boolean isNew) throws Exception
+ {
+ for (UserProfileEventListener listener : listeners_)
+ {
+ listener.preSave(profile, isNew);
+ }
+ }
+
+ private void postSave(UserProfile profile, boolean isNew) throws Exception
+ {
+ for (UserProfileEventListener listener : listeners_)
+ {
+ listener.postSave(profile, isNew);
+ }
+ }
+
+ private void preDelete(UserProfile profile) throws Exception
+ {
+ for (UserProfileEventListener listener : listeners_)
+ {
+ listener.preDelete(profile);
+ }
+ }
+
+ private void postDelete(UserProfile profile) throws Exception
+ {
+ for (UserProfileEventListener listener : listeners_)
+ {
+ listener.postDelete(profile);
+ }
+ }
+
+ public UserProfile getProfile(String userName) throws Exception
+ {
+ if (getIdentitySession().getPersistenceManager().findUser(userName) == null)
+ {
+ return null;
+ }
+
+ Map<String, Attribute> attrs = getIdentitySession().getAttributesManager().getAttributes(userName);
+
+ if (attrs == null || attrs.isEmpty())
+ {
+ return null;
+ }
+
+ Map<String, String> filteredAttrs = new HashMap<String, String>();
+
+ for (String key : attrs.keySet())
+ {
+ // Check if attribute is part of User interface data
+ if (!UserDAOImpl.USER_NON_PROFILE_KEYS.contains(key))
+ {
+ filteredAttrs.put(key, attrs.get(key).getValue().toString());
+ }
+
+ }
+
+ if (filteredAttrs.isEmpty())
+ {
+ return null;
+ }
+
+ UserProfile profile = new UserProfileImpl(userName, filteredAttrs);
+
+ return profile;
+
+ }
+
+ public void setProfile(String userName, UserProfile profile) throws Exception
+ {
+
+ Map<String, String> profileAttrs = profile.getUserInfoMap();
+
+ Set<Attribute> attrs = new HashSet<Attribute>();
+
+ for (Map.Entry<String, String> entry : profileAttrs.entrySet())
+ {
+ attrs.add(new SimpleAttribute(entry.getKey(), entry.getValue()));
+ }
+
+ Attribute[] attrArray = new Attribute[attrs.size()];
+ attrArray = attrs.toArray(attrArray);
+
+ getIdentitySession().getAttributesManager().updateAttributes(userName, attrArray);
+
+ }
+
+ public void removeProfile(String userName, UserProfile profile) throws Exception
+ {
+ Map<String, String> profileAttrs = profile.getUserInfoMap();
+
+ String[] attrKeys = new String[profileAttrs.keySet().size()];
+
+ attrKeys = profileAttrs.keySet().toArray(attrKeys);
+
+ getIdentitySession().getAttributesManager().removeAttributes(userName, attrKeys);
+ }
+
+ private IdentitySession getIdentitySession() throws Exception
+ {
+ return service_.getIdentitySession();
+ }
+}
Modified: portal/branches/wsrp-integration/component/identity/src/test/java/conf/portal/idm-configuration.xml
===================================================================
--- portal/branches/wsrp-integration/component/identity/src/test/java/conf/portal/idm-configuration.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/identity/src/test/java/conf/portal/idm-configuration.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -25,54 +25,54 @@
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
<component>
- <key>org.exoplatform.services.organization.jbidm.JBossIDMService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</type>
+ <key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
<init-params>
<value-param>
<name>config</name>
<value>jar:/conf/portal/idm-config.xml</value>
</value-param>
- <values-param>
- <name>hibernate.annotations</name>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
- </values-param>
- <properties-param>
- <name>hibernate.properties</name>
- <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
- <property name="hibernate.current_session_context_class" value="thread"/>
- <property name="hibernate.show_sql" value="false"/>
- <property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
- <property name="hibernate.connection.url" value="jdbc:hsqldb:file:target/temp/data/exodb"/>
- <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
- <property name="hibernate.connection.autocommit" value="true"/>
- <property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value=""/>
- <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
- <property name="hibernate.c3p0.min_size" value="5"/>
- <property name="hibernate.c3p0.max_size" value="20"/>
- <property name="hibernate.c3p0.timeout" value="1800"/>
- <property name="hibernate.c3p0.max_statements" value="50"/>
- </properties-param>
-
</init-params>
</component>
<component>
<key>org.exoplatform.services.organization.OrganizationService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</type>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
</component>
+ <component>
+ <key>org.exoplatform.services.database.HibernateService</key>
+ <jmx-name>database:type=HibernateService</jmx-name>
+ <type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>
+ <init-params>
+ <properties-param>
+ <name>hibernate.properties</name>
+ <description>Default Hibernate Service</description>
+ <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+ <!--<property name="hibernate.show_sql" value="true"/>-->
+ <!--<property name="hibernate.use_sql_comments" value="true"/>-->
+ <!--<property name="hibernate.format_sql" value="true"/>-->
+ <property name="hibernate.current_session_context_class" value="thread"/>
+ <property name="hibernate.jdbc.batch_size" value="0"/>
+ <property name="hibernate.cache.use_second_level_cache" value="true"/>
+ <property name="hibernate.cache.use_query_cache" value="true"/>
+ <!--CHANGEME HashtableCacheProvider shold not be used in production env-->
+ <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
+ <property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
+ <property name="hibernate.connection.url" value="jdbc:hsqldb:file:../temp/data/exodb${container.name.suffix}"/>
+ <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
+ <property name="hibernate.connection.autocommit" value="true"/>
+ <property name="hibernate.connection.username" value="sa"/>
+ <property name="hibernate.connection.password" value=""/>
+ <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
+ <property name="hibernate.c3p0.min_size" value="5"/>
+ <property name="hibernate.c3p0.max_size" value="20"/>
+ <property name="hibernate.c3p0.timeout" value="1800"/>
+ <property name="hibernate.c3p0.max_statements" value="50"/>
+ </properties-param>
+ </init-params>
+ </component>
+
<external-component-plugins>
<target-component>org.exoplatform.services.database.HibernateService</target-component>
<component-plugin>
@@ -81,19 +81,18 @@
<type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
<init-params>
<values-param>
- <name>hibernate.annotations</name>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
+ <name>hibernate.mapping</name>
+ <value>mappings/HibernateRealm.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObject.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredential.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
</values-param>
</init-params>
</component-plugin>
Modified: portal/branches/wsrp-integration/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java
===================================================================
--- portal/branches/wsrp-integration/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -173,6 +173,7 @@
// newly created 'test' and 'demo'
assertEquals(2, piterator.currentPage().size());
+// membershipHandler_.removeMembershipByUser(USER,false);
userHandler_.removeUser(USER, true);
piterator = userHandler_.getUserPageList(10);
// one 'demo'
@@ -436,19 +437,20 @@
groupHandler_.removeGroup(group3, true);
}
- public void testUserProfileListener() throws Exception
- {
- UserProfileListener l = new UserProfileListener();
- profileHandler_.addUserProfileEventListener(l);
- User user = createUser(USER);
- assertNotNull(user);
- UserProfile profile = profileHandler_.createUserProfileInstance(user.getUserName());
- profile.setAttribute("blah", "blah");
- profileHandler_.saveUserProfile(profile, true);
- assertTrue(l.preSave && l.postSave);
- profileHandler_.removeUserProfile(user.getUserName(), true);
- assertFalse(l.preDelete && l.postDelete);
- }
+// public void testUserProfileListener() throws Exception
+// {
+// UserProfileListener l = new UserProfileListener();
+// profileHandler_.addUserProfileEventListener(l);
+// User user = createUser(USER);
+// assertNotNull(user);
+// UserProfile profile = profileHandler_.createUserProfileInstance(user.getUserName());
+// profile.setAttribute("blah", "blah");
+// profileHandler_.saveUserProfile(profile, true);
+// assertTrue(l.preSave && l.postSave);
+// profileHandler_.removeUserProfile(user.getUserName(), true);
+// assertFalse(l.preDelete && l.postDelete);
+// userHandler_.removeUser(user.getUserName(), false);
+// }
public void testFindUsersByGroupId() throws Exception
{
Modified: portal/branches/wsrp-integration/component/pc/pom.xml
===================================================================
--- portal/branches/wsrp-integration/component/pc/pom.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/pc/pom.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -89,6 +89,11 @@
</exclusions>
</dependency>
<dependency>
+ <groupId>org.gatein.pc</groupId>
+ <artifactId>pc-bridge</artifactId>
+ <version>${org.gatein.pc.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-wci</artifactId>
<version>${org.gatein.wci.version}</version>
Modified: portal/branches/wsrp-integration/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java
===================================================================
--- portal/branches/wsrp-integration/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/pc/src/main/java/org/exoplatform/portal/pc/ExoKernelIntegration.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -21,7 +21,9 @@
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.services.resources.ResourceBundleService;
import org.gatein.pc.api.PortletInvoker;
+import org.gatein.pc.bridge.BridgeInterceptor;
import org.gatein.pc.federation.FederatingPortletInvoker;
import org.gatein.pc.federation.impl.FederatingPortletInvokerService;
import org.gatein.pc.mc.PortletApplicationDeployer;
@@ -56,13 +58,20 @@
/** Exo Context */
private final ExoContainer container;
+ /** DO NOT REMOVE ME, OTHERWISE YOU'LL BREAK THINGS. */
+ private final ResourceBundleService resourceBundleService;
+
/**
* We enforce the dependency with the ResourceBundleService since it must be stared before the
* <code>portletApplicationRegistry</code>
+ *
+ * @param context the exo container context
+ * @param resourceBundleService the resource bundle service that is here for the sake of creating a dependency
*/
- public ExoKernelIntegration(ExoContainerContext context)
+ public ExoKernelIntegration(ExoContainerContext context, ResourceBundleService resourceBundleService)
{
this.container = context.getContainer();
+ this.resourceBundleService = resourceBundleService;
}
public void start()
@@ -83,8 +92,10 @@
requestAttributeConversationInterceptor.setNext(eventPayloadInterceptor);
CCPPInterceptor ccppInterceptor = new CCPPInterceptor();
ccppInterceptor.setNext(requestAttributeConversationInterceptor);
+ BridgeInterceptor bridgepInterceptor = new BridgeInterceptor();
+ bridgepInterceptor.setNext(ccppInterceptor);
ProducerCacheInterceptor producerCacheInterceptor = new ProducerCacheInterceptor();
- producerCacheInterceptor.setNext(ccppInterceptor);
+ producerCacheInterceptor.setNext(bridgepInterceptor);
ContextDispatcherInterceptor contextDispatcherInterceptor = new ContextDispatcherInterceptor();
contextDispatcherInterceptor.setNext(producerCacheInterceptor);
SecureTransportInterceptor secureTransportInterceptor = new SecureTransportInterceptor();
Modified: portal/branches/wsrp-integration/component/portal/pom.xml
===================================================================
--- portal/branches/wsrp-integration/component/portal/pom.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/portal/pom.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -82,11 +82,18 @@
</dependency>
<dependency>
- <groupId>org.jboss.identity.idm</groupId>
- <artifactId>idm-core</artifactId>
- <version>${org.jboss.identity.idm}</version>
+ <groupId>org.picketlink.idm</groupId>
+ <artifactId>picketlink-idm-core</artifactId>
+ <version>${org.picketlink.idm}</version>
</dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>${javax.servlet.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
</dependencies>
<build>
Modified: portal/branches/wsrp-integration/component/portal/src/main/java/conf/portal/portal-nodetypes.xml
===================================================================
--- portal/branches/wsrp-integration/component/portal/src/main/java/conf/portal/portal-nodetypes.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/portal/src/main/java/conf/portal/portal-nodetypes.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -91,6 +91,46 @@
</propertyDefinitions>
</nodeType>
+ <nodeType name="mop:portletpreferences" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:customizationstate</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="mop:portletpreference" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:portletpreference</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:portletpreference" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="value" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="readonly" requiredType="Boolean" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:gadget" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:customizationstate</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="prefs" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
<nodeType name="mop:wsrpstate" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
<supertypes>
<supertype>mop:customizationstate</supertype>
Modified: portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/config/RemoveGroupPortalConfigListener.java
===================================================================
--- portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/config/RemoveGroupPortalConfigListener.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/config/RemoveGroupPortalConfigListener.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -24,7 +24,7 @@
import org.exoplatform.services.listener.Event;
import org.exoplatform.services.listener.Listener;
import org.exoplatform.services.organization.Group;
-import org.exoplatform.services.organization.jdbc.GroupDAOImpl;
+import org.exoplatform.services.organization.GroupHandler;
/**
* Created by The eXo Platform SARL
@@ -32,11 +32,11 @@
* tung.pham(a)exoplatform.com
* Jul 31, 2007
*/
-public class RemoveGroupPortalConfigListener extends Listener<GroupDAOImpl, Group>
+public class RemoveGroupPortalConfigListener extends Listener<GroupHandler, Group>
{
@Override
- public void onEvent(Event<GroupDAOImpl, Group> event) throws Exception
+ public void onEvent(Event<GroupHandler, Group> event) throws Exception
{
Group group = event.getData();
ExoContainer container = ExoContainerContext.getCurrentContainer();
Modified: portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/config/RemoveUserPortalConfigListener.java
===================================================================
--- portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/config/RemoveUserPortalConfigListener.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/config/RemoveUserPortalConfigListener.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -24,7 +24,7 @@
import org.exoplatform.services.listener.Event;
import org.exoplatform.services.listener.Listener;
import org.exoplatform.services.organization.User;
-import org.exoplatform.services.organization.jdbc.UserDAOImpl;
+import org.exoplatform.services.organization.UserHandler;
/**
* Created by The eXo Platform SARL
@@ -32,11 +32,11 @@
* tung.pham(a)exoplatform.com
* Aug 1, 2007
*/
-public class RemoveUserPortalConfigListener extends Listener<UserDAOImpl, User>
+public class RemoveUserPortalConfigListener extends Listener<UserHandler, User>
{
@Override
- public void onEvent(Event<UserDAOImpl, User> event) throws Exception
+ public void onEvent(Event<UserHandler, User> event) throws Exception
{
User user = event.getData();
ExoContainer container = ExoContainerContext.getCurrentContainer();
Modified: portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java
===================================================================
--- portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -30,8 +30,8 @@
import org.exoplatform.portal.pom.spi.gadget.GadgetState;
import org.exoplatform.portal.pom.spi.portlet.Portlet;
import org.exoplatform.portal.pom.spi.portlet.PortletContentProvider;
+import org.exoplatform.portal.pom.spi.portlet.PortletState;
import org.exoplatform.portal.pom.spi.portlet.PreferenceState;
-import org.exoplatform.portal.pom.spi.portlet.PortletState;
import org.exoplatform.portal.pom.spi.wsrp.WSRP;
import org.exoplatform.portal.pom.spi.wsrp.WSRPContentProvider;
import org.exoplatform.portal.pom.spi.wsrp.WSRPState;
Copied: portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/config/PortalMOPService.java (from rev 804, portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/PortalMOPService.java)
===================================================================
--- portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/config/PortalMOPService.java (rev 0)
+++ portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/config/PortalMOPService.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2003-2007 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.portal.pom.config;
+
+import org.chromattic.api.ChromatticBuilder;
+import org.chromattic.apt.InstrumentorImpl;
+import org.exoplatform.portal.pom.registry.CategoryDefinition;
+import org.exoplatform.portal.pom.registry.ContentDefinition;
+import org.exoplatform.portal.pom.registry.ContentRegistry;
+import org.exoplatform.portal.pom.spi.gadget.Gadget;
+import org.exoplatform.portal.pom.spi.gadget.GadgetContentProvider;
+import org.exoplatform.portal.pom.spi.gadget.GadgetState;
+import org.exoplatform.portal.pom.spi.portlet.Portlet;
+import org.exoplatform.portal.pom.spi.portlet.PortletContentProvider;
+import org.exoplatform.portal.pom.spi.portlet.PortletState;
+import org.exoplatform.portal.pom.spi.portlet.PreferenceState;
+import org.exoplatform.portal.pom.spi.wsrp.WSRP;
+import org.exoplatform.portal.pom.spi.wsrp.WSRPContentProvider;
+import org.exoplatform.portal.pom.spi.wsrp.WSRPState;
+import org.gatein.mop.core.api.MOPService;
+import org.gatein.mop.core.api.content.ContentManagerRegistry;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class PortalMOPService extends MOPService
+{
+
+ @Override
+ protected void configure(ChromatticBuilder builder)
+ {
+ builder.setOption(ChromatticBuilder.SESSION_LIFECYCLE_CLASSNAME, PortalSessionLifeCycle.class.getName());
+ builder.setOption(ChromatticBuilder.INSTRUMENTOR_CLASSNAME, InstrumentorImpl.class.getName());
+
+ //
+ builder.add(PortletState.class);
+ builder.add(PreferenceState.class);
+ builder.add(GadgetState.class);
+ builder.add(WSRPState.class);
+
+ //
+ builder.add(ContentRegistry.class);
+ builder.add(CategoryDefinition.class);
+ builder.add(ContentDefinition.class);
+ }
+
+ @Override
+ protected void configure(ContentManagerRegistry registry)
+ {
+ registry.register(Portlet.CONTENT_TYPE, new PortletContentProvider());
+ registry.register(Gadget.CONTENT_TYPE, new GadgetContentProvider());
+ registry.register(WSRP.CONTENT_TYPE, new WSRPContentProvider());
+ }
+}
Modified: portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java
===================================================================
--- portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/data/Mapper.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -23,7 +23,6 @@
import org.exoplatform.portal.config.model.ApplicationState;
import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.config.model.CloneApplicationState;
-import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.config.model.PersistentApplicationState;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.config.model.TransientApplicationState;
@@ -216,6 +215,7 @@
}
//
+ final List<String> orders = new ArrayList<String>();
Set<String> savedSet = new HashSet<String>();
for (NavigationNodeData node : src.getNodes())
{
@@ -236,6 +236,7 @@
}
save(node, dstChild);
savedSet.add(srcId);
+ orders.add(dstChild.getObjectId());
}
for (Iterator<? extends Navigation> i = dst.getChildren().iterator(); i.hasNext();)
{
@@ -245,6 +246,22 @@
i.remove();
}
}
+ // Now sort children according to the order provided by the container
+ // need to replace that with Collections.sort once the set(int index, E element) is implemented in Chromattic lists
+ Navigation[] a = dst.getChildren().toArray(new Navigation[dst.getChildren().size()]);
+ Arrays.sort(a, new Comparator<Navigation>()
+ {
+ public int compare(Navigation o1, Navigation o2)
+ {
+ int i1 = orders.indexOf(o1.getObjectId());
+ int i2 = orders.indexOf(o2.getObjectId());
+ return i1 - i2;
+ }
+ });
+ for (int j = 0; j < a.length; j++)
+ {
+ dst.getChildren().add(j, a[j]);
+ }
}
public PortalData load(Site src)
Modified: portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/spi/gadget/GadgetContentProvider.java
===================================================================
--- portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/spi/gadget/GadgetContentProvider.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/spi/gadget/GadgetContentProvider.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -22,7 +22,6 @@
import org.exoplatform.portal.pom.spi.ContentProviderHelper;
import org.exoplatform.portal.pom.spi.HelpableContentProvider;
import org.gatein.mop.spi.content.ContentProvider;
-import org.gatein.mop.spi.content.GetState;
import org.gatein.mop.spi.content.StateContainer;
import java.util.List;
@@ -34,11 +33,6 @@
public class GadgetContentProvider implements ContentProvider<Gadget>, HelpableContentProvider<GadgetState, Gadget>
{
- public GetState<Gadget> getState(String contentId)
- {
- throw new UnsupportedOperationException();
- }
-
public Gadget combine(List<Gadget> states)
{
throw new UnsupportedOperationException();
Modified: portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/spi/portlet/PortletContentProvider.java
===================================================================
--- portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/spi/portlet/PortletContentProvider.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/spi/portlet/PortletContentProvider.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -22,7 +22,6 @@
import org.exoplatform.portal.pom.spi.ContentProviderHelper;
import org.exoplatform.portal.pom.spi.HelpableContentProvider;
import org.gatein.mop.spi.content.ContentProvider;
-import org.gatein.mop.spi.content.GetState;
import org.gatein.mop.spi.content.StateContainer;
import java.util.HashMap;
@@ -41,11 +40,6 @@
{
}
- public GetState<Portlet> getState(String contentId)
- {
- throw new UnsupportedOperationException();
- }
-
public Portlet combine(List<Portlet> states)
{
Map<String, Preference> entries = new HashMap<String, Preference>();
Modified: portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp/WSRPContentProvider.java
===================================================================
--- portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp/WSRPContentProvider.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp/WSRPContentProvider.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -23,7 +23,6 @@
import org.exoplatform.portal.pom.spi.ContentProviderHelper;
import org.exoplatform.portal.pom.spi.HelpableContentProvider;
import org.gatein.mop.spi.content.ContentProvider;
-import org.gatein.mop.spi.content.GetState;
import org.gatein.mop.spi.content.StateContainer;
import java.io.ByteArrayInputStream;
@@ -36,11 +35,6 @@
public class WSRPContentProvider implements ContentProvider<WSRP>, HelpableContentProvider<WSRPState, WSRP>
{
- public GetState<WSRP> getState(String s)
- {
- throw new UnsupportedOperationException("todo");
- }
-
public WSRP combine(List<WSRP> wsrpStates)
{
throw new UnsupportedOperationException("todo");
Modified: portal/branches/wsrp-integration/component/portal/src/test/java/conf/portal/database-configuration.xml
===================================================================
--- portal/branches/wsrp-integration/component/portal/src/test/java/conf/portal/database-configuration.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/portal/src/test/java/conf/portal/database-configuration.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -33,6 +33,11 @@
<name>hibernate.properties</name>
<description>Default Hibernate Service</description>
<property name="hibernate.show_sql" value="false"/>
+ <property name="hibernate.current_session_context_class" value="thread"/>
+ <property name="hibernate.cache.use_second_level_cache" value="false"/>
+ <property name="hibernate.cache.use_query_cache" value="false"/>
+ <property name="hibernate.jdbc.batch_size" value="0"/>
+ <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
<property name="hibernate.connection.url" value="jdbc:hsqldb:file:target/temp/data/exodb"/>
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
Modified: portal/branches/wsrp-integration/component/portal/src/test/java/conf/portal/idm-configuration.xml
===================================================================
--- portal/branches/wsrp-integration/component/portal/src/test/java/conf/portal/idm-configuration.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/portal/src/test/java/conf/portal/idm-configuration.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -25,52 +25,19 @@
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
<component>
- <key>org.exoplatform.services.organization.jbidm.JBossIDMService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</type>
+ <key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
<init-params>
<value-param>
<name>config</name>
<value>war:/conf/organization/idm-config.xml</value>
</value-param>
- <values-param>
- <name>hibernate.annotations</name>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
- </values-param>
- <properties-param>
- <name>hibernate.properties</name>
- <property name="hibernate.hbm2ddl.auto" value="update"/>
- <property name="hibernate.current_session_context_class" value="thread"/>
- <property name="hibernate.show_sql" value="false"/>
- <property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
- <property name="hibernate.connection.url" value="jdbc:hsqldb:file:target/temp/data/exodb"/>
- <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
- <property name="hibernate.connection.autocommit" value="true"/>
- <property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value=""/>
- <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
- <property name="hibernate.c3p0.min_size" value="5"/>
- <property name="hibernate.c3p0.max_size" value="20"/>
- <property name="hibernate.c3p0.timeout" value="1800"/>
- <property name="hibernate.c3p0.max_statements" value="50"/>
- </properties-param>
-
</init-params>
</component>
<component>
<key>org.exoplatform.services.organization.OrganizationService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</type>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
</component>
<external-component-plugins>
@@ -81,19 +48,18 @@
<type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
<init-params>
<values-param>
- <name>hibernate.annotations</name>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
+ <name>hibernate.mapping</name>
+ <value>mappings/HibernateRealm.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObject.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredential.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
</values-param>
</init-params>
</component-plugin>
Modified: portal/branches/wsrp-integration/component/portal/src/test/java/conf/portal/jcr-configuration.xml
===================================================================
--- portal/branches/wsrp-integration/component/portal/src/test/java/conf/portal/jcr-configuration.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/portal/src/test/java/conf/portal/jcr-configuration.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -79,7 +79,7 @@
<values-param>
<name>autoCreatedInNewRepository</name>
<description>Node types configuration file</description>
- <value>jar:/conf/standalone/nodetypes.xml</value>
+ <value>jar:/conf/mop-nodetypes.xml</value>
<value>jar:/conf/portal/portal-nodetypes.xml</value>
</values-param>
</init-params>
Modified: portal/branches/wsrp-integration/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java
===================================================================
--- portal/branches/wsrp-integration/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/portal/src/test/java/org/exoplatform/portal/config/TestDataStorage.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -19,8 +19,6 @@
package org.exoplatform.portal.config;
-import static org.exoplatform.portal.pom.config.Utils.split;
-
import org.exoplatform.container.PortalContainer;
import org.exoplatform.portal.application.PortletPreferences;
import org.exoplatform.portal.application.Preference;
@@ -29,12 +27,13 @@
import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.config.model.Container;
import org.exoplatform.portal.config.model.Dashboard;
-import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PageNavigation;
+import org.exoplatform.portal.config.model.PageNode;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.config.model.TransientApplicationState;
import org.exoplatform.portal.pom.config.POMSessionManager;
+import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.pom.spi.gadget.Gadget;
import org.exoplatform.portal.pom.spi.portlet.Portlet;
import org.exoplatform.portal.pom.spi.portlet.PortletBuilder;
@@ -44,6 +43,8 @@
import java.util.Collections;
import java.util.List;
+import static org.exoplatform.portal.pom.config.Utils.split;
+
/**
* Created by The eXo Platform SARL Author : Tung Pham thanhtungty(a)gmail.com Nov
* 13, 2007
@@ -294,6 +295,48 @@
assertNull(navigation);
}
+ public void testNavigationOrder() throws Exception
+ {
+ PortalConfig portal = new PortalConfig("portal");
+ portal.setName("test_nav");
+ storage_.create(portal);
+
+ //
+ PageNavigation nav = new PageNavigation();
+ nav.setOwnerType("portal");
+ nav.setOwnerId("test_nav");
+ PageNode node1 = new PageNode();
+ node1.setName("n1");
+ PageNode node2 = new PageNode();
+ node2.setName("n2");
+ PageNode node3 = new PageNode();
+ node3.setName("n3");
+ nav.addNode(node1);
+ nav.addNode(node2);
+ nav.addNode(node3);
+
+ //
+ storage_.save(nav);
+
+ //
+ nav = storage_.getPageNavigation("portal", "test_nav");
+ assertEquals(3, nav.getNodes().size());
+ assertEquals("n1", nav.getNodes().get(0).getName());
+ assertEquals("n2", nav.getNodes().get(1).getName());
+ assertEquals("n3", nav.getNodes().get(2).getName());
+
+ //
+ nav.getNodes().add(0, nav.getNodes().remove(1));
+ storage_.save(nav);
+
+ //
+ nav = storage_.getPageNavigation("portal", "test_nav");
+ assertEquals(3, nav.getNodes().size());
+ assertEquals("n2", nav.getNodes().get(0).getName());
+ assertEquals("n1", nav.getNodes().get(1).getName());
+ assertEquals("n3", nav.getNodes().get(2).getName());
+ }
+
public void testCreatePortletPreferences() throws Exception
{
ArrayList<Preference> prefs = new ArrayList<Preference>();
Modified: portal/branches/wsrp-integration/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java
===================================================================
--- portal/branches/wsrp-integration/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/portal/src/test/java/org/exoplatform/portal/config/TestUserPortalConfigService.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -20,7 +20,6 @@
package org.exoplatform.portal.config;
import junit.framework.AssertionFailedError;
-
import org.exoplatform.container.PortalContainer;
import org.exoplatform.portal.application.PortletPreferences;
import org.exoplatform.portal.config.model.Application;
@@ -43,12 +42,12 @@
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.User;
import org.exoplatform.services.organization.UserHandler;
-import org.exoplatform.services.organization.jbidm.JBossIDMService;
+import org.exoplatform.services.organization.idm.PicketLinkIDMService;
import org.exoplatform.services.security.Authenticator;
import org.exoplatform.services.security.ConversationState;
import org.exoplatform.test.BasicTestCase;
-import org.jboss.identity.idm.api.IdentitySession;
-import org.jboss.identity.idm.common.exception.IdentityException;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.common.exception.IdentityException;
import java.util.Arrays;
import java.util.Collections;
@@ -76,7 +75,7 @@
private DataStorage storage_;
/** . */
- private JBossIDMService idmService;
+ private PicketLinkIDMService idmService;
/** . */
private POMSessionManager mgr;
@@ -122,7 +121,7 @@
userPortalConfigSer_ =
(UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
orgService_ = (OrganizationService)container.getComponentInstanceOfType(OrganizationService.class);
- idmService = (JBossIDMService)container.getComponentInstanceOfType(JBossIDMService.class);
+ idmService = (PicketLinkIDMService)container.getComponentInstanceOfType(PicketLinkIDMService.class);
mgr = (POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
authenticator = (Authenticator)container.getComponentInstanceOfType(Authenticator.class);
listenerService = (ListenerService)container.getComponentInstanceOfType(ListenerService.class);
Modified: portal/branches/wsrp-integration/component/scripting/pom.xml
===================================================================
--- portal/branches/wsrp-integration/component/scripting/pom.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/component/scripting/pom.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -53,13 +53,13 @@
<dependency>
<groupId>rhino</groupId>
<artifactId>js</artifactId>
- <version>1.6R5</version>
+ <version>${rhino.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
- <version>1.5.7</version>
+ <version>${org.codehaus.groovy.version}</version>
</dependency>
</dependencies>
</project>
Copied: portal/branches/wsrp-integration/docs/testing (from rev 804, portal/trunk/docs/testing)
Deleted: portal/branches/wsrp-integration/docs/testing/GateIn_v3.0_BasicPortlets_TestDefinition.ods
===================================================================
(Binary files differ)
Copied: portal/branches/wsrp-integration/docs/testing/GateIn_v3.0_BasicPortlets_TestDefinition.ods (from rev 804, portal/trunk/docs/testing/GateIn_v3.0_BasicPortlets_TestDefinition.ods)
===================================================================
(Binary files differ)
Deleted: portal/branches/wsrp-integration/docs/testing/GateIn_v3.0_MainFucntions_TestDefinition.ods
===================================================================
(Binary files differ)
Copied: portal/branches/wsrp-integration/docs/testing/GateIn_v3.0_MainFucntions_TestDefinition.ods (from rev 804, portal/trunk/docs/testing/GateIn_v3.0_MainFucntions_TestDefinition.ods)
===================================================================
(Binary files differ)
Deleted: portal/branches/wsrp-integration/docs/testing/GateIn_v3.0_SniffTests.ods
===================================================================
(Binary files differ)
Copied: portal/branches/wsrp-integration/docs/testing/GateIn_v3.0_SniffTests.ods (from rev 804, portal/trunk/docs/testing/GateIn_v3.0_SniffTests.ods)
===================================================================
(Binary files differ)
Deleted: portal/branches/wsrp-integration/docs/testing/selenium-suite.zip
===================================================================
(Binary files differ)
Copied: portal/branches/wsrp-integration/docs/testing/selenium-suite.zip (from rev 804, portal/trunk/docs/testing/selenium-suite.zip)
===================================================================
(Binary files differ)
Property changes on: portal/branches/wsrp-integration/docs/user-guide
___________________________________________________________________
Name: svn:ignore
- *.iml
.idea
+ *.iml
.idea
target
Modified: portal/branches/wsrp-integration/docs/user-guide/en/master.xml
===================================================================
--- portal/branches/wsrp-integration/docs/user-guide/en/master.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/docs/user-guide/en/master.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -118,6 +118,9 @@
<!-- Gadgets -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="modules/Gadgets.xml" />
+
+ <!-- Single Sign On -->
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="modules/SSO.xml" />
<!--
Copied: portal/branches/wsrp-integration/docs/user-guide/en/modules/SSO.xml (from rev 804, portal/trunk/docs/user-guide/en/modules/SSO.xml)
===================================================================
--- portal/branches/wsrp-integration/docs/user-guide/en/modules/SSO.xml (rev 0)
+++ portal/branches/wsrp-integration/docs/user-guide/en/modules/SSO.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -0,0 +1,173 @@
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook V4.4//EN" "http://www.oasis-open.org/docbook/sgml/4.4/docbookx.dtd">
+<chapter>
+<title>Single Sign On</title>
+
+ <section>
+ <title>Overview of SSO</title>
+ <para>Portal as an integration and aggregation platform provides some form of SSO by itself. When you log into
+ the portal you gain access to many systems through portlets using a single identity. Still in many cases you
+ need to integrate the portal infrastructure with other SSO enabled systems. There are many different Identity Management
+ solutions on the market. In most cases each SSO framework provides its own way to plug into Java EE application.
+ </para>
+ </section>
+
+ <section>
+ <title>CAS - Central Authentication Service</title>
+ <para>This Single Sign On plugin enables seamless integration between GateIn Portal and the CAS Single Sign On Framework.
+ Details about CAS can be found <ulink url="http://www.ja-sig.org/products/cas/">here</ulink>
+ </para>
+ <section>
+ <title>Integration</title>
+ <section>
+ <title>From source</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Check out the GateIn SSO component from SVN using the following command:
+ <programlisting>
+ <![CDATA[
+svn co http://anonsvn.jboss.org/repos/gatein/components/sso/tags/<appropriate sso component version>
+ ]]>
+ </programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Update <emphasis>packaging/profiles.xml</emphasis> to reflect the directories where your local JBoss AS 5.1.0.GA and Tomcat 6.0.2 are installed
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>Install CAS plugin into a designated CAS (3.3.4) server</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <programlisting>
+ <![CDATA[
+ mvn -Pplugin-cas-install install
+ ]]>
+ </programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>Install CAS GateIn Agent into the designated GateIn server</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <programlisting>
+ <![CDATA[
+ mvn -Pgatein-cas-install install
+ ]]>
+ </programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+ <section>
+ <title>CAS Server Plugin Configuration</title>
+ <para>
+ The CAS Server Plugin makes secure authentication callbacks to a RESTful service installed on the remote GateIn server in order to authenticate a user.
+ In order for the plugin to function correctly, it needs to be properly configured to connect to this service. This configuration is done via the
+ <emphasis>cas.war/WEB-INF/deployerConfigContext.xml</emphasis> file.
+ </para>
+ <para>
+ <programlisting>
+ <![CDATA[
+ <!--
+ Note: Modify the Plugin Configuration based on the actual information of a GateIn instance.
+ The instance can be anywhere on the internet...Not on localhost where CAS is running
+ -->
+ <bean class="org.gatein.sso.cas.plugin.AuthenticationPlugin">
+ <property name="gateInHost"><value>localhost</value></property>
+ <property name="gateInPort"><value>8080</value></property>
+ <property name="gateInContext"><value>portal</value></property>
+ </bean>
+ ]]>
+ </programlisting>
+ </para>
+ </section>
+ <section>
+ <title>GateIn Agent Configuration</title>
+ <para>
+ In a Single Sign On usecase, the GateIn server re-directs all "private" resource requests to the CAS server for authentication first. The CAS server can be
+ located anywhere on the Internet, and this information must be properly configured within the GateIn instance. This configuration needs to be done in 3 files
+ <itemizedlist>
+ <listitem>
+ <emphasis>gatein.ear/02portal.war/groovy/portal/webui/UILoginForm.gtmpl</emphasis>
+ <para>
+ <programlisting>
+ <![CDATA[
+ <script>
+ <%=uicomponent.event("Close");%>
+ window.location = 'http://localhost:8888/cas/login?service=http://localhost:8080/portal/priv...';
+ </script>
+ ]]>
+ </programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <emphasis>gatein.ear/02portal.war/login/jsp/login.jsp</emphasis>
+ <para>
+ <programlisting>
+ <![CDATA[
+ <html>
+ <head>
+ <script type="text/javascript">
+ window.location = 'http://localhost:8888/cas/login?service=http://localhost:8080/portal/priv...';
+ </script>
+ </head>
+ <body>
+ </body>
+ </html>
+ ]]>
+ </programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <emphasis>gatein.ear/02portal.war/WEB-INF/web.xml</emphasis>
+ <para>
+ <programlisting>
+ <![CDATA[
+ <servlet>
+ <servlet-name>InitiateLoginServlet</servlet-name>
+ <servlet-class>org.gatein.sso.agent.GenericSSOAgent</servlet-class>
+ <init-param>
+ <param-name>casServerUrl</param-name>
+ <param-value>http://localhost:8888/cas</param-value>
+ </init-param>
+ </servlet>
+ ]]>
+ </programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ </section>
+ </section>
+</chapter>
\ No newline at end of file
Modified: portal/branches/wsrp-integration/packaging/module/pom.xml
===================================================================
--- portal/branches/wsrp-integration/packaging/module/pom.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/packaging/module/pom.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -63,7 +63,6 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
- <version>1.3</version>
<executions>
<execution>
<id>attach-artifacts</id>
Modified: portal/branches/wsrp-integration/packaging/module/src/main/javascript/portal.packaging.module.js
===================================================================
--- portal/branches/wsrp-integration/packaging/module/src/main/javascript/portal.packaging.module.js 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/packaging/module/src/main/javascript/portal.packaging.module.js 2009-11-26 01:03:34 UTC (rev 805)
@@ -37,12 +37,14 @@
var mopVersion = "${org.gatein.mop.version}";
var chromatticVersion = "${version.chromattic}";
var reflectVersion = "${version.reflect}";
- var idmVersion = "${org.jboss.identity.idm}";
+ var idmVersion = "${org.picketlink.idm}";
var pcVersion = "${org.gatein.pc.version}";
var wciVersion = "${org.gatein.wci.version}";
var commonVersion = "${org.gatein.common.version}";
var wsrpVersion = "${org.gatein.wsrp.version}";
var shindigVersion = "${org.shindig.version}";
+ var groovyVersion = "${org.codehaus.groovy.version}";
+ var rhinoVersion = "${rhino.version}";
//TODO versions for gatein components
@@ -51,7 +53,8 @@
new Project("org.exoplatform.portal", "exo.portal.component.resources", "jar", module.version);
module.component.common =
- new Project("org.exoplatform.portal", "exo.portal.component.common", "jar", module.version);
+ new Project("org.exoplatform.portal", "exo.portal.component.common", "jar", module.version).
+ addDependency(new Project("org.gatein.common", "common-logging", "jar", commonVersion));
module.component.pc =
new Project("org.exoplatform.portal", "exo.portal.component.pc", "jar", module.version).
@@ -59,6 +62,7 @@
addDependency(new Project("javax.ccpp", "ccpp", "jar", "1.0")).
addDependency(new Project("javax.xml.bind", "jaxb-api", "jar", "2.1")).
addDependency(new Project("org.gatein.pc", "pc-api", "jar", pcVersion)).
+ addDependency(new Project("org.gatein.pc", "pc-bridge", "jar", pcVersion)).
addDependency(new Project("org.gatein.pc", "pc-portlet", "jar", pcVersion)).
addDependency(new Project("org.gatein.pc", "pc-mc", "jar", pcVersion)).
addDependency(new Project("org.gatein.pc", "pc-controller", "jar", pcVersion)).
@@ -70,6 +74,7 @@
addDependency(new Project("log4j", "log4j", "jar", "1.2.14")).
addDependency(new Project("org.jboss", "jbossxb", "jar", "2.0.1.GA")).
addDependency(new Project("org.jboss.logging", "jboss-logging-spi", "jar", "2.0.5.GA")).
+ addDependency(new Project("org.apache.portals.bridges", "portals-bridges-common", "jar", "1.0.4")).
addDependency(new Project("org.jboss", "jboss-common-core", "jar", "2.2.9.GA"));
@@ -89,8 +94,8 @@
module.component.scripting =
new Project("org.exoplatform.portal", "exo.portal.component.scripting", "jar", module.version).
addDependency(module.component.xmlParser).
- addDependency(new Project("rhino", "js", "jar", "1.6R5")).
- addDependency(new Project("org.codehaus.groovy", "groovy-all", "jar", "1.6.5"));
+ addDependency(new Project("rhino", "js", "jar", rhinoVersion)).
+ addDependency(new Project("org.codehaus.groovy", "groovy-all", "jar", groovyVersion));
module.component.web =
new Project("org.exoplatform.portal", "exo.portal.component.web", "jar", module.version).
@@ -115,12 +120,12 @@
module.component.identity =
new Project("org.exoplatform.portal", "exo.portal.component.identity", "jar", module.version).
- addDependency(new Project("org.jboss.identity.idm", "idm-core", "jar", idmVersion)).
- addDependency(new Project("org.jboss.identity.idm", "idm-common", "jar", idmVersion)).
- addDependency(new Project("org.jboss.identity.idm", "idm-api", "jar", idmVersion)).
- addDependency(new Project("org.jboss.identity.idm", "idm-spi", "jar", idmVersion)).
- addDependency(new Project("org.jboss.identity.idm", "idm-hibernate", "jar", idmVersion)).
- addDependency(new Project("org.jboss.identity.idm", "idm-ldap", "jar", idmVersion));
+ addDependency(new Project("org.picketlink.idm", "picketlink-idm-core", "jar", idmVersion)).
+ addDependency(new Project("org.picketlink.idm", "picketlink-idm-common", "jar", idmVersion)).
+ addDependency(new Project("org.picketlink.idm", "picketlink-idm-api", "jar", idmVersion)).
+ addDependency(new Project("org.picketlink.idm", "picketlink-idm-spi", "jar", idmVersion)).
+ addDependency(new Project("org.picketlink.idm", "picketlink-idm-hibernate", "jar", idmVersion)).
+ addDependency(new Project("org.picketlink.idm", "picketlink-idm-ldap", "jar", idmVersion));
module.component.applicationRegistry =
new Project("org.exoplatform.portal", "exo.portal.component.application-registry", "jar", module.version).
Modified: portal/branches/wsrp-integration/packaging/pkg/pom.xml
===================================================================
--- portal/branches/wsrp-integration/packaging/pkg/pom.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/packaging/pkg/pom.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -34,10 +34,10 @@
<dependencies>
<dependency>
- <groupId>org.exoplatform.tool</groupId>
- <artifactId>exopackage</artifactId>
+ <groupId>org.gatein.tools</groupId>
+ <artifactId>packager</artifactId>
<type>zip</type>
- <version>1.1.0-Beta05</version>
+ <version>1.0.0-Beta02</version>
</dependency>
<dependency>
@@ -104,19 +104,11 @@
<overWriteSnapshots>true</overWriteSnapshots>
<artifactItems>
<artifactItem>
- <groupId>org.exoplatform.tool</groupId>
- <artifactId>exopackage</artifactId>
- <type>zip</type>
- <outputDirectory>target/exopackage</outputDirectory>
+ <groupId>org.gatein.tools</groupId>
+ <artifactId>packager</artifactId>
+ <type>zip</type>
+ <outputDirectory>target/packager</outputDirectory>
</artifactItem>
- <!--
- <artifactItem>
- <groupId>org.exoplatform.delivery</groupId>
- <artifactId>exopackage-conf</artifactId>
- <type>zip</type>
- <outputDirectory>target/exopackage-conf</outputDirectory>
- </artifactItem>
- -->
</artifactItems>
</configuration>
</execution>
@@ -129,8 +121,7 @@
<configuration>
<includeTypes>js</includeTypes>
<stripVersion>true</stripVersion>
- <!--includeArtifactIds>exo.packaging.*.module</includeArtifactIds-->
- <outputDirectory>${project.build.directory}/exopackage-conf</outputDirectory>
+ <outputDirectory>${project.build.directory}/packager-conf</outputDirectory>
</configuration>
</execution>
</executions>
@@ -186,16 +177,16 @@
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
- <id>tomcat-exopackage</id>
+ <id>tomcat-packaging</id>
<phase>package</phase>
<configuration>
<executable>java</executable>
<workingDirectory>${basedir}</workingDirectory>
<arguments>
- <argument>-Dexo.package.home=${basedir}/target/exopackage</argument>
+ <argument>-Dexo.package.home=${basedir}/target/packager</argument>
<argument>-Dexo.current.dir=${basedir}</argument>
<argument>-Dexo.base.dir=${exo.projects.directory.base}</argument>
- <argument>-Dexo.conf.dir=${basedir}/target/exopackage-conf</argument>
+ <argument>-Dexo.conf.dir=${basedir}/target/packager-conf</argument>
<argument>-Dexo.working.dir=${gatein.working.dir}/</argument>
<!--argument>-Dexo.src.dir=NONE</argument-->
<argument>-Dexo.dep.dir=${exo.projects.directory.dependencies}</argument><!-- to get the server ref install -->
@@ -206,9 +197,9 @@
<argument>-Xms128m</argument>
<argument>-Xmx512m</argument>
<argument>-classpath</argument>
- <argument>${basedir}/target/exopackage/lib/js.jar</argument>
+ <argument>${basedir}/target/packager/lib/js.jar</argument>
<argument>org.mozilla.javascript.tools.shell.Main</argument>
- <argument>${basedir}/target/exopackage/javascript/eXo/eXo.js</argument>
+ <argument>${basedir}/target/packager/javascript/eXo/eXo.js</argument>
<argument>exobuild</argument>
<argument>--product=portal</argument>
<argument>--deploy=tomcat</argument>
@@ -287,16 +278,16 @@
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
- <id>jbossas-exopackage</id>
+ <id>jbossas-packaging</id>
<phase>package</phase>
<configuration>
<executable>java</executable>
<workingDirectory>${basedir}</workingDirectory>
<arguments>
- <argument>-Dexo.package.home=${basedir}/target/exopackage</argument>
+ <argument>-Dexo.package.home=${basedir}/target/packager</argument>
<argument>-Dexo.current.dir=${basedir}</argument>
<argument>-Dexo.base.dir=${exo.projects.directory.base}</argument>
- <argument>-Dexo.conf.dir=${basedir}/target/exopackage-conf</argument>
+ <argument>-Dexo.conf.dir=${basedir}/target/packager-conf</argument>
<argument>-Dexo.working.dir=${gatein.working.dir}</argument>
<!--argument>-Dexo.src.dir=NONE</argument-->
<argument>-Dexo.dep.dir=${exo.projects.directory.dependencies}</argument><!-- to get the server ref install -->
@@ -307,9 +298,9 @@
<argument>-Xms128m</argument>
<argument>-Xmx512m</argument>
<argument>-classpath</argument>
- <argument>${basedir}/target/exopackage/lib/js.jar</argument>
+ <argument>${basedir}/target/packager/lib/js.jar</argument>
<argument>org.mozilla.javascript.tools.shell.Main</argument>
- <argument>${basedir}/target/exopackage/javascript/eXo/eXo.js</argument>
+ <argument>${basedir}/target/packager/javascript/eXo/eXo.js</argument>
<argument>exobuild</argument>
<argument>--product=portal</argument>
<argument>--deploy=jbossear</argument>
Modified: portal/branches/wsrp-integration/packaging/pom.xml
===================================================================
--- portal/branches/wsrp-integration/packaging/pom.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/packaging/pom.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -32,7 +32,6 @@
<name>GateIn Portal Packaging</name>
<modules>
- <!--module>exopackage</module-->
<module>module</module>
<module>product</module>
<module>pkg</module>
Modified: portal/branches/wsrp-integration/packaging/product/pom.xml
===================================================================
--- portal/branches/wsrp-integration/packaging/product/pom.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/packaging/product/pom.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -64,7 +64,6 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
- <version>1.3</version>
<executions>
<execution>
<id>attach-artifacts</id>
Modified: portal/branches/wsrp-integration/pom.xml
===================================================================
--- portal/branches/wsrp-integration/pom.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/pom.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -19,15 +19,14 @@
-->
-<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">
+<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>
<parent>
<groupId>org.gatein</groupId>
<artifactId>gatein-parent</artifactId>
- <version>1.0.0-Beta03</version>
+ <version>1.0.0-Beta04</version>
</parent>
<groupId>org.exoplatform.portal</groupId>
@@ -35,23 +34,27 @@
<version>3.0.0-Beta03-SNAPSHOT</version>
<packaging>pom</packaging>
- <name>GateIn Portal</name>
+ <name>GateIn - Portal</name>
<properties>
- <org.exoplatform.kernel.version>2.2.0-Beta02</org.exoplatform.kernel.version>
- <org.exoplatform.core.version>2.3.0-Beta02</org.exoplatform.core.version>
- <org.exoplatform.ws.version>2.1.0-Beta02</org.exoplatform.ws.version>
- <org.exoplatform.jcr.version>1.12.0-Beta02</org.exoplatform.jcr.version>
+ <org.exoplatform.kernel.version>2.2.0-Beta04</org.exoplatform.kernel.version>
+ <org.exoplatform.core.version>2.3.0-Beta04</org.exoplatform.core.version>
+ <org.exoplatform.ws.version>2.1.0-Beta04</org.exoplatform.ws.version>
+ <org.exoplatform.jcr.version>1.12.0-Beta04</org.exoplatform.jcr.version>
<org.jibx.version>1.2.1</org.jibx.version>
<org.shindig.version>SNAPSHOT-r790473</org.shindig.version>
- <org.gatein.common.version>2.0.0-CR1-SNAPSHOT</org.gatein.common.version>
- <org.gatein.wci.version>2.0.0-Beta02</org.gatein.wci.version>
- <org.gatein.pc.version>2.1.0-Beta02</org.gatein.pc.version>
- <org.jboss.identity.idm>1.0.0.Beta3</org.jboss.identity.idm>
+ <org.gatein.common.version>2.0.0-CR02</org.gatein.common.version>
+ <org.gatein.wci.version>2.0.0-CR01</org.gatein.wci.version>
+ <org.gatein.pc.version>2.1.0-CR01</org.gatein.pc.version>
+ <org.picketlink.idm>1.0.0.CR1</org.picketlink.idm>
<org.gatein.wsrp.version>1.0.0-Beta02-SNAPSHOT</org.gatein.wsrp.version>
- <org.gatein.mop.version>1.0.0-Beta09</org.gatein.mop.version>
+ <org.gatein.mop.version>1.0.0-Beta10</org.gatein.mop.version>
+ <org.slf4j.version>1.5.6</org.slf4j.version>
+ <rhino.version>1.6R5</rhino.version>
+ <org.codehaus.groovy.version>1.6.5</org.codehaus.groovy.version>
+ <javax.servlet.version>2.5</javax.servlet.version>
<version.chromattic>1.0.0-beta8</version.chromattic>
- <version.reflect>1.0.0-beta3</version.reflect>
+ <version.reflect>1.0.0-beta4</version.reflect>
<!-- ************** -->
<!-- Build settings -->
@@ -87,7 +90,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
- <version>1.5.6</version>
+ <version>${org.slf4j.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -123,6 +126,11 @@
<version>1.1.1</version>
</plugin>
<plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.4</version>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
@@ -170,17 +178,13 @@
<rules>
<requireProperty>
<property>gatein.checkout.dir</property>
- <message>"You must define the property gatein.checkout.dir to give the path of the root of
- your working area"
- </message>
+ <message>"You must define the property gatein.checkout.dir to give the path of the root of your working area"</message>
</requireProperty>
<requireFilesExist>
<files>
<file>${gatein.checkout.dir}/web/portal/src/main/webapp</file>
</files>
- <message>"The following directory doesn't exist :
- ${gatein.checkout.dir}/web/portal/src/main/webapp"
- </message>
+ <message>"The following directory doesn't exist : ${gatein.checkout.dir}/web/portal/src/main/webapp"</message>
</requireFilesExist>
</rules>
<fail>true</fail>
@@ -197,12 +201,11 @@
<phase>compile</phase>
<configuration>
<tasks>
- <copy failonerror="false"
- todir="${project.build.directory}/${project.build.finalName}/WEB-INF/classes">
+ <copy failonerror="false" todir="${project.build.directory}/${project.build.finalName}/WEB-INF/classes">
<fileset dir="${basedir}/src/main/webapp/WEB-INF/classes">
- <include name="**/*_en.properties"/>
+ <include name="**/*_en.properties" />
</fileset>
- <globmapper from="*_en.properties" to="*.properties"/>
+ <globmapper from="*_en.properties" to="*.properties" />
</copy>
</tasks>
</configuration>
Modified: portal/branches/wsrp-integration/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java
===================================================================
--- portal/branches/wsrp-integration/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/portlet/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UITabPaneDashboard.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -101,9 +101,10 @@
return null;
}
- public int getCurrentNumberOfTabs()
+ public int getCurrentNumberOfTabs() throws Exception
{
- return pageNavigation.getNodes().size();
+
+ return getSameSiblingsNode().size();
}
public int getStartShowIndex()
@@ -123,6 +124,18 @@
}
}
+ public List<PageNode> getSameSiblingsNode() throws Exception
+ {
+ List<PageNode> siblings = getPageNavigation().getNodes();
+ List<PageNode> selectedPath = Util.getUIPortal().getSelectedPaths();
+ if (selectedPath != null && selectedPath.size() > 1)
+ {
+ PageNode currentParent = selectedPath.get(selectedPath.size() - 2);
+ siblings = currentParent.getChildren();
+ }
+ return siblings;
+ }
+
public PageNavigation getPageNavigation() throws Exception
{
if (pageNavigation == null)
@@ -141,9 +154,16 @@
{
try
{
- ArrayList<PageNode> nodes = pageNavigation.getNodes();
- if (nodes.size() < 2)
+ List<PageNode> nodes = pageNavigation.getNodes();
+ PageNode parentNode = null;
+ List<PageNode> selectedPath = uiPortal.getSelectedPaths();
+ if (selectedPath != null && selectedPath.size() > 1)
{
+ parentNode = selectedPath.get(selectedPath.size() - 2);
+ nodes = parentNode.getChildren();
+ }
+ if (parentNode == null && nodes.size() < 2)
+ {
return null; // At the moment, we prevent user from deleting all the dashboard
}
PageNode tobeRemoved = nodes.get(nodeIndex);
@@ -151,6 +171,12 @@
nodes.remove(nodeIndex);
+ String pageRef = tobeRemoved.getPageReference();
+ if (pageRef != null && pageRef.length() > 0)
+ {
+ configService.remove(configService.getPage(pageRef));
+ }
+
if (tobeRemoved.getUri().equals(selectedNode.getUri()))
{
selectedNode = nodes.get(Math.max(0, nodeIndex - 1));
@@ -181,6 +207,13 @@
pageNavigation.getOwnerId());
page.setTitle(nodeLabel);
+ List<PageNode> selectedPath = uiPortal.getSelectedPaths();
+ PageNode parentNode = null;
+ if (selectedPath != null && selectedPath.size() > 1)
+ {
+ parentNode = selectedPath.get(selectedPath.size() - 2);
+ }
+
PageNode pageNode = new PageNode();
pageNode.setLabel(nodeLabel);
String uniqueNodeName = nodeLabel.toLowerCase().replace(' ', '_');
@@ -189,18 +222,28 @@
uniqueNodeName = uniqueNodeName + "_" + System.currentTimeMillis();
}
+ String fullName = (parentNode != null) ? parentNode.getUri() + "/" + uniqueNodeName : uniqueNodeName;
+
page.setName(uniqueNodeName);
pageNode.setName(uniqueNodeName);
- pageNode.setUri(uniqueNodeName);
+ pageNode.setUri(fullName);
pageNode.setPageReference(page.getPageId());
- pageNavigation.addNode(pageNode);
+ if (parentNode == null)
+ {
+ pageNavigation.addNode(pageNode);
+ }
+ else if (parentNode.getChildren() != null)
+ {
+ parentNode.getChildren().add(pageNode);
+ }
+
uiPortal.setSelectedNode(pageNode);
configService.create(page);
configService.update(pageNavigation);
- return uniqueNodeName;
+ return fullName;
}
catch (Exception ex)
{
@@ -248,7 +291,15 @@
{
try
{
- ArrayList<PageNode> nodes = pageNavigation.getNodes();
+ List<PageNode> nodes = pageNavigation.getNodes();
+ List<PageNode> selectedPath = uiPortal.getSelectedPaths();
+ PageNode parentNode = null;
+ if (selectedPath != null && selectedPath.size() > 1)
+ {
+ parentNode = selectedPath.get(selectedPath.size() - 2);
+ nodes = parentNode.getChildren();
+ }
+
PageNode renamedNode = nodes.get(nodeIndex);
if (renamedNode == null || newNodeLabel.length() == 0)
{
@@ -263,10 +314,13 @@
newNodeName = newNodeName + "_" + System.currentTimeMillis();
}
renamedNode.setName(newNodeName);
- renamedNode.setUri(newNodeName);
+ String newUri = (parentNode != null) ? parentNode.getUri() + "/" + newNodeName : newNodeName;
+
+ renamedNode.setUri(newUri);
+
configService.update(pageNavigation);
- return newNodeName;
+ return newUri;
}
catch (Exception ex)
{
@@ -311,7 +365,11 @@
{
UITabPaneDashboard source = event.getSource();
WebuiRequestContext context = event.getRequestContext();
- if (source.getCurrentNumberOfTabs() == 1)
+ List<PageNode> path = Util.getUIPortal().getSelectedPaths();
+ boolean isRoot = true;
+ if (path != null && path.size() > 1)
+ isRoot = false;
+ if (isRoot && source.getCurrentNumberOfTabs() == 1)
{
source.getAncestorOfType(UIApplication.class).addMessage(
new ApplicationMessage("UITabPaneDashboard.msg.cannotDeleteLastTab", null));
@@ -324,7 +382,8 @@
if (selectedNode != null)
{
PortalRequestContext prContext = Util.getPortalRequestContext();
- prContext.getResponse().sendRedirect(prContext.getPortalURI() + selectedNode.getName());
+ prContext.setResponseComplete(true);
+ prContext.getResponse().sendRedirect(prContext.getPortalURI() + selectedNode.getUri());
}
}
}
@@ -341,13 +400,14 @@
context.getUIApplication().addMessage(new ApplicationMessage("UITabPaneDashboard.msg.wrongTabName", null));
return;
}
- String newNodeName = tabPane.createNewPageNode(newTabLabel);
+ String uri = tabPane.createNewPageNode(newTabLabel);
//If new node is created with success, then redirect to it
- if (newNodeName != null)
+ if (uri != null)
{
PortalRequestContext prContext = Util.getPortalRequestContext();
- prContext.getResponse().sendRedirect(prContext.getPortalURI() + newNodeName);
+ prContext.setResponseComplete(true);
+ prContext.getResponse().sendRedirect(prContext.getPortalURI() + uri);
}
}
}
@@ -375,13 +435,13 @@
context.getUIApplication().addMessage(new ApplicationMessage("UITabPaneDashboard.msg.wrongTabName", null));
return;
}
- String newNodeName = tabPane.renamePageNode(nodeIndex, newTabLabel);
+ String newUri = tabPane.renamePageNode(nodeIndex, newTabLabel);
//If page node is renamed with success, then redirect to new URL
- if (newNodeName != null)
+ if (newUri != null)
{
PortalRequestContext prContext = Util.getPortalRequestContext();
- prContext.getResponse().sendRedirect(prContext.getPortalURI() + newNodeName);
+ prContext.getResponse().sendRedirect(prContext.getPortalURI() + newUri);
}
}
}
Deleted: portal/branches/wsrp-integration/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetEditMode.java
===================================================================
--- portal/branches/wsrp-integration/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetEditMode.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetEditMode.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -1,212 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.gadget.webui.component;
-
-import org.exoplatform.application.registry.Application;
-import org.exoplatform.application.registry.ApplicationRegistryService;
-import org.exoplatform.portal.config.UserACL;
-import org.exoplatform.portal.config.model.ApplicationType;
-import org.exoplatform.portal.config.model.TransientApplicationState;
-import org.exoplatform.portal.pom.spi.gadget.Gadget;
-import org.exoplatform.portal.webui.application.UIGadget;
-import org.exoplatform.portal.webui.util.Util;
-import org.exoplatform.portal.webui.workspace.UIPortalApplication;
-import org.exoplatform.web.application.ApplicationMessage;
-import org.exoplatform.webui.application.WebuiRequestContext;
-import org.exoplatform.webui.application.portlet.PortletRequestContext;
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.config.annotation.EventConfig;
-import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
-import org.exoplatform.webui.core.model.SelectItemOption;
-import org.exoplatform.webui.event.Event;
-import org.exoplatform.webui.event.EventListener;
-import org.exoplatform.webui.event.Event.Phase;
-import org.exoplatform.webui.form.UIForm;
-import org.exoplatform.webui.form.UIFormSelectBox;
-import org.exoplatform.webui.form.UIFormStringInput;
-import org.exoplatform.webui.form.validator.MandatoryValidator;
-import org.exoplatform.webui.form.validator.URLValidator;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.portlet.PortletMode;
-import javax.portlet.PortletPreferences;
-
-/**
- * Created by The eXo Platform SARL Author : dang.tung tungcnw(a)gmail.com June
- * 27, 2008
- */
-@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "system:/groovy/webui/form/UIFormWithTitle.gtmpl", events = {
- @EventConfig(listeners = UIGadgetEditMode.SaveActionListener.class),
- @EventConfig(listeners = UIGadgetEditMode.SelectTypeActionListener.class, phase = Phase.DECODE)})
-public class UIGadgetEditMode extends UIForm
-{
-
- public static final String FIELD_URL = "gadgetUrl";
-
- public static final String TYPE_SELECTOR = "typeSelector";
-
- public static final String GADGET_SELECTOR = "gadgetSelector";
-
- public static final String REMOTE_TYPE = "remote";
-
- public static final String LOCAL_TYPE = "local";
-
- public UIGadgetEditMode() throws Exception
- {
- PortletRequestContext pcontext = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
- PortletPreferences pref = pcontext.getRequest().getPreferences();
-
- List<SelectItemOption<String>> options = new ArrayList<SelectItemOption<String>>();
- options.add(new SelectItemOption<String>(REMOTE_TYPE, REMOTE_TYPE));
- options.add(new SelectItemOption<String>(LOCAL_TYPE, LOCAL_TYPE));
-
- UIFormSelectBox typeSelector = new UIFormSelectBox(TYPE_SELECTOR, null, options);
- typeSelector.setOnChange("SelectType");
- addUIFormInput(typeSelector);
- addUIFormInput(new UIFormStringInput(FIELD_URL, FIELD_URL, pref.getValue("url",
- "http://www.google.com/ig/modules/horoscope.xml")));
- UIFormSelectBox gadgetSelector =
- new UIFormSelectBox(GADGET_SELECTOR, null, new ArrayList<SelectItemOption<String>>());
- gadgetSelector.setRendered(false);
- gadgetSelector.addValidator(MandatoryValidator.class);
- addUIFormInput(gadgetSelector);
- setActions(new String[]{"Save"});
- }
-
- public static class SaveActionListener extends EventListener<UIGadgetEditMode>
- {
- public void execute(final Event<UIGadgetEditMode> event) throws Exception
- {
- UIGadgetEditMode uiGadgetEditMode = event.getSource();
- PortletRequestContext pcontext = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
- String url = uiGadgetEditMode.getUIStringInput(FIELD_URL).getValue();
- UIGadgetPortlet uiPortlet = uiGadgetEditMode.getParent();
- UIFormSelectBox typeSelector = uiGadgetEditMode.getUIFormSelectBox(TYPE_SELECTOR);
- org.exoplatform.webui.core.UIApplication uiApplication = pcontext.getUIApplication();
- UIPortalApplication portalApp = Util.getUIPortalApplication();
-
- if (typeSelector.getValue().equals(REMOTE_TYPE))
- {
- String label = uiGadgetEditMode.getLabel(FIELD_URL);
- if (label.charAt(label.length() - 1) == ':')
- label = label.substring(0, label.length() - 1);
- Object[] args = {label};
-
- if (url == null || url.length() == 0)
- {
- uiGadgetEditMode.getUIStringInput(FIELD_URL).setValue(uiPortlet.getUrl());
- uiApplication.addMessage(new ApplicationMessage("EmptyFieldValidator.msg.empty-input", args,
- ApplicationMessage.WARNING));
- return;
- }
- url = url.trim();
- if (!url.matches(URLValidator.URL_REGEX))
- {
- uiGadgetEditMode.getUIStringInput(FIELD_URL).setValue(uiPortlet.getUrl());
- uiApplication.addMessage(new ApplicationMessage("URLValidator.msg.invalid-url", args,
- ApplicationMessage.WARNING));
- return;
- }
- try
- {
- PortletPreferences pref = pcontext.getRequest().getPreferences();
- new URL(url);
- pref.setValue("url", url);
- pref.store();
- uiGadgetEditMode.getUIStringInput(FIELD_URL).setValue(url);
- if (portalApp.getModeState() == UIPortalApplication.NORMAL_MODE)
- pcontext.setApplicationMode(PortletMode.VIEW);
- }
- catch (Exception e)
- {
- uiGadgetEditMode.getUIStringInput(FIELD_URL).setValue(uiPortlet.getUrl());
- }
- }
- else
- {
- UIFormSelectBox gadgetSelector = uiGadgetEditMode.getUIFormSelectBox(GADGET_SELECTOR);
- String gadgetId = gadgetSelector.getValue();
-
- ApplicationRegistryService service = uiPortlet.getApplicationComponent(ApplicationRegistryService.class);
- Application application = service.getApplication(gadgetId);
- if (application == null)
- {
- return;
- }
- UIGadget uiGadget = event.getSource().createUIComponent(pcontext, UIGadget.class, null, null);
- uiGadget.setState(new TransientApplicationState<Gadget>(application.getApplicationName()));
- PortletPreferences pref = pcontext.getRequest().getPreferences();
- pref.setValue("url", uiGadget.getUrl());
- pref.store();
- uiGadgetEditMode.getUIStringInput(FIELD_URL).setValue(uiGadget.getUrl());
-
- if (portalApp.getModeState() == UIPortalApplication.NORMAL_MODE)
- pcontext.setApplicationMode(PortletMode.VIEW);
- pcontext.addUIComponentToUpdateByAjax(uiPortlet);
- }
- }
- }
-
- static public class SelectTypeActionListener extends EventListener<UIGadgetEditMode>
- {
- public void execute(final Event<UIGadgetEditMode> event) throws Exception
- {
- UIGadgetEditMode uiGadgetEdit = event.getSource();
- UIFormSelectBox typeSelector = uiGadgetEdit.getUIFormSelectBox(TYPE_SELECTOR);
- String selectedValue = typeSelector.getValue();
- UIFormStringInput urlInput = uiGadgetEdit.getUIStringInput(FIELD_URL);
- UIFormSelectBox gadgetSelector = uiGadgetEdit.getUIFormSelectBox(GADGET_SELECTOR);
- if (selectedValue.equals(REMOTE_TYPE))
- {
- urlInput.setRendered(true);
- gadgetSelector.setRendered(false);
- }
- else
- {
- urlInput.setRendered(false);
- gadgetSelector.setRendered(true);
- List<SelectItemOption<String>> gadgetItems = gadgetSelector.getOptions();
- gadgetItems.clear();
-
- ApplicationRegistryService service = uiGadgetEdit.getApplicationComponent(ApplicationRegistryService.class);
- UserACL acl = uiGadgetEdit.getApplicationComponent(UserACL.class);
- List<Application> appList = service.getAllApplications();
- for (Application app : appList)
- {
- if (app.getType().equals(ApplicationType.GADGET))
- {
- for (String per : app.getAccessPermissions())
- {
- if (acl.hasPermission(per))
- {
- gadgetItems.add(new SelectItemOption<String>(app.getDisplayName(), app.getId()));
- break;
- }
- }
- }
- }
- }
- event.getRequestContext().addUIComponentToUpdateByAjax(uiGadgetEdit);
- }
- }
-}
Modified: portal/branches/wsrp-integration/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java
===================================================================
--- portal/branches/wsrp-integration/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -41,8 +41,7 @@
{
public UIGadgetPortlet() throws Exception
{
- addChild(UIGadgetViewMode.class, null, null);
- addChild(UIGadgetEditMode.class, null, null);
+ addChild(UIGadgetViewMode.class, null, null);
}
public String getUrl()
Modified: portal/branches/wsrp-integration/portlet/dashboard/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portal/branches/wsrp-integration/portlet/dashboard/src/main/webapp/WEB-INF/portlet.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/portlet/dashboard/src/main/webapp/WEB-INF/portlet.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -75,7 +75,6 @@
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
- <portlet-mode>edit</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<resource-bundle>locale.portlet.gadget.GadgetPortlet</resource-bundle>
Modified: portal/branches/wsrp-integration/portlet/dashboard/src/main/webapp/groovy/dashboard/webui/component/UITabPaneDashboard.gtmpl
===================================================================
--- portal/branches/wsrp-integration/portlet/dashboard/src/main/webapp/groovy/dashboard/webui/component/UITabPaneDashboard.gtmpl 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/portlet/dashboard/src/main/webapp/groovy/dashboard/webui/component/UITabPaneDashboard.gtmpl 2009-11-26 01:03:34 UTC (rev 805)
@@ -7,8 +7,9 @@
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.web.application.JavascriptManager;
- PageNavigation pageNavigation = uicomponent.getPageNavigation();
- ArrayList<PageNode> nodes = pageNavigation.getNodes();
+ //PageNavigation pageNavigation = uicomponent.getPageNavigation();
+ //ArrayList<PageNode> nodes = pageNavigation.getNodes();
+ ArrayList<PageNode> nodes = uicomponent.getSameSiblingsNode();
def tabNbs = nodes.size();
PortalRequestContext pcontext = Util.getPortalRequestContext();
@@ -56,7 +57,7 @@
<div class="LeftTab">
<div class="RightTab">
<div class="MiddleTab">
- <a href="<%= portalURI + node.getName(); %>"><span>$tabLabel</span></a>
+ <a href="<%= portalURI + node.getUri(); %>"><span>$tabLabel</span></a>
<a href="<%= uicomponent.url("DeleteTab",param); %>">
<img class="CloseIcon" src="/eXoResources/skin/sharedImages/Blank.gif" alt="DEL" />
</a>
Modified: portal/branches/wsrp-integration/portlet/dashboard/src/main/webapp/groovy/gadget/webui/component/UIGadgetPortlet.gtmpl
===================================================================
--- portal/branches/wsrp-integration/portlet/dashboard/src/main/webapp/groovy/gadget/webui/component/UIGadgetPortlet.gtmpl 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/portlet/dashboard/src/main/webapp/groovy/gadget/webui/component/UIGadgetPortlet.gtmpl 2009-11-26 01:03:34 UTC (rev 805)
@@ -1,6 +1,5 @@
<% import javax.portlet.PortletMode ;
- import org.exoplatform.gadget.webui.component.UIGadgetViewMode ;
- import org.exoplatform.gadget.webui.component.UIGadgetEditMode ;
+ import org.exoplatform.gadget.webui.component.UIGadgetViewMode;
def rcontext = _ctx.getRequestContext() ;
def popupMsgs = uicomponent.getUIPopupMessages();
%>
@@ -8,8 +7,6 @@
<%
if( rcontext.getApplicationMode() == PortletMode.VIEW ) {
uicomponent.renderChild(UIGadgetViewMode.class) ;
- } else {
- uicomponent.renderChild(UIGadgetEditMode.class);
}
if(popupMsgs != null) popupMsgs.processRender(rcontext); %>
Modified: portal/branches/wsrp-integration/portlet/dashboard/src/main/webapp/skin/gadget/webui/component/UIGadgetPortlet/DefaultStylesheet.css
===================================================================
--- portal/branches/wsrp-integration/portlet/dashboard/src/main/webapp/skin/gadget/webui/component/UIGadgetPortlet/DefaultStylesheet.css 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/portlet/dashboard/src/main/webapp/skin/gadget/webui/component/UIGadgetPortlet/DefaultStylesheet.css 2009-11-26 01:03:34 UTC (rev 805)
@@ -21,9 +21,7 @@
padding: 1px;
height: 100%;
}
-.UIGadgetPortlet .UIGadgetEditMode{
- padding: 50px 0;
-}
+
.UIGadgetPortlet .UIGadgetViewMode {
height: 100%;
}
Modified: portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterForm.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -19,9 +19,6 @@
package org.exoplatform.account.webui.component;
-import java.util.ArrayList;
-import java.util.List;
-
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.UserHandler;
import org.exoplatform.web.application.ApplicationMessage;
@@ -31,12 +28,15 @@
import org.exoplatform.webui.core.UIApplication;
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.event.EventListener;
-import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.form.UIForm;
import org.exoplatform.webui.form.UIFormInputWithActions;
import org.exoplatform.webui.form.UIFormInputWithActions.ActionData;
+import java.util.ArrayList;
+import java.util.List;
+
/**
*
* @author <a href="mailto:hoang281283@gmail.com">Minh Hoang TO</a>
@@ -75,6 +75,10 @@
setActions(ACTIONS);
}
+ private void resetInput(){
+ getChild(UIRegisterInputSet.class).reset();
+ }
+
static public class SubscribeActionListener extends EventListener<UIRegisterForm>{
@Override
public void execute(Event<UIRegisterForm> event) throws Exception {
@@ -86,6 +90,8 @@
if(registerInput.save(userHandler, context)){
//TODO: Send email and add Account Activating feature
+ UIApplication uiApp = context.getUIApplication();
+ uiApp.addMessage(new ApplicationMessage("UIRegisterForm.registerWithSuccess.message", null));
}
}
}
@@ -129,7 +135,7 @@
{
// TODO Auto-generated method stub
UIRegisterForm registerForm = event.getSource();
- registerForm.reset();
+ registerForm.resetInput();
}
}
}
Modified: portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationOrganizer.java
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationOrganizer.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationOrganizer.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -37,10 +37,9 @@
import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.event.MonitorEvent;
+import javax.portlet.PortletPreferences;
import java.util.List;
-import javax.portlet.PortletPreferences;
-
/** Created by The eXo Platform SAS Author : Pham Thanh Tung thanhtungty(a)gmail.com Jun 24, 2008 */
@ComponentConfig(template = "app:/groovy/applicationregistry/webui/component/UIApplicationOrganizer.gtmpl", events = {
@EventConfig(listeners = UIApplicationOrganizer.ShowCategoryActionListener.class),
@@ -239,6 +238,7 @@
{
UIApplicationOrganizer uiOrganizer = event.getSource();
ApplicationRegistryService service = uiOrganizer.getApplicationComponent(ApplicationRegistryService.class);
+
service.importAllPortlets();
service.importExoGadgets();
uiOrganizer.reload();
Modified: portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetInfo.java
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetInfo.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetInfo.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -65,8 +65,7 @@
public UIGadgetInfo() throws Exception
{
- UICategorySelector categorySelector = addChild(UICategorySelector.class, null, null);
- categorySelector.setRendered(false);
+ addChild(UICategorySelector.class, null, null);
}
public Gadget getGadget()
@@ -99,8 +98,7 @@
for (ApplicationCategory category : allCategories)
{
- String definitionName = gadget_.getTitle().replace(' ', '_');
- if (appRegService.getApplication(category.getName(), definitionName) != null)
+ if (appRegService.getApplication(category.getName(), gadget_.getName()) != null)
{
nameList.add(category.getDisplayName());
}
Modified: portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -128,6 +128,7 @@
uiGadgetInfo = addChild(UIGadgetInfo.class, null, null);
}
uiGadgetInfo.setGadget(selectedGadget_);
+ uiGadgetInfo.getChild(UICategorySelector.class).setRendered(false);
}
public void processRender(WebuiRequestContext context) throws Exception
Copied: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties (from rev 804, portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties)
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties (rev 0)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties 2009-11-26 01:03:34 UTC (rev 805)
@@ -0,0 +1,21 @@
+#
+# Copyright (C) 2009 eXo Platform SAS.
+#
+# This is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+#
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this software; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+#
+
+UIRegisterForm.registerWithSuccess.message=You have successfully registered a new account!
+UIRegisterForm.title=Register New Account
Modified: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -97,7 +97,7 @@
</supports>
<supported-locale>en</supported-locale>
- <!--<resource-bundle>locale.portlet.exoadmin.RegisterPortlet</resource-bundle>-->
+ <resource-bundle>locale.portlet.exoadmin.RegisterPortlet</resource-bundle>
<portlet-info>
<title>Register Portlet</title>
<short-title>Register Portlet</short-title>
Modified: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/DefaultStylesheet.css
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/DefaultStylesheet.css 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/DefaultStylesheet.css 2009-11-26 01:03:34 UTC (rev 805)
@@ -24,7 +24,7 @@
}
.UIManagement .ManagementBlock {
- background: url('background/BgEvenRow.gif') repeat-x left top;
+ background: #f8f8f8 url('background/BgEvenRow.gif') repeat-x left top;
margin-bottom: 1px;
}
@@ -52,11 +52,11 @@
}
.UIPortalNavigationPortlet .UIManagement table.ManagementBlock td.Content {
- width: 23%;
+ width: 20%;
}
.UIPortalNavigationPortlet .UIManagement table.ManagementBlock td.ActionBlock {
- width: 65%;
+ width: 68%;
}
.UIManagement table.ManagementBlock td.Content strong {
Copied: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/background/BgEvenRow.gif (from rev 804, portal/trunk/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/background/BgEvenRow.gif)
===================================================================
(Binary files differ)
Copied: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/background/BgOddRow.gif (from rev 804, portal/trunk/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/background/BgOddRow.gif)
===================================================================
(Binary files differ)
Copied: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/background/Button.gif (from rev 804, portal/trunk/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/background/Button.gif)
===================================================================
(Binary files differ)
Modified: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/background/GroupImage.png
===================================================================
(Binary files differ)
Modified: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/background/LineBg.gif
===================================================================
(Binary files differ)
Modified: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/navigation/webui/component/background/MiniIcon.gif
===================================================================
(Binary files differ)
Modified: portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/register/webui/component/DefaultStylesheet.css
===================================================================
--- portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/register/webui/component/DefaultStylesheet.css 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/register/webui/component/DefaultStylesheet.css 2009-11-26 01:03:34 UTC (rev 805)
@@ -16,3 +16,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
+
+.UIRegisterPortlet {
+ padding: 30px 0;
+}
\ No newline at end of file
Modified: portal/branches/wsrp-integration/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UILogoEditMode.java
===================================================================
--- portal/branches/wsrp-integration/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UILogoEditMode.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/portlet/web/src/main/java/org/exoplatform/portal/webui/component/UILogoEditMode.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -19,9 +19,6 @@
package org.exoplatform.portal.webui.component;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletPreferences;
-
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.portal.webui.workspace.UIPortalApplication;
import org.exoplatform.web.application.ApplicationMessage;
@@ -35,9 +32,11 @@
import org.exoplatform.webui.exception.MessageException;
import org.exoplatform.webui.form.UIForm;
import org.exoplatform.webui.form.UIFormStringInput;
-import org.exoplatform.webui.form.validator.MandatoryValidator;
import org.exoplatform.webui.form.validator.URLValidator;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletPreferences;
+
/** Created by The eXo Platform SAS Author : eXoPlatform October 2, 2009 */
@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "system:/groovy/webui/form/UIFormWithTitle.gtmpl", events = {@EventConfig(listeners = UILogoEditMode.SaveActionListener.class)})
public class UILogoEditMode extends UIForm
@@ -49,8 +48,7 @@
{
PortletRequestContext pcontext = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
PortletPreferences pref = pcontext.getRequest().getPreferences();
- addUIFormInput(new UIFormStringInput(FIELD_URL, FIELD_URL, pref.getValue("url", ""))
- .addValidator(MandatoryValidator.class));
+ addUIFormInput(new UIFormStringInput(FIELD_URL, FIELD_URL, pref.getValue("url", "")));
}
static public class SaveActionListener extends EventListener<UILogoEditMode>
@@ -59,7 +57,7 @@
{
UILogoEditMode uiForm = event.getSource();
String url = uiForm.getUIStringInput(FIELD_URL).getValue();
- if (url != null && !url.trim().matches(URLValidator.URL_REGEX))
+ if ((url == null || url.trim().length() == 0) || (!url.trim().matches(URLValidator.URL_REGEX)))
{
UILogoPortlet uiPortlet = uiForm.getParent();
uiForm.getUIStringInput(FIELD_URL).setValue(uiPortlet.getURL());
Modified: portal/branches/wsrp-integration/server/jboss/patch-ear/src/main/jboss/server/default/deployers/jbossweb.deployer/web.xml
===================================================================
--- portal/branches/wsrp-integration/server/jboss/patch-ear/src/main/jboss/server/default/deployers/jbossweb.deployer/web.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/server/jboss/patch-ear/src/main/jboss/server/default/deployers/jbossweb.deployer/web.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -304,7 +304,7 @@
<init-param>
<description>Portlet standard tlds</description>
<param-name>tagLibJar2</param-name>
- <param-value>../../deploy/gatein.ear/pc-portlet-(a){org.gatein.pc.version}.jar</param-value>
+ <param-value>../../deploy/gatein.ear/lib/pc-portlet-(a){org.gatein.pc.version}.jar</param-value>
</init-param>
Modified: portal/branches/wsrp-integration/server/jboss/pom.xml
===================================================================
--- portal/branches/wsrp-integration/server/jboss/pom.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/server/jboss/pom.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -35,7 +35,6 @@
<name>GateIn Portal Server JBoss</name>
<modules>
- <module>patch</module>
<module>patch-ear</module>
<module>plugin</module>
</modules>
Modified: portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
===================================================================
--- portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js 2009-11-26 01:03:34 UTC (rev 805)
@@ -543,7 +543,6 @@
var middleBlock = eXo.core.DOMUtil.findFirstChildByClass(portalComposer, "div", "MLPortalComposer");
var bottomBlock = eXo.core.DOMUtil.findFirstChildByClass(portalComposer, "div", "BLPortalComposer");
var fakeBottom = eXo.core.DOMUtil.findFirstChildByClass(portalComposer, "div", "Bottom");
- var params;
if(middleBlock && middleBlock.style.display != "none") {
middleBlock.style.display = "none";
bottomBlock.style.display = "none";
@@ -556,7 +555,7 @@
eXo.core.DOMUtil.replaceClass(clickedEle, "CollapseIcon", "ExpandIcon");
}
var requestStr = eXo.env.server.createPortalURL(portalComposer.id, "Toggle", true);
- ajaxGet(requestStr);
+ ajaxAsyncGetRequest(requestStr);
};
UIPortal.prototype.collapseExpand = function(element) {
Modified: portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/javascript/eXo/webui/UITabbedDashboard.js
===================================================================
--- portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/javascript/eXo/webui/UITabbedDashboard.js 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/javascript/eXo/webui/UITabbedDashboard.js 2009-11-26 01:03:34 UTC (rev 805)
@@ -19,7 +19,7 @@
eXo.webui.UITabbedDashboard = {
- init : function(){},
+ init : function(){eXo.webui.UITabbedDashboard.isInRequest = false;},
renameTabLabel : function(e){
if(!e){
@@ -91,6 +91,7 @@
if(!e){
e = window.event;
}
+ if(eXo.webui.UITabbedDashboard.isInRequest) return;
var keyNum = e.keyCode;
//If user presses on ENTER button
@@ -106,6 +107,7 @@
href += "&uicomponent=UITabPaneDashboard";
href += "&op=AddDashboard";
href += "&objectId=" + newTabLabel;
+ eXo.webui.UITabbedDashboard.isInRequest = true;
window.location = href;
}
//If user presses on ESCAPE button
Modified: portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPage/Stylesheet.css
===================================================================
--- portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPage/Stylesheet.css 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPage/Stylesheet.css 2009-11-26 01:03:34 UTC (rev 805)
@@ -92,7 +92,8 @@
}
.UIPageBody .VIEW-PAGEBODY .UIPage .UIComponentBlock {
- background: white;
+ background: white;
+ height: 100%;
}
.UIPageBody .BLPagebody {
Modified: portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIToolbarContainer/Stylesheet.css
===================================================================
--- portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIToolbarContainer/Stylesheet.css 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIToolbarContainer/Stylesheet.css 2009-11-26 01:03:34 UTC (rev 805)
@@ -121,79 +121,81 @@
.UIToolbarContainer .MenuItem .ArrowIcon {
background: url('background/ToolbarContainer.gif') no-repeat right bottom; /* orientation=lt */
- background: url('background/ToolbarContainer-rt.gif') no-repeat left bottom; /* orientation=rt */
+ background: url('background/ToolbarContainer-rt.gif') no-repeat 5px bottom; /* orientation=rt */
}
.UIToolbarContainer .MenuItem a {
- padding-right: 15px; /* orientation=lt */
- padding-left: 15px; /* orientation=rt */
+ padding-right: 25px; /* orientation=lt */
+ padding-left: 25px; /* orientation=rt */
}
-.UIToolbarContainer .MenuItem .DefaultPageIcon {
+.UIToolbarContainer .ItemIcon {
background-position: 10px center; /* orientation=lt */
- background-position: 90% center; /* orientation=rt */
+ background-position: 95% center; /* orientation=rt */
}
/**********************************/
.UIToolbarContainer .DashboardIcon {
- background: url('background/ToolbarContainer.gif') no-repeat left -64px; /* orientation=lt */
- background: url('background/ToolbarContainer.gif') no-repeat right -64px; /* orientation=rt */
+ background: url('background/ToolbarContainer.gif') no-repeat 5px -64px; /* orientation=lt */
+ background: url('background/ToolbarContainer.gif') no-repeat 100% -64px; /* orientation=rt */
}
.UIToolbarContainer .SiteIcon {
- background: url('background/ToolbarContainer.gif') no-repeat left -96px; /* orientation=lt */
- background: url('background/ToolbarContainer.gif') no-repeat right -96px; /* orientation=rt */
+ background: url('background/ToolbarContainer.gif') no-repeat 5px -96px; /* orientation=lt */
+ background: url('background/ToolbarContainer.gif') no-repeat 100% -96px; /* orientation=rt */
}
.UIToolbarContainer .SitesIcon {
- background: url('background/ToolbarContainer.gif') no-repeat left -96px; /* orientation=lt */
- background: url('background/ToolbarContainer.gif') no-repeat right -96px; /* orientation=rt */
+ background: url('background/ToolbarContainer.gif') no-repeat 5px -96px; /* orientation=lt */
+ background: url('background/ToolbarContainer.gif') no-repeat 100% -96px; /* orientation=rt */
}
.UIToolbarContainer .GroupIcon {
background: url('background/ToolbarContainer.gif') no-repeat left -128px; /* orientation=lt */
- background: url('background/ToolbarContainer.gif') no-repeat right -128px; /* orientation=rt */
+ background: url('background/ToolbarContainer.gif') no-repeat 100% -128px; /* orientation=rt */
+ margin-left: 10px; /* orientation=lt */
+ margin-right: 10px; /* orientation=rt */
}
.UIToolbarContainer .EditorIcon {
- background: url('background/ToolbarContainer.gif') no-repeat left -161px; /* orientation=lt */
- background: url('background/ToolbarContainer.gif') no-repeat right -161px; /* orientation=rt */
+ background: url('background/ToolbarContainer.gif') no-repeat 5px -161px; /* orientation=lt */
+ background: url('background/ToolbarContainer.gif') no-repeat 100% -161px; /* orientation=rt */
}
.UIToolbarContainer .AddPageIcon {
- background: url('background/ToolbarContainer.gif') no-repeat left -320px; /* orientation=lt */
- background: url('background/ToolbarContainer.gif') no-repeat right -320px; /* orientation=rt */
+ background: url('background/ToolbarContainer.gif') no-repeat 5px -320px; /* orientation=lt */
+ background: url('background/ToolbarContainer.gif') no-repeat 100% -320px; /* orientation=rt */
}
.UIToolbarContainer .EditPageIcon {
- background: url('background/ToolbarContainer.gif') no-repeat left -352px; /* orientation=lt */
- background: url('background/ToolbarContainer.gif') no-repeat right -352px; /* orientation=rt */
+ background: url('background/ToolbarContainer.gif') no-repeat 5px -352px; /* orientation=lt */
+ background: url('background/ToolbarContainer.gif') no-repeat 100% -352px; /* orientation=rt */
}
.UIToolbarContainer .EditSiteIcon {
- background: url('background/ToolbarContainer.gif') no-repeat left -384px; /* orientation=lt */
- background: url('background/ToolbarContainer.gif') no-repeat right -384px; /* orientation=rt */
+ background: url('background/ToolbarContainer.gif') no-repeat 5px -384px; /* orientation=lt */
+ background: url('background/ToolbarContainer.gif') no-repeat 100% -384px; /* orientation=rt */
}
.UIToolbarContainer .ChangeLanguageIcon {
- background: url('background/ToolbarContainer.gif') no-repeat left -192px; /* orientation=lt */
- background: url('background/ToolbarContainer.gif') no-repeat right -192px; /* orientation=rt */
+ background: url('background/ToolbarContainer.gif') no-repeat 5px -192px; /* orientation=lt */
+ background: url('background/ToolbarContainer.gif') no-repeat 100% -192px; /* orientation=rt */
}
.UIToolbarContainer .ChangeSkinIcon {
- background: url('background/ToolbarContainer.gif') no-repeat left -224px; /* orientation=lt */
- background: url('background/ToolbarContainer.gif') no-repeat right -224px; /* orientation=rt */
+ background: url('background/ToolbarContainer.gif') no-repeat 5px -224px; /* orientation=lt */
+ background: url('background/ToolbarContainer.gif') no-repeat 100% -224px; /* orientation=rt */
}
.UIToolbarContainer .AccountSettingIcon {
- background: url('background/ToolbarContainer.gif') no-repeat left -256px; /* orientation=lt */
- background: url('background/ToolbarContainer.gif') no-repeat right -256px; /* orientation=rt */
+ background: url('background/ToolbarContainer.gif') no-repeat 5px -256px; /* orientation=lt */
+ background: url('background/ToolbarContainer.gif') no-repeat 100% -256px; /* orientation=rt */
}
.UIToolbarContainer .SignOutIcon {
- background: url('background/ToolbarContainer.gif') no-repeat left -288px; /* orientation=lt */
- background: url('background/ToolbarContainer.gif') no-repeat right -288px; /* orientation=rt */
+ background: url('background/ToolbarContainer.gif') no-repeat 5px -288px; /* orientation=lt */
+ background: url('background/ToolbarContainer.gif') no-repeat 100% -288px; /* orientation=rt */
}
.UIToolbarContainer .Name a {
Modified: portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIToolbarContainer/background/ToolbarContainer.gif
===================================================================
(Binary files differ)
Modified: portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIForms/UIFormWithTitle/Stylesheet.css
===================================================================
--- portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIForms/UIFormWithTitle/Stylesheet.css 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIForms/UIFormWithTitle/Stylesheet.css 2009-11-26 01:03:34 UTC (rev 805)
@@ -30,13 +30,15 @@
padding-left: 15px; /* orientation=lt */
padding-right: 15px; /* orientation=rt */
background: url('background/TitleBG1x20.gif') repeat-x;
- height: 19px;
- vertical-align: middle; line-height: 19px;
- border: solid 1px #b7b7b7;
+ height: 26px;
+ vertical-align: middle; line-height: 26px;
+ border: solid 1px #e3e2e2;
+ color: #2b2b2b;
+ font-weight: bold;
}
.UIFormWithTitle .HorizontalLayout {
- background: #efefef;
- border: 1px #b7b7b7 solid;
+ background: #f7f7f7;
+ border: 1px #e3e2e2 solid;
border-top: none;
}
\ No newline at end of file
Modified: portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIForms/UIFormWithTitle/background/TitleBG1x20.gif
===================================================================
(Binary files differ)
Modified: portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIToolbar/Stylesheet.css
===================================================================
--- portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIToolbar/Stylesheet.css 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIToolbar/Stylesheet.css 2009-11-26 01:03:34 UTC (rev 805)
@@ -212,7 +212,7 @@
float: right; /* orientation=rt */
text-align: center;
padding: 5px;
- width: 150px;
+ width: 75px;
}
.UIToolbar .BlueLargeToolbar .LablelIcon {
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2009-11-26 01:03:34 UTC (rev 805)
@@ -638,10 +638,9 @@
UIPageCreationWizard.label.pageCreateWizard=Page Creation Wizard
UIPageCreationWizard.label.step=Step
UIPageCreationWizard.label.wizardSteps=Wizard Steps
-UIPageCreationWizard.label.step1.title=Welcome to the Page Creation Wizard
-UIPageCreationWizard.label.step2.title=Select a Navigation Node and create the Page
-UIPageCreationWizard.label.step3.title=Select a Page Layout Template
-UIPageCreationWizard.label.step4.title=Re-arrange the Page Layout and add Portlets to the Page
+UIPageCreationWizard.label.step1.title=Select a Navigation Node and create the Page
+UIPageCreationWizard.label.step2.title=Select a Page Layout Template
+UIPageCreationWizard.label.step3.title=Re-arrange the Page Layout and add Portlets to the Page
UIPageCreationWizard.label.abort=#{word.abort}
UIPageCreationWizard.label.back=#{word.back}
UIPageCreationWizard.label.next=#{word.next}
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties 2009-11-26 01:03:34 UTC (rev 805)
@@ -638,10 +638,9 @@
UIPageCreationWizard.label.pageCreateWizard=Asistente Creaci\u00f3n de P\u00e1gina
UIPageCreationWizard.label.step=Paso
UIPageCreationWizard.label.wizardSteps=Pasos del Asistente
-UIPageCreationWizard.label.step1.title=Bienvenido al Asistente Creaci\u00f3n de P\u00e1gina
-UIPageCreationWizard.label.step2.title=Selecciona un Nodo de Navegaci\u00f3n y crea la P\u00e1gina
-UIPageCreationWizard.label.step3.title=Selecciona una Plantilla de Distribuci\u00f3n de P\u00e1gina
-UIPageCreationWizard.label.step4.title=Reorganiza la Distribuci\u00f3n de la P\u00e1gina y a\u00f1ade Portlets a la P\u00e1gina
+UIPageCreationWizard.label.step1.title=Selecciona un Nodo de Navegaci\u00f3n y crea la P\u00e1gina
+UIPageCreationWizard.label.step2.title=Selecciona una Plantilla de Distribuci\u00f3n de P\u00e1gina
+UIPageCreationWizard.label.step3.title=Reorganiza la Distribuci\u00f3n de la P\u00e1gina y a\u00f1ade Portlets a la P\u00e1gina
UIPageCreationWizard.label.abort=#{word.abort}
UIPageCreationWizard.label.back=#{word.back}
UIPageCreationWizard.label.next=#{word.next}
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2009-11-26 01:03:34 UTC (rev 805)
@@ -614,10 +614,9 @@
UIPageCreationWizard.label.pageCreateWizard=Assistant de création de page
UIPageCreationWizard.label.step=Etape
UIPageCreationWizard.label.wizardSteps=Etapes de l'assistant
-UIPageCreationWizard.label.step1.title=Bienvenue dans l'assistant de création de page
-UIPageCreationWizard.label.step2.title=Sélectionner un noeud pour la page et indiquer le nom de la page
-UIPageCreationWizard.label.step3.title=Sélectionner un modèle d'organisation de page
-UIPageCreationWizard.label.step4.title=Ré-organiser la page et ajouter des portlets
+UIPageCreationWizard.label.step1.title=Sélectionner un noeud pour la page et indiquer le nom de la page
+UIPageCreationWizard.label.step2.title=Sélectionner un modèle d'organisation de page
+UIPageCreationWizard.label.step3.title=Ré-organiser la page et ajouter des portlets
UIPageCreationWizard.label.abort=#{word.abort}
UIPageCreationWizard.label.back=#{word.back}
UIPageCreationWizard.label.next=#{word.next}
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ru.properties
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ru.properties 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ru.properties 2009-11-26 01:03:34 UTC (rev 805)
@@ -628,10 +628,9 @@
UIPageCreationWizard.label.pageCreateWizard=Мастер создания страниц
UIPageCreationWizard.label.step=Шаг
UIPageCreationWizard.label.wizardSteps=Шаги
-UIPageCreationWizard.label.step1.title=Добро пожаловать в мастер создания страниц
-UIPageCreationWizard.label.step2.title=Выберите узел навигации и создайте страницу
-UIPageCreationWizard.label.step3.title=Выберите макет страницы
-UIPageCreationWizard.label.step4.title=Измените макет и добавьте портлеты
+UIPageCreationWizard.label.step1.title=Выберите узел навигации и создайте страницу
+UIPageCreationWizard.label.step2.title=Выберите макет страницы
+UIPageCreationWizard.label.step3.title=Измените макет и добавьте портлеты
UIPageCreationWizard.label.abort=#{word.abort}
UIPageCreationWizard.label.back=#{word.back}
UIPageCreationWizard.label.next=#{word.next}
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_uk.properties
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_uk.properties 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_uk.properties 2009-11-26 01:03:34 UTC (rev 805)
@@ -619,10 +619,9 @@
UIPageCreationWizard.label.pageCreateWizard=Wizard-створювач сторінок
UIPageCreationWizard.label.step=Крок
UIPageCreationWizard.label.wizardSteps=Wizard кроки
-UIPageCreationWizard.label.step1.title=Вітаємо на сторінці Wizard-створювача
-UIPageCreationWizard.label.step2.title=Вибрати навігаційний вузол і створити сторінку
-UIPageCreationWizard.label.step3.title=Вибрати шаблон сторінкової схеми
-UIPageCreationWizard.label.step4.title=Перекомпонувати схему сторінки і додати портлети
+UIPageCreationWizard.label.step1.title=Вибрати навігаційний вузол і створити сторінку
+UIPageCreationWizard.label.step2.title=Вибрати шаблон сторінкової схеми
+UIPageCreationWizard.label.step3.title=Перекомпонувати схему сторінки і додати портлети
UIPageCreationWizard.label.abort=#{word.abort}
UIPageCreationWizard.label.back=#{word.back}
UIPageCreationWizard.label.next=#{word.next}
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties 2009-11-26 01:03:34 UTC (rev 805)
@@ -619,10 +619,9 @@
UIPageCreationWizard.label.pageCreateWizard=Khởi tạo trang bằng Wizard
UIPageCreationWizard.label.step=Bước
UIPageCreationWizard.label.wizardSteps=Các bước tạo trang
-UIPageCreationWizard.label.step1.title=Chào mừng bạn đến với khởi tạo trang bằng Wizard.
-UIPageCreationWizard.label.step2.title=Chọn một node của trang và tạo tên trang.
-UIPageCreationWizard.label.step3.title=Lựa chọn cách trình bày trang theo mẫu.
-UIPageCreationWizard.label.step4.title=Sắp xếp lại cách trình bày trang và thêm Portlet vào trang.
+UIPageCreationWizard.label.step1.title=Chọn một node của trang và tạo tên trang.
+UIPageCreationWizard.label.step2.title=Lựa chọn cách trình bày trang theo mẫu.
+UIPageCreationWizard.label.step3.title=Sắp xếp lại cách trình bày trang và thêm Portlet vào trang.
UIPageCreationWizard.label.abort=#{word.abort}
UIPageCreationWizard.label.back=#{word.back}
UIPageCreationWizard.label.next=#{word.next}
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/database/database-configuration.xml
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/database/database-configuration.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/database/database-configuration.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -33,6 +33,11 @@
<name>hibernate.properties</name>
<description>Default Hibernate Service</description>
<property name="hibernate.show_sql" value="false"/>
+ <property name="hibernate.current_session_context_class" value="thread"/>
+ <property name="hibernate.cache.use_second_level_cache" value="true"/>
+ <property name="hibernate.cache.use_query_cache" value="true"/>
+ <!--CHANGEME HashtableCacheProvider shold not be used in production env-->
+ <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
<property name="hibernate.connection.url" value="jdbc:hsqldb:file:../temp/data/exodb${container.name.suffix}"/>
<property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-config.xml
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-config.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-config.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -20,9 +20,9 @@
-->
-<jboss-identity xmlns="urn:jboss:identity:idm:config:v1_0_beta"
+<jboss-identity xmlns="urn:picketlink:idm:config:v1_0_0_cr1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="urn:jboss:identity:idm:config:v1_0_alpha identity-config.xsd">
+ xsi:schemaLocation="urn:picketlink:idm:config:v1_0_0_cr1 identity-config.xsd">
<realms>
<realm>
<id>PortalRealm</id>
@@ -35,7 +35,7 @@
<repositories>
<repository>
<id>PortalRepository</id>
- <class>org.jboss.identity.idm.impl.repository.WrapperIdentityStoreRepository</class>
+ <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>
@@ -46,7 +46,7 @@
<identity-stores>
<identity-store>
<id>HibernateStore</id>
- <class>org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
+ <class>org.picketlink.idm.impl.store.hibernate.HibernateIdentityStoreImpl</class>
<external-config/>
<supported-relationship-types>
<relationship-type>JBOSS_IDENTITY_MEMBERSHIP</relationship-type>
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/organization/idm-configuration.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -23,54 +23,50 @@
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+
<component>
- <key>org.exoplatform.services.organization.jbidm.JBossIDMService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMServiceImpl</type>
+ <key>org.exoplatform.services.organization.idm.PicketLinkIDMService</key>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMServiceImpl</type>
<init-params>
<value-param>
<name>config</name>
<value>war:/conf/organization/idm-config.xml</value>
</value-param>
- <values-param>
- <name>hibernate.annotations</name>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObject</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectBinaryAttributeValue</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredential</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectCredentialType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationship</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipName</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectRelationshipType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectTextAttribute</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateIdentityObjectType</value>
- <value>org.jboss.identity.idm.impl.model.hibernate.HibernateRealm</value>
- </values-param>
- <properties-param>
- <name>hibernate.properties</name>
- <property name="hibernate.hbm2ddl.auto" value="update"/>
- <property name="hibernate.current_session_context_class" value="thread"/>
- <property name="hibernate.show_sql" value="false"/>
- <property name="hibernate.cglib.use_reflection_optimizer" value="true"/>
- <property name="hibernate.connection.url" value="jdbc:hsqldb:file:../temp/data/exodb${container.name.suffix}"/>
- <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
- <property name="hibernate.connection.autocommit" value="true"/>
- <property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value=""/>
- <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
- <property name="hibernate.c3p0.min_size" value="5"/>
- <property name="hibernate.c3p0.max_size" value="20"/>
- <property name="hibernate.c3p0.timeout" value="1800"/>
- <property name="hibernate.c3p0.max_statements" value="50"/>
- </properties-param>
-
</init-params>
</component>
+
<component>
<key>org.exoplatform.services.organization.OrganizationService</key>
- <type>org.exoplatform.services.organization.jbidm.JBossIDMOrganizationServiceImpl</type>
+ <type>org.exoplatform.services.organization.idm.PicketLinkIDMOrganizationServiceImpl</type>
</component>
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.database.HibernateService</target-component>
+ <component-plugin>
+ <name>add.hibernate.mapping</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.database.impl.AddHibernateMappingPlugin</type>
+ <init-params>
+ <values-param>
+ <name>hibernate.mapping</name>
+ <value>mappings/HibernateRealm.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredentialBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectAttributeBinaryValue.hbm.xml</value>
+ <value>mappings/HibernateIdentityObject.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredential.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectCredentialType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectAttribute.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationship.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationshipType.hbm.xml</value>
+ <value>mappings/HibernateIdentityObjectRelationshipName.hbm.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+
</configuration>
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -378,11 +378,11 @@
</object-param>
<object-param>
- <name>eXoGadgets</name>
+ <name>Gadgets</name>
<description>Gadgets</description>
<object type="org.exoplatform.application.registry.ApplicationCategory">
<field name="name">
- <string>eXoGadgets</string>
+ <string>Gadgets</string>
</field>
<field name="displayName">
<string>Gadgets</string>
@@ -402,7 +402,7 @@
<value>
<object type="org.exoplatform.application.registry.Application">
<field name="categoryName">
- <string>eXoGadgets</string>
+ <string>Gadgets</string>
</field>
<field name="applicationName">
<string>Todo</string>
@@ -431,7 +431,7 @@
<value>
<object type="org.exoplatform.application.registry.Application">
<field name="categoryName">
- <string>eXoGadgets</string>
+ <string>Gadgets</string>
</field>
<field name="applicationName">
<string>Calendar</string>
@@ -462,7 +462,7 @@
<value>
<object type="org.exoplatform.application.registry.Application">
<field name="categoryName">
- <string>eXoGadgets</string>
+ <string>Gadgets</string>
</field>
<field name="applicationName">
<string>Calculator</string>
@@ -493,7 +493,7 @@
<value>
<object type="org.exoplatform.application.registry.Application">
<field name="categoryName">
- <string>eXoGadgets</string>
+ <string>Gadgets</string>
</field>
<field name="applicationName">
<string>rssAggregator</string>
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/classic/pages.xml
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/classic/pages.xml 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/portal/portal/classic/pages.xml 2009-11-26 01:03:34 UTC (rev 805)
@@ -103,13 +103,6 @@
<portlet>
<application-ref>web</application-ref>
<portlet-ref>SiteMapPortlet</portlet-ref>
- <preferences>
- <preference>
- <name>url</name>
- <value>http://www.facebook.com</value>
- <read-only>false</read-only>
- </preference>
- </preferences>
</portlet>
<title>SiteMap</title>
<access-permissions>Everyone</access-permissions>
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/groovy/webui/core/UIWizard.gtmpl
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/groovy/webui/core/UIWizard.gtmpl 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/groovy/webui/core/UIWizard.gtmpl 2009-11-26 01:03:34 UTC (rev 805)
@@ -39,7 +39,7 @@
}
strStep = _ctx.appRes(uicomponent.getId() + ".label.step") + String.valueOf(j);
if(i != step) {
- actionLink = uicomponent.url("ViewStep" + String.valueOf(i));0
+ actionLink = uicomponent.url("ViewStep" + String.valueOf(i));
print "<a href=\"$actionLink\" title=\"$strStep\">";
} else print "<a href=\"#\" class=\"SelectedStep\" title=\"$strStep\">";
Modified: portal/branches/wsrp-integration/web/portal/src/main/webapp/templates/groovy/webui/component/UIHomePagePortlet.gtmpl
===================================================================
--- portal/branches/wsrp-integration/web/portal/src/main/webapp/templates/groovy/webui/component/UIHomePagePortlet.gtmpl 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/web/portal/src/main/webapp/templates/groovy/webui/component/UIHomePagePortlet.gtmpl 2009-11-26 01:03:34 UTC (rev 805)
@@ -92,10 +92,4 @@
</div>
<div class="ClearBoth"><span></span></div>
</div>
-<div class="BottomDecoratorHome">
- <div class="BottomDecoratorLeft">
- <div class="BottomDecoratorRight">
- <div class="BottomDecoratorMiddle"><span></span></div>
- </div>
- </div>
-</div>
+
Modified: portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/application/ApplicationStatistic.java
===================================================================
--- portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/application/ApplicationStatistic.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/application/ApplicationStatistic.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -51,6 +51,11 @@
this.appId = appId;
}
+ public String getAppId()
+ {
+ return appId;
+ }
+
/**
* Log the time.
*
Modified: portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/application/ApplicationStatisticService.java
===================================================================
--- portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/application/ApplicationStatisticService.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/application/ApplicationStatisticService.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -19,8 +19,6 @@
package org.exoplatform.portal.application;
-import org.exoplatform.application.registry.Application;
-import org.exoplatform.application.registry.ApplicationRegistryService;
import org.exoplatform.management.annotations.Managed;
import org.exoplatform.management.annotations.ManagedDescription;
import org.exoplatform.management.annotations.ManagedName;
@@ -31,11 +29,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
-import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@@ -50,17 +44,11 @@
public class ApplicationStatisticService implements Startable
{
- private ApplicationRegistryService appRegistryService;
+ /** . */
+ private final ConcurrentMap<String, ApplicationStatistic> apps = new ConcurrentHashMap<String, ApplicationStatistic>();
- private ConcurrentMap<String, ApplicationStatistic> apps = new ConcurrentHashMap<String, ApplicationStatistic>();
-
- private final String ASC = "ASC";
-
- private final String DESC = "DESC";
-
- public ApplicationStatisticService(ApplicationRegistryService appRegistryService)
+ public ApplicationStatisticService()
{
- this.appRegistryService = appRegistryService;
}
/*
@@ -70,22 +58,9 @@
@ManagedDescription("The list of application identifiers sorted alphabetically")
public String[] getApplicationList()
{
- List<Application> list = null;
- try
- {
- list = appRegistryService.getAllApplications();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- List<String> appIds = new ArrayList<String>();
- for (Application app : list)
- {
- appIds.add(app.getId());
- }
- Collections.sort(appIds);
- return appIds.toArray(new String[appIds.size()]);
+ List<String> list = new ArrayList<String>(apps.keySet());
+ Collections.sort(list);
+ return list.toArray(new String[list.size()]);
}
/*
@@ -158,28 +133,7 @@
@ManagedDescription("The list of the 10 slowest applications")
public String[] getSlowestApplications()
{
- List<Application> list = null;
- Map application = new HashMap();
- try
- {
- list = appRegistryService.getAllApplications();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
-
- for (Application app : list)
- {
- ApplicationStatistic appSta = getApplicationStatistic(app.getId());
- // remove application haven't loaded
- if (appSta.getAverageTime() != 0)
- {
- application.put(app.getId(), appSta.getAverageTime());
- }
- }
-
- return sort(application, DESC);
+ return getApplicationsSortedByAverageTime(true);
}
/*
@@ -189,28 +143,32 @@
@ManagedDescription("The list of the 10 fastest applications")
public String[] getFastestApplications()
{
- List<Application> list = null;
- Map application = new HashMap();
- try
+ return getApplicationsSortedByAverageTime(false);
+ }
+
+ private String[] getApplicationsSortedByAverageTime(boolean desc)
+ {
+ List<ApplicationStatistic> list = new ArrayList<ApplicationStatistic>();
+ for (ApplicationStatistic app : apps.values())
{
- list = appRegistryService.getAllApplications();
+ if (app.getAverageTime() > 0)
+ {
+ list.add(app);
+ }
}
- catch (Exception e)
+ Collections.sort(list, new Comparator<ApplicationStatistic>()
{
- e.printStackTrace();
- }
-
- for (Application app : list)
- {
- ApplicationStatistic appSta = getApplicationStatistic(app.getId());
- // remove application haven't loaded
- if (appSta.getAverageTime() != 0)
+ public int compare(ApplicationStatistic o1, ApplicationStatistic o2)
{
- application.put(app.getId(), appSta.getAverageTime());
+ return (int)Math.signum(o1.getAverageTime() - o2.getAverageTime());
}
+ });
+ if (desc)
+ {
+ Collections.reverse(list);
}
-
- return sort(application, ASC);
+ List<ApplicationStatistic> sub = list.subList(0, Math.min(list.size(), 10));
+ return asIds(sub);
}
/*
@@ -220,97 +178,34 @@
@ManagedDescription("The list of the 10 most executed applications")
public String[] getMostExecutedApplications()
{
- List<Application> list = null;
- Map application = new HashMap();
- try
+ ArrayList<ApplicationStatistic> list = new ArrayList<ApplicationStatistic>();
+ for (ApplicationStatistic app : apps.values())
{
- list = appRegistryService.getAllApplications();
+ if (app.executionCount() > 0)
+ {
+ list.add(app);
+ }
}
- catch (Exception e)
+ Collections.sort(list, new Comparator<ApplicationStatistic>()
{
- e.printStackTrace();
- }
-
- for (Application app : list)
- {
- ApplicationStatistic appSta = getApplicationStatistic(app.getId());
- // remove application haven't loaded
- if (appSta.executionCount() != 0)
+ public int compare(ApplicationStatistic o1, ApplicationStatistic o2)
{
- application.put(app.getId(), appSta.executionCount());
+ long diff = o1.executionCount() - o2.executionCount();
+ return diff == 0 ? 0 : diff > 0 ? -1 : 1;
}
- }
-
- return sort(application, DESC);
+ });
+ List<ApplicationStatistic> sub = list.subList(0, Math.min(list.size(), 10));
+ return asIds(sub);
}
- /*
- * sort map by value asc or desc
- */
- private String[] sort(Map source, String order)
+ private String[] asIds(List<ApplicationStatistic> list)
{
- String[] app = new String[10];
- List<Object> list = new LinkedList<Object>(source.entrySet());
- if (order.equals(ASC))
+ String[] array = new String[list.size()];
+ for (int i = 0;i < list.size();i++)
{
- Collections.sort(list, new Comparator<Object>()
- {
- public int compare(Object o1, Object o2)
- {
- double value1 = Double.parseDouble(((Map.Entry)(o1)).getValue().toString());
- double value2 = Double.parseDouble(((Map.Entry)(o2)).getValue().toString());
- if (value1 > value2)
- {
- return 1;
- }
- else if (value1 < value2)
- {
- return -1;
- }
- else
- {
- return 0;
- }
- }
- });
+ array[i] = list.get(i).getAppId();
}
- else if (order.equals(DESC))
- {
- Collections.sort(list, new Comparator<Object>()
- {
- public int compare(Object o1, Object o2)
- {
- double value1 = Double.parseDouble(((Map.Entry)(o1)).getValue().toString());
- double value2 = Double.parseDouble(((Map.Entry)(o2)).getValue().toString());
- if (value2 > value1)
- {
- return 1;
- }
- else if (value2 < value1)
- {
- return -1;
- }
- else
- {
- return 0;
- }
- }
- });
- }
-
- int index = 0;
- for (Iterator it = list.iterator(); it.hasNext();)
- {
- Map.Entry entry = (Map.Entry)it.next();
- app[index] = (String)entry.getKey();
- index++;
- if (index >= app.length)
- {
- break;
- }
- }
- return app;
-
+ return array;
}
private double toSeconds(double value)
Modified: portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ModelAdapter.java
===================================================================
--- portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ModelAdapter.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ModelAdapter.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -183,7 +183,7 @@
public ApplicationState<Gadget> update(ExoContainer container, ExoPortletState updateState,
ApplicationState<Gadget> gadgetApplicationState) throws Exception
{
- throw new UnsupportedOperationException("todo / julien");
+ throw new UnsupportedOperationException("Cannot edit gadget preferences");
}
@Override
Modified: portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java
===================================================================
--- portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -149,6 +149,7 @@
private List<String> supportModes_;
private List<QName> supportedProcessingEvents_;
+ private List<QName> supportedPublishingEvents_;
private List<String> supportedPublicParams_;
private boolean portletInPortal_ = true;
private StateString navigationalState;
@@ -488,14 +489,49 @@
QName eventName = iter.next();
if (eventName.equals(name))
{
- log.info("The Portlet " + producerOfferedPortletContext + " supports the event : " + name);
+ log.info("The Portlet " + producerOfferedPortletContext + " supports comsuming the event : " + name);
return true;
}
}
- log.info("The portlet " + producerOfferedPortletContext + " doesn't support the event : " + name);
+ log.info("The portlet " + producerOfferedPortletContext + " doesn't support consuming the event : " + name);
return false;
}
+ public boolean supportsPublishingEvent (QName name)
+ {
+ if (supportedPublishingEvents_ == null)
+ {
+ org.gatein.pc.api.Portlet portlet = getProducedOfferedPortlet();
+
+ if (portlet == null)
+ {
+ log.info("Could not find portlet with ID : " + producerOfferedPortletContext.getId());
+ return false;
+ }
+
+ Map<QName, EventInfo> producedEvents = (Map<QName, EventInfo>)portlet.getInfo().getEventing().getProducedEvents();
+
+ if (producedEvents == null)
+ {
+ return false;
+ }
+
+ supportedPublishingEvents_ = new ArrayList<QName>(producedEvents.keySet());
+ }
+
+ for (Iterator<QName> iter = supportedPublishingEvents_.iterator(); iter.hasNext();)
+ {
+ QName eventName = iter.next();
+ if (eventName.equals(name))
+ {
+ log.info("The Portlet " + producerOfferedPortletContext + " supports producing the event : " + name);
+ return true;
+ }
+ }
+ log.info("The portlet " + producerOfferedPortletContext + " doesn't support producing the event : " + name);
+ return false;
+ }
+
/**
* Tells, according to the info located in portlet.xml, wether this portlet supports the public render parameter
* given as a method argument
Modified: portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
===================================================================
--- portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -211,8 +211,11 @@
{
for (UpdateNavigationalStateResponse.Event nsEvent : nsEvents)
{
- javax.portlet.Event portletEvent = new PortletEvent(nsEvent.getName(), nsEvent.getPayload());
- events.add(portletEvent);
+ if (uiPortlet.supportsPublishingEvent(nsEvent.getName()))
+ {
+ javax.portlet.Event portletEvent = new PortletEvent(nsEvent.getName(), nsEvent.getPayload());
+ events.add(portletEvent);
+ }
}
}
@@ -597,8 +600,8 @@
setupPublicRenderParams(uiPortlet, request.getParameterMap());
//set render params
- Map<String, String[]> renderParams = ((PortalRequestContext)event.getRequestContext()).getPortletParameters();
- uiPortlet.setNavigationalState(ParametersStateString.create(renderParams));
+ String navState = ((PortalRequestContext)event.getRequestContext()).getRequestParameter(ExoPortletInvocationContext.NAVIGATIONAL_STATE_PARAM_NAME);
+ uiPortlet.setNavigationalState(ParametersStateString.create(navState));
}
}
Modified: portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java
===================================================================
--- portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationManagement.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -95,7 +95,11 @@
UserPortalConfigService portalConfigService =
uiManagement.getApplicationComponent(UserPortalConfigService.class);
PageNavigation navigation = uiNodeSelector.getSelectedNavigation();
- portalConfigService.update(navigation);
+ List<String> allPortalNames = portalConfigService.getAllPortalNames();
+ if(allPortalNames.contains(navigation.getOwnerId()))
+ {
+ portalConfigService.update(navigation);
+ }
UIPortal uiPortal = Util.getUIPortal();
setNavigation(uiPortal.getNavigations(), navigation);
UIPopupWindow uiPopup = uiManagement.getParent();
Modified: portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationNodeSelector.java
===================================================================
--- portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationNodeSelector.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UINavigationNodeSelector.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -495,7 +495,8 @@
}
else
{
- throw new Exception("Page don't exist!");
+ uiApp.addMessage(new ApplicationMessage("UIPageNodeSelector.msg.notAvailable", null));
+ return;
}
}
}
Modified: portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java
===================================================================
--- portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageCreationWizard.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -287,6 +287,7 @@
if (uiWizard.getSelectedStep() < THIRD_STEP)
{
+ uiWizard.setShowActions(true);
uiWizard.setDescriptionWizard(uiWizard.getSelectedStep());
uiWizard.updateWizardComponent();
uiPortalApp.addMessage(new ApplicationMessage("UIPageCreationWizard.msg.StepByStep", null));
Modified: portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
===================================================================
--- portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2009-11-25 21:32:49 UTC (rev 804)
+++ portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2009-11-26 01:03:34 UTC (rev 805)
@@ -19,7 +19,6 @@
package org.exoplatform.portal.webui.portal;
-import org.exoplatform.application.gadget.GadgetRegistryService;
import org.exoplatform.application.registry.Application;
import org.exoplatform.commons.utils.PageList;
import org.exoplatform.portal.application.PortalRequestContext;
@@ -27,13 +26,8 @@
import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.config.model.CloneApplicationState;
import org.exoplatform.portal.config.model.Container;
-import org.exoplatform.portal.config.model.TransientApplicationState;
-import org.exoplatform.portal.pom.spi.gadget.Gadget;
-import org.exoplatform.portal.pom.spi.portlet.Portlet;
-import org.exoplatform.portal.pom.spi.portlet.Preference;
import org.exoplatform.portal.webui.application.PortletState;
import org.exoplatform.portal.webui.application.UIApplicationList;
-import org.exoplatform.portal.webui.application.UIGadget;
import org.exoplatform.portal.webui.application.UIPortlet;
import org.exoplatform.portal.webui.container.UIContainerList;
import org.exoplatform.portal.webui.login.UILogin;
@@ -50,10 +44,6 @@
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.Query;
import org.exoplatform.services.organization.User;
-import org.exoplatform.services.rss.parser.DefaultRSSChannel;
-import org.exoplatform.services.rss.parser.DefaultRSSItem;
-import org.exoplatform.services.rss.parser.RSSDocument;
-import org.exoplatform.services.rss.parser.RSSParser;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.web.application.JavascriptManager;
import org.exoplatform.webui.core.UIComponent;
@@ -63,7 +53,6 @@
import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.exception.MessageException;
-import java.net.URI;
import java.util.Date;
import java.util.List;
@@ -97,9 +86,9 @@
static public class DeleteComponentActionListener extends EventListener<UIComponent>
{
- private final static String UI_CONTAINER = "UIContainer";
+ private final static String UI_CONTAINER_PREFIX = "UIContainer-";
- private final static String UI_PORTLET = "UIPortlet";
+ private final static String UI_PORTLET_PREFIX = "UIPortlet-";
public void execute(Event<UIComponent> event) throws Exception
{
@@ -152,42 +141,87 @@
Util.showComponentLayoutMode(uiRemoveComponent.getClass());
PortalRequestContext pcontext = (PortalRequestContext)event.getRequestContext();
- String componentType = null;
+
+ // Case1: current component is a portlet
if (uiComponent instanceof UIPortlet)
{
- componentType = UI_PORTLET;
+ removeComponent(id, UI_PORTLET_PREFIX, pcontext);
+ return;
}
- else if (uiComponent instanceof org.exoplatform.portal.webui.container.UIContainer)
+
+ // Case 2: current component is a container
+ if (uiComponent instanceof org.exoplatform.portal.webui.container.UIContainer)
{
- componentType = UI_CONTAINER;
- org.exoplatform.portal.webui.container.UIContainer topAncestor = getTopBlockContainer((org.exoplatform.portal.webui.container.UIContainer)uiParent);
-
- //Case of nested container like tab container, mixed container
- if(topAncestor != null){
+ org.exoplatform.portal.webui.container.UIContainer topAncestor =
+ getTopBlockContainer((org.exoplatform.portal.webui.container.UIContainer)uiParent);
+
+ /**
+ * topAncestor is null if the uiParent is either UIPortal or UIPage,
+ * that happens when our container is a simple container
+ */
+ if (topAncestor == null)
+ {
+ removeComponent(id, UI_CONTAINER_PREFIX, pcontext);
+ return;
+ }
+ /** Case of nested container like tab container, mixed container */
+ else
+ {
String topAncestorId = topAncestor.getId();
- //Add UIContainer- prefix to the id as it is required to be updated by Ajax
- if(!topAncestorId.startsWith("UIContainer-")){
- topAncestor.setId("UIContainer-" + topAncestorId);
+
+ /** If the topAncestor has no child, then it is removed */
+ if (topAncestor.getChildren().size() == 0)
+ {
+ /** Update server-side */
+ UIContainer parentOfTopAncestor = topAncestor.getParent();
+ parentOfTopAncestor.removeChildById(topAncestorId);
+
+ /** Update client side */
+ if (topAncestorId.startsWith(UI_CONTAINER_PREFIX))
+ {
+ topAncestorId = topAncestorId.substring(UI_CONTAINER_PREFIX.length());
+ topAncestor.setId(topAncestorId);
+ }
+ removeComponent(topAncestorId, UI_CONTAINER_PREFIX, pcontext);
+ return;
}
+
+ /** If the uiParent is not the topAncestor and having no child, then it is removed */
+ if(uiParent.getChildren().size() == 0)
+ {
+ /** Update server-side */
+ UIContainer itsParent = uiParent.getParent();
+ itsParent.removeChildById(uiParent.getId());
+ }
+
+ /**
+ * Update the topAncestor by Ajax
+ */
+ if (!topAncestorId.startsWith(UI_CONTAINER_PREFIX))
+ {
+ topAncestor.setId(UI_CONTAINER_PREFIX + topAncestorId);
+ }
pcontext.addUIComponentToUpdateByAjax(topAncestor);
return;
}
}
- if (componentType != null)
- {
- JavascriptManager jsManager = pcontext.getJavascriptManager();
- jsManager.addJavascript(scriptRemovingComponent(id, componentType));
- jsManager.addJavascript("eXo.portal.UIPortal.changeComposerSaveButton();");
- }
}
- private String scriptRemovingComponent(String componentId, String componentType)
+ /** Add Javascript script to remove component */
+ private void removeComponent(String componentId, String componentType, PortalRequestContext pcontext)
{
+ String scriptRemovingComponent = scriptRemovingComponent(componentId, componentType);
+ JavascriptManager jsManager = pcontext.getJavascriptManager();
+ jsManager.addJavascript(scriptRemovingComponent);
+ jsManager.addJavascript("eXo.portal.UIPortal.changeComposerSaveButton();");
+ }
+
+ private String scriptRemovingComponent(String componentId, String prefix)
+ {
StringBuffer buffer = new StringBuffer();
buffer.append("eXo.portal.UIPortal.removeComponent('");
- buffer.append(componentType);
- buffer.append("-");
+ buffer.append(prefix);
buffer.append(componentId);
buffer.append("');");
return buffer.toString();
@@ -196,12 +230,13 @@
/**
* Returns the top ancestor( of type
* org.exoplatform.portal.webui.container.UIContainer but not of type
- * UIPortal) of a given container
+ * UIPortal or UIPage) of a given container
*/
private static org.exoplatform.portal.webui.container.UIContainer getTopBlockContainer(
org.exoplatform.portal.webui.container.UIContainer container)
{
- if(container instanceof UIPortal){
+ if (container instanceof UIPortal || container instanceof UIPage)
+ {
return null;
}
org.exoplatform.portal.webui.container.UIContainer topAncestor = container;
@@ -209,7 +244,8 @@
try
{
intermediateCont = topAncestor.getParent();
- while (intermediateCont != null && !(intermediateCont instanceof UIPortal))
+ while (intermediateCont != null && !(intermediateCont instanceof UIPortal)
+ && !(intermediateCont instanceof UIPage))
{
topAncestor = intermediateCont;
intermediateCont = topAncestor.getParent();
@@ -305,15 +341,6 @@
app = appList.getApplication(sourceId);
ApplicationType applicationType = app.getType();
- // TanPD: Hardcoded to fix bug GTNPORTAL-91
- Application temp = null;
- if (applicationType.equals(ApplicationType.GADGET))
- {
- applicationType = ApplicationType.PORTLET;
- temp = app;
- app = appList.getApplication("dashboard/Gadget_Wrapper_Portlet");
- }
-
//
UIPortlet uiPortlet = uiTarget.createUIComponent(UIPortlet.class, null, null);
if (app.getDisplayName() != null)
@@ -342,41 +369,9 @@
//
uiPortlet.setState(new PortletState(state, applicationType));
-
- // TanPD: Fix bug GTNPORTAL-91
- if (temp != null && applicationType.equals(ApplicationType.PORTLET))
- {
- Portlet pref = uiPortlet.getPreferences();
- try
- {
- UIGadget uiGadget = uiPortlet.createUIComponent(UIGadget.class, null, null);
- uiGadget.setState(new TransientApplicationState<Gadget>(temp.getApplicationName()));
- pref.setValue("url", uiGadget.getUrl());
- }
- catch (Exception e)
- {
- // Fix in case: RSS Reader Gadget
- Preference aggIdPref = pref.getPreference("aggregatorId");
- String aggregatorId = null;
- if (aggIdPref == null || aggIdPref.getValue() == null || aggIdPref.getValue().length() == 0)
- aggregatorId = "rssAggregator";
- else
- aggregatorId = aggIdPref.getValue();
- GadgetRegistryService gadgetSrv = uiApp.getApplicationComponent(GadgetRegistryService.class);
- org.exoplatform.application.gadget.Gadget gadget = gadgetSrv.getGadget(aggregatorId);
- // TODO make sure it's an rss feed
- // TODO make sure that we did not add it already
- UIGadget uiGadget = uiPortlet.createUIComponent(UIGadget.class, null, null);
- uiGadget.setState(new TransientApplicationState<org.exoplatform.portal.pom.spi.gadget.Gadget>(
- gadget.getName()));
- pref.setValue("url", uiGadget.getUrl());
- }
- }
-
uiPortlet.setPortletInPortal(uiTarget instanceof UIPortal);
uiPortlet.setShowEditControl(true);
uiSource = uiPortlet;
-
}
List<UIComponent> children = uiTarget.getChildren();
uiSource.setParent(uiTarget);
15 years, 1 month