Move to security
authorMathieu Baudier <mbaudier@argeo.org>
Sun, 27 Feb 2011 11:24:11 +0000 (11:24 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Sun, 27 Feb 2011 11:24:11 +0000 (11:24 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@4226 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

152 files changed:
security/eclipse/plugins/org.argeo.security.equinox/.classpath [deleted file]
security/eclipse/plugins/org.argeo.security.equinox/.project [deleted file]
security/eclipse/plugins/org.argeo.security.equinox/.settings/org.eclipse.jdt.core.prefs [deleted file]
security/eclipse/plugins/org.argeo.security.equinox/.settings/org.eclipse.pde.core.prefs [deleted file]
security/eclipse/plugins/org.argeo.security.equinox/META-INF/spring/loginModules.xml [deleted file]
security/eclipse/plugins/org.argeo.security.equinox/META-INF/spring/osgi.xml [deleted file]
security/eclipse/plugins/org.argeo.security.equinox/build.properties [deleted file]
security/eclipse/plugins/org.argeo.security.equinox/plugin.xml [deleted file]
security/eclipse/plugins/org.argeo.security.equinox/pom.xml [deleted file]
security/eclipse/plugins/org.argeo.security.equinox/src/main/java/org/argeo/security/equinox/SpringLoginModule.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/.classpath [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/.project [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/.settings/org.eclipse.jdt.core.prefs [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/META-INF/jaas_default.txt [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/argeo_security_rap.properties [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/build.properties [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_about.gif [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_launcher.icns [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_launcher.ico [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_launcher.xpm [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_window_16.gif [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_window_32.gif [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/log4j.properties [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/org.argeo.security.ui.application.product [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/plugin.xml [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/plugin_customization.ini [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/pom.xml [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/AbstractSecureApplication.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/RapSecureWorkbenchWindowAdvisor.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureActionBarAdvisor.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureApplicationActivator.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureRap.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureRcp.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureWorkbenchAdvisor.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureWorkbenchWindowAdvisor.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui.rap/pom.xml [deleted file]
security/eclipse/plugins/org.argeo.security.ui/.classpath [deleted file]
security/eclipse/plugins/org.argeo.security.ui/.project [deleted file]
security/eclipse/plugins/org.argeo.security.ui/.settings/org.eclipse.jdt.core.prefs [deleted file]
security/eclipse/plugins/org.argeo.security.ui/.settings/org.eclipse.pde.core.prefs [deleted file]
security/eclipse/plugins/org.argeo.security.ui/META-INF/spring/commands.xml [deleted file]
security/eclipse/plugins/org.argeo.security.ui/META-INF/spring/editors.xml [deleted file]
security/eclipse/plugins/org.argeo.security.ui/META-INF/spring/osgi.xml [deleted file]
security/eclipse/plugins/org.argeo.security.ui/META-INF/spring/views.xml [deleted file]
security/eclipse/plugins/org.argeo.security.ui/build.properties [deleted file]
security/eclipse/plugins/org.argeo.security.ui/icons/add.gif [deleted file]
security/eclipse/plugins/org.argeo.security.ui/icons/password.gif [deleted file]
security/eclipse/plugins/org.argeo.security.ui/icons/refresh.png [deleted file]
security/eclipse/plugins/org.argeo.security.ui/icons/remove.gif [deleted file]
security/eclipse/plugins/org.argeo.security.ui/icons/role.gif [deleted file]
security/eclipse/plugins/org.argeo.security.ui/icons/save.gif [deleted file]
security/eclipse/plugins/org.argeo.security.ui/icons/save_security.png [deleted file]
security/eclipse/plugins/org.argeo.security.ui/icons/save_security_disabled.png [deleted file]
security/eclipse/plugins/org.argeo.security.ui/icons/security.gif [deleted file]
security/eclipse/plugins/org.argeo.security.ui/icons/user.gif [deleted file]
security/eclipse/plugins/org.argeo.security.ui/icons/users.gif [deleted file]
security/eclipse/plugins/org.argeo.security.ui/plugin.xml [deleted file]
security/eclipse/plugins/org.argeo.security.ui/pom.xml [deleted file]
security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/CurrentUser.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/SecurityPerspective.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/SecurityUiPlugin.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/AddRole.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/OpenArgeoUserEditor.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/OpenChangePasswordDialog.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/RefreshUsersList.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/SaveArgeoUser.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/dialogs/AbstractLoginDialog.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/dialogs/ChangePasswordDialog.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/dialogs/DefaultLoginDialog.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/editors/ArgeoUserEditor.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/editors/ArgeoUserEditorInput.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/editors/DefaultUserMainPage.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/views/CurrentUserView.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/views/RolesView.java [deleted file]
security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/views/UsersView.java [deleted file]
security/eclipse/plugins/pom.xml [deleted file]
security/plugins/org.argeo.security.equinox/.classpath [new file with mode: 0644]
security/plugins/org.argeo.security.equinox/.project [new file with mode: 0644]
security/plugins/org.argeo.security.equinox/.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
security/plugins/org.argeo.security.equinox/.settings/org.eclipse.pde.core.prefs [new file with mode: 0644]
security/plugins/org.argeo.security.equinox/META-INF/spring/loginModules.xml [new file with mode: 0644]
security/plugins/org.argeo.security.equinox/META-INF/spring/osgi.xml [new file with mode: 0644]
security/plugins/org.argeo.security.equinox/build.properties [new file with mode: 0644]
security/plugins/org.argeo.security.equinox/plugin.xml [new file with mode: 0644]
security/plugins/org.argeo.security.equinox/pom.xml [new file with mode: 0644]
security/plugins/org.argeo.security.equinox/src/main/java/org/argeo/security/equinox/SpringLoginModule.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/.classpath [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/.project [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/META-INF/jaas_default.txt [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/argeo_security_rap.properties [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/build.properties [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/icons/alt_about.gif [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/icons/alt_launcher.icns [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/icons/alt_launcher.ico [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/icons/alt_launcher.xpm [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/icons/alt_window_16.gif [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/icons/alt_window_32.gif [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/log4j.properties [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/org.argeo.security.ui.application.product [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/plugin.xml [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/plugin_customization.ini [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/pom.xml [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/AbstractSecureApplication.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/RapSecureWorkbenchWindowAdvisor.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureActionBarAdvisor.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureApplicationActivator.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureRap.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureRcp.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureWorkbenchAdvisor.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureWorkbenchWindowAdvisor.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui.rap/pom.xml [new file with mode: 0644]
security/plugins/org.argeo.security.ui/.classpath [new file with mode: 0644]
security/plugins/org.argeo.security.ui/.project [new file with mode: 0644]
security/plugins/org.argeo.security.ui/.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
security/plugins/org.argeo.security.ui/.settings/org.eclipse.pde.core.prefs [new file with mode: 0644]
security/plugins/org.argeo.security.ui/META-INF/spring/commands.xml [new file with mode: 0644]
security/plugins/org.argeo.security.ui/META-INF/spring/editors.xml [new file with mode: 0644]
security/plugins/org.argeo.security.ui/META-INF/spring/osgi.xml [new file with mode: 0644]
security/plugins/org.argeo.security.ui/META-INF/spring/views.xml [new file with mode: 0644]
security/plugins/org.argeo.security.ui/build.properties [new file with mode: 0644]
security/plugins/org.argeo.security.ui/icons/add.gif [new file with mode: 0644]
security/plugins/org.argeo.security.ui/icons/password.gif [new file with mode: 0644]
security/plugins/org.argeo.security.ui/icons/refresh.png [new file with mode: 0644]
security/plugins/org.argeo.security.ui/icons/remove.gif [new file with mode: 0644]
security/plugins/org.argeo.security.ui/icons/role.gif [new file with mode: 0644]
security/plugins/org.argeo.security.ui/icons/save.gif [new file with mode: 0644]
security/plugins/org.argeo.security.ui/icons/save_security.png [new file with mode: 0644]
security/plugins/org.argeo.security.ui/icons/save_security_disabled.png [new file with mode: 0644]
security/plugins/org.argeo.security.ui/icons/security.gif [new file with mode: 0644]
security/plugins/org.argeo.security.ui/icons/user.gif [new file with mode: 0644]
security/plugins/org.argeo.security.ui/icons/users.gif [new file with mode: 0644]
security/plugins/org.argeo.security.ui/plugin.xml [new file with mode: 0644]
security/plugins/org.argeo.security.ui/pom.xml [new file with mode: 0644]
security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/CurrentUser.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/SecurityPerspective.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/SecurityUiPlugin.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/AddRole.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/OpenArgeoUserEditor.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/OpenChangePasswordDialog.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/RefreshUsersList.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/SaveArgeoUser.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/dialogs/AbstractLoginDialog.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/dialogs/ChangePasswordDialog.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/dialogs/DefaultLoginDialog.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/editors/ArgeoUserEditor.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/editors/ArgeoUserEditorInput.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/editors/DefaultUserMainPage.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/views/CurrentUserView.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/views/RolesView.java [new file with mode: 0644]
security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/views/UsersView.java [new file with mode: 0644]
security/plugins/pom.xml [new file with mode: 0644]

diff --git a/security/eclipse/plugins/org.argeo.security.equinox/.classpath b/security/eclipse/plugins/org.argeo.security.equinox/.classpath
deleted file mode 100644 (file)
index 92f19d2..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
-       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-       <classpathentry kind="src" path="src/main/java"/>
-       <classpathentry kind="output" path="target/classes"/>
-</classpath>
diff --git a/security/eclipse/plugins/org.argeo.security.equinox/.project b/security/eclipse/plugins/org.argeo.security.equinox/.project
deleted file mode 100644 (file)
index e4dd594..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>org.argeo.security.equinox</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.ManifestBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.SchemaBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.pde.PluginNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-       </natures>
-</projectDescription>
diff --git a/security/eclipse/plugins/org.argeo.security.equinox/.settings/org.eclipse.jdt.core.prefs b/security/eclipse/plugins/org.argeo.security.equinox/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644 (file)
index 62fa6bd..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#Sun Jan 16 11:20:02 CET 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/security/eclipse/plugins/org.argeo.security.equinox/.settings/org.eclipse.pde.core.prefs b/security/eclipse/plugins/org.argeo.security.equinox/.settings/org.eclipse.pde.core.prefs
deleted file mode 100644 (file)
index 87ab381..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#Sun Jan 16 11:19:07 CET 2011
-eclipse.preferences.version=1
-pluginProject.extensions=false
-resolve.requirebundle=false
diff --git a/security/eclipse/plugins/org.argeo.security.equinox/META-INF/spring/loginModules.xml b/security/eclipse/plugins/org.argeo.security.equinox/META-INF/spring/loginModules.xml
deleted file mode 100644 (file)
index f454d7a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans.xsd">
-
-       <bean id="springLoginModule" class="org.argeo.security.equinox.SpringLoginModule"
-               scope="prototype">
-               <property name="authenticationManager" ref="authenticationManager" />
-       </bean>
-</beans>
diff --git a/security/eclipse/plugins/org.argeo.security.equinox/META-INF/spring/osgi.xml b/security/eclipse/plugins/org.argeo.security.equinox/META-INF/spring/osgi.xml
deleted file mode 100644 (file)
index 8003fb2..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
-       xmlns:osgi="http://www.springframework.org/schema/osgi"\r
-       xsi:schemaLocation="http://www.springframework.org/schema/osgi  \r
-       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
-       http://www.springframework.org/schema/beans   \r
-       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"\r
-       osgi:default-timeout="30000">\r
-\r
-       <reference id="authenticationManager"\r
-               interface="org.springframework.security.AuthenticationManager"\r
-               context-class-loader="client" />\r
-</beans:beans>
\ No newline at end of file
diff --git a/security/eclipse/plugins/org.argeo.security.equinox/build.properties b/security/eclipse/plugins/org.argeo.security.equinox/build.properties
deleted file mode 100644 (file)
index 3e2615f..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-bin.includes = META-INF/,\
-               plugin.xml
-source.. = src/main/java/
-output.. = target/classes/
diff --git a/security/eclipse/plugins/org.argeo.security.equinox/plugin.xml b/security/eclipse/plugins/org.argeo.security.equinox/plugin.xml
deleted file mode 100644 (file)
index b407360..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
-   <extension
-         id="springSecurityContextLoginModule"
-         point="org.eclipse.equinox.security.loginModule">
-      <loginModule
-            class="org.springframework.security.providers.jaas.SecurityContextLoginModule"
-            description="Spring Security Context (provided by Spring)">
-      </loginModule>
-   </extension>
-  <extension id="unixLoginModule"
-           name="Unix Login Module"
-           point="org.eclipse.equinox.security.loginModule">
-   <loginModule
-       class="com.sun.security.auth.module.UnixLoginModule"
-       description="Unix Login Module">
-   </loginModule>
-   </extension>
-  <extension
-        id="springLoginModule"
-        point="org.eclipse.equinox.security.loginModule">
-        name="Spring Login Module"
-     <loginModule
-           class="org.argeo.eclipse.spring.SpringExtensionFactory"
-           description="Spring Login Module">
-     </loginModule>
-  </extension>
-
-</plugin>
diff --git a/security/eclipse/plugins/org.argeo.security.equinox/pom.xml b/security/eclipse/plugins/org.argeo.security.equinox/pom.xml
deleted file mode 100644 (file)
index 944a6e0..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-<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.argeo.commons.security</groupId>
-               <version>0.2.3-SNAPSHOT</version>
-               <artifactId>plugins</artifactId>
-               <relativePath>..</relativePath>
-       </parent>
-       <artifactId>org.argeo.security.equinox</artifactId>
-       <name>Commons Security Equinox</name>
-       <packaging>jar</packaging>
-       <build>
-               <plugins>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-compiler-plugin</artifactId>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-source-plugin</artifactId>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-jar-plugin</artifactId>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.felix</groupId>
-                               <artifactId>maven-bundle-plugin</artifactId>
-                               <version>${version.maven-bundle-plugin}</version>
-                               <configuration>
-<!--                                   <instructions>-->
-<!--                                           <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>-->
-<!--                                           <Bundle-Activator>org.argeo.security.equinox.EquinoxSecurity</Bundle-Activator>-->
-<!--                                           <Import-Package>-->
-<!--                                                   org.osgi.framework;version="0.0.0",-->
-<!--                                                   !org.eclipse.equinox.security.auth,-->
-<!--                                                   org.springframework.core,-->
-<!--                                                   org.argeo.eclipse.spring,-->
-<!--                                                   *-->
-<!--                                           </Import-Package>-->
-<!--                                           <Require-Bundle>org.eclipse.equinox.security</Require-Bundle>-->
-<!--                                   </instructions>-->
-                                       <instructions>
-                                               <Import-Package>*,
-                                                       org.springframework.core,
-                                                       org.argeo.eclipse.spring
-                                               </Import-Package>
-                                       </instructions>
-                               </configuration>
-                       </plugin>
-               </plugins>
-       </build>
-       <dependencies>
-
-               <!-- Eclipse -->
-               <dependency>
-                       <groupId>org.eclipse.osgi</groupId>
-                       <artifactId>org.eclipse.osgi</artifactId>
-               </dependency>
-               <dependency>
-                       <groupId>org.eclipse.equinox</groupId>
-                       <artifactId>org.eclipse.equinox.security</artifactId>
-               </dependency>
-
-               <!-- Commons -->
-               <dependency>
-                       <groupId>org.argeo.commons.basic</groupId>
-                       <artifactId>org.argeo.basic.nodeps</artifactId>
-                       <version>0.2.3-SNAPSHOT</version>
-               </dependency>
-
-               <!-- Spring -->
-               <dependency>
-                       <groupId>org.springframework.security</groupId>
-                       <artifactId>org.springframework.security.core</artifactId>
-               </dependency>
-       </dependencies>
-</project>
diff --git a/security/eclipse/plugins/org.argeo.security.equinox/src/main/java/org/argeo/security/equinox/SpringLoginModule.java b/security/eclipse/plugins/org.argeo.security.equinox/src/main/java/org/argeo/security/equinox/SpringLoginModule.java
deleted file mode 100644 (file)
index 2222fae..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-package org.argeo.security.equinox;
-
-import java.util.Map;
-
-import javax.security.auth.Subject;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.TextOutputCallback;
-import javax.security.auth.login.LoginException;
-
-import org.springframework.security.Authentication;
-import org.springframework.security.AuthenticationManager;
-import org.springframework.security.BadCredentialsException;
-import org.springframework.security.context.SecurityContextHolder;
-import org.springframework.security.providers.UsernamePasswordAuthenticationToken;
-import org.springframework.security.providers.jaas.SecurityContextLoginModule;
-
-/** Login module which caches one subject per thread. */
-public class SpringLoginModule extends SecurityContextLoginModule {
-       private AuthenticationManager authenticationManager;
-
-       private CallbackHandler callbackHandler;
-
-       public SpringLoginModule() {
-
-       }
-
-       @SuppressWarnings("rawtypes")
-       public void initialize(Subject subject, CallbackHandler callbackHandler,
-                       Map sharedState, Map options) {
-               super.initialize(subject, callbackHandler, sharedState, options);
-               // this.subject.set(subject);
-               this.callbackHandler = callbackHandler;
-       }
-
-       public boolean login() throws LoginException {
-               // thread already logged in
-               if (SecurityContextHolder.getContext().getAuthentication() != null)
-                       return super.login();
-
-               // if (getSubject().getPrincipals(Authentication.class).size() == 1) {
-               // registerAuthentication(getSubject()
-               // .getPrincipals(Authentication.class).iterator().next());
-               // return super.login();
-               // } else if (getSubject().getPrincipals(Authentication.class).size() >
-               // 1) {
-               // throw new LoginException(
-               // "Multiple Authentication principals not supported: "
-               // + getSubject().getPrincipals(Authentication.class));
-               // } else {
-               // ask for username and password
-               Callback label = new TextOutputCallback(TextOutputCallback.INFORMATION,
-                               "Required login");
-               NameCallback nameCallback = new NameCallback("User");
-               PasswordCallback passwordCallback = new PasswordCallback("Password",
-                               false);
-
-               if (callbackHandler == null) {
-                       throw new LoginException("No call back handler available");
-                       // return false;
-               }
-               try {
-                       callbackHandler.handle(new Callback[] { label, nameCallback,
-                                       passwordCallback });
-               } catch (Exception e) {
-                       LoginException le = new LoginException("Callback handling failed");
-                       le.initCause(e);
-                       throw le;
-               }
-
-               // Set user name and password
-               String username = nameCallback.getName();
-               String password = "";
-               if (passwordCallback.getPassword() != null) {
-                       password = String.valueOf(passwordCallback.getPassword());
-               }
-               UsernamePasswordAuthenticationToken credentials = new UsernamePasswordAuthenticationToken(
-                               username, password);
-
-               try {
-                       Authentication authentication = authenticationManager
-                                       .authenticate(credentials);
-                       registerAuthentication(authentication);
-                       boolean res = super.login();
-                       // if (log.isDebugEnabled())
-                       // log.debug("User " + username + " logged in");
-                       return res;
-               } catch (BadCredentialsException bce) {
-                       throw bce;
-               } catch (Exception e) {
-                       LoginException loginException = new LoginException(
-                                       "Bad credentials");
-                       loginException.initCause(e);
-                       throw loginException;
-               }
-               // }
-       }
-
-       @Override
-       public boolean logout() throws LoginException {
-               return super.logout();
-       }
-
-       /**
-        * Register an {@link Authentication} in the security context.
-        * 
-        * @param authentication
-        *            has to implement {@link Authentication}.
-        */
-       protected void registerAuthentication(Object authentication) {
-               SecurityContextHolder.getContext().setAuthentication(
-                               (Authentication) authentication);
-       }
-
-       public void setAuthenticationManager(
-                       AuthenticationManager authenticationManager) {
-               this.authenticationManager = authenticationManager;
-       }
-
-       // protected Subject getSubject() {
-       // return subject.get();
-       // }
-
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/.classpath b/security/eclipse/plugins/org.argeo.security.ui.application/.classpath
deleted file mode 100644 (file)
index 92f19d2..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
-       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-       <classpathentry kind="src" path="src/main/java"/>
-       <classpathentry kind="output" path="target/classes"/>
-</classpath>
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/.project b/security/eclipse/plugins/org.argeo.security.ui.application/.project
deleted file mode 100644 (file)
index e83b5d5..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>org.argeo.security.ui.application</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.ManifestBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.SchemaBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.pde.PluginNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-       </natures>
-</projectDescription>
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/.settings/org.eclipse.jdt.core.prefs b/security/eclipse/plugins/org.argeo.security.ui.application/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644 (file)
index 1f382cb..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#Sat Jan 15 17:51:30 CET 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/META-INF/jaas_default.txt b/security/eclipse/plugins/org.argeo.security.ui.application/META-INF/jaas_default.txt
deleted file mode 100644 (file)
index b6cbaa6..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-UNIX {
-    org.eclipse.equinox.security.auth.module.ExtensionLoginModule sufficient
-        extensionId="org.argeo.security.equinox.unixLoginModule";
-};
-
-SPRING {
-    org.eclipse.equinox.security.auth.module.ExtensionLoginModule sufficient
-        extensionId="org.argeo.security.equinox.springLoginModule";
-};
-
-SPRING_SECURITY_CONTEXT {
-    org.eclipse.equinox.security.auth.module.ExtensionLoginModule sufficient
-        extensionId="org.argeo.security.equinox.springSecurityContextLoginModule";
-};
\ No newline at end of file
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/argeo_security_rap.properties b/security/eclipse/plugins/org.argeo.security.ui.application/argeo_security_rap.properties
deleted file mode 100644 (file)
index 3557749..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-argeo.osgi.start=\
-com.springsource.javax.servlet,\
-org.eclipse.core.runtime,\
-org.eclipse.equinox.common,\
-org.eclipse.equinox.http.jetty,\
-org.eclipse.equinox.http.registry,\
-org.eclipse.equinox.launcher,\
-org.eclipse.rap.demo,\
-org.mortbay.jetty.server,\
-org.springframework.osgi.extender,\
-org.argeo.server.ads.server,\
-org.argeo.security.manager.ldap,\
-org.argeo.security.services,\
-org.argeo.security.equinox,\
-org.argeo.security.ui,\
-org.argeo.security.ui.rcp,\
-
-eclipse.ignoreApp=true
-osgi.noShutdown=true
-
-log4j.configuration=file:../../log4j.properties
-
-org.eclipse.equinox.http.jetty.log.stderr.threshold=debug
-org.osgi.service.http.port=9090
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/build.properties b/security/eclipse/plugins/org.argeo.security.ui.application/build.properties
deleted file mode 100644 (file)
index ac478ab..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-source.. = src/main/java/
-output.. = target/classes/
-bin.includes = plugin.xml,\
-               META-INF/,\
-               .,\
-               log4j.properties,\
-               jaas_config.txt
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_about.gif b/security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_about.gif
deleted file mode 100644 (file)
index 20d9ad2..0000000
Binary files a/security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_about.gif and /dev/null differ
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_launcher.icns b/security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_launcher.icns
deleted file mode 100644 (file)
index b77a6a6..0000000
Binary files a/security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_launcher.icns and /dev/null differ
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_launcher.ico b/security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_launcher.ico
deleted file mode 100644 (file)
index d548f71..0000000
Binary files a/security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_launcher.ico and /dev/null differ
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_launcher.xpm b/security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_launcher.xpm
deleted file mode 100644 (file)
index b0c139e..0000000
+++ /dev/null
@@ -1,307 +0,0 @@
-/* XPM */\r
-static char * icon48_xpm[] = {\r
-"48 48 256 2",\r
-"      c #4B4B3B3B9090",\r
-".     c #0D0D0E0E5454",\r
-"X     c #11110E0E5B5B",\r
-"o     c #17170F0F6363",\r
-"O     c #1D1D13136969",\r
-"+     c #212114146C6C",\r
-"@     c #252514147171",\r
-"#     c #282811116C6C",\r
-"$     c #26260D0D6363",\r
-"%     c #22220B0B5E5E",\r
-"&     c #1C1C0B0B5A5A",\r
-"*     c #1C1C0B0B5252",\r
-"=     c #1B1B05055353",\r
-"-     c #161606064D4D",\r
-";     c #161605054949",\r
-":     c #111104044848",\r
-">     c #131304044545",\r
-",     c #131305054242",\r
-"<     c #141410105E5E",\r
-"1     c #2C2C15157373",\r
-"2     c #2B2B1B1B7575",\r
-"3     c #343416167272",\r
-"4     c #313113136E6E",\r
-"5     c #222209095757",\r
-"6     c #1B1B06064D4D",\r
-"7     c #15150B0B4242",\r
-"8     c #13130C0C5555",\r
-"9     c #2E2E1B1B7878",\r
-"0     c #33331F1F7C7C",\r
-"q     c #343418187878",\r
-"w     c #3B3B1C1C7575",\r
-"e     c #2E2E10106767",\r
-"r     c #1B1B07074747",\r
-"t     c #18180B0B4646",\r
-"y     c #151513136262",\r
-"u     c #1A1A15156464",\r
-"i     c #34341F1F7777",\r
-"p     c #40401E1E8080",\r
-"a     c #42421B1B7A7A",\r
-"s     c #3B3B15157474",\r
-"d     c #2B2B0B0B5B5B",\r
-"f     c #222207075252",\r
-"g     c #373727277A7A",\r
-"h     c #474724248484",\r
-"j     c #393915156E6E",\r
-"k     c #373711116A6A",\r
-"l     c #343413136363",\r
-"z     c #232319196E6E",\r
-"x     c #292919197070",\r
-"c     c #3C3C2C2C8282",\r
-"v     c #444431318585",\r
-"b     c #494934348A8A",\r
-"n     c #505026268A8A",\r
-"m     c #3D3D1B1B6E6E",\r
-"M     c #31310E0E5C5C",\r
-"N     c #2B2B0D0D5353",\r
-"B     c #222207074A4A",\r
-"V     c #52523C3C9292",\r
-"C     c #58583C3C9494",\r
-"Z     c #5D5D44449797",\r
-"A     c #5C5C2E2E9292",\r
-"S     c #676733339595",\r
-"D     c #424228287575",\r
-"F     c #29290A0A4F4F",\r
-"G     c #6C6C4A4A9E9E",\r
-"H     c #72725454A7A7",\r
-"J     c #8C8C6D6DB2B2",\r
-"K     c #343424246E6E",\r
-"L     c #3A3A23236A6A",\r
-"P     c #3A3A1C1C6767",\r
-"I     c #24240A0A4B4B",\r
-"U     c #151518186161",\r
-"Y     c #76766F6FA5A5",\r
-"T     c #ADAD9191CCCC",\r
-"R     c #98988989D3D3",\r
-"E     c #45453B3B8686",\r
-"W     c #3C3C35357979",\r
-"Q     c #363631317575",\r
-"!     c #32322D2D6B6B",\r
-"~     c #323229296363",\r
-"^     c #30301F1F6262",\r
-"/     c #323218185E5E",\r
-"(     c #272707074B4B",\r
-")     c #202028286C6C",\r
-"_     c #1E1E1D1D6868",\r
-"`     c #9A9A8282BBBB",\r
-"'     c #C8C8B3B3D3D3",\r
-"]     c #B3B3AFAFE7E7",\r
-"[     c #84847272C6C6",\r
-"{     c #58585757A3A3",\r
-"}     c #3F3F3C3C8A8A",\r
-"|     c #3B3B3A3A8484",\r
-" .    c #414139397D7D",\r
-"..    c #3D3D39397A7A",\r
-"X.    c #37372E2E6E6E",\r
-"o.    c #2C2C21215A5A",\r
-"O.    c #2E2E1B1B5B5B",\r
-"+.    c #F5F5EFEFF5F5",\r
-"@.    c #656566669A9A",\r
-"#.    c #47474B4B8E8E",\r
-"$.    c #3C3C44447B7B",\r
-"%.    c #444442428080",\r
-"&.    c #45453E3E8181",\r
-"*.    c #40403C3C8181",\r
-"=.    c #3D3D33337474",\r
-"-.    c #3B3B30306E6E",\r
-";.    c #38382D2D6969",\r
-":.    c #303026265D5D",\r
-">.    c #2C2C15155A5A",\r
-",.    c #1F1F1C1C7070",\r
-"<.    c #25251E1E7171",\r
-"1.    c #59595C5C9191",\r
-"2.    c #4D4D53538989",\r
-"3.    c #4C4C49498484",\r
-"4.    c #484845458585",\r
-"5.    c #494941418585",\r
-"6.    c #494940408181",\r
-"7.    c #2F2F1C1C5353",\r
-"8.    c #2B2B28287676",\r
-"9.    c #323231317F7F",\r
-"0.    c #545452528B8B",\r
-"q.    c #51514E4E8989",\r
-"w.    c #4E4E4B4B8C8C",\r
-"e.    c #4C4C47478686",\r
-"r.    c #46463D3D7E7E",\r
-"t.    c #434336367A7A",\r
-"y.    c #2B2B13135555",\r
-"u.    c #47473D3D8D8D",\r
-"i.    c #575757578E8E",\r
-"p.    c #48483E3E7F7F",\r
-"a.    c #46463A3A7D7D",\r
-"s.    c #424235357575",\r
-"d.    c #404034347171",\r
-"f.    c #BFBFCBCBFAFA",\r
-"g.    c #B8B8A8A8DDDD",\r
-"h.    c #5E5E60609292",\r
-"j.    c #565655558C8C",\r
-"k.    c #4B4B44448282",\r
-"l.    c #454539397B7B",\r
-"z.    c #434338387878",\r
-"x.    c #3F3F32326D6D",\r
-"c.    c #3D3D30306969",\r
-"v.    c #3A3A2E2E6363",\r
-"b.    c #36362A2A5C5C",\r
-"n.    c #343424245555",\r
-"m.    c #30301E1E4D4D",\r
-"M.    c #49493C3C8282",\r
-"N.    c #5E5E4F4F8C8C",\r
-"B.    c #56563B3B8B8B",\r
-"V.    c #545407078585",\r
-"C.    c #424234347272",\r
-"Z.    c #9797A4A4F7F7",\r
-"A.    c #444436367676",\r
-"S.    c #7D7D7979D5D5",\r
-"D.    c #464640408A8A",\r
-"F.    c #44444B4B8282",\r
-"G.    c #414107077777",\r
-"H.    c #71716161C1C1",\r
-"J.    c #303039397979",\r
-"K.    c #8E8E8E8EE6E6",\r
-"L.    c #404033338B8B",\r
-"P.    c #4A4A45458C8C",\r
-"I.    c #46463A3A8080",\r
-"U.    c #363629295454",\r
-"Y.    c #303022224848",\r
-"T.    c #424237377575",\r
-"R.    c #2E2E1D1D6363",\r
-"E.    c #79798383EAEA",\r
-"W.    c #74747B7BE4E4",\r
-"Q.    c #6D6D7676D6D6",\r
-"!.    c #6A6A7171CECE",\r
-"~.    c #66666969C6C6",\r
-"^.    c #62626565BCBC",\r
-"/.    c #5F5F6060B5B5",\r
-"(.    c #5B5B5B5BACAC",\r
-").    c #535353539898",\r
-"_.    c #4F4F4F4FA4A4",\r
-"`.    c #54544D4DA4A4",\r
-"'.    c #323204046B6B",\r
-"].    c #303035357979",\r
-"[.    c #313122224343",\r
-"{.    c #5A5A5B5BB7B7",\r
-"}.    c #484846468080",\r
-"|.    c #454541417575",\r
-" X    c #4B4B31318282",\r
-".X    c #47473C3C8484",\r
-"XX    c #3E3E35356E6E",\r
-"oX    c #2F2F26264040",\r
-"OX    c #2B2B23233A3A",\r
-"+X    c #262619195C5C",\r
-"@X    c #252515155A5A",\r
-"#X    c #55555151B3B3",\r
-"$X    c #3C3C2D2D5D5D",\r
-"%X    c #39392F2F5656",\r
-"&X    c #37372D2D5050",\r
-"*X    c #25251F1F3030",\r
-"=X    c #24241D1D4343",\r
-"-X    c #202013135656",\r
-";X    c #41413B3B6C6C",\r
-":X    c #444442429696",\r
-">X    c #212100005E5E",\r
-",X    c #444436367272",\r
-"<X    c #444436366F6F",\r
-"1X    c #424236366868",\r
-"2X    c #3F3F34346161",\r
-"3X    c #3C3C32325A5A",\r
-"4X    c #34342A2A4A4A",\r
-"5X    c #21211B1B2121",\r
-"6X    c #22221C1C6363",\r
-"7X    c #2D2D01015E5E",\r
-"8X    c #20201B1B2525",\r
-"9X    c #49492F2F7B7B",\r
-"0X    c #434334346C6C",\r
-"qX    c #323229294545",\r
-"wX    c #1C1C10104F4F",\r
-"eX    c #222217176363",\r
-"rX    c #37371E1E6B6B",\r
-"tX    c #424232326E6E",\r
-"yX    c #444433336969",\r
-"uX    c #424233336565",\r
-"iX    c #1E1E1A1A1E1E",\r
-"pX    c #161601014C4C",\r
-"aX    c #1C1C11115454",\r
-"sX    c #252503035B5B",\r
-"dX    c #414131316A6A",\r
-"fX    c #22221F1F7878",\r
-"gX    c #272724246767",\r
-"hX    c #1D1D16165E5E",\r
-"jX    c #131305055151",\r
-"kX    c #40402F2F6464",\r
-"lX    c #111107074E4E",\r
-"zX    c #0C0C05054B4B",\r
-"xX    c #22221E1E5757",\r
-"cX    c #1A1A0D0D4D4D",\r
-"vX    c #16160B0B4D4D",\r
-"bX    c #060604044747",\r
-"nX    c #040403034343",\r
-"mX    c #3B3B27276565",\r
-"MX    c #0E0E03034141",\r
-"NX    c #111106064A4A",\r
-"BX    c #0E0E04044646",\r
-"VX    c #111105053B3B",\r
-"CX    c #0D0D01013A3A",\r
-"ZX    c #030305053F3F",\r
-"AX    c #0F0F0F0F4C4C",\r
-"SX    c #020207073B3B",\r
-"DX    c #0D0D03034646",\r
-"FX    c #0B0B02023F3F",\r
-"GX    c #0D0D02023434",\r
-"HX    c #0A0A0E0E4444",\r
-"JX    c #161614145252",\r
-"KX    c #0B0B04044646",\r
-"LX    c #0A0A03034444",\r
-"PX    c #1D1D21215757",\r
-"IX    c #090910104040",\r
-"UX    c #18181E1E5353",\r
-"                                                                                                ",\r
-"  . . . . X X o o o o O + + @ @ @ @ @ @ @ # # # # # # $ $ % % & & & & * = - - - ; : > > , , ,   ",\r
-"  . . X X < < o o O O + @ 1 2 2 1 1 1 1 1 1 1 1 3 4 # # $ $ $ % % % 5 = = 6 6 - ; ; > > , , 7   ",\r
-"  . 8 < < < o O O + @ @ 2 9 9 0 0 q q q q q q q w 3 4 4 e e $ $ $ $ % 5 = = 6 6 6 ; ; > > r t   ",\r
-"  . X < y u O O + @ 1 2 i 0 0 p p p p p p p a a p a s 3 4 4 e e e e d 5 5 f f 6 6 6 ; ; r r t   ",\r
-"  X < y u O + + @ 2 9 0 g p p h h h h h h h p h h a a s s j k k j l d d 5 5 f f 6 6 r r r r r   ",\r
-"  X < y O z x x 9 0 g c v b n n n n n n n n n n n h a a s s j j m l M d d N f f B B B B r r r   ",\r
-"  < y u + z 2 0 c c b V C Z C C A A A A A S S S n h D w w m m m m k l M d d N f F F F B r r r   ",\r
-"  < y O z z 9 c b V Z G H H H G S G G J J H V v c g g K K K K L P l l l M M N N N N I B B r r   ",\r
-"  U u + z x i v C H Y J J J J H J T R H V E W W Q Q Q Q ! ! ! ~ ^ ^ / / M M M M M N ( B B r r   ",\r
-"  ) _ z x 9 g b Z Y ` ' ' ' T T ] [ { } |  .........W W Q Q X.! ~ ~ o.O./ / / / N F ( B B B r   ",\r
-"  ) ) z x i c V G J ' +.+.+.+.] [ @.#.$.%.%.%.&.*. . .....W =.-.X.;.~ :.o.O.^ >.N F ( B B B B   ",\r
-"  ) ,.<.2 g v C H J ' +.+.+.+.T Y 1.2.3.4.4.4.5.6.&.&. . ...W =.=.-.;.~ :.o.7.>.N F F ( B I I   ",\r
-"  ) ,.<.8.9.b C H J T +.+.+.' J @.1.0.q.q.w.e.4.5.6.&.r. . .t.W =.=.-.;.~ :.o.7.y.N F ( ( I I   ",\r
-"  8.8.8.9.| u.C G J T +.+.' ` Y @.1.i.0.q.q.e.e.5.6.p.r.a. .t.t.s.d.d.-.;.~ :.7.7.y.F F ( I I   ",\r
-"  9.c c c v b A S H ' f.g.` Y @.h.1.i.j.0.q.q.e.k.6.p.r.a.l.t.z.s.s.d.x.c.v.b.n.m.7.N F F F I   ",\r
-"  <.g M.N.B.B.n V.J f.R J @.h.h.1.i.i.j.j.0.q.3.k.6.p.r.a.l.l.z.s.C.d.x.x.c.v.b.n.m.y.N F F F   ",\r
-"  + x i v B.Z Z G g.Z.[ @.2.i.i.j.j.j.j.j.0.q.3.k.6.p.p.a.l.l.A.s.C.C.d.x.c.v.b.n.m.7.y.N N y.  ",\r
-"  O # 3 w p n Z ` f.S.H D.F.q.0.0.0.0.j.0.q.q.3.k.6.p.r.a.a.l.A.s.s.C.d.x.x.c.v.b.n.m.y.y.y.y.  ",\r
-"  O # 4 s a G.V.T Z.H.V J.%.e.w.q.0.0.0.0.q.q.e.k.6.p.r.a.a.l.z.A.s.C.d.d.x.c.v.b.n.m.7.>.y.y.  ",\r
-"  O # 4 s w G.A f.K.H L...4.P.w.w.w.q.q.q.q.e.e.5.6.M.I.I.a.a.l.z.A.s.d.d.x.c.v.v.U.Y.7.O.>.y.  ",\r
-"  $ # 4 3 s G.G f.S.Z 9.*.D.P.P.w.w.w.w.w.e.e.5.5.M.M.I.I.a.a.l.z.T.s.d.d.x.x.c.v.U.Y.m.R.>.>.  ",\r
-"  E.E.W.W.W.W.E.Z.E.W.Q.Q.Q.Q.Q.Q.Q.Q.Q.Q.!.!.!.!.!.~.~.~.~.~.~.^.^.^.^.^./././.(.{ { )._.`._.  ",\r
-"  + # 3 w s '.` f.H.V ].*.D.P.P.P.P.P.P.P.5.5.5.M.M.M.I.I.a.l.z.z.T.T.s.d.d.x.c.v.U.Y.[.^ O.>.  ",\r
-"  ~.~.~.~.~.~.K.Z.S.~.{.^.^.^.^.^.^.^.^././././././.(.(.(.(.(.(.{ { { { { ).).).w.w.}.|.P.u.}   ",\r
-"   .I.6. X X XT f.H.b ].*.E D.D.D.D.5.5..X.XM.M.I.I.a.a.l.l.z.z.T.T.T.d.XXx.c.v.b.U.oXOXR.+X@X  ",\r
-"  E.E.E.W.W.W.K.Z.E.W.Q.Q.Q.Q.Q.Q.Q.Q.!.!.!.!.!.!.~.~.~.~.~.~.^.^.^.^.^./././.(.{ { ).).#X_._.  ",\r
-"  & % $ e '.= H f.H.b 8.W *.E E E .X.X.XI.I.I.I.a.a.l.l.z.z.T.T.T.C.XXXXc.v.$X%X&XY.*X=X2 @X-X  ",\r
-"  {.{.{.{.{.#X~.Z.W.~.{.{./././././././././.(.(.(.(.(.(.(.{ { { { { { ).).).w.w.3.}.;X%.:X} }   ",\r
-"  & & % $ e >XV.f.S.C K X.W t. . .l.l.t.t.t.t.A.A.A.,X,X,X,X,X<X;X1X1X2X3X%X&X4XoX*X5Xo.6X-X-X  ",\r
-"  & & % $ $ >X7X` Z.Z D ! =.=.s.t.t.t.A.A.s.A.,X,X,X,X<X<X<X<X;X1X2X2X3X%X&X4XoXOX8X5X<.@X-X-X  ",\r
-"  8 & & $ e K 9XJ f.^. XK X.=.=.s.s.s.s.s.C.C.C.C.<X0X0X0X1X1X1X2X2X3X%X&X4XqXOX*X8X=X<.-X-XwX  ",\r
-"  8 & eXK k.@.M. Xg.E.B.rX~ -.d.d.C.C.C.C.C.tX0X0X0XyXyX1X1XuX2X2X3X%X&X4XqXoXOX8XiX6XeX-X-XwX  ",\r
-"  6XQ h.Y N.K e pXB.f./.9Xo.;.-.x.d.tXtXtXtXtX0X0XyXyXyXuXuX2X2X3X%X&X4XqXoXOX*XiX=X_ aX-XaXwX  ",\r
-"  Y Y  .R.@X% sX= 7XT Z.V P :.;.c.x.x.x.tXdXdXdXyXyXuXuX2X2X3X3X%X&X4XqXoXOX*X8X*XfXaXaXaXwXwX  ",\r
-"  gXhX& * & 5 5 sXjXa ] S.9X/ ~ v.c.dXdXdXdXdXuXuXuXkX2X2X3X%X%X&X4XqXoXOX*X8XiX<.hXwXwXaXwXwX  ",\r
-"  8 lXlXjX= * 5 5 = zX9X] H.D 7.b.v.v.kXc.kXkXkXkXkX2X$X3X%X&X&X4XqXoXOX*X8XiXxXhXwXcXcXwXwXwX  ",\r
-"  zXzXlXlXjX= = f f sXD Y ] ~.D 7.n.b.v.v.kXkXkXkX$X$X%X%X&X4XqXoXoXOX*X8X5XgXu cXvXvXcXcXwXwX  ",\r
-"  bXbXzXlXlX- = * @XX.h.e D T S.D n.m.b.$X$X$X$X$X%X%X&X&X4XqXoXOX*X8X8X*X<.hXvX; ; vXvXvXcXwX  ",\r
-"  nXbXzXzXlXlX- -XX.Y R.pXpXP J K.Z mXm.n.U.U.U.U.U.4X4XY.oXOX*X8X8X8X=X,.aXvX; > > > t t t cX  ",\r
-"  nXbXbXzXzXlXaXXXY +Xf = f = 7XtXR R   mXn.Y.[.[.[.[.OX*X*X8X5X*X=X,.u vXvX; > > MXMX, 7 t t   ",\r
-"  nXnXnXbXzXvX-.Y +XcX6 6 = = = d L B.G H `.X.:.7.m.=X=X=X=X=X6X,.u cXvXNX: BX> MXVXCXVX7 7 7   ",\r
-"  ZXZXnXbXAXgX@.+XvX; - - - - * @XR.>.sX>.R.i 0 x eXeXeXeXO hXaXcXvXNX: BXMXMXMXVXCXCXCXVX7 7   ",\r
-"  SXZXZXAXgXN.aXNX: : NXNXNX- * +X+X* 6 6 6 * * * * * * * vXvX- NX: DXBXMXMXFXCXCXCXCXGXVXVX7   ",\r
-"  SXSXHXgX0.JXKXLXKXKXDX: : NX* @X-X- - - - - - - - - - - NX: DXDXDXMXMXFXFXCXCXCXCXGXGXGXVXVX  ",\r
-"  SXHXPX3.JXnXnXnXnXbXLXKXKXNXaX-XvX: : NX: : : : : : : BXDXDXLXMXMXFXFXCXCXCXCXGXGXGXGXGXGXGX  ",\r
-"  IXUX$.AXZXZXZXZXnXnXnXLXLXNXJXvXBXDXBXBXBXBXDXDXDXDXLXDXLXLXFXFXFXFXCXCXCXCXGXGXGXGXGXGXGXGX  ",\r
-"                                                                                                "};\r
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_window_16.gif b/security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_window_16.gif
deleted file mode 100644 (file)
index 05626b1..0000000
Binary files a/security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_window_16.gif and /dev/null differ
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_window_32.gif b/security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_window_32.gif
deleted file mode 100644 (file)
index b432f88..0000000
Binary files a/security/eclipse/plugins/org.argeo.security.ui.application/icons/alt_window_32.gif and /dev/null differ
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/log4j.properties b/security/eclipse/plugins/org.argeo.security.ui.application/log4j.properties
deleted file mode 100644 (file)
index 8a89a4a..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-log4j.rootLogger=WARN, console
-
-## Levels
-log4j.logger.org.argeo=DEBUG
-log4j.logger.org.springframework.security=DEBUG
-
-log4j.logger.org.apache.catalina=INFO
-log4j.logger.org.apache.coyote=INFO
-log4j.logger.org.apache.tomcat=INFO
-
-log4j.logger.org.apache.directory.server=INFO
-log4j.logger.org.apache.directory.server.core.partition=ERROR
-log4j.logger.org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry=ERROR
-
-log4j.logger.org.apache.jackrabbit=WARN
-log4j.logger.org.apache.jackrabbit.core.query.lucene=ERROR
-
-## Appenders
-# console is set to be a ConsoleAppender.
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-
-# console uses PatternLayout.
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c - [%t]%n
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/org.argeo.security.ui.application.product b/security/eclipse/plugins/org.argeo.security.ui.application/org.argeo.security.ui.application.product
deleted file mode 100644 (file)
index be468c8..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?pde version="3.5"?>
-
-<product name="SecureRCP" application="org.argeo.security.ui.application.secureUi" useFeatures="false" includeLaunchers="true">
-
-   <configIni use="default">
-   </configIni>
-
-   <launcherArgs>
-      <programArgs>-console -clean</programArgs>
-      <vmArgs>-Dlog4j.configuration=file:${system_property:user.home}/dev/src/commons/security/eclipse/plugins/org.argeo.security.ui.application/log4j.properties</vmArgs>
-      <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
-   </launcherArgs>
-
-   <launcher>
-      <solaris/>
-      <win useIco="false">
-         <bmp/>
-      </win>
-   </launcher>
-
-   <vm>
-   </vm>
-
-   <plugins>
-      <plugin id="com.ibm.icu"/>
-      <plugin id="com.springsource.antlr"/>
-      <plugin id="com.springsource.edu.emory.mathcs.backport"/>
-      <plugin id="com.springsource.javax.servlet"/>
-      <plugin id="com.springsource.javax.xml.stream"/>
-      <plugin id="com.springsource.jdbm"/>
-      <plugin id="com.springsource.junit"/>
-      <plugin id="com.springsource.org.aopalliance"/>
-      <plugin id="com.springsource.org.apache.commons.codec"/>
-      <plugin id="com.springsource.org.apache.commons.collections"/>
-      <plugin id="com.springsource.org.apache.commons.io"/>
-      <plugin id="com.springsource.org.apache.commons.lang"/>
-      <plugin id="com.springsource.org.apache.commons.pool"/>
-      <plugin id="com.springsource.org.apache.directory.server.changepw"/>
-      <plugin id="com.springsource.org.apache.directory.server.core" fragment="true"/>
-      <plugin id="com.springsource.org.apache.directory.server.core.shared"/>
-      <plugin id="com.springsource.org.apache.directory.server.jndi"/>
-      <plugin id="com.springsource.org.apache.directory.server.kerberos"/>
-      <plugin id="com.springsource.org.apache.directory.server.kerberos.shared"/>
-      <plugin id="com.springsource.org.apache.directory.server.ldap"/>
-      <plugin id="com.springsource.org.apache.directory.server.ntp"/>
-      <plugin id="com.springsource.org.apache.directory.server.protocol.shared"/>
-      <plugin id="com.springsource.org.apache.directory.shared.asn1"/>
-      <plugin id="com.springsource.org.apache.directory.shared.ldap"/>
-      <plugin id="com.springsource.org.apache.log4j"/>
-      <plugin id="com.springsource.org.apache.mina"/>
-      <plugin id="com.springsource.org.apache.ws.commons.schema"/>
-      <plugin id="com.springsource.org.codehaus.jackson"/>
-      <plugin id="com.springsource.org.codehaus.jackson.mapper"/>
-      <plugin id="com.springsource.slf4j.api"/>
-      <plugin id="com.springsource.slf4j.log4j" fragment="true"/>
-      <plugin id="com.springsource.slf4j.org.apache.commons.logging"/>
-      <plugin id="org.argeo.basic.nodeps"/>
-      <plugin id="org.argeo.dep.osgi.directory.shared.asn.codec" fragment="true"/>
-      <plugin id="org.argeo.dep.osgi.mina.filter.ssl" fragment="true"/>
-      <plugin id="org.argeo.dep.osgi.springframework.ldap"/>
-      <plugin id="org.argeo.eclipse.ui"/>
-      <plugin id="org.argeo.security.core"/>
-      <plugin id="org.argeo.security.equinox"/>
-      <plugin id="org.argeo.security.ldap"/>
-      <plugin id="org.argeo.security.manager.ldap"/>
-      <plugin id="org.argeo.security.services"/>
-      <plugin id="org.argeo.security.ui"/>
-      <plugin id="org.argeo.security.ui.application"/>
-      <plugin id="org.argeo.server.ads"/>
-      <plugin id="org.argeo.server.ads.server"/>
-      <plugin id="org.argeo.server.core"/>
-      <plugin id="org.argeo.server.json"/>
-      <plugin id="org.argeo.slc.demo.log4j" fragment="true"/>
-      <plugin id="org.eclipse.core.commands"/>
-      <plugin id="org.eclipse.core.contenttype"/>
-      <plugin id="org.eclipse.core.databinding"/>
-      <plugin id="org.eclipse.core.databinding.observable"/>
-      <plugin id="org.eclipse.core.databinding.property"/>
-      <plugin id="org.eclipse.core.expressions"/>
-      <plugin id="org.eclipse.core.jobs"/>
-      <plugin id="org.eclipse.core.runtime"/>
-      <plugin id="org.eclipse.equinox.app"/>
-      <plugin id="org.eclipse.equinox.common"/>
-      <plugin id="org.eclipse.equinox.preferences"/>
-      <plugin id="org.eclipse.equinox.registry"/>
-      <plugin id="org.eclipse.equinox.security"/>
-      <plugin id="org.eclipse.help"/>
-      <plugin id="org.eclipse.jface"/>
-      <plugin id="org.eclipse.jface.databinding"/>
-      <plugin id="org.eclipse.osgi"/>
-      <plugin id="org.eclipse.swt"/>
-      <plugin id="org.eclipse.swt.gtk.linux.x86_64" fragment="true"/>
-      <plugin id="org.eclipse.swt.win32.win32.x86" fragment="true"/>
-      <plugin id="org.eclipse.ui"/>
-      <plugin id="org.eclipse.ui.forms"/>
-      <plugin id="org.eclipse.ui.workbench"/>
-      <plugin id="org.springframework.aop"/>
-      <plugin id="org.springframework.beans"/>
-      <plugin id="org.springframework.context"/>
-      <plugin id="org.springframework.core"/>
-      <plugin id="org.springframework.osgi.core"/>
-      <plugin id="org.springframework.osgi.extender"/>
-      <plugin id="org.springframework.osgi.io"/>
-      <plugin id="org.springframework.oxm"/>
-      <plugin id="org.springframework.security.core"/>
-      <plugin id="org.springframework.transaction"/>
-      <plugin id="org.springframework.web.servlet"/>
-      <plugin id="org.springframework.xml"/>
-   </plugins>
-
-   <configurations>
-      <plugin id="org.argeo.security.manager.ldap" autoStart="true" startLevel="0" />
-      <plugin id="org.argeo.security.services" autoStart="true" startLevel="0" />
-      <plugin id="org.argeo.server.ads.server" autoStart="true" startLevel="0" />
-      <plugin id="org.springframework.osgi.extender" autoStart="true" startLevel="0" />
-   </configurations>
-
-</product>
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/plugin.xml b/security/eclipse/plugins/org.argeo.security.ui.application/plugin.xml
deleted file mode 100644 (file)
index 6541416..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
-
-       <!-- We use the product to define some of the product preferences 
-       see http://dev.eclipse.org/viewcvs/viewvc.cgi/platform-ui-home/rcp/faq.html?revision=1.6#customPrefs --> 
-       <extension
-         id="org.argeo.security.ui.product"
-         point="org.eclipse.core.runtime.products">
-      <product
-            name="ArgeoProduct" application="org.argeo.security.ui.application.secureUi">
-          <property
-               name="appName"
-               value="Secure UI">
-         </property>
-            <property
-               name="preferenceCustomization"
-               value="plugin_customization.ini"/>
-      </product>
-   </extension>
-
-       <extension
-         id="org.argeo.security.webui.product"
-         point="org.eclipse.core.runtime.products">
-      <product
-            name="ArgeoProduct" application="org.argeo.security.ui.application.secureWebUi">
-          <property
-               name="appName"
-               value="Secure Web UI">
-         </property>
-            <property
-               name="preferenceCustomization"
-               value="plugin_customization.ini"/>
-      </product>
-   </extension>
-  
-
-   <extension
-         id="secureUi"
-         name="Argeo Secure UI"
-         point="org.eclipse.core.runtime.applications">
-      <application cardinality="singleton-global"
-         thread="main"
-         visible="true">
-         <run
-               class="org.argeo.security.ui.application.SecureRcp">
-         </run>
-      </application>
-   </extension>
-   <extension
-         id="secureWebUi"
-         name="Argeo Secure Web UI"
-         point="org.eclipse.core.runtime.applications">
-      <application cardinality="singleton-global"
-         thread="main"
-         visible="true">
-         <run
-               class="org.argeo.security.ui.application.SecureRap">
-         </run>
-      </application>
-   </extension>
-
-</plugin>
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/plugin_customization.ini b/security/eclipse/plugins/org.argeo.security.ui.application/plugin_customization.ini
deleted file mode 100644 (file)
index baf9cef..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-org.eclipse.ui/DOCK_PERSPECTIVE_BAR=topRight
-org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=true
-org.eclipse.ui/PERSPECTIVE_BAR_SIZE=100
-org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=true
-org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = false
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/pom.xml b/security/eclipse/plugins/org.argeo.security.ui.application/pom.xml
deleted file mode 100644 (file)
index e664848..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-<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.argeo.commons.security</groupId>
-               <version>0.2.3-SNAPSHOT</version>
-               <artifactId>plugins</artifactId>
-               <relativePath>..</relativePath>
-       </parent>
-       <artifactId>org.argeo.security.ui.application</artifactId>
-       <name>Commons Security UI Application</name>
-       <packaging>jar</packaging>
-       <build>
-               <plugins>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-compiler-plugin</artifactId>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-source-plugin</artifactId>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-jar-plugin</artifactId>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.felix</groupId>
-                               <artifactId>maven-bundle-plugin</artifactId>
-                               <version>${version.maven-bundle-plugin}</version>
-                               <configuration>
-                                       <instructions>
-                                               <Bundle-Activator>org.argeo.security.ui.application.SecureApplicationActivator</Bundle-Activator>
-                                               <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
-                                               <Require-Bundle>org.eclipse.ui;resolution:=optional,org.eclipse.rap.ui;resolution:=optional,org.eclipse.core.runtime</Require-Bundle>
-                                               <Import-Package>*</Import-Package>
-                                       </instructions>
-                               </configuration>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.argeo.maven.plugins</groupId>
-                               <artifactId>maven-argeo-osgi-plugin</artifactId>
-                               <executions>
-                                       <execution>
-                                               <id>resolve-pde-sources</id>
-                                               <goals>
-                                                       <goal>pde-sources</goal>
-                                               </goals>
-                                               <phase>generate-resources</phase>
-                                       </execution>
-                                       <execution>
-                                               <id>generate-descriptors</id>
-                                               <goals>
-                                                       <goal>descriptors</goal>
-                                               </goals>
-                                               <phase>generate-resources</phase>
-                                       </execution>
-                                       <execution>
-                                               <id>check-osgi</id>
-                                               <phase>test</phase>
-                                               <goals>
-                                                       <goal>equinox</goal>
-                                               </goals>
-                                               <configuration>
-                                                       <onlyCheck>true</onlyCheck>
-                                                       <argsToAppend>
-                                                               <arg>-clean</arg>
-                                                       </argsToAppend>
-                                               </configuration>
-                                       </execution>
-                               </executions>
-                       </plugin>
-               </plugins>
-       </build>
-       <dependencies>
-               <!-- Argeo Security -->
-               <dependency>
-                       <groupId>org.argeo.commons.security</groupId>
-                       <artifactId>org.argeo.security.ui</artifactId>
-                       <version>0.2.3-SNAPSHOT</version>
-               </dependency>
-               <dependency>
-                       <groupId>org.argeo.commons.security</groupId>
-                       <artifactId>org.argeo.security.equinox</artifactId>
-                       <version>0.2.3-SNAPSHOT</version>
-               </dependency>
-
-               <!-- Argeo Eclipse distribution (common dependencies for both RAP and RCP) -->
-               <dependency>
-                       <groupId>org.argeo.commons.eclipse</groupId>
-                       <artifactId>org.argeo.eclipse.dep.rcp</artifactId>
-                       <version>0.2.3-SNAPSHOT</version>
-                       <scope>provided</scope>
-               </dependency>
-
-               <!-- Commons -->
-               <dependency>
-                       <groupId>org.argeo.commons.basic</groupId>
-                       <artifactId>org.argeo.basic.nodeps</artifactId>
-                       <version>0.2.3-SNAPSHOT</version>
-               </dependency>
-
-
-               <!-- Others -->
-               <dependency>
-                       <groupId>org.slf4j</groupId>
-                       <artifactId>com.springsource.slf4j.org.apache.commons.logging</artifactId>
-               </dependency>
-
-               <!-- For testing and target platform generation -->
-               <!--  LDAP server and security services -->
-               <dependency>
-                       <groupId>org.argeo.commons.security</groupId>
-                       <artifactId>org.argeo.security.dep.ads</artifactId>
-                       <version>${version.argeo-commons}</version>
-                       <type>pom</type>
-                       <scope>test</scope>
-               </dependency>
-       </dependencies>
-</project>
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/AbstractSecureApplication.java b/security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/AbstractSecureApplication.java
deleted file mode 100644 (file)
index a0a2f92..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-package org.argeo.security.ui.application;
-
-import java.security.PrivilegedAction;
-
-import javax.security.auth.Subject;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.equinox.app.IApplication;
-import org.eclipse.equinox.app.IApplicationContext;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.application.WorkbenchAdvisor;
-
-public abstract class AbstractSecureApplication implements IApplication {
-       private static final Log log = LogFactory
-                       .getLog(AbstractSecureApplication.class);
-
-       protected abstract WorkbenchAdvisor createWorkbenchAdvisor();
-
-       @SuppressWarnings("unchecked")
-       public Object start(IApplicationContext context) throws Exception {
-
-               Integer returnCode = null;
-               Display display = PlatformUI.createDisplay();
-
-               // Force login
-
-               try {
-                       String username = null;
-                       Exception loginException = null;
-                       Subject subject = null;
-                       try {
-                               SecureApplicationActivator.getLoginContext().login();
-                               subject = SecureApplicationActivator.getLoginContext()
-                                               .getSubject();
-
-                               // username = CurrentUser.getUsername();
-                       } catch (Exception e) {
-                               loginException = e;
-                               e.printStackTrace();
-                       }
-                       if (subject == null) {
-                               IStatus status = new Status(IStatus.ERROR,
-                                               "org.argeo.security.application", "Login is mandatory",
-                                               loginException);
-                               ErrorDialog.openError(null, "Error", "Shutdown...", status);
-                               return status.getSeverity();
-                       }
-                       if (log.isDebugEnabled())
-                               log.debug("Logged in as " + username);
-                       returnCode = (Integer) Subject.doAs(subject, getRunAction(display));
-                       SecureApplicationActivator.getLoginContext().logout();
-                       return processReturnCode(returnCode);
-               } catch (Exception e) {
-                       // e.printStackTrace();
-                       IStatus status = new Status(IStatus.ERROR,
-                                       "org.argeo.security.rcp", "Login failed", e);
-                       ErrorDialog.openError(null, "Error", "Shutdown...", status);
-                       return returnCode;
-               } finally {
-                       display.dispose();
-               }
-       }
-
-       protected Integer processReturnCode(Integer returnCode) {
-               return returnCode;
-       }
-
-       @SuppressWarnings("rawtypes")
-       private PrivilegedAction getRunAction(final Display display) {
-               return new PrivilegedAction() {
-
-                       public Object run() {
-                               int result = createAndRunWorkbench(display);
-                               return new Integer(result);
-                       }
-               };
-       }
-
-       protected Integer createAndRunWorkbench(Display display) {
-               return PlatformUI.createAndRunWorkbench(display,
-                               createWorkbenchAdvisor());
-       }
-
-       public void stop() {
-               final IWorkbench workbench;
-               try {
-                       workbench = PlatformUI.getWorkbench();
-               } catch (Exception e) {
-                       return;
-               }
-               if (workbench == null)
-                       return;
-               final Display display = workbench.getDisplay();
-               if (display != null && !display.isDisposed())
-                       display.syncExec(new Runnable() {
-
-                               public void run() {
-                                       if (!display.isDisposed())
-                                               workbench.close();
-                               }
-                       });
-
-               if (log.isDebugEnabled())
-                       log.debug("workbench stopped");
-               // String username = CurrentUser.getUsername();
-               // if (log.isDebugEnabled())
-               // log.debug("workbench stopped, logged in as " + username);
-
-       }
-
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/RapSecureWorkbenchWindowAdvisor.java b/security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/RapSecureWorkbenchWindowAdvisor.java
deleted file mode 100644 (file)
index fb4911a..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.argeo.security.ui.application;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.application.ActionBarAdvisor;
-import org.eclipse.ui.application.IActionBarConfigurer;
-import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
-
-public class RapSecureWorkbenchWindowAdvisor extends
-               SecureWorkbenchWindowAdvisor {
-       public RapSecureWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
-               super(configurer);
-       }
-
-       @Override
-       public ActionBarAdvisor createActionBarAdvisor(
-                       IActionBarConfigurer configurer) {
-               return new SecureActionBarAdvisor(configurer, false);
-       }
-
-       public void preWindowOpen() {
-               IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
-               configurer.setShowCoolBar(true);
-               configurer.setShowMenuBar(true);
-               configurer.setShowStatusLine(false);
-               configurer.setShowPerspectiveBar(true);
-               configurer.setTitle("Argeo Secure UI"); //$NON-NLS-1$
-               // Full screen, see
-               // http://dev.eclipse.org/newslists/news.eclipse.technology.rap/msg02697.html
-               configurer.setShellStyle(SWT.NONE);
-               Rectangle bounds = Display.getDefault().getBounds();
-               configurer.setInitialSize(new Point(bounds.width, bounds.height));
-       }
-
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureActionBarAdvisor.java b/security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureActionBarAdvisor.java
deleted file mode 100644 (file)
index 61a3c04..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-package org.argeo.security.ui.application;
-
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.ICoolBarManager;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.swt.SWT;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
-import org.eclipse.ui.application.ActionBarAdvisor;
-import org.eclipse.ui.application.IActionBarConfigurer;
-
-public class SecureActionBarAdvisor extends ActionBarAdvisor {
-       private IWorkbenchAction exitAction;
-       private IWorkbenchAction openPerspectiveDialogAction;
-       private IWorkbenchAction showViewMenuAction;
-       private IWorkbenchAction preferences;
-       private IWorkbenchAction saveAction;
-       private IWorkbenchAction saveAllAction;
-       private IWorkbenchAction closeAllAction;
-
-       // private final Boolean isRcp;
-
-       public SecureActionBarAdvisor(IActionBarConfigurer configurer, Boolean isRcp) {
-               super(configurer);
-               // this.isRcp = isRcp;
-       }
-
-       protected void makeActions(IWorkbenchWindow window) {
-               preferences = ActionFactory.PREFERENCES.create(window);
-               register(preferences);
-               openPerspectiveDialogAction = ActionFactory.OPEN_PERSPECTIVE_DIALOG
-                               .create(window);
-               register(openPerspectiveDialogAction);
-               showViewMenuAction = ActionFactory.SHOW_VIEW_MENU.create(window);
-               register(showViewMenuAction);
-
-               exitAction = ActionFactory.QUIT.create(window);
-               register(exitAction);
-
-               // Save semantiocs
-               saveAction = ActionFactory.SAVE.create(window);
-               register(saveAction);
-               saveAllAction = ActionFactory.SAVE_ALL.create(window);
-               register(saveAllAction);
-               closeAllAction = ActionFactory.CLOSE_ALL.create(window);
-               register(closeAllAction);
-
-       }
-
-       protected void fillMenuBar(IMenuManager menuBar) {
-               MenuManager fileMenu = new MenuManager("&File",
-                               IWorkbenchActionConstants.M_FILE);
-               MenuManager editMenu = new MenuManager("&Edit",
-                               IWorkbenchActionConstants.M_EDIT);
-               MenuManager windowMenu = new MenuManager("&Window",
-                               IWorkbenchActionConstants.M_WINDOW);
-
-               menuBar.add(fileMenu);
-               menuBar.add(editMenu);
-               menuBar.add(windowMenu);
-               // Add a group marker indicating where action set menus will appear.
-               menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
-
-               // File
-               fileMenu.add(saveAction);
-               fileMenu.add(saveAllAction);
-               fileMenu.add(closeAllAction);
-               fileMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
-               fileMenu.add(new Separator());
-               fileMenu.add(exitAction);
-
-               // Edit
-               editMenu.add(preferences);
-
-               // Window
-               windowMenu.add(openPerspectiveDialogAction);
-               windowMenu.add(showViewMenuAction);
-       }
-
-       @Override
-       protected void fillCoolBar(ICoolBarManager coolBar) {
-               IToolBarManager saveToolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
-               saveToolbar.add(saveAction);
-               saveToolbar.add(saveAllAction);
-               coolBar.add(saveToolbar);
-       }
-
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureApplicationActivator.java b/security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureApplicationActivator.java
deleted file mode 100644 (file)
index ec5d625..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.argeo.security.ui.application;
-
-import java.net.URL;
-
-import org.eclipse.equinox.security.auth.ILoginContext;
-import org.eclipse.equinox.security.auth.LoginContextFactory;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class SecureApplicationActivator implements BundleActivator {
-
-       public final static String CONTEXT_SPRING = "SPRING";
-       private static final String JAAS_CONFIG_FILE = "/META-INF/jaas_default.txt";
-
-       private static ILoginContext loginContext = null;
-
-       public void start(BundleContext bundleContext) throws Exception {
-               URL configUrl = bundleContext.getBundle().getEntry(JAAS_CONFIG_FILE);
-               loginContext = LoginContextFactory.createContext(CONTEXT_SPRING,
-                               configUrl);
-       }
-
-       public void stop(BundleContext context) throws Exception {
-       }
-
-       static ILoginContext getLoginContext() {
-               return loginContext;
-       }
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureRap.java b/security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureRap.java
deleted file mode 100644 (file)
index 5f2ea3e..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.argeo.security.ui.application;
-
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
-import org.eclipse.ui.application.WorkbenchAdvisor;
-import org.eclipse.ui.application.WorkbenchWindowAdvisor;
-
-/** Generic secure application for RAP. */
-public class SecureRap extends AbstractSecureApplication {
-
-       @Override
-       protected WorkbenchAdvisor createWorkbenchAdvisor() {
-               return new SecureWorkbenchAdvisor() {
-                       public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
-                                       IWorkbenchWindowConfigurer configurer) {
-                               return new RapSecureWorkbenchWindowAdvisor(configurer);
-                       }
-
-               };
-       }
-
-       public void stop() {
-               final IWorkbench workbench = PlatformUI.getWorkbench();
-               if (workbench == null)
-                       return;
-               final Display display = workbench.getDisplay();
-               display.syncExec(new Runnable() {
-
-                       public void run() {
-                               if (!display.isDisposed())
-                                       workbench.close();
-                       }
-               });
-       }
-
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureRcp.java b/security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureRcp.java
deleted file mode 100644 (file)
index b8576c4..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.argeo.security.ui.application;
-
-import org.eclipse.equinox.app.IApplication;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.application.WorkbenchAdvisor;
-
-public class SecureRcp extends AbstractSecureApplication {
-
-       @Override
-       protected WorkbenchAdvisor createWorkbenchAdvisor() {
-               return new SecureWorkbenchAdvisor();
-       }
-
-       protected Integer processReturnCode(Integer returnCode) {
-               if (returnCode == PlatformUI.RETURN_RESTART)
-                       return IApplication.EXIT_RESTART;
-               else
-                       return IApplication.EXIT_OK;
-       }
-
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureWorkbenchAdvisor.java b/security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureWorkbenchAdvisor.java
deleted file mode 100644 (file)
index 4179816..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.argeo.security.ui.application;
-
-import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
-import org.eclipse.ui.application.WorkbenchAdvisor;
-import org.eclipse.ui.application.WorkbenchWindowAdvisor;
-
-public class SecureWorkbenchAdvisor extends WorkbenchAdvisor {
-
-       static final String DEFAULT_PERSPECTIVE_ID = "org.argeo.security.ui.securityPerspective"; //$NON-NLS-1$
-
-       public final static String INITIAL_PERSPECTIVE_PROPERTY = "org.argeo.security.ui.initialPerspective";
-       private String initialPerspective = System.getProperty(
-                       INITIAL_PERSPECTIVE_PROPERTY, DEFAULT_PERSPECTIVE_ID);
-
-       public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
-                       IWorkbenchWindowConfigurer configurer) {
-               return new SecureWorkbenchWindowAdvisor(configurer);
-       }
-
-       public String getInitialWindowPerspectiveId() {
-               return initialPerspective;
-       }
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureWorkbenchWindowAdvisor.java b/security/eclipse/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureWorkbenchWindowAdvisor.java
deleted file mode 100644 (file)
index 1eb5c67..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.argeo.security.ui.application;
-
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.ui.application.ActionBarAdvisor;
-import org.eclipse.ui.application.IActionBarConfigurer;
-import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
-import org.eclipse.ui.application.WorkbenchWindowAdvisor;
-
-public class SecureWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
-
-       public SecureWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
-               super(configurer);
-       }
-
-       public ActionBarAdvisor createActionBarAdvisor(
-                       IActionBarConfigurer configurer) {
-               return new SecureActionBarAdvisor(configurer, true);
-       }
-
-       public void preWindowOpen() {
-               IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
-               configurer.setInitialSize(new Point(1200, 900));
-               configurer.setShowCoolBar(true);
-               configurer.setShowMenuBar(true);
-               configurer.setShowStatusLine(false);
-
-               configurer.setShowPerspectiveBar(true);
-               configurer.setTitle("Argeo Secure UI"); //$NON-NLS-1$
-
-       }
-
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui.rap/pom.xml b/security/eclipse/plugins/org.argeo.security.ui.rap/pom.xml
deleted file mode 100644 (file)
index 764c63f..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-<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.argeo.commons.security</groupId>
-               <version>0.2.3-SNAPSHOT</version>
-               <artifactId>plugins</artifactId>
-               <relativePath>..</relativePath>
-       </parent>
-       <artifactId>org.argeo.security.ui.rap</artifactId>
-       <name>Commons Security UI RAP</name>
-       <packaging>jar</packaging>
-       <build>
-               <plugins>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-compiler-plugin</artifactId>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-source-plugin</artifactId>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-jar-plugin</artifactId>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.argeo.maven.plugins</groupId>
-                               <artifactId>maven-argeo-osgi-plugin</artifactId>
-                               <executions>
-                                       <execution>
-                                               <id>resolve-pde-sources</id>
-                                               <goals>
-                                                       <goal>pde-sources</goal>
-                                               </goals>
-                                               <phase>generate-resources</phase>
-                                       </execution>
-                                       <execution>
-                                               <id>generate-descriptors</id>
-                                               <goals>
-                                                       <goal>descriptors</goal>
-                                               </goals>
-                                               <phase>generate-resources</phase>
-                                       </execution>
-                                       <execution>
-                                               <id>check-osgi</id>
-                                               <phase>test</phase>
-                                               <goals>
-                                                       <goal>equinox</goal>
-                                               </goals>
-                                               <configuration>
-                                                       <onlyCheck>true</onlyCheck>
-                                                       <argsToAppend>
-                                                               <arg>-clean</arg>
-                                                       </argsToAppend>
-                                               </configuration>
-                                       </execution>
-                               </executions>
-                       </plugin>
-               </plugins>
-       </build>
-       <dependencies>
-               <dependency>
-                       <groupId>org.argeo.commons.security</groupId>
-                       <artifactId>org.argeo.security.ui.application</artifactId>
-                       <version>0.2.3-SNAPSHOT</version>
-                       <exclusions>
-                               <exclusion>
-                                       <groupId>org.argeo.commons.eclipse</groupId>
-                                       <artifactId>org.argeo.eclipse.dep.rcp</artifactId>
-                               </exclusion>
-                       </exclusions>
-               </dependency>
-               <!-- RAP -->
-               <dependency>
-                       <groupId>org.argeo.commons.eclipse</groupId>
-                       <artifactId>org.argeo.eclipse.dep.rap</artifactId>
-                       <version>0.2.3-SNAPSHOT</version>
-               </dependency>
-
-
-               <!-- TODO: factorize with application.ui -->
-               <!-- For testing and target platform generation -->
-               <dependency>
-                       <groupId>org.argeo.commons.server</groupId>
-                       <artifactId>org.argeo.server.ads.server</artifactId>
-                       <version>${version.argeo-commons}</version>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.argeo.commons.security</groupId>
-                       <artifactId>org.argeo.security.services</artifactId>
-                       <version>${version.argeo-commons}</version>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.argeo.commons.security</groupId>
-                       <artifactId>org.argeo.security.ldap</artifactId>
-                       <version>${version.argeo-commons}</version>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.argeo.commons.security</groupId>
-                       <artifactId>org.argeo.security.manager.ldap</artifactId>
-                       <version>${version.argeo-commons}</version>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.argeo.commons.server</groupId>
-                       <artifactId>org.argeo.server.ads</artifactId>
-                       <version>0.2.3-SNAPSHOT</version>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.argeo.dep.osgi</groupId>
-                       <artifactId>org.argeo.dep.osgi.springframework.ldap</artifactId>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.argeo.commons.basic</groupId>
-                       <artifactId>org.argeo.basic.dep.log4j</artifactId>
-                       <version>0.2.3-SNAPSHOT</version>
-                       <type>pom</type>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>net.sourceforge.jdbm</groupId>
-                       <artifactId>com.springsource.jdbm</artifactId>
-                       <scope>test</scope>
-               </dependency>
-       </dependencies>
-</project>
diff --git a/security/eclipse/plugins/org.argeo.security.ui/.classpath b/security/eclipse/plugins/org.argeo.security.ui/.classpath
deleted file mode 100644 (file)
index 92f19d2..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
-       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-       <classpathentry kind="src" path="src/main/java"/>
-       <classpathentry kind="output" path="target/classes"/>
-</classpath>
diff --git a/security/eclipse/plugins/org.argeo.security.ui/.project b/security/eclipse/plugins/org.argeo.security.ui/.project
deleted file mode 100644 (file)
index a052e9a..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>org.argeo.security.ui</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.ManifestBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.SchemaBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.pde.PluginNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-       </natures>
-</projectDescription>
diff --git a/security/eclipse/plugins/org.argeo.security.ui/.settings/org.eclipse.jdt.core.prefs b/security/eclipse/plugins/org.argeo.security.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644 (file)
index aef0f52..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#Sat Jan 15 13:25:02 CET 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/security/eclipse/plugins/org.argeo.security.ui/.settings/org.eclipse.pde.core.prefs b/security/eclipse/plugins/org.argeo.security.ui/.settings/org.eclipse.pde.core.prefs
deleted file mode 100644 (file)
index dfa507d..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sat Jan 15 18:15:48 CET 2011
-eclipse.preferences.version=1
-resolve.requirebundle=false
diff --git a/security/eclipse/plugins/org.argeo.security.ui/META-INF/spring/commands.xml b/security/eclipse/plugins/org.argeo.security.ui/META-INF/spring/commands.xml
deleted file mode 100644 (file)
index a89876a..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans.xsd">
-
-       <bean id="org.argeo.security.ui.openArgeoUserEditor" class="org.argeo.security.ui.commands.OpenArgeoUserEditor"
-               scope="prototype" />
-       <bean id="org.argeo.security.ui.newArgeoUserEditor" class="org.argeo.security.ui.commands.OpenArgeoUserEditor"
-               scope="prototype" />
-       <bean id="org.argeo.security.ui.addRole" class="org.argeo.security.ui.commands.AddRole"
-               scope="prototype">
-               <property name="securityService" ref="securityService" />
-       </bean>
-       <bean id="org.argeo.security.ui.openChangePasswordDialog" class="org.argeo.security.ui.commands.OpenChangePasswordDialog"
-               scope="prototype">
-               <property name="securityService" ref="securityService" />
-       </bean>
-       <bean id="org.argeo.security.ui.refreshUsersList" class="org.argeo.security.ui.commands.RefreshUsersList"
-               scope="prototype" />
-</beans>
diff --git a/security/eclipse/plugins/org.argeo.security.ui/META-INF/spring/editors.xml b/security/eclipse/plugins/org.argeo.security.ui/META-INF/spring/editors.xml
deleted file mode 100644 (file)
index 747c2b7..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans.xsd">
-
-       <!-- Editors -->
-       <bean id="org.argeo.security.ui.argeoUserEditor" class="org.argeo.security.ui.editors.ArgeoUserEditor"
-               scope="prototype">
-               <property name="securityService" ref="securityService" />
-       </bean>
-</beans>
diff --git a/security/eclipse/plugins/org.argeo.security.ui/META-INF/spring/osgi.xml b/security/eclipse/plugins/org.argeo.security.ui/META-INF/spring/osgi.xml
deleted file mode 100644 (file)
index 6574cf1..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
-       xmlns:osgi="http://www.springframework.org/schema/osgi"\r
-       xsi:schemaLocation="http://www.springframework.org/schema/osgi  \r
-       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
-       http://www.springframework.org/schema/beans   \r
-       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"\r
-       osgi:default-timeout="30000">\r
-\r
-       <reference id="securityService" interface="org.argeo.security.ArgeoSecurityService" />\r
-</beans:beans>
\ No newline at end of file
diff --git a/security/eclipse/plugins/org.argeo.security.ui/META-INF/spring/views.xml b/security/eclipse/plugins/org.argeo.security.ui/META-INF/spring/views.xml
deleted file mode 100644 (file)
index 7ae3b62..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans.xsd">
-
-       <bean id="org.argeo.security.ui.usersView" class="org.argeo.security.ui.views.UsersView"
-               scope="prototype">
-               <property name="securityService" ref="securityService" />
-       </bean>
-       <bean id="org.argeo.security.ui.rolesView" class="org.argeo.security.ui.views.RolesView"
-               scope="prototype">
-               <property name="securityService" ref="securityService" />
-       </bean>
-       <bean id="org.argeo.security.ui.currentUserView" class="org.argeo.security.ui.views.CurrentUserView"
-               scope="prototype">
-       </bean>
-</beans>
diff --git a/security/eclipse/plugins/org.argeo.security.ui/build.properties b/security/eclipse/plugins/org.argeo.security.ui/build.properties
deleted file mode 100644 (file)
index 3868784..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-source.. = src/main/java/
-output.. = target/classes/
-bin.includes = META-INF/,\
-               .,\
-               plugin.xml,\
-               icons/
diff --git a/security/eclipse/plugins/org.argeo.security.ui/icons/add.gif b/security/eclipse/plugins/org.argeo.security.ui/icons/add.gif
deleted file mode 100644 (file)
index 252d7eb..0000000
Binary files a/security/eclipse/plugins/org.argeo.security.ui/icons/add.gif and /dev/null differ
diff --git a/security/eclipse/plugins/org.argeo.security.ui/icons/password.gif b/security/eclipse/plugins/org.argeo.security.ui/icons/password.gif
deleted file mode 100644 (file)
index a6b251f..0000000
Binary files a/security/eclipse/plugins/org.argeo.security.ui/icons/password.gif and /dev/null differ
diff --git a/security/eclipse/plugins/org.argeo.security.ui/icons/refresh.png b/security/eclipse/plugins/org.argeo.security.ui/icons/refresh.png
deleted file mode 100644 (file)
index a3884fb..0000000
Binary files a/security/eclipse/plugins/org.argeo.security.ui/icons/refresh.png and /dev/null differ
diff --git a/security/eclipse/plugins/org.argeo.security.ui/icons/remove.gif b/security/eclipse/plugins/org.argeo.security.ui/icons/remove.gif
deleted file mode 100644 (file)
index 0ae6dec..0000000
Binary files a/security/eclipse/plugins/org.argeo.security.ui/icons/remove.gif and /dev/null differ
diff --git a/security/eclipse/plugins/org.argeo.security.ui/icons/role.gif b/security/eclipse/plugins/org.argeo.security.ui/icons/role.gif
deleted file mode 100644 (file)
index 274a850..0000000
Binary files a/security/eclipse/plugins/org.argeo.security.ui/icons/role.gif and /dev/null differ
diff --git a/security/eclipse/plugins/org.argeo.security.ui/icons/save.gif b/security/eclipse/plugins/org.argeo.security.ui/icons/save.gif
deleted file mode 100644 (file)
index 654ad7b..0000000
Binary files a/security/eclipse/plugins/org.argeo.security.ui/icons/save.gif and /dev/null differ
diff --git a/security/eclipse/plugins/org.argeo.security.ui/icons/save_security.png b/security/eclipse/plugins/org.argeo.security.ui/icons/save_security.png
deleted file mode 100644 (file)
index ca41dc9..0000000
Binary files a/security/eclipse/plugins/org.argeo.security.ui/icons/save_security.png and /dev/null differ
diff --git a/security/eclipse/plugins/org.argeo.security.ui/icons/save_security_disabled.png b/security/eclipse/plugins/org.argeo.security.ui/icons/save_security_disabled.png
deleted file mode 100644 (file)
index fb7d08d..0000000
Binary files a/security/eclipse/plugins/org.argeo.security.ui/icons/save_security_disabled.png and /dev/null differ
diff --git a/security/eclipse/plugins/org.argeo.security.ui/icons/security.gif b/security/eclipse/plugins/org.argeo.security.ui/icons/security.gif
deleted file mode 100644 (file)
index 57fb95e..0000000
Binary files a/security/eclipse/plugins/org.argeo.security.ui/icons/security.gif and /dev/null differ
diff --git a/security/eclipse/plugins/org.argeo.security.ui/icons/user.gif b/security/eclipse/plugins/org.argeo.security.ui/icons/user.gif
deleted file mode 100644 (file)
index 90a0014..0000000
Binary files a/security/eclipse/plugins/org.argeo.security.ui/icons/user.gif and /dev/null differ
diff --git a/security/eclipse/plugins/org.argeo.security.ui/icons/users.gif b/security/eclipse/plugins/org.argeo.security.ui/icons/users.gif
deleted file mode 100644 (file)
index 2de7edd..0000000
Binary files a/security/eclipse/plugins/org.argeo.security.ui/icons/users.gif and /dev/null differ
diff --git a/security/eclipse/plugins/org.argeo.security.ui/plugin.xml b/security/eclipse/plugins/org.argeo.security.ui/plugin.xml
deleted file mode 100644 (file)
index 3a741cb..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
-   <extension
-         point="org.eclipse.ui.perspectives">
-      <perspective
-            class="org.argeo.security.ui.SecurityPerspective"
-            icon="icons/security.gif"
-            id="org.argeo.security.ui.securityPerspective"
-            name="Security">
-      </perspective>
-   </extension>
-   <extension
-         point="org.eclipse.ui.views">
-      <view
-            class="org.argeo.eclipse.spring.SpringExtensionFactory"
-            icon="icons/users.gif"
-            id="org.argeo.security.ui.usersView"
-            name="Users"
-            restorable="false">
-      </view>
-      <view
-            class="org.argeo.eclipse.spring.SpringExtensionFactory"
-            id="org.argeo.security.ui.currentUserView"
-            name="Current User"
-            restorable="false">
-      </view>
-      <view
-            class="org.argeo.eclipse.spring.SpringExtensionFactory"
-            icon="icons/role.gif"
-            id="org.argeo.security.ui.rolesView"
-            name="Roles"
-            restorable="false">
-      </view>
-   </extension>
-   
-   <!-- Security -->
-   <extension
-         id="defaultLoginDialog"
-         name="Default Login Dialog"
-         point="org.eclipse.equinox.security.callbackHandler">
-      <callbackHandler
-            class="org.argeo.security.ui.dialogs.DefaultLoginDialog">
-      </callbackHandler>
-   </extension>
-   <extension
-         point="org.eclipse.equinox.security.callbackHandlerMapping">
-      <callbackHandlerMapping
-            callbackHandlerId="org.argeo.security.ui.defaultLoginDialog"
-            configName="SPRING">
-      </callbackHandlerMapping>
-   </extension>
-   <extension
-         point="org.eclipse.equinox.security.callbackHandlerMapping">
-         <callbackHandlerMapping
-            callbackHandlerId="org.argeo.security.ui.defaultLoginDialog"
-            configName="UNIX">
-      </callbackHandlerMapping>
-   </extension>
-   <extension
-         point="org.eclipse.equinox.security.callbackHandlerMapping">
-      <callbackHandlerMapping
-            callbackHandlerId="org.argeo.security.ui.defaultLoginDialog"
-            configName="SPRING_SECURITY_CONTEXT">
-      </callbackHandlerMapping>
-   </extension>
-   <extension
-           point="org.eclipse.ui.editors">
-               <editor
-                 class="org.argeo.eclipse.spring.SpringExtensionFactory"
-              id="org.argeo.security.ui.argeoUserEditor"
-              name="User"
-              icon="icons/user.gif"
-              default="false">
-        </editor>
-     </extension>
-    <extension
-         point="org.eclipse.ui.commands">
-      <command
-            defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
-            id="org.argeo.security.ui.openArgeoUserEditor"
-            name="OpenArgeoUserEditor">
-                       <commandParameter
-                       id="org.argeo.security.ui.username"
-                       name="Username">
-                       </commandParameter>
-      </command>
-      <command
-            defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
-            id="org.argeo.security.ui.newArgeoUserEditor"
-            name="OpenArgeoUserEditor">
-      </command>
-      <command
-            defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
-            id="org.argeo.security.ui.addRole"
-            name="AddRole">
-      </command>
-      <command
-            defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
-            id="org.argeo.security.ui.openChangePasswordDialog"
-            name="OpenChangePasswordDialog">
-      </command>
-      <command
-            defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
-            id="org.argeo.security.ui.refreshUsersList"
-            name="refreshUsersList">
-      </command>
-    </extension>
-     <extension
-         point="org.eclipse.ui.menus">
-       <menuContribution
-            locationURI="toolbar:org.argeo.security.ui.rolesView">
-            <command
-                  commandId="org.argeo.security.ui.addRole"
-                  icon="icons/add.gif"
-                  label="Add Role"
-                  tooltip="Add new role">
-            </command>
-        </menuContribution>
-       <menuContribution
-            locationURI="toolbar:org.argeo.security.ui.usersView">
-            <command
-                  commandId="org.argeo.security.ui.newArgeoUserEditor"
-                  icon="icons/add.gif"
-                  label="Add User"
-                  tooltip="Add new user">
-            </command>
-            <command
-                  commandId="org.argeo.security.ui.refreshUsersList"
-                  icon="icons/refresh.png"
-                  label="Refresh"
-                  tooltip="Refresh user list">
-            </command>
-        </menuContribution>
-        <menuContribution
-                allPopups="false"
-                locationURI="menu:file?after=additions">
-                <command
-                      commandId="org.argeo.security.ui.openChangePasswordDialog"
-                      disabledIcon="icons/password.gif"
-                      icon="icons/password.gif"
-                      label="Change password"
-                      style="push"
-                      tooltip="Change password">
-                </command>
-          </menuContribution>
-  </extension>
-     <extension
-           id="product"
-           point="org.eclipse.core.runtime.products">
-        <product
-              application="org.argeo.security.ui.application.secureUi"
-              name="Agfa Sebi">
-           <property
-                 name="appName"
-                 value="Agfa Sebi">
-           </property>
-        </product>
-     </extension>
- </plugin>
diff --git a/security/eclipse/plugins/org.argeo.security.ui/pom.xml b/security/eclipse/plugins/org.argeo.security.ui/pom.xml
deleted file mode 100644 (file)
index 0d9ed31..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-<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.argeo.commons.security</groupId>
-               <version>0.2.3-SNAPSHOT</version>
-               <artifactId>plugins</artifactId>
-               <relativePath>..</relativePath>
-       </parent>
-       <artifactId>org.argeo.security.ui</artifactId>
-       <name>Commons Security UI</name>
-       <packaging>jar</packaging>
-       <build>
-               <plugins>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-compiler-plugin</artifactId>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-source-plugin</artifactId>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-jar-plugin</artifactId>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.felix</groupId>
-                               <artifactId>maven-bundle-plugin</artifactId>
-                               <version>${version.maven-bundle-plugin}</version>
-                               <configuration>
-                                       <!-- <instructions> -->
-                                       <!-- <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy> -->
-                                       <!-- <Bundle-Activator>org.argeo.security.ui.SecurityUiPlugin</Bundle-Activator> -->
-                                       <!-- <Require-Bundle>org.eclipse.ui;resolution:=optional,org.eclipse.rap.ui;resolution:=optional,org.eclipse.core.runtime</Require-Bundle> -->
-                                       <!-- <Import-Package> -->
-                                       <!-- org.argeo.eclipse.spring, -->
-                                       <!-- org.osgi.framework;version="0.0.0", -->
-                                       <!-- !org.eclipse.core.runtime, -->
-                                       <!-- !org.eclipse.core.commands, -->
-                                       <!-- !org.eclipse.ui.plugin, -->
-                                       <!-- !org.eclipse.ui, -->
-                                       <!-- !org.eclipse.ui.commands, -->
-                                       <!-- !org.eclipse.ui.handlers, -->
-                                       <!-- !org.eclipse.ui.part, -->
-                                       <!-- * -->
-                                       <!-- </Import-Package> -->
-                                       <!-- <Private-Package>icons</Private-Package> -->
-                                       <!-- <Export-Package>org.argeo.security.ui.*</Export-Package> -->
-                                       <!-- </instructions> -->
-                                       <instructions>
-                                               <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
-                                               <Bundle-Activator>org.argeo.security.ui.SecurityUiPlugin</Bundle-Activator>
-                                               <Require-Bundle>org.eclipse.ui;resolution:=optional,org.eclipse.rap.ui;resolution:=optional,org.eclipse.core.runtime</Require-Bundle>
-                                               <Import-Package>
-                                                       org.argeo.eclipse.spring,
-                                                       *
-                                               </Import-Package>
-                                       </instructions>
-                               </configuration>
-                       </plugin>
-               </plugins>
-       </build>
-       <dependencies>
-               <!-- Argeo Security -->
-               <dependency>
-                       <groupId>org.argeo.commons.security</groupId>
-                       <artifactId>org.argeo.security.core</artifactId>
-                       <version>0.2.3-SNAPSHOT</version>
-               </dependency>
-
-               <!-- Argeo Eclipse -->
-               <dependency>
-                       <groupId>org.argeo.commons.eclipse</groupId>
-                       <artifactId>org.argeo.eclipse.ui</artifactId>
-                       <version>0.2.3-SNAPSHOT</version>
-               </dependency>
-
-               <!-- Argeo Eclipse distribution (common dependencies for both RAP and RCP) -->
-               <dependency>
-                       <groupId>org.argeo.commons.eclipse</groupId>
-                       <artifactId>org.argeo.eclipse.dep.common</artifactId>
-                       <version>0.2.3-SNAPSHOT</version>
-               </dependency>
-
-               <!-- RCP only dependency, needed at compile time -->
-               <dependency>
-                       <groupId>org.argeo.commons.eclipse</groupId>
-                       <artifactId>org.argeo.eclipse.dep.rcp</artifactId>
-                       <version>0.2.3-SNAPSHOT</version>
-                       <scope>provided</scope>
-               </dependency>
-
-               <!-- Commons -->
-               <dependency>
-                       <groupId>org.argeo.commons.basic</groupId>
-                       <artifactId>org.argeo.basic.nodeps</artifactId>
-                       <version>0.2.3-SNAPSHOT</version>
-               </dependency>
-
-               <!-- Spring -->
-               <dependency>
-                       <groupId>org.springframework.security</groupId>
-                       <artifactId>org.springframework.security.core</artifactId>
-               </dependency>
-
-               <!-- Others -->
-               <dependency>
-                       <groupId>org.slf4j</groupId>
-                       <artifactId>com.springsource.slf4j.org.apache.commons.logging</artifactId>
-               </dependency>
-       </dependencies>
-</project>
diff --git a/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/CurrentUser.java b/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/CurrentUser.java
deleted file mode 100644 (file)
index a864c3a..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.argeo.security.ui;
-
-import java.security.AccessController;
-import java.security.Principal;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.security.auth.Subject;
-
-import org.argeo.ArgeoException;
-import org.springframework.security.Authentication;
-import org.springframework.security.GrantedAuthority;
-
-public class CurrentUser {
-       public final static String getUsername() {
-               Subject subject = getSubject();
-               if (subject == null)
-                       return null;
-               Principal principal = subject.getPrincipals().iterator().next();
-               return principal.getName();
-
-       }
-
-       public final static Set<String> roles() {
-               Principal principal = getSubject().getPrincipals().iterator().next();
-               Authentication authentication = (Authentication) principal;
-               Set<String> roles = Collections.synchronizedSet(new HashSet<String>());
-               for (GrantedAuthority ga : authentication.getAuthorities()) {
-                       roles.add(ga.getAuthority());
-               }
-               return Collections.unmodifiableSet(roles);
-       }
-
-       public final static Subject getSubject() {
-
-               Subject subject = Subject.getSubject(AccessController.getContext());
-               if (subject == null)
-                       throw new ArgeoException("Not authenticated.");
-               return subject;
-
-       }
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/SecurityPerspective.java b/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/SecurityPerspective.java
deleted file mode 100644 (file)
index 3b3b9b8..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.argeo.security.ui;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IFolderLayout;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-
-public class SecurityPerspective implements IPerspectiveFactory {
-       private String adminRole = "ROLE_ADMIN";
-
-       public void createInitialLayout(IPageLayout layout) {
-               if (!CurrentUser.roles().contains(adminRole)) {
-                       MessageDialog
-                                       .openError(Display.getCurrent().getActiveShell(),
-                                                       "Forbidden",
-                                                       "You are not allowed to access this resource.");
-                       return;
-               }
-
-               String editorArea = layout.getEditorArea();
-               layout.setEditorAreaVisible(true);
-               layout.setFixed(false);
-
-               IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT,
-                               0.4f, editorArea);
-
-               left.addView("org.argeo.security.ui.usersView");
-               left.addView("org.argeo.security.ui.rolesView");
-               // left.addView("org.argeo.security.ui.currentUserView");
-       }
-
-       public void setAdminRole(String adminRole) {
-               this.adminRole = adminRole;
-       }
-
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/SecurityUiPlugin.java b/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/SecurityUiPlugin.java
deleted file mode 100644 (file)
index bc05495..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.argeo.security.ui;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class SecurityUiPlugin extends AbstractUIPlugin {
-
-       // The plug-in ID
-       public static final String PLUGIN_ID = "org.argeo.security.ui"; //$NON-NLS-1$
-
-       // The shared instance
-       private static SecurityUiPlugin plugin;
-
-       /**
-        * The constructor
-        */
-       public SecurityUiPlugin() {
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
-        * )
-        */
-       public void start(BundleContext context) throws Exception {
-               super.start(context);
-               plugin = this;
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
-        * )
-        */
-       public void stop(BundleContext context) throws Exception {
-               plugin = null;
-               super.stop(context);
-       }
-
-       /**
-        * Returns the shared instance
-        * 
-        * @return the shared instance
-        */
-       public static SecurityUiPlugin getDefault() {
-               return plugin;
-       }
-
-       public static ImageDescriptor getImageDescriptor(String path) {
-               return imageDescriptorFromPlugin(PLUGIN_ID, path);
-       }
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/AddRole.java b/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/AddRole.java
deleted file mode 100644 (file)
index 1873a13..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.argeo.security.ui.commands;
-
-import org.argeo.ArgeoException;
-import org.argeo.security.ArgeoSecurityService;
-import org.argeo.security.ui.views.RolesView;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/** Add a new role. */
-public class AddRole extends AbstractHandler {
-       public final static String COMMAND_ID = "org.argeo.security.ui.addRole";
-       private ArgeoSecurityService securityService;
-       private String rolePrefix = "ROLE_";
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               RolesView rolesView = (RolesView) HandlerUtil
-                               .getActiveWorkbenchWindow(event).getActivePage()
-                               .findView(RolesView.ID);
-               String role = rolesView.getNewRole();
-               if (role.trim().equals(""))
-                       return null;
-               if (role.equals(rolesView.getAddNewRoleText()))
-                       return null;
-               role = role.trim().toUpperCase();
-               if (!role.startsWith(rolePrefix))
-                       role = rolePrefix + role;
-               if (securityService.listEditableRoles().contains(role))
-                       throw new ArgeoException("Role " + role + " already exists");
-               securityService.newRole(role);
-               rolesView.refresh();
-               return null;
-       }
-
-       public void setSecurityService(ArgeoSecurityService securityService) {
-               this.securityService = securityService;
-       }
-
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/OpenArgeoUserEditor.java b/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/OpenArgeoUserEditor.java
deleted file mode 100644 (file)
index c9bd25f..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.argeo.security.ui.commands;
-
-import org.argeo.security.ui.editors.ArgeoUserEditor;
-import org.argeo.security.ui.editors.ArgeoUserEditorInput;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/** Command handler to set visible or open a Argeo user. */
-public class OpenArgeoUserEditor extends AbstractHandler {
-       public final static String COMMAND_ID = "org.argeo.security.ui.openArgeoUserEditor";
-       public final static String PARAM_USERNAME = "org.argeo.security.ui.username";
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               try {
-                       ArgeoUserEditorInput editorInput = new ArgeoUserEditorInput(
-                                       event.getParameter(PARAM_USERNAME));
-                       IWorkbenchPage activePage = HandlerUtil.getActiveWorkbenchWindow(
-                                       event).getActivePage();
-                       activePage.openEditor(editorInput, ArgeoUserEditor.ID);
-               } catch (Exception e) {
-                       throw new ExecutionException("Cannot open editor", e);
-               }
-               return null;
-       }
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/OpenChangePasswordDialog.java b/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/OpenChangePasswordDialog.java
deleted file mode 100644 (file)
index 7047115..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.argeo.security.ui.commands;
-
-import org.argeo.security.ArgeoSecurityService;
-import org.argeo.security.ui.dialogs.ChangePasswordDialog;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/** Opens the change password dialog. */
-public class OpenChangePasswordDialog extends AbstractHandler {
-       private ArgeoSecurityService securityService;
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               ChangePasswordDialog dialog = new ChangePasswordDialog(
-                               HandlerUtil.getActiveShell(event), securityService);
-               dialog.open();
-               return null;
-       }
-
-       public void setSecurityService(ArgeoSecurityService securityService) {
-               this.securityService = securityService;
-       }
-
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/RefreshUsersList.java b/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/RefreshUsersList.java
deleted file mode 100644 (file)
index a385eb9..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.argeo.security.ui.commands;
-
-import org.argeo.security.ui.views.UsersView;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/** Refresh the main EBI list. */
-public class RefreshUsersList extends AbstractHandler {
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               UsersView view = (UsersView) HandlerUtil
-                               .getActiveWorkbenchWindow(event).getActivePage()
-                               .findView(UsersView.ID);
-               view.refresh();
-               return null;
-       }
-
-}
\ No newline at end of file
diff --git a/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/SaveArgeoUser.java b/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/SaveArgeoUser.java
deleted file mode 100644 (file)
index 7d81743..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.argeo.security.ui.commands;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/** Save the currently edited Argeo user. */
-public class SaveArgeoUser extends AbstractHandler {
-       public final static String COMMAND_ID = "org.argeo.security.ui.saveArgeoUser";
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               try {
-                       IWorkbenchPart iwp = HandlerUtil.getActiveWorkbenchWindow(event)
-                                       .getActivePage().getActivePart();
-
-                       if (!(iwp instanceof IEditorPart))
-                               return null;
-                       IEditorPart editor = (IEditorPart) iwp;
-                       editor.doSave(null);
-               } catch (Exception e) {
-                       MessageDialog.openError(Display.getDefault().getActiveShell(),
-                                       "Error", "Cannot save user: " + e.getMessage());
-               }
-               return null;
-       }
-
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/dialogs/AbstractLoginDialog.java b/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/dialogs/AbstractLoginDialog.java
deleted file mode 100644 (file)
index d3d1be3..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-package org.argeo.security.ui.dialogs;
-
-import java.io.IOException;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.operation.ModalContext;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-public abstract class AbstractLoginDialog extends TitleAreaDialog implements
-               CallbackHandler {
-
-       boolean processCallbacks = false;
-       boolean isCancelled = false;
-       Callback[] callbackArray;
-
-       protected final Callback[] getCallbacks() {
-               return this.callbackArray;
-       }
-
-       public abstract void internalHandle();
-
-       public boolean isCancelled() {
-               return isCancelled;
-       }
-
-       protected AbstractLoginDialog(Shell parentShell) {
-               super(parentShell);
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * javax.security.auth.callback.CallbackHandler#handle(javax.security.auth
-        * .callback.Callback[])
-        */
-       public void handle(final Callback[] callbacks) throws IOException {
-               this.callbackArray = callbacks;
-               final Display display = Display.getDefault();
-               display.syncExec(new Runnable() {
-
-                       public void run() {
-                               isCancelled = false;
-                               setBlockOnOpen(false);
-                               open();
-                               final Button okButton = getButton(IDialogConstants.OK_ID);
-                               okButton.setText("Login");
-                               okButton.addSelectionListener(new SelectionListener() {
-
-                                       public void widgetSelected(final SelectionEvent event) {
-                                               processCallbacks = true;
-                                       }
-
-                                       public void widgetDefaultSelected(final SelectionEvent event) {
-                                               // nothing to do
-                                       }
-                               });
-                               final Button cancel = getButton(IDialogConstants.CANCEL_ID);
-                               cancel.addSelectionListener(new SelectionListener() {
-
-                                       public void widgetSelected(final SelectionEvent event) {
-                                               isCancelled = true;
-                                               processCallbacks = true;
-                                       }
-
-                                       public void widgetDefaultSelected(final SelectionEvent event) {
-                                               // nothing to do
-                                       }
-                               });
-                       }
-               });
-               try {
-                       ModalContext.setAllowReadAndDispatch(true); // Works for now.
-                       ModalContext.run(new IRunnableWithProgress() {
-
-                               public void run(final IProgressMonitor monitor) {
-                                       // Wait here until OK or cancel is pressed, then let it rip.
-                                       // The event
-                                       // listener
-                                       // is responsible for closing the dialog (in the
-                                       // loginSucceeded
-                                       // event).
-                                       while (!processCallbacks) {
-                                               try {
-                                                       Thread.sleep(100);
-                                               } catch (final Exception e) {
-                                                       // do nothing
-                                               }
-                                       }
-                                       processCallbacks = false;
-                                       // Call the adapter to handle the callbacks
-                                       if (!isCancelled())
-                                               internalHandle();
-                                       else
-                                               // clear callbacks are when cancelling
-                                               for (Callback callback : callbacks)
-                                                       if (callback instanceof PasswordCallback)
-                                                               ((PasswordCallback) callback).setPassword(null);
-                                                       else if (callback instanceof NameCallback)
-                                                               ((NameCallback) callback).setName(null);
-                               }
-                       }, true, new NullProgressMonitor(), Display.getDefault());
-               } catch (final Exception e) {
-                       final IOException ioe = new IOException();
-                       ioe.initCause(e);
-                       throw ioe;
-               }
-       }
-
-       protected void configureShell(Shell shell) {
-               super.configureShell(shell);
-               shell.setText("Login");
-       }
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/dialogs/ChangePasswordDialog.java b/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/dialogs/ChangePasswordDialog.java
deleted file mode 100644 (file)
index e2e78e8..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-package org.argeo.security.ui.dialogs;
-
-import org.argeo.ArgeoException;
-import org.argeo.security.ArgeoSecurityService;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/** Dialog to change the current user password */
-public class ChangePasswordDialog extends TitleAreaDialog {
-       private Text currentPassword, newPassword1, newPassword2;
-       private ArgeoSecurityService securityService;
-
-       public ChangePasswordDialog(Shell parentShell,
-                       ArgeoSecurityService securityService) {
-               super(parentShell);
-               this.securityService = securityService;
-       }
-
-       protected Point getInitialSize() {
-               return new Point(300, 250);
-       }
-
-       protected Control createDialogArea(Composite parent) {
-               Composite dialogarea = (Composite) super.createDialogArea(parent);
-               dialogarea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-               Composite composite = new Composite(dialogarea, SWT.NONE);
-               composite.setLayout(new GridLayout(2, false));
-               composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-               currentPassword = createLP(composite, "Current password");
-               newPassword1 = createLP(composite, "New password");
-               newPassword2 = createLP(composite, "Repeat new password");
-
-               setMessage("Change password", IMessageProvider.INFORMATION);
-               parent.pack();
-               return composite;
-       }
-
-       @Override
-       protected void okPressed() {
-               if (!newPassword1.getText().equals(newPassword2.getText()))
-                       throw new ArgeoException("Passwords are different");
-               securityService.updateCurrentUserPassword(currentPassword.getText(),
-                               newPassword1.getText());
-               close();
-       }
-
-       /** Creates label and password. */
-       protected Text createLP(Composite parent, String label) {
-               new Label(parent, SWT.NONE).setText(label);
-               Text text = new Text(parent, SWT.SINGLE | SWT.LEAD | SWT.PASSWORD
-                               | SWT.BORDER);
-               text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-               return text;
-       }
-
-       protected void configureShell(Shell shell) {
-               super.configureShell(shell);
-               shell.setText("Change password");
-       }
-
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/dialogs/DefaultLoginDialog.java b/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/dialogs/DefaultLoginDialog.java
deleted file mode 100644 (file)
index d00e961..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-package org.argeo.security.ui.dialogs;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.TextOutputCallback;
-
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-public class DefaultLoginDialog extends AbstractLoginDialog {
-
-       public DefaultLoginDialog() {
-               this(Display.getDefault().getActiveShell());
-       }
-
-       protected DefaultLoginDialog(Shell parentShell) {
-               super(parentShell);
-       }
-
-       protected Point getInitialSize() {
-               return new Point(300, 250);
-       }
-
-       protected Control createDialogArea(Composite parent) {
-               Composite dialogarea = (Composite) super.createDialogArea(parent);
-               // dialogarea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
-               // true));
-               Composite composite = new Composite(dialogarea, SWT.NONE);
-               composite.setLayout(new GridLayout(2, false));
-               composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-               createCallbackHandlers(composite);
-               parent.pack();
-               return composite;
-       }
-
-       private void createCallbackHandlers(Composite composite) {
-               Callback[] callbacks = getCallbacks();
-               for (int i = 0; i < callbacks.length; i++) {
-                       Callback callback = callbacks[i];
-                       if (callback instanceof TextOutputCallback) {
-                               createTextoutputHandler(composite,
-                                               (TextOutputCallback) callback);
-                       } else if (callback instanceof NameCallback) {
-                               createNameHandler(composite, (NameCallback) callback);
-                       } else if (callback instanceof PasswordCallback) {
-                               createPasswordHandler(composite, (PasswordCallback) callback);
-                       }
-               }
-       }
-
-       private void createPasswordHandler(Composite composite,
-                       final PasswordCallback callback) {
-               Label label = new Label(composite, SWT.NONE);
-               label.setText(callback.getPrompt());
-               final Text passwordText = new Text(composite, SWT.SINGLE | SWT.LEAD
-                               | SWT.PASSWORD | SWT.BORDER);
-               passwordText
-                               .setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-               passwordText.addModifyListener(new ModifyListener() {
-
-                       public void modifyText(ModifyEvent event) {
-                               callback.setPassword(passwordText.getText().toCharArray());
-                       }
-               });
-       }
-
-       private void createNameHandler(Composite composite,
-                       final NameCallback callback) {
-               Label label = new Label(composite, SWT.NONE);
-               label.setText(callback.getPrompt());
-               final Text text = new Text(composite, SWT.SINGLE | SWT.LEAD
-                               | SWT.BORDER);
-               text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-               text.addModifyListener(new ModifyListener() {
-
-                       public void modifyText(ModifyEvent event) {
-                               callback.setName(text.getText());
-                       }
-               });
-       }
-
-       private void createTextoutputHandler(Composite composite,
-                       TextOutputCallback callback) {
-               int messageType = callback.getMessageType();
-               int dialogMessageType = IMessageProvider.NONE;
-               switch (messageType) {
-               case TextOutputCallback.INFORMATION:
-                       dialogMessageType = IMessageProvider.INFORMATION;
-                       break;
-               case TextOutputCallback.WARNING:
-                       dialogMessageType = IMessageProvider.WARNING;
-                       break;
-               case TextOutputCallback.ERROR:
-                       dialogMessageType = IMessageProvider.ERROR;
-                       break;
-               }
-               setMessage(callback.getMessage(), dialogMessageType);
-       }
-
-       public void internalHandle() {
-       }
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/editors/ArgeoUserEditor.java b/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/editors/ArgeoUserEditor.java
deleted file mode 100644 (file)
index 99a4652..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.argeo.security.ui.editors;
-
-import org.argeo.ArgeoException;
-import org.argeo.security.ArgeoSecurityService;
-import org.argeo.security.ArgeoUser;
-import org.argeo.security.SimpleArgeoUser;
-import org.argeo.security.nature.SimpleUserNature;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.forms.editor.FormEditor;
-
-/** Editor for an Argeo user. */
-public class ArgeoUserEditor extends FormEditor {
-       public final static String ID = "org.argeo.security.ui.argeoUserEditor";
-
-       private ArgeoUser user;
-       private ArgeoSecurityService securityService;
-
-       public void init(IEditorSite site, IEditorInput input)
-                       throws PartInitException {
-               super.init(site, input);
-               String username = ((ArgeoUserEditorInput) getEditorInput())
-                               .getUsername();
-               if (username == null) {// new
-                       user = new SimpleArgeoUser();
-                       user.getUserNatures().put(SimpleUserNature.TYPE,
-                                       new SimpleUserNature());
-               } else
-                       user = securityService.getUser(username);
-               this.setPartProperty("name", username != null ? username : "<new user>");
-               setPartName(username != null ? username : "<new user>");
-       }
-
-       protected void addPages() {
-               try {
-                       addPage(new DefaultUserMainPage(this, securityService, user));
-
-               } catch (PartInitException e) {
-                       throw new ArgeoException("Not able to add page ", e);
-               }
-       }
-
-       @Override
-       public void doSave(IProgressMonitor monitor) {
-               // list pages
-               // TODO: make it more generic
-               findPage(DefaultUserMainPage.ID).doSave(monitor);
-
-               if (securityService.userExists(user.getUsername()))
-                       securityService.updateUser(user);
-               else {
-                       securityService.newUser(user);
-                       setPartName(user.getUsername());
-               }
-               firePropertyChange(PROP_DIRTY);
-       }
-
-       @Override
-       public void doSaveAs() {
-       }
-
-       @Override
-       public boolean isSaveAsAllowed() {
-               return false;
-       }
-
-       public void setSecurityService(ArgeoSecurityService securityService) {
-               this.securityService = securityService;
-       }
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/editors/ArgeoUserEditorInput.java b/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/editors/ArgeoUserEditorInput.java
deleted file mode 100644 (file)
index 9d61e9f..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.argeo.security.ui.editors;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPersistableElement;
-
-/** Editor input for an Argeo user. */
-public class ArgeoUserEditorInput implements IEditorInput {
-       private final String username;
-
-       public ArgeoUserEditorInput(String username) {
-               this.username = username;
-       }
-
-       public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
-               return null;
-       }
-
-       public boolean exists() {
-               return username != null;
-       }
-
-       public ImageDescriptor getImageDescriptor() {
-               return null;
-       }
-
-       public String getName() {
-               return username != null ? username : "<new user>";
-       }
-
-       public IPersistableElement getPersistable() {
-               return null;
-       }
-
-       public String getToolTipText() {
-               return username != null ? username : "<new user>";
-       }
-
-       public boolean equals(Object obj) {
-               if (!(obj instanceof ArgeoUserEditorInput))
-                       return false;
-               if (((ArgeoUserEditorInput) obj).getUsername() == null)
-                       return false;
-               return ((ArgeoUserEditorInput) obj).getUsername().equals(username);
-       }
-
-       public String getUsername() {
-               return username;
-       }
-
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/editors/DefaultUserMainPage.java b/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/editors/DefaultUserMainPage.java
deleted file mode 100644 (file)
index 6180de4..0000000
+++ /dev/null
@@ -1,337 +0,0 @@
-package org.argeo.security.ui.editors;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.security.ArgeoSecurityService;
-import org.argeo.security.ArgeoUser;
-import org.argeo.security.SimpleArgeoUser;
-import org.argeo.security.nature.SimpleUserNature;
-import org.argeo.security.ui.SecurityUiPlugin;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.CheckboxCellEditor;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.EditingSupport;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.AbstractFormPart;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.SectionPart;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
-import org.eclipse.ui.forms.widgets.ColumnLayout;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * Display/edit the properties common to all {@link ArgeoUser} (username and
- * roles) as well as the properties of the {@link SimpleUserNature}.
- */
-public class DefaultUserMainPage extends FormPage {
-       final static String ID = "argeoUserEditor.mainPage";
-
-       private final static Log log = LogFactory.getLog(DefaultUserMainPage.class);
-       private final static Image ROLE_CHECKED = SecurityUiPlugin
-                       .getImageDescriptor("icons/security.gif").createImage();
-
-       private ArgeoUser user;
-       private SimpleUserNature simpleNature;
-       private String simpleNatureType;
-       private ArgeoSecurityService securityService;
-
-       public DefaultUserMainPage(FormEditor editor,
-                       ArgeoSecurityService securityService, ArgeoUser user) {
-               super(editor, ID, "Main");
-               this.securityService = securityService;
-               this.user = user;
-               this.simpleNature = SimpleUserNature.findSimpleUserNature(user,
-                               simpleNatureType);
-       }
-
-       protected void createFormContent(final IManagedForm mf) {
-               ScrolledForm form = mf.getForm();
-               form.setText(simpleNature.getFirstName() + " "
-                               + simpleNature.getLastName());
-               ColumnLayout mainLayout = new ColumnLayout();
-               mainLayout.minNumColumns = 1;
-               mainLayout.maxNumColumns = 4;
-               mainLayout.topMargin = 0;
-               mainLayout.bottomMargin = 5;
-               mainLayout.leftMargin = mainLayout.rightMargin = mainLayout.horizontalSpacing = mainLayout.verticalSpacing = 10;
-               form.getBody().setLayout(mainLayout);
-
-               createGeneralPart(form.getBody());
-               createRolesPart(form.getBody());
-               createPassworPart(form.getBody());
-       }
-
-       /** Creates the general section */
-       protected void createGeneralPart(Composite parent) {
-               FormToolkit tk = getManagedForm().getToolkit();
-               Section section = tk.createSection(parent, Section.TITLE_BAR);
-               section.setText("General");
-
-               Composite body = tk.createComposite(section, SWT.WRAP);
-               section.setClient(body);
-               GridLayout layout = new GridLayout();
-               layout.marginWidth = layout.marginHeight = 0;
-               layout.numColumns = 2;
-               body.setLayout(layout);
-
-               // add widgets (view)
-               final Text username;
-               if (user.getUsername() != null) {
-                       tk.createLabel(body, "Username");
-                       tk.createLabel(body, user.getUsername());
-                       username = null;
-               } else {
-                       username = createLT(body, "Username", "");
-               }
-               final Text firstName = createLT(body, "First name",
-                               simpleNature.getFirstName());
-               final Text lastName = createLT(body, "Last name",
-                               simpleNature.getLastName());
-               final Text email = createLT(body, "Email", simpleNature.getEmail());
-               final Text description = createLT(body, "Description",
-                               simpleNature.getDescription());
-
-               // create form part (controller)
-               AbstractFormPart part = new SectionPart(section) {
-                       public void commit(boolean onSave) {
-                               if (username != null) {
-                                       ((SimpleArgeoUser) user).setUsername(username.getText());
-                                       username.setEditable(false);
-                                       username.setEnabled(false);
-                               }
-                               simpleNature.setFirstName(firstName.getText());
-                               simpleNature.setLastName(lastName.getText());
-                               simpleNature.setEmail(email.getText());
-                               simpleNature.setDescription(description.getText());
-                               super.commit(onSave);
-                               if (log.isTraceEnabled())
-                                       log.trace("General part committed");
-                       }
-               };
-               if (username != null)
-                       username.addModifyListener(new FormPartML(part));
-               firstName.addModifyListener(new FormPartML(part));
-               lastName.addModifyListener(new FormPartML(part));
-               email.addModifyListener(new FormPartML(part));
-               description.addModifyListener(new FormPartML(part));
-               getManagedForm().addPart(part);
-       }
-
-       /** Creates the password section */
-       protected void createPassworPart(Composite parent) {
-               FormToolkit tk = getManagedForm().getToolkit();
-               Section section = tk.createSection(parent, Section.TITLE_BAR);
-               section.setText("Password");
-
-               Composite body = tk.createComposite(section, SWT.WRAP);
-               section.setClient(body);
-               GridLayout layout = new GridLayout();
-               layout.marginWidth = layout.marginHeight = 0;
-               layout.numColumns = 2;
-               body.setLayout(layout);
-
-               // add widgets (view)
-               final Text password1 = createLP(body, "New password", "");
-               final Text password2 = createLP(body, "Repeat password", "");
-               // create form part (controller)
-               AbstractFormPart part = new SectionPart(section) {
-                       public void commit(boolean onSave) {
-                               if (!password1.getText().equals("")
-                                               && password1.getText().equals(password2.getText())) {
-                                       ((SimpleArgeoUser) user).setPassword(password1.getText());
-                               }
-                               super.commit(onSave);
-                               if (log.isTraceEnabled())
-                                       log.trace("Password part committed");
-                       }
-               };
-               password1.addModifyListener(new FormPartML(part));
-               password2.addModifyListener(new FormPartML(part));
-               getManagedForm().addPart(part);
-       }
-
-       /** Creates the role section */
-       protected void createRolesPart(Composite parent) {
-               FormToolkit tk = getManagedForm().getToolkit();
-               Section section = tk.createSection(parent, Section.DESCRIPTION
-                               | Section.TITLE_BAR);
-               section.setText("Roles");
-               section.setDescription("Roles define "
-                               + "the authorizations for this user.");
-               Table table = new Table(section, SWT.MULTI | SWT.H_SCROLL
-                               | SWT.V_SCROLL);
-               section.setClient(table);
-
-               AbstractFormPart part = new SectionPart(section) {
-                       public void commit(boolean onSave) {
-                               // roles have already been modified in editing
-                               super.commit(onSave);
-                               if (log.isTraceEnabled())
-                                       log.trace("Role part committed");
-                       }
-               };
-               getManagedForm().addPart(part);
-
-               GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
-               gridData.verticalSpan = 20;
-               table.setLayoutData(gridData);
-               table.setLinesVisible(true);
-               table.setHeaderVisible(false);
-               TableViewer viewer = new TableViewer(table);
-
-               // check column
-               TableViewerColumn column = createTableViewerColumn(viewer, "checked",
-                               20);
-               column.setLabelProvider(new ColumnLabelProvider() {
-                       public String getText(Object element) {
-                               return null;
-                       }
-
-                       public Image getImage(Object element) {
-                               String role = element.toString();
-                               if (user.getRoles().contains(role)) {
-                                       return ROLE_CHECKED;
-                               } else {
-                                       return null;
-                               }
-                       }
-               });
-               column.setEditingSupport(new RoleEditingSupport(viewer, part));
-
-               // role column
-               column = createTableViewerColumn(viewer, "Role", 200);
-               column.setLabelProvider(new ColumnLabelProvider() {
-                       public String getText(Object element) {
-                               return element.toString();
-                       }
-
-                       public Image getImage(Object element) {
-                               return null;
-                       }
-               });
-               viewer.setContentProvider(new RolesContentProvider());
-               viewer.setInput(getEditorSite());
-       }
-
-       protected TableViewerColumn createTableViewerColumn(TableViewer viewer,
-                       String title, int bound) {
-               final TableViewerColumn viewerColumn = new TableViewerColumn(viewer,
-                               SWT.NONE);
-               final TableColumn column = viewerColumn.getColumn();
-               column.setText(title);
-               column.setWidth(bound);
-               column.setResizable(true);
-               column.setMoveable(true);
-               return viewerColumn;
-
-       }
-
-       /** Creates label and text. */
-       protected Text createLT(Composite body, String label, String value) {
-               FormToolkit toolkit = getManagedForm().getToolkit();
-               toolkit.createLabel(body, label);
-               Text text = toolkit.createText(body, value, SWT.BORDER);
-               text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-               return text;
-       }
-
-       /** Creates label and password. */
-       protected Text createLP(Composite body, String label, String value) {
-               FormToolkit toolkit = getManagedForm().getToolkit();
-               toolkit.createLabel(body, label);
-               Text text = toolkit.createText(body, value, SWT.BORDER | SWT.PASSWORD);
-               text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-               return text;
-       }
-
-       public void setSimpleNatureType(String simpleNatureType) {
-               this.simpleNatureType = simpleNatureType;
-       }
-
-       private class FormPartML implements ModifyListener {
-               private AbstractFormPart formPart;
-
-               public FormPartML(AbstractFormPart generalPart) {
-                       this.formPart = generalPart;
-               }
-
-               public void modifyText(ModifyEvent e) {
-                       formPart.markDirty();
-               }
-
-       }
-
-       private class RolesContentProvider implements IStructuredContentProvider {
-               public Object[] getElements(Object inputElement) {
-                       return securityService.listEditableRoles().toArray();
-               }
-
-               public void dispose() {
-               }
-
-               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-               }
-       }
-
-       /** Select the columns by editing the checkbox in the first column */
-       class RoleEditingSupport extends EditingSupport {
-
-               private final TableViewer viewer;
-               private final AbstractFormPart formPart;
-
-               public RoleEditingSupport(TableViewer viewer, AbstractFormPart formPart) {
-                       super(viewer);
-                       this.viewer = viewer;
-                       this.formPart = formPart;
-               }
-
-               @Override
-               protected CellEditor getCellEditor(Object element) {
-                       return new CheckboxCellEditor(null, SWT.CHECK | SWT.READ_ONLY);
-
-               }
-
-               @Override
-               protected boolean canEdit(Object element) {
-                       return true;
-               }
-
-               @Override
-               protected Object getValue(Object element) {
-                       String role = element.toString();
-                       return user.getRoles().contains(role);
-
-               }
-
-               @Override
-               protected void setValue(Object element, Object value) {
-                       Boolean inRole = (Boolean) value;
-                       String role = element.toString();
-                       if (inRole && !user.getRoles().contains(role)) {
-                               user.getRoles().add(role);
-                               formPart.markDirty();
-                       } else if (!inRole && user.getRoles().contains(role)) {
-                               user.getRoles().remove(role);
-                               formPart.markDirty();
-                       }
-                       viewer.refresh();
-               }
-       }
-
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/views/CurrentUserView.java b/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/views/CurrentUserView.java
deleted file mode 100644 (file)
index 5b04928..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-package org.argeo.security.ui.views;
-
-import org.argeo.security.ui.CurrentUser;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.ui.part.ViewPart;
-
-public class CurrentUserView extends ViewPart {
-       private TableViewer viewer;
-
-       @Override
-       public void createPartControl(Composite parent) {
-
-               // viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL
-               // | SWT.V_SCROLL);
-               viewer = new TableViewer(createTable(parent));
-               viewer.setContentProvider(new UsersContentProvider());
-               viewer.setLabelProvider(new UsersLabelProvider());
-               viewer.setInput(getViewSite());
-               // viewer.setInput(SecurityContextHolder.getContext());
-       }
-
-       protected Table createTable(Composite parent) {
-               int style = SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL;
-
-               Table table = new Table(parent, style);
-
-               // GridData gridData = new GridData(GridData.FILL_BOTH);
-               // gridData.grabExcessVerticalSpace = true;
-               // gridData.grabExcessHorizontalSpace = true;
-               // gridData.horizontalSpan = 3;
-               // table.setLayoutData(gridData);
-
-               table.setLinesVisible(true);
-               table.setHeaderVisible(true);
-
-               TableColumn column = new TableColumn(table, SWT.LEFT, 0);
-               column.setText("ID");
-               column.setWidth(100);
-
-               // column = new TableColumn(table, SWT.LEFT, 1);
-               // column.setText("Password");
-               // column.setWidth(200);
-
-               // column = new TableColumn(table, SWT.LEFT, 2);
-               // column.setText("Roles");
-               // column.setWidth(300);
-
-               return table;
-       }
-
-       @Override
-       public void setFocus() {
-               viewer.getTable().setFocus();
-       }
-
-       private class UsersContentProvider implements IStructuredContentProvider {
-
-               public Object[] getElements(Object inputElement) {
-                       return getChildren(inputElement);
-               }
-
-               public Object[] getChildren(Object parentElement) {
-                       // ILoginContext secureContext = LoginContextFactory
-                       // .createContext("SPRING");
-                       // try {
-                       // secureContext.login();
-                       // } catch (LoginException e) {
-                       // // login failed
-                       // }
-                       //
-                       // Subject subject = null;
-                       // // subject = Subject.getSubject(AccessController.getContext());
-                       // try {
-                       // subject = secureContext.getSubject();
-                       // } catch (Exception e) {
-                       // e.printStackTrace();
-                       // throw new ArgeoException("Cannot retrieve subject", e);
-                       // }
-                       //
-                       // if (subject == null)
-                       // throw new ArgeoException("No subject found");
-                       // return subject.getPrincipals().toArray();
-                       return CurrentUser.roles().toArray();
-               }
-
-               public void dispose() {
-                       // TODO Auto-generated method stub
-
-               }
-
-               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-                       // TODO Auto-generated method stub
-
-               }
-
-       }
-
-       private class UsersLabelProvider extends LabelProvider implements
-                       ITableLabelProvider {
-               public String getColumnText(Object element, int columnIndex) {
-                       // Principal argeoUser = (Principal) element;
-                       // switch (columnIndex) {
-                       // case 0:
-                       // return argeoUser.getName();
-                       // case 1:
-                       // return argeoUser.toString();
-                       // default:
-                       // throw new ArgeoException("Unmanaged column " + columnIndex);
-                       // }
-                       return element.toString();
-               }
-
-               public Image getColumnImage(Object element, int columnIndex) {
-                       // TODO Auto-generated method stub
-                       return null;
-               }
-
-       }
-
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/views/RolesView.java b/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/views/RolesView.java
deleted file mode 100644 (file)
index a58675e..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-package org.argeo.security.ui.views;
-
-import java.util.ArrayList;
-
-import org.argeo.ArgeoException;
-import org.argeo.security.ArgeoSecurityService;
-import org.argeo.security.ArgeoUser;
-import org.argeo.security.ui.SecurityUiPlugin;
-import org.argeo.security.ui.commands.AddRole;
-import org.argeo.security.ui.commands.OpenArgeoUserEditor;
-import org.eclipse.core.commands.Command;
-import org.eclipse.core.commands.IParameter;
-import org.eclipse.core.commands.Parameterization;
-import org.eclipse.core.commands.ParameterizedCommand;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.handlers.IHandlerService;
-import org.eclipse.ui.part.ViewPart;
-
-/** List all roles. */
-public class RolesView extends ViewPart {
-       public final static String ID = "org.argeo.security.ui.rolesView";
-
-       private Text newRole;
-
-       private TableViewer viewer;
-       private ArgeoSecurityService securityService;
-
-       private String addNewRoleText = "<add new role here>";
-
-       @Override
-       public void createPartControl(Composite parent) {
-               parent.setLayout(new GridLayout(1, false));
-
-               // new role text field
-               newRole = new Text(parent, SWT.BORDER);
-               newRole.setText(addNewRoleText);
-               newRole.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-               // default action is add role
-               newRole.addListener(SWT.DefaultSelection, new Listener() {
-                       public void handleEvent(Event evt) {
-                               IWorkbench iw = SecurityUiPlugin.getDefault().getWorkbench();
-                               IHandlerService handlerService = (IHandlerService) iw
-                                               .getService(IHandlerService.class);
-                               try {
-                                       handlerService.executeCommand(AddRole.COMMAND_ID, evt);
-                               } catch (Exception e) {
-                                       throw new ArgeoException("Cannot execute add role command",
-                                                       e);
-                               }
-                       }
-               });
-               // select all on focus
-               newRole.addListener(SWT.FocusIn, new Listener() {
-                       public void handleEvent(Event e) {
-                               newRole.selectAll();
-                       }
-               });
-
-               // roles table
-               Table table = new Table(parent, SWT.V_SCROLL | SWT.BORDER);
-               table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-               table.setLinesVisible(false);
-               table.setHeaderVisible(false);
-               viewer = new TableViewer(table);
-               viewer.setContentProvider(new RolesContentProvider());
-               viewer.setLabelProvider(new UsersLabelProvider());
-               viewer.setInput(getViewSite());
-               viewer.addDoubleClickListener(new ViewDoubleClickListener());
-       }
-
-       @Override
-       public void setFocus() {
-               viewer.getTable().setFocus();
-       }
-
-       public void setSecurityService(ArgeoSecurityService securityService) {
-               this.securityService = securityService;
-       }
-
-       public String getAddNewRoleText() {
-               return addNewRoleText;
-       }
-
-       private class RolesContentProvider implements IStructuredContentProvider {
-
-               public Object[] getElements(Object inputElement) {
-                       return securityService.listEditableRoles().toArray();
-               }
-
-               public void dispose() {
-               }
-
-               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-               }
-
-       }
-
-       private class UsersLabelProvider extends LabelProvider implements
-                       ITableLabelProvider {
-               public String getColumnText(Object element, int columnIndex) {
-                       return element.toString();
-               }
-
-               public Image getColumnImage(Object element, int columnIndex) {
-                       return null;
-               }
-
-       }
-
-       class ViewDoubleClickListener implements IDoubleClickListener {
-               public void doubleClick(DoubleClickEvent evt) {
-                       Object obj = ((IStructuredSelection) evt.getSelection())
-                                       .getFirstElement();
-
-                       if (obj instanceof ArgeoUser) {
-                               ArgeoUser argeoUser = (ArgeoUser) obj;
-
-                               IWorkbench iw = SecurityUiPlugin.getDefault().getWorkbench();
-                               IHandlerService handlerService = (IHandlerService) iw
-                                               .getService(IHandlerService.class);
-                               try {
-                                       String commandId = OpenArgeoUserEditor.COMMAND_ID;
-                                       String paramName = OpenArgeoUserEditor.PARAM_USERNAME;
-
-                                       // TODO: factorize this
-                                       // execute related command
-                                       IWorkbenchWindow window = iw.getActiveWorkbenchWindow();
-                                       ICommandService cmdService = (ICommandService) window
-                                                       .getService(ICommandService.class);
-                                       Command cmd = cmdService.getCommand(commandId);
-                                       ArrayList<Parameterization> parameters = new ArrayList<Parameterization>();
-                                       IParameter iparam = cmd.getParameter(paramName);
-                                       Parameterization param = new Parameterization(iparam,
-                                                       argeoUser.getUsername());
-                                       parameters.add(param);
-                                       ParameterizedCommand pc = new ParameterizedCommand(cmd,
-                                                       parameters.toArray(new Parameterization[parameters
-                                                                       .size()]));
-                                       handlerService = (IHandlerService) window
-                                                       .getService(IHandlerService.class);
-                                       handlerService.executeCommand(pc, null);
-                               } catch (Exception e) {
-                                       throw new ArgeoException("Cannot open editor", e);
-                               }
-
-                       }
-               }
-       }
-
-       public String getNewRole() {
-               return newRole.getText();
-       }
-
-       public void refresh() {
-               viewer.refresh();
-               newRole.setText(addNewRoleText);
-       }
-}
diff --git a/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/views/UsersView.java b/security/eclipse/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/views/UsersView.java
deleted file mode 100644 (file)
index 5d78178..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-package org.argeo.security.ui.views;
-
-import java.util.ArrayList;
-
-import org.argeo.ArgeoException;
-import org.argeo.security.ArgeoSecurityService;
-import org.argeo.security.ArgeoUser;
-import org.argeo.security.nature.SimpleUserNature;
-import org.argeo.security.ui.CurrentUser;
-import org.argeo.security.ui.SecurityUiPlugin;
-import org.argeo.security.ui.commands.OpenArgeoUserEditor;
-import org.eclipse.core.commands.Command;
-import org.eclipse.core.commands.IParameter;
-import org.eclipse.core.commands.Parameterization;
-import org.eclipse.core.commands.ParameterizedCommand;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.handlers.IHandlerService;
-import org.eclipse.ui.part.ViewPart;
-
-/** List all users. */
-public class UsersView extends ViewPart {
-       public final static String ID = "org.argeo.security.ui.usersView";
-
-       private TableViewer viewer;
-       private ArgeoSecurityService securityService;
-
-       private String simpleNatureType = null;
-
-       @Override
-       public void createPartControl(Composite parent) {
-               viewer = new TableViewer(createTable(parent));
-               viewer.setContentProvider(new UsersContentProvider());
-               viewer.setLabelProvider(new UsersLabelProvider());
-               viewer.addDoubleClickListener(new ViewDoubleClickListener());
-               viewer.setInput(getViewSite());
-       }
-
-       protected Table createTable(Composite parent) {
-               Table table = new Table(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
-               table.setLinesVisible(true);
-               table.setHeaderVisible(true);
-               TableColumn column = new TableColumn(table, SWT.LEFT, 0);
-               column.setText("User");
-               column.setWidth(50);
-               column = new TableColumn(table, SWT.LEFT, 1);
-               column.setText("First Name");
-               column.setWidth(100);
-               column = new TableColumn(table, SWT.LEFT, 2);
-               column.setText("Last Name");
-               column.setWidth(100);
-               column = new TableColumn(table, SWT.LEFT, 3);
-               column.setText("E-mail");
-               column.setWidth(100);
-               return table;
-       }
-
-       @Override
-       public void setFocus() {
-               viewer.getTable().setFocus();
-       }
-
-       public void setSecurityService(ArgeoSecurityService securityService) {
-               this.securityService = securityService;
-       }
-
-       public void setSimpleNatureType(String simpleNatureType) {
-               this.simpleNatureType = simpleNatureType;
-       }
-
-       public void refresh() {
-               viewer.refresh();
-       }
-
-       private class UsersContentProvider implements IStructuredContentProvider {
-
-               public Object[] getElements(Object inputElement) {
-                       return securityService.listUsers().toArray();
-               }
-
-               public void dispose() {
-               }
-
-               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-               }
-
-       }
-
-       private class UsersLabelProvider extends LabelProvider implements
-                       ITableLabelProvider {
-               public String getColumnText(Object element, int columnIndex) {
-                       String currentUsername = CurrentUser.getUsername();
-                       ArgeoUser user = (ArgeoUser) element;
-                       SimpleUserNature simpleNature = SimpleUserNature
-                                       .findSimpleUserNature(user, simpleNatureType);
-                       switch (columnIndex) {
-                       case 0:
-                               String userName = user.getUsername();
-                               if (userName.equals(currentUsername))
-                                       userName = userName + "*";
-                               return userName;
-                       case 1:
-                               return simpleNature.getFirstName();
-                       case 2:
-                               return simpleNature.getLastName();
-                       case 3:
-                               return simpleNature.getEmail();
-                       default:
-                               throw new ArgeoException("Unmanaged column " + columnIndex);
-                       }
-               }
-
-               public Image getColumnImage(Object element, int columnIndex) {
-                       // TODO Auto-generated method stub
-                       return null;
-               }
-
-       }
-
-       class ViewDoubleClickListener implements IDoubleClickListener {
-               public void doubleClick(DoubleClickEvent evt) {
-                       Object obj = ((IStructuredSelection) evt.getSelection())
-                                       .getFirstElement();
-
-                       if (obj instanceof ArgeoUser) {
-                               ArgeoUser argeoUser = (ArgeoUser) obj;
-
-                               IWorkbench iw = SecurityUiPlugin.getDefault().getWorkbench();
-                               IHandlerService handlerService = (IHandlerService) iw
-                                               .getService(IHandlerService.class);
-                               try {
-                                       String commandId = OpenArgeoUserEditor.COMMAND_ID;
-                                       String paramName = OpenArgeoUserEditor.PARAM_USERNAME;
-
-                                       // TODO: factorize this
-                                       // execute related command
-                                       IWorkbenchWindow window = iw.getActiveWorkbenchWindow();
-                                       ICommandService cmdService = (ICommandService) window
-                                                       .getService(ICommandService.class);
-                                       Command cmd = cmdService.getCommand(commandId);
-                                       ArrayList<Parameterization> parameters = new ArrayList<Parameterization>();
-                                       IParameter iparam = cmd.getParameter(paramName);
-                                       Parameterization param = new Parameterization(iparam,
-                                                       argeoUser.getUsername());
-                                       parameters.add(param);
-                                       ParameterizedCommand pc = new ParameterizedCommand(cmd,
-                                                       parameters.toArray(new Parameterization[parameters
-                                                                       .size()]));
-                                       handlerService = (IHandlerService) window
-                                                       .getService(IHandlerService.class);
-                                       handlerService.executeCommand(pc, null);
-                               } catch (Exception e) {
-                                       throw new ArgeoException("Cannot open editor", e);
-                               }
-
-                       }
-               }
-       }
-
-}
diff --git a/security/eclipse/plugins/pom.xml b/security/eclipse/plugins/pom.xml
deleted file mode 100644 (file)
index ab837fe..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-<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.argeo.commons.security</groupId>
-               <version>0.2.3-SNAPSHOT</version>
-               <artifactId>eclipse</artifactId>
-               <relativePath>..</relativePath>
-       </parent>
-       <artifactId>plugins</artifactId>
-       <name>Commons Security Eclipse plugins</name>
-       <packaging>pom</packaging>
-       <modules>
-               <module>org.argeo.security.equinox</module>
-               <module>org.argeo.security.ui</module>
-               <module>org.argeo.security.ui.application</module>
-               <module>org.argeo.security.ui.rap</module>
-       </modules>
-       <build>
-               <resources>
-                       <resource>
-                               <directory>src/main/resources</directory>
-                       </resource>
-                       <resource>
-                               <directory>.</directory>
-                               <includes>
-                                       <include>plugin.xml</include>
-                                       <include>META-INF/**</include>
-                                       <include>jaas/**</include>
-                                       <include>icons/**</include>
-                               </includes>
-                       </resource>
-               </resources>
-               <plugins>
-                       <plugin>
-                               <artifactId>maven-clean-plugin</artifactId>
-                               <configuration>
-                                       <filesets>
-                                               <fileset>
-                                                       <directory>META-INF</directory>
-                                                       <includes>
-                                                               <include>MANIFEST.MF</include>
-                                                       </includes>
-                                               </fileset>
-                                       </filesets>
-                               </configuration>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-jar-plugin</artifactId>
-                               <configuration>
-                                       <archive>
-                                               <manifestFile>META-INF/MANIFEST.MF</manifestFile>
-                                       </archive>
-                               </configuration>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-source-plugin</artifactId>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-surefire-plugin</artifactId>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.felix</groupId>
-                               <artifactId>maven-bundle-plugin</artifactId>
-                               <configuration>
-                                       <manifestLocation>META-INF</manifestLocation>
-                                       <instructions>
-                                               <Bundle-SymbolicName>${pom.artifactId};singleton:=true</Bundle-SymbolicName>
-                                       </instructions>
-                               </configuration>
-                       </plugin>
-               </plugins>
-       </build>
-       <dependencies>
-               <dependency>
-                       <groupId>org.argeo.commons.osgi</groupId>
-                       <artifactId>org.argeo.osgi.boot</artifactId>
-                       <version>0.2.3-SNAPSHOT</version>
-                       <scope>test</scope>
-               </dependency>
-               <dependency>
-                       <groupId>javax.xml.stream</groupId>
-                       <artifactId>com.springsource.javax.xml.stream</artifactId>
-                       <scope>test</scope>
-               </dependency>
-       </dependencies>
-</project>
diff --git a/security/plugins/org.argeo.security.equinox/.classpath b/security/plugins/org.argeo.security.equinox/.classpath
new file mode 100644 (file)
index 0000000..92f19d2
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry kind="src" path="src/main/java"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/security/plugins/org.argeo.security.equinox/.project b/security/plugins/org.argeo.security.equinox/.project
new file mode 100644 (file)
index 0000000..e4dd594
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.security.equinox</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
diff --git a/security/plugins/org.argeo.security.equinox/.settings/org.eclipse.jdt.core.prefs b/security/plugins/org.argeo.security.equinox/.settings/org.eclipse.jdt.core.prefs
new file mode 100644 (file)
index 0000000..62fa6bd
--- /dev/null
@@ -0,0 +1,8 @@
+#Sun Jan 16 11:20:02 CET 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/security/plugins/org.argeo.security.equinox/.settings/org.eclipse.pde.core.prefs b/security/plugins/org.argeo.security.equinox/.settings/org.eclipse.pde.core.prefs
new file mode 100644 (file)
index 0000000..87ab381
--- /dev/null
@@ -0,0 +1,4 @@
+#Sun Jan 16 11:19:07 CET 2011
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/security/plugins/org.argeo.security.equinox/META-INF/spring/loginModules.xml b/security/plugins/org.argeo.security.equinox/META-INF/spring/loginModules.xml
new file mode 100644 (file)
index 0000000..f454d7a
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+       <bean id="springLoginModule" class="org.argeo.security.equinox.SpringLoginModule"
+               scope="prototype">
+               <property name="authenticationManager" ref="authenticationManager" />
+       </bean>
+</beans>
diff --git a/security/plugins/org.argeo.security.equinox/META-INF/spring/osgi.xml b/security/plugins/org.argeo.security.equinox/META-INF/spring/osgi.xml
new file mode 100644 (file)
index 0000000..8003fb2
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+       xmlns:osgi="http://www.springframework.org/schema/osgi"\r
+       xsi:schemaLocation="http://www.springframework.org/schema/osgi  \r
+       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+       http://www.springframework.org/schema/beans   \r
+       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"\r
+       osgi:default-timeout="30000">\r
+\r
+       <reference id="authenticationManager"\r
+               interface="org.springframework.security.AuthenticationManager"\r
+               context-class-loader="client" />\r
+</beans:beans>
\ No newline at end of file
diff --git a/security/plugins/org.argeo.security.equinox/build.properties b/security/plugins/org.argeo.security.equinox/build.properties
new file mode 100644 (file)
index 0000000..3e2615f
--- /dev/null
@@ -0,0 +1,4 @@
+bin.includes = META-INF/,\
+               plugin.xml
+source.. = src/main/java/
+output.. = target/classes/
diff --git a/security/plugins/org.argeo.security.equinox/plugin.xml b/security/plugins/org.argeo.security.equinox/plugin.xml
new file mode 100644 (file)
index 0000000..b407360
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         id="springSecurityContextLoginModule"
+         point="org.eclipse.equinox.security.loginModule">
+      <loginModule
+            class="org.springframework.security.providers.jaas.SecurityContextLoginModule"
+            description="Spring Security Context (provided by Spring)">
+      </loginModule>
+   </extension>
+  <extension id="unixLoginModule"
+           name="Unix Login Module"
+           point="org.eclipse.equinox.security.loginModule">
+   <loginModule
+       class="com.sun.security.auth.module.UnixLoginModule"
+       description="Unix Login Module">
+   </loginModule>
+   </extension>
+  <extension
+        id="springLoginModule"
+        point="org.eclipse.equinox.security.loginModule">
+        name="Spring Login Module"
+     <loginModule
+           class="org.argeo.eclipse.spring.SpringExtensionFactory"
+           description="Spring Login Module">
+     </loginModule>
+  </extension>
+
+</plugin>
diff --git a/security/plugins/org.argeo.security.equinox/pom.xml b/security/plugins/org.argeo.security.equinox/pom.xml
new file mode 100644 (file)
index 0000000..944a6e0
--- /dev/null
@@ -0,0 +1,79 @@
+<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.argeo.commons.security</groupId>
+               <version>0.2.3-SNAPSHOT</version>
+               <artifactId>plugins</artifactId>
+               <relativePath>..</relativePath>
+       </parent>
+       <artifactId>org.argeo.security.equinox</artifactId>
+       <name>Commons Security Equinox</name>
+       <packaging>jar</packaging>
+       <build>
+               <plugins>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-compiler-plugin</artifactId>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-source-plugin</artifactId>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-jar-plugin</artifactId>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.apache.felix</groupId>
+                               <artifactId>maven-bundle-plugin</artifactId>
+                               <version>${version.maven-bundle-plugin}</version>
+                               <configuration>
+<!--                                   <instructions>-->
+<!--                                           <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>-->
+<!--                                           <Bundle-Activator>org.argeo.security.equinox.EquinoxSecurity</Bundle-Activator>-->
+<!--                                           <Import-Package>-->
+<!--                                                   org.osgi.framework;version="0.0.0",-->
+<!--                                                   !org.eclipse.equinox.security.auth,-->
+<!--                                                   org.springframework.core,-->
+<!--                                                   org.argeo.eclipse.spring,-->
+<!--                                                   *-->
+<!--                                           </Import-Package>-->
+<!--                                           <Require-Bundle>org.eclipse.equinox.security</Require-Bundle>-->
+<!--                                   </instructions>-->
+                                       <instructions>
+                                               <Import-Package>*,
+                                                       org.springframework.core,
+                                                       org.argeo.eclipse.spring
+                                               </Import-Package>
+                                       </instructions>
+                               </configuration>
+                       </plugin>
+               </plugins>
+       </build>
+       <dependencies>
+
+               <!-- Eclipse -->
+               <dependency>
+                       <groupId>org.eclipse.osgi</groupId>
+                       <artifactId>org.eclipse.osgi</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.eclipse.equinox</groupId>
+                       <artifactId>org.eclipse.equinox.security</artifactId>
+               </dependency>
+
+               <!-- Commons -->
+               <dependency>
+                       <groupId>org.argeo.commons.basic</groupId>
+                       <artifactId>org.argeo.basic.nodeps</artifactId>
+                       <version>0.2.3-SNAPSHOT</version>
+               </dependency>
+
+               <!-- Spring -->
+               <dependency>
+                       <groupId>org.springframework.security</groupId>
+                       <artifactId>org.springframework.security.core</artifactId>
+               </dependency>
+       </dependencies>
+</project>
diff --git a/security/plugins/org.argeo.security.equinox/src/main/java/org/argeo/security/equinox/SpringLoginModule.java b/security/plugins/org.argeo.security.equinox/src/main/java/org/argeo/security/equinox/SpringLoginModule.java
new file mode 100644 (file)
index 0000000..2222fae
--- /dev/null
@@ -0,0 +1,126 @@
+package org.argeo.security.equinox;
+
+import java.util.Map;
+
+import javax.security.auth.Subject;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.auth.callback.TextOutputCallback;
+import javax.security.auth.login.LoginException;
+
+import org.springframework.security.Authentication;
+import org.springframework.security.AuthenticationManager;
+import org.springframework.security.BadCredentialsException;
+import org.springframework.security.context.SecurityContextHolder;
+import org.springframework.security.providers.UsernamePasswordAuthenticationToken;
+import org.springframework.security.providers.jaas.SecurityContextLoginModule;
+
+/** Login module which caches one subject per thread. */
+public class SpringLoginModule extends SecurityContextLoginModule {
+       private AuthenticationManager authenticationManager;
+
+       private CallbackHandler callbackHandler;
+
+       public SpringLoginModule() {
+
+       }
+
+       @SuppressWarnings("rawtypes")
+       public void initialize(Subject subject, CallbackHandler callbackHandler,
+                       Map sharedState, Map options) {
+               super.initialize(subject, callbackHandler, sharedState, options);
+               // this.subject.set(subject);
+               this.callbackHandler = callbackHandler;
+       }
+
+       public boolean login() throws LoginException {
+               // thread already logged in
+               if (SecurityContextHolder.getContext().getAuthentication() != null)
+                       return super.login();
+
+               // if (getSubject().getPrincipals(Authentication.class).size() == 1) {
+               // registerAuthentication(getSubject()
+               // .getPrincipals(Authentication.class).iterator().next());
+               // return super.login();
+               // } else if (getSubject().getPrincipals(Authentication.class).size() >
+               // 1) {
+               // throw new LoginException(
+               // "Multiple Authentication principals not supported: "
+               // + getSubject().getPrincipals(Authentication.class));
+               // } else {
+               // ask for username and password
+               Callback label = new TextOutputCallback(TextOutputCallback.INFORMATION,
+                               "Required login");
+               NameCallback nameCallback = new NameCallback("User");
+               PasswordCallback passwordCallback = new PasswordCallback("Password",
+                               false);
+
+               if (callbackHandler == null) {
+                       throw new LoginException("No call back handler available");
+                       // return false;
+               }
+               try {
+                       callbackHandler.handle(new Callback[] { label, nameCallback,
+                                       passwordCallback });
+               } catch (Exception e) {
+                       LoginException le = new LoginException("Callback handling failed");
+                       le.initCause(e);
+                       throw le;
+               }
+
+               // Set user name and password
+               String username = nameCallback.getName();
+               String password = "";
+               if (passwordCallback.getPassword() != null) {
+                       password = String.valueOf(passwordCallback.getPassword());
+               }
+               UsernamePasswordAuthenticationToken credentials = new UsernamePasswordAuthenticationToken(
+                               username, password);
+
+               try {
+                       Authentication authentication = authenticationManager
+                                       .authenticate(credentials);
+                       registerAuthentication(authentication);
+                       boolean res = super.login();
+                       // if (log.isDebugEnabled())
+                       // log.debug("User " + username + " logged in");
+                       return res;
+               } catch (BadCredentialsException bce) {
+                       throw bce;
+               } catch (Exception e) {
+                       LoginException loginException = new LoginException(
+                                       "Bad credentials");
+                       loginException.initCause(e);
+                       throw loginException;
+               }
+               // }
+       }
+
+       @Override
+       public boolean logout() throws LoginException {
+               return super.logout();
+       }
+
+       /**
+        * Register an {@link Authentication} in the security context.
+        * 
+        * @param authentication
+        *            has to implement {@link Authentication}.
+        */
+       protected void registerAuthentication(Object authentication) {
+               SecurityContextHolder.getContext().setAuthentication(
+                               (Authentication) authentication);
+       }
+
+       public void setAuthenticationManager(
+                       AuthenticationManager authenticationManager) {
+               this.authenticationManager = authenticationManager;
+       }
+
+       // protected Subject getSubject() {
+       // return subject.get();
+       // }
+
+}
diff --git a/security/plugins/org.argeo.security.ui.application/.classpath b/security/plugins/org.argeo.security.ui.application/.classpath
new file mode 100644 (file)
index 0000000..92f19d2
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry kind="src" path="src/main/java"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/security/plugins/org.argeo.security.ui.application/.project b/security/plugins/org.argeo.security.ui.application/.project
new file mode 100644 (file)
index 0000000..e83b5d5
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.security.ui.application</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
diff --git a/security/plugins/org.argeo.security.ui.application/.settings/org.eclipse.jdt.core.prefs b/security/plugins/org.argeo.security.ui.application/.settings/org.eclipse.jdt.core.prefs
new file mode 100644 (file)
index 0000000..1f382cb
--- /dev/null
@@ -0,0 +1,8 @@
+#Sat Jan 15 17:51:30 CET 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/security/plugins/org.argeo.security.ui.application/META-INF/jaas_default.txt b/security/plugins/org.argeo.security.ui.application/META-INF/jaas_default.txt
new file mode 100644 (file)
index 0000000..b6cbaa6
--- /dev/null
@@ -0,0 +1,14 @@
+UNIX {
+    org.eclipse.equinox.security.auth.module.ExtensionLoginModule sufficient
+        extensionId="org.argeo.security.equinox.unixLoginModule";
+};
+
+SPRING {
+    org.eclipse.equinox.security.auth.module.ExtensionLoginModule sufficient
+        extensionId="org.argeo.security.equinox.springLoginModule";
+};
+
+SPRING_SECURITY_CONTEXT {
+    org.eclipse.equinox.security.auth.module.ExtensionLoginModule sufficient
+        extensionId="org.argeo.security.equinox.springSecurityContextLoginModule";
+};
\ No newline at end of file
diff --git a/security/plugins/org.argeo.security.ui.application/argeo_security_rap.properties b/security/plugins/org.argeo.security.ui.application/argeo_security_rap.properties
new file mode 100644 (file)
index 0000000..3557749
--- /dev/null
@@ -0,0 +1,24 @@
+argeo.osgi.start=\
+com.springsource.javax.servlet,\
+org.eclipse.core.runtime,\
+org.eclipse.equinox.common,\
+org.eclipse.equinox.http.jetty,\
+org.eclipse.equinox.http.registry,\
+org.eclipse.equinox.launcher,\
+org.eclipse.rap.demo,\
+org.mortbay.jetty.server,\
+org.springframework.osgi.extender,\
+org.argeo.server.ads.server,\
+org.argeo.security.manager.ldap,\
+org.argeo.security.services,\
+org.argeo.security.equinox,\
+org.argeo.security.ui,\
+org.argeo.security.ui.rcp,\
+
+eclipse.ignoreApp=true
+osgi.noShutdown=true
+
+log4j.configuration=file:../../log4j.properties
+
+org.eclipse.equinox.http.jetty.log.stderr.threshold=debug
+org.osgi.service.http.port=9090
diff --git a/security/plugins/org.argeo.security.ui.application/build.properties b/security/plugins/org.argeo.security.ui.application/build.properties
new file mode 100644 (file)
index 0000000..ac478ab
--- /dev/null
@@ -0,0 +1,7 @@
+source.. = src/main/java/
+output.. = target/classes/
+bin.includes = plugin.xml,\
+               META-INF/,\
+               .,\
+               log4j.properties,\
+               jaas_config.txt
diff --git a/security/plugins/org.argeo.security.ui.application/icons/alt_about.gif b/security/plugins/org.argeo.security.ui.application/icons/alt_about.gif
new file mode 100644 (file)
index 0000000..20d9ad2
Binary files /dev/null and b/security/plugins/org.argeo.security.ui.application/icons/alt_about.gif differ
diff --git a/security/plugins/org.argeo.security.ui.application/icons/alt_launcher.icns b/security/plugins/org.argeo.security.ui.application/icons/alt_launcher.icns
new file mode 100644 (file)
index 0000000..b77a6a6
Binary files /dev/null and b/security/plugins/org.argeo.security.ui.application/icons/alt_launcher.icns differ
diff --git a/security/plugins/org.argeo.security.ui.application/icons/alt_launcher.ico b/security/plugins/org.argeo.security.ui.application/icons/alt_launcher.ico
new file mode 100644 (file)
index 0000000..d548f71
Binary files /dev/null and b/security/plugins/org.argeo.security.ui.application/icons/alt_launcher.ico differ
diff --git a/security/plugins/org.argeo.security.ui.application/icons/alt_launcher.xpm b/security/plugins/org.argeo.security.ui.application/icons/alt_launcher.xpm
new file mode 100644 (file)
index 0000000..b0c139e
--- /dev/null
@@ -0,0 +1,307 @@
+/* XPM */\r
+static char * icon48_xpm[] = {\r
+"48 48 256 2",\r
+"      c #4B4B3B3B9090",\r
+".     c #0D0D0E0E5454",\r
+"X     c #11110E0E5B5B",\r
+"o     c #17170F0F6363",\r
+"O     c #1D1D13136969",\r
+"+     c #212114146C6C",\r
+"@     c #252514147171",\r
+"#     c #282811116C6C",\r
+"$     c #26260D0D6363",\r
+"%     c #22220B0B5E5E",\r
+"&     c #1C1C0B0B5A5A",\r
+"*     c #1C1C0B0B5252",\r
+"=     c #1B1B05055353",\r
+"-     c #161606064D4D",\r
+";     c #161605054949",\r
+":     c #111104044848",\r
+">     c #131304044545",\r
+",     c #131305054242",\r
+"<     c #141410105E5E",\r
+"1     c #2C2C15157373",\r
+"2     c #2B2B1B1B7575",\r
+"3     c #343416167272",\r
+"4     c #313113136E6E",\r
+"5     c #222209095757",\r
+"6     c #1B1B06064D4D",\r
+"7     c #15150B0B4242",\r
+"8     c #13130C0C5555",\r
+"9     c #2E2E1B1B7878",\r
+"0     c #33331F1F7C7C",\r
+"q     c #343418187878",\r
+"w     c #3B3B1C1C7575",\r
+"e     c #2E2E10106767",\r
+"r     c #1B1B07074747",\r
+"t     c #18180B0B4646",\r
+"y     c #151513136262",\r
+"u     c #1A1A15156464",\r
+"i     c #34341F1F7777",\r
+"p     c #40401E1E8080",\r
+"a     c #42421B1B7A7A",\r
+"s     c #3B3B15157474",\r
+"d     c #2B2B0B0B5B5B",\r
+"f     c #222207075252",\r
+"g     c #373727277A7A",\r
+"h     c #474724248484",\r
+"j     c #393915156E6E",\r
+"k     c #373711116A6A",\r
+"l     c #343413136363",\r
+"z     c #232319196E6E",\r
+"x     c #292919197070",\r
+"c     c #3C3C2C2C8282",\r
+"v     c #444431318585",\r
+"b     c #494934348A8A",\r
+"n     c #505026268A8A",\r
+"m     c #3D3D1B1B6E6E",\r
+"M     c #31310E0E5C5C",\r
+"N     c #2B2B0D0D5353",\r
+"B     c #222207074A4A",\r
+"V     c #52523C3C9292",\r
+"C     c #58583C3C9494",\r
+"Z     c #5D5D44449797",\r
+"A     c #5C5C2E2E9292",\r
+"S     c #676733339595",\r
+"D     c #424228287575",\r
+"F     c #29290A0A4F4F",\r
+"G     c #6C6C4A4A9E9E",\r
+"H     c #72725454A7A7",\r
+"J     c #8C8C6D6DB2B2",\r
+"K     c #343424246E6E",\r
+"L     c #3A3A23236A6A",\r
+"P     c #3A3A1C1C6767",\r
+"I     c #24240A0A4B4B",\r
+"U     c #151518186161",\r
+"Y     c #76766F6FA5A5",\r
+"T     c #ADAD9191CCCC",\r
+"R     c #98988989D3D3",\r
+"E     c #45453B3B8686",\r
+"W     c #3C3C35357979",\r
+"Q     c #363631317575",\r
+"!     c #32322D2D6B6B",\r
+"~     c #323229296363",\r
+"^     c #30301F1F6262",\r
+"/     c #323218185E5E",\r
+"(     c #272707074B4B",\r
+")     c #202028286C6C",\r
+"_     c #1E1E1D1D6868",\r
+"`     c #9A9A8282BBBB",\r
+"'     c #C8C8B3B3D3D3",\r
+"]     c #B3B3AFAFE7E7",\r
+"[     c #84847272C6C6",\r
+"{     c #58585757A3A3",\r
+"}     c #3F3F3C3C8A8A",\r
+"|     c #3B3B3A3A8484",\r
+" .    c #414139397D7D",\r
+"..    c #3D3D39397A7A",\r
+"X.    c #37372E2E6E6E",\r
+"o.    c #2C2C21215A5A",\r
+"O.    c #2E2E1B1B5B5B",\r
+"+.    c #F5F5EFEFF5F5",\r
+"@.    c #656566669A9A",\r
+"#.    c #47474B4B8E8E",\r
+"$.    c #3C3C44447B7B",\r
+"%.    c #444442428080",\r
+"&.    c #45453E3E8181",\r
+"*.    c #40403C3C8181",\r
+"=.    c #3D3D33337474",\r
+"-.    c #3B3B30306E6E",\r
+";.    c #38382D2D6969",\r
+":.    c #303026265D5D",\r
+">.    c #2C2C15155A5A",\r
+",.    c #1F1F1C1C7070",\r
+"<.    c #25251E1E7171",\r
+"1.    c #59595C5C9191",\r
+"2.    c #4D4D53538989",\r
+"3.    c #4C4C49498484",\r
+"4.    c #484845458585",\r
+"5.    c #494941418585",\r
+"6.    c #494940408181",\r
+"7.    c #2F2F1C1C5353",\r
+"8.    c #2B2B28287676",\r
+"9.    c #323231317F7F",\r
+"0.    c #545452528B8B",\r
+"q.    c #51514E4E8989",\r
+"w.    c #4E4E4B4B8C8C",\r
+"e.    c #4C4C47478686",\r
+"r.    c #46463D3D7E7E",\r
+"t.    c #434336367A7A",\r
+"y.    c #2B2B13135555",\r
+"u.    c #47473D3D8D8D",\r
+"i.    c #575757578E8E",\r
+"p.    c #48483E3E7F7F",\r
+"a.    c #46463A3A7D7D",\r
+"s.    c #424235357575",\r
+"d.    c #404034347171",\r
+"f.    c #BFBFCBCBFAFA",\r
+"g.    c #B8B8A8A8DDDD",\r
+"h.    c #5E5E60609292",\r
+"j.    c #565655558C8C",\r
+"k.    c #4B4B44448282",\r
+"l.    c #454539397B7B",\r
+"z.    c #434338387878",\r
+"x.    c #3F3F32326D6D",\r
+"c.    c #3D3D30306969",\r
+"v.    c #3A3A2E2E6363",\r
+"b.    c #36362A2A5C5C",\r
+"n.    c #343424245555",\r
+"m.    c #30301E1E4D4D",\r
+"M.    c #49493C3C8282",\r
+"N.    c #5E5E4F4F8C8C",\r
+"B.    c #56563B3B8B8B",\r
+"V.    c #545407078585",\r
+"C.    c #424234347272",\r
+"Z.    c #9797A4A4F7F7",\r
+"A.    c #444436367676",\r
+"S.    c #7D7D7979D5D5",\r
+"D.    c #464640408A8A",\r
+"F.    c #44444B4B8282",\r
+"G.    c #414107077777",\r
+"H.    c #71716161C1C1",\r
+"J.    c #303039397979",\r
+"K.    c #8E8E8E8EE6E6",\r
+"L.    c #404033338B8B",\r
+"P.    c #4A4A45458C8C",\r
+"I.    c #46463A3A8080",\r
+"U.    c #363629295454",\r
+"Y.    c #303022224848",\r
+"T.    c #424237377575",\r
+"R.    c #2E2E1D1D6363",\r
+"E.    c #79798383EAEA",\r
+"W.    c #74747B7BE4E4",\r
+"Q.    c #6D6D7676D6D6",\r
+"!.    c #6A6A7171CECE",\r
+"~.    c #66666969C6C6",\r
+"^.    c #62626565BCBC",\r
+"/.    c #5F5F6060B5B5",\r
+"(.    c #5B5B5B5BACAC",\r
+").    c #535353539898",\r
+"_.    c #4F4F4F4FA4A4",\r
+"`.    c #54544D4DA4A4",\r
+"'.    c #323204046B6B",\r
+"].    c #303035357979",\r
+"[.    c #313122224343",\r
+"{.    c #5A5A5B5BB7B7",\r
+"}.    c #484846468080",\r
+"|.    c #454541417575",\r
+" X    c #4B4B31318282",\r
+".X    c #47473C3C8484",\r
+"XX    c #3E3E35356E6E",\r
+"oX    c #2F2F26264040",\r
+"OX    c #2B2B23233A3A",\r
+"+X    c #262619195C5C",\r
+"@X    c #252515155A5A",\r
+"#X    c #55555151B3B3",\r
+"$X    c #3C3C2D2D5D5D",\r
+"%X    c #39392F2F5656",\r
+"&X    c #37372D2D5050",\r
+"*X    c #25251F1F3030",\r
+"=X    c #24241D1D4343",\r
+"-X    c #202013135656",\r
+";X    c #41413B3B6C6C",\r
+":X    c #444442429696",\r
+">X    c #212100005E5E",\r
+",X    c #444436367272",\r
+"<X    c #444436366F6F",\r
+"1X    c #424236366868",\r
+"2X    c #3F3F34346161",\r
+"3X    c #3C3C32325A5A",\r
+"4X    c #34342A2A4A4A",\r
+"5X    c #21211B1B2121",\r
+"6X    c #22221C1C6363",\r
+"7X    c #2D2D01015E5E",\r
+"8X    c #20201B1B2525",\r
+"9X    c #49492F2F7B7B",\r
+"0X    c #434334346C6C",\r
+"qX    c #323229294545",\r
+"wX    c #1C1C10104F4F",\r
+"eX    c #222217176363",\r
+"rX    c #37371E1E6B6B",\r
+"tX    c #424232326E6E",\r
+"yX    c #444433336969",\r
+"uX    c #424233336565",\r
+"iX    c #1E1E1A1A1E1E",\r
+"pX    c #161601014C4C",\r
+"aX    c #1C1C11115454",\r
+"sX    c #252503035B5B",\r
+"dX    c #414131316A6A",\r
+"fX    c #22221F1F7878",\r
+"gX    c #272724246767",\r
+"hX    c #1D1D16165E5E",\r
+"jX    c #131305055151",\r
+"kX    c #40402F2F6464",\r
+"lX    c #111107074E4E",\r
+"zX    c #0C0C05054B4B",\r
+"xX    c #22221E1E5757",\r
+"cX    c #1A1A0D0D4D4D",\r
+"vX    c #16160B0B4D4D",\r
+"bX    c #060604044747",\r
+"nX    c #040403034343",\r
+"mX    c #3B3B27276565",\r
+"MX    c #0E0E03034141",\r
+"NX    c #111106064A4A",\r
+"BX    c #0E0E04044646",\r
+"VX    c #111105053B3B",\r
+"CX    c #0D0D01013A3A",\r
+"ZX    c #030305053F3F",\r
+"AX    c #0F0F0F0F4C4C",\r
+"SX    c #020207073B3B",\r
+"DX    c #0D0D03034646",\r
+"FX    c #0B0B02023F3F",\r
+"GX    c #0D0D02023434",\r
+"HX    c #0A0A0E0E4444",\r
+"JX    c #161614145252",\r
+"KX    c #0B0B04044646",\r
+"LX    c #0A0A03034444",\r
+"PX    c #1D1D21215757",\r
+"IX    c #090910104040",\r
+"UX    c #18181E1E5353",\r
+"                                                                                                ",\r
+"  . . . . X X o o o o O + + @ @ @ @ @ @ @ # # # # # # $ $ % % & & & & * = - - - ; : > > , , ,   ",\r
+"  . . X X < < o o O O + @ 1 2 2 1 1 1 1 1 1 1 1 3 4 # # $ $ $ % % % 5 = = 6 6 - ; ; > > , , 7   ",\r
+"  . 8 < < < o O O + @ @ 2 9 9 0 0 q q q q q q q w 3 4 4 e e $ $ $ $ % 5 = = 6 6 6 ; ; > > r t   ",\r
+"  . X < y u O O + @ 1 2 i 0 0 p p p p p p p a a p a s 3 4 4 e e e e d 5 5 f f 6 6 6 ; ; r r t   ",\r
+"  X < y u O + + @ 2 9 0 g p p h h h h h h h p h h a a s s j k k j l d d 5 5 f f 6 6 r r r r r   ",\r
+"  X < y O z x x 9 0 g c v b n n n n n n n n n n n h a a s s j j m l M d d N f f B B B B r r r   ",\r
+"  < y u + z 2 0 c c b V C Z C C A A A A A S S S n h D w w m m m m k l M d d N f F F F B r r r   ",\r
+"  < y O z z 9 c b V Z G H H H G S G G J J H V v c g g K K K K L P l l l M M N N N N I B B r r   ",\r
+"  U u + z x i v C H Y J J J J H J T R H V E W W Q Q Q Q ! ! ! ~ ^ ^ / / M M M M M N ( B B r r   ",\r
+"  ) _ z x 9 g b Z Y ` ' ' ' T T ] [ { } |  .........W W Q Q X.! ~ ~ o.O./ / / / N F ( B B B r   ",\r
+"  ) ) z x i c V G J ' +.+.+.+.] [ @.#.$.%.%.%.&.*. . .....W =.-.X.;.~ :.o.O.^ >.N F ( B B B B   ",\r
+"  ) ,.<.2 g v C H J ' +.+.+.+.T Y 1.2.3.4.4.4.5.6.&.&. . ...W =.=.-.;.~ :.o.7.>.N F F ( B I I   ",\r
+"  ) ,.<.8.9.b C H J T +.+.+.' J @.1.0.q.q.w.e.4.5.6.&.r. . .t.W =.=.-.;.~ :.o.7.y.N F ( ( I I   ",\r
+"  8.8.8.9.| u.C G J T +.+.' ` Y @.1.i.0.q.q.e.e.5.6.p.r.a. .t.t.s.d.d.-.;.~ :.7.7.y.F F ( I I   ",\r
+"  9.c c c v b A S H ' f.g.` Y @.h.1.i.j.0.q.q.e.k.6.p.r.a.l.t.z.s.s.d.x.c.v.b.n.m.7.N F F F I   ",\r
+"  <.g M.N.B.B.n V.J f.R J @.h.h.1.i.i.j.j.0.q.3.k.6.p.r.a.l.l.z.s.C.d.x.x.c.v.b.n.m.y.N F F F   ",\r
+"  + x i v B.Z Z G g.Z.[ @.2.i.i.j.j.j.j.j.0.q.3.k.6.p.p.a.l.l.A.s.C.C.d.x.c.v.b.n.m.7.y.N N y.  ",\r
+"  O # 3 w p n Z ` f.S.H D.F.q.0.0.0.0.j.0.q.q.3.k.6.p.r.a.a.l.A.s.s.C.d.x.x.c.v.b.n.m.y.y.y.y.  ",\r
+"  O # 4 s a G.V.T Z.H.V J.%.e.w.q.0.0.0.0.q.q.e.k.6.p.r.a.a.l.z.A.s.C.d.d.x.c.v.b.n.m.7.>.y.y.  ",\r
+"  O # 4 s w G.A f.K.H L...4.P.w.w.w.q.q.q.q.e.e.5.6.M.I.I.a.a.l.z.A.s.d.d.x.c.v.v.U.Y.7.O.>.y.  ",\r
+"  $ # 4 3 s G.G f.S.Z 9.*.D.P.P.w.w.w.w.w.e.e.5.5.M.M.I.I.a.a.l.z.T.s.d.d.x.x.c.v.U.Y.m.R.>.>.  ",\r
+"  E.E.W.W.W.W.E.Z.E.W.Q.Q.Q.Q.Q.Q.Q.Q.Q.Q.!.!.!.!.!.~.~.~.~.~.~.^.^.^.^.^./././.(.{ { )._.`._.  ",\r
+"  + # 3 w s '.` f.H.V ].*.D.P.P.P.P.P.P.P.5.5.5.M.M.M.I.I.a.l.z.z.T.T.s.d.d.x.c.v.U.Y.[.^ O.>.  ",\r
+"  ~.~.~.~.~.~.K.Z.S.~.{.^.^.^.^.^.^.^.^././././././.(.(.(.(.(.(.{ { { { { ).).).w.w.}.|.P.u.}   ",\r
+"   .I.6. X X XT f.H.b ].*.E D.D.D.D.5.5..X.XM.M.I.I.a.a.l.l.z.z.T.T.T.d.XXx.c.v.b.U.oXOXR.+X@X  ",\r
+"  E.E.E.W.W.W.K.Z.E.W.Q.Q.Q.Q.Q.Q.Q.Q.!.!.!.!.!.!.~.~.~.~.~.~.^.^.^.^.^./././.(.{ { ).).#X_._.  ",\r
+"  & % $ e '.= H f.H.b 8.W *.E E E .X.X.XI.I.I.I.a.a.l.l.z.z.T.T.T.C.XXXXc.v.$X%X&XY.*X=X2 @X-X  ",\r
+"  {.{.{.{.{.#X~.Z.W.~.{.{./././././././././.(.(.(.(.(.(.(.{ { { { { { ).).).w.w.3.}.;X%.:X} }   ",\r
+"  & & % $ e >XV.f.S.C K X.W t. . .l.l.t.t.t.t.A.A.A.,X,X,X,X,X<X;X1X1X2X3X%X&X4XoX*X5Xo.6X-X-X  ",\r
+"  & & % $ $ >X7X` Z.Z D ! =.=.s.t.t.t.A.A.s.A.,X,X,X,X<X<X<X<X;X1X2X2X3X%X&X4XoXOX8X5X<.@X-X-X  ",\r
+"  8 & & $ e K 9XJ f.^. XK X.=.=.s.s.s.s.s.C.C.C.C.<X0X0X0X1X1X1X2X2X3X%X&X4XqXOX*X8X=X<.-X-XwX  ",\r
+"  8 & eXK k.@.M. Xg.E.B.rX~ -.d.d.C.C.C.C.C.tX0X0X0XyXyX1X1XuX2X2X3X%X&X4XqXoXOX8XiX6XeX-X-XwX  ",\r
+"  6XQ h.Y N.K e pXB.f./.9Xo.;.-.x.d.tXtXtXtXtX0X0XyXyXyXuXuX2X2X3X%X&X4XqXoXOX*XiX=X_ aX-XaXwX  ",\r
+"  Y Y  .R.@X% sX= 7XT Z.V P :.;.c.x.x.x.tXdXdXdXyXyXuXuX2X2X3X3X%X&X4XqXoXOX*X8X*XfXaXaXaXwXwX  ",\r
+"  gXhX& * & 5 5 sXjXa ] S.9X/ ~ v.c.dXdXdXdXdXuXuXuXkX2X2X3X%X%X&X4XqXoXOX*X8XiX<.hXwXwXaXwXwX  ",\r
+"  8 lXlXjX= * 5 5 = zX9X] H.D 7.b.v.v.kXc.kXkXkXkXkX2X$X3X%X&X&X4XqXoXOX*X8XiXxXhXwXcXcXwXwXwX  ",\r
+"  zXzXlXlXjX= = f f sXD Y ] ~.D 7.n.b.v.v.kXkXkXkX$X$X%X%X&X4XqXoXoXOX*X8X5XgXu cXvXvXcXcXwXwX  ",\r
+"  bXbXzXlXlX- = * @XX.h.e D T S.D n.m.b.$X$X$X$X$X%X%X&X&X4XqXoXOX*X8X8X*X<.hXvX; ; vXvXvXcXwX  ",\r
+"  nXbXzXzXlXlX- -XX.Y R.pXpXP J K.Z mXm.n.U.U.U.U.U.4X4XY.oXOX*X8X8X8X=X,.aXvX; > > > t t t cX  ",\r
+"  nXbXbXzXzXlXaXXXY +Xf = f = 7XtXR R   mXn.Y.[.[.[.[.OX*X*X8X5X*X=X,.u vXvX; > > MXMX, 7 t t   ",\r
+"  nXnXnXbXzXvX-.Y +XcX6 6 = = = d L B.G H `.X.:.7.m.=X=X=X=X=X6X,.u cXvXNX: BX> MXVXCXVX7 7 7   ",\r
+"  ZXZXnXbXAXgX@.+XvX; - - - - * @XR.>.sX>.R.i 0 x eXeXeXeXO hXaXcXvXNX: BXMXMXMXVXCXCXCXVX7 7   ",\r
+"  SXZXZXAXgXN.aXNX: : NXNXNX- * +X+X* 6 6 6 * * * * * * * vXvX- NX: DXBXMXMXFXCXCXCXCXGXVXVX7   ",\r
+"  SXSXHXgX0.JXKXLXKXKXDX: : NX* @X-X- - - - - - - - - - - NX: DXDXDXMXMXFXFXCXCXCXCXGXGXGXVXVX  ",\r
+"  SXHXPX3.JXnXnXnXnXbXLXKXKXNXaX-XvX: : NX: : : : : : : BXDXDXLXMXMXFXFXCXCXCXCXGXGXGXGXGXGXGX  ",\r
+"  IXUX$.AXZXZXZXZXnXnXnXLXLXNXJXvXBXDXBXBXBXBXDXDXDXDXLXDXLXLXFXFXFXFXCXCXCXCXGXGXGXGXGXGXGXGX  ",\r
+"                                                                                                "};\r
diff --git a/security/plugins/org.argeo.security.ui.application/icons/alt_window_16.gif b/security/plugins/org.argeo.security.ui.application/icons/alt_window_16.gif
new file mode 100644 (file)
index 0000000..05626b1
Binary files /dev/null and b/security/plugins/org.argeo.security.ui.application/icons/alt_window_16.gif differ
diff --git a/security/plugins/org.argeo.security.ui.application/icons/alt_window_32.gif b/security/plugins/org.argeo.security.ui.application/icons/alt_window_32.gif
new file mode 100644 (file)
index 0000000..b432f88
Binary files /dev/null and b/security/plugins/org.argeo.security.ui.application/icons/alt_window_32.gif differ
diff --git a/security/plugins/org.argeo.security.ui.application/log4j.properties b/security/plugins/org.argeo.security.ui.application/log4j.properties
new file mode 100644 (file)
index 0000000..8a89a4a
--- /dev/null
@@ -0,0 +1,24 @@
+log4j.rootLogger=WARN, console
+
+## Levels
+log4j.logger.org.argeo=DEBUG
+log4j.logger.org.springframework.security=DEBUG
+
+log4j.logger.org.apache.catalina=INFO
+log4j.logger.org.apache.coyote=INFO
+log4j.logger.org.apache.tomcat=INFO
+
+log4j.logger.org.apache.directory.server=INFO
+log4j.logger.org.apache.directory.server.core.partition=ERROR
+log4j.logger.org.apache.directory.server.core.schema.bootstrap.BootstrapAttributeTypeRegistry=ERROR
+
+log4j.logger.org.apache.jackrabbit=WARN
+log4j.logger.org.apache.jackrabbit.core.query.lucene=ERROR
+
+## Appenders
+# console is set to be a ConsoleAppender.
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+
+# console uses PatternLayout.
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c - [%t]%n
diff --git a/security/plugins/org.argeo.security.ui.application/org.argeo.security.ui.application.product b/security/plugins/org.argeo.security.ui.application/org.argeo.security.ui.application.product
new file mode 100644 (file)
index 0000000..be468c8
--- /dev/null
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?pde version="3.5"?>
+
+<product name="SecureRCP" application="org.argeo.security.ui.application.secureUi" useFeatures="false" includeLaunchers="true">
+
+   <configIni use="default">
+   </configIni>
+
+   <launcherArgs>
+      <programArgs>-console -clean</programArgs>
+      <vmArgs>-Dlog4j.configuration=file:${system_property:user.home}/dev/src/commons/security/eclipse/plugins/org.argeo.security.ui.application/log4j.properties</vmArgs>
+      <vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts</vmArgsMac>
+   </launcherArgs>
+
+   <launcher>
+      <solaris/>
+      <win useIco="false">
+         <bmp/>
+      </win>
+   </launcher>
+
+   <vm>
+   </vm>
+
+   <plugins>
+      <plugin id="com.ibm.icu"/>
+      <plugin id="com.springsource.antlr"/>
+      <plugin id="com.springsource.edu.emory.mathcs.backport"/>
+      <plugin id="com.springsource.javax.servlet"/>
+      <plugin id="com.springsource.javax.xml.stream"/>
+      <plugin id="com.springsource.jdbm"/>
+      <plugin id="com.springsource.junit"/>
+      <plugin id="com.springsource.org.aopalliance"/>
+      <plugin id="com.springsource.org.apache.commons.codec"/>
+      <plugin id="com.springsource.org.apache.commons.collections"/>
+      <plugin id="com.springsource.org.apache.commons.io"/>
+      <plugin id="com.springsource.org.apache.commons.lang"/>
+      <plugin id="com.springsource.org.apache.commons.pool"/>
+      <plugin id="com.springsource.org.apache.directory.server.changepw"/>
+      <plugin id="com.springsource.org.apache.directory.server.core" fragment="true"/>
+      <plugin id="com.springsource.org.apache.directory.server.core.shared"/>
+      <plugin id="com.springsource.org.apache.directory.server.jndi"/>
+      <plugin id="com.springsource.org.apache.directory.server.kerberos"/>
+      <plugin id="com.springsource.org.apache.directory.server.kerberos.shared"/>
+      <plugin id="com.springsource.org.apache.directory.server.ldap"/>
+      <plugin id="com.springsource.org.apache.directory.server.ntp"/>
+      <plugin id="com.springsource.org.apache.directory.server.protocol.shared"/>
+      <plugin id="com.springsource.org.apache.directory.shared.asn1"/>
+      <plugin id="com.springsource.org.apache.directory.shared.ldap"/>
+      <plugin id="com.springsource.org.apache.log4j"/>
+      <plugin id="com.springsource.org.apache.mina"/>
+      <plugin id="com.springsource.org.apache.ws.commons.schema"/>
+      <plugin id="com.springsource.org.codehaus.jackson"/>
+      <plugin id="com.springsource.org.codehaus.jackson.mapper"/>
+      <plugin id="com.springsource.slf4j.api"/>
+      <plugin id="com.springsource.slf4j.log4j" fragment="true"/>
+      <plugin id="com.springsource.slf4j.org.apache.commons.logging"/>
+      <plugin id="org.argeo.basic.nodeps"/>
+      <plugin id="org.argeo.dep.osgi.directory.shared.asn.codec" fragment="true"/>
+      <plugin id="org.argeo.dep.osgi.mina.filter.ssl" fragment="true"/>
+      <plugin id="org.argeo.dep.osgi.springframework.ldap"/>
+      <plugin id="org.argeo.eclipse.ui"/>
+      <plugin id="org.argeo.security.core"/>
+      <plugin id="org.argeo.security.equinox"/>
+      <plugin id="org.argeo.security.ldap"/>
+      <plugin id="org.argeo.security.manager.ldap"/>
+      <plugin id="org.argeo.security.services"/>
+      <plugin id="org.argeo.security.ui"/>
+      <plugin id="org.argeo.security.ui.application"/>
+      <plugin id="org.argeo.server.ads"/>
+      <plugin id="org.argeo.server.ads.server"/>
+      <plugin id="org.argeo.server.core"/>
+      <plugin id="org.argeo.server.json"/>
+      <plugin id="org.argeo.slc.demo.log4j" fragment="true"/>
+      <plugin id="org.eclipse.core.commands"/>
+      <plugin id="org.eclipse.core.contenttype"/>
+      <plugin id="org.eclipse.core.databinding"/>
+      <plugin id="org.eclipse.core.databinding.observable"/>
+      <plugin id="org.eclipse.core.databinding.property"/>
+      <plugin id="org.eclipse.core.expressions"/>
+      <plugin id="org.eclipse.core.jobs"/>
+      <plugin id="org.eclipse.core.runtime"/>
+      <plugin id="org.eclipse.equinox.app"/>
+      <plugin id="org.eclipse.equinox.common"/>
+      <plugin id="org.eclipse.equinox.preferences"/>
+      <plugin id="org.eclipse.equinox.registry"/>
+      <plugin id="org.eclipse.equinox.security"/>
+      <plugin id="org.eclipse.help"/>
+      <plugin id="org.eclipse.jface"/>
+      <plugin id="org.eclipse.jface.databinding"/>
+      <plugin id="org.eclipse.osgi"/>
+      <plugin id="org.eclipse.swt"/>
+      <plugin id="org.eclipse.swt.gtk.linux.x86_64" fragment="true"/>
+      <plugin id="org.eclipse.swt.win32.win32.x86" fragment="true"/>
+      <plugin id="org.eclipse.ui"/>
+      <plugin id="org.eclipse.ui.forms"/>
+      <plugin id="org.eclipse.ui.workbench"/>
+      <plugin id="org.springframework.aop"/>
+      <plugin id="org.springframework.beans"/>
+      <plugin id="org.springframework.context"/>
+      <plugin id="org.springframework.core"/>
+      <plugin id="org.springframework.osgi.core"/>
+      <plugin id="org.springframework.osgi.extender"/>
+      <plugin id="org.springframework.osgi.io"/>
+      <plugin id="org.springframework.oxm"/>
+      <plugin id="org.springframework.security.core"/>
+      <plugin id="org.springframework.transaction"/>
+      <plugin id="org.springframework.web.servlet"/>
+      <plugin id="org.springframework.xml"/>
+   </plugins>
+
+   <configurations>
+      <plugin id="org.argeo.security.manager.ldap" autoStart="true" startLevel="0" />
+      <plugin id="org.argeo.security.services" autoStart="true" startLevel="0" />
+      <plugin id="org.argeo.server.ads.server" autoStart="true" startLevel="0" />
+      <plugin id="org.springframework.osgi.extender" autoStart="true" startLevel="0" />
+   </configurations>
+
+</product>
diff --git a/security/plugins/org.argeo.security.ui.application/plugin.xml b/security/plugins/org.argeo.security.ui.application/plugin.xml
new file mode 100644 (file)
index 0000000..6541416
--- /dev/null
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+       <!-- We use the product to define some of the product preferences 
+       see http://dev.eclipse.org/viewcvs/viewvc.cgi/platform-ui-home/rcp/faq.html?revision=1.6#customPrefs --> 
+       <extension
+         id="org.argeo.security.ui.product"
+         point="org.eclipse.core.runtime.products">
+      <product
+            name="ArgeoProduct" application="org.argeo.security.ui.application.secureUi">
+          <property
+               name="appName"
+               value="Secure UI">
+         </property>
+            <property
+               name="preferenceCustomization"
+               value="plugin_customization.ini"/>
+      </product>
+   </extension>
+
+       <extension
+         id="org.argeo.security.webui.product"
+         point="org.eclipse.core.runtime.products">
+      <product
+            name="ArgeoProduct" application="org.argeo.security.ui.application.secureWebUi">
+          <property
+               name="appName"
+               value="Secure Web UI">
+         </property>
+            <property
+               name="preferenceCustomization"
+               value="plugin_customization.ini"/>
+      </product>
+   </extension>
+  
+
+   <extension
+         id="secureUi"
+         name="Argeo Secure UI"
+         point="org.eclipse.core.runtime.applications">
+      <application cardinality="singleton-global"
+         thread="main"
+         visible="true">
+         <run
+               class="org.argeo.security.ui.application.SecureRcp">
+         </run>
+      </application>
+   </extension>
+   <extension
+         id="secureWebUi"
+         name="Argeo Secure Web UI"
+         point="org.eclipse.core.runtime.applications">
+      <application cardinality="singleton-global"
+         thread="main"
+         visible="true">
+         <run
+               class="org.argeo.security.ui.application.SecureRap">
+         </run>
+      </application>
+   </extension>
+
+</plugin>
diff --git a/security/plugins/org.argeo.security.ui.application/plugin_customization.ini b/security/plugins/org.argeo.security.ui.application/plugin_customization.ini
new file mode 100644 (file)
index 0000000..baf9cef
--- /dev/null
@@ -0,0 +1,5 @@
+org.eclipse.ui/DOCK_PERSPECTIVE_BAR=topRight
+org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=true
+org.eclipse.ui/PERSPECTIVE_BAR_SIZE=100
+org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=true
+org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = false
diff --git a/security/plugins/org.argeo.security.ui.application/pom.xml b/security/plugins/org.argeo.security.ui.application/pom.xml
new file mode 100644 (file)
index 0000000..e664848
--- /dev/null
@@ -0,0 +1,120 @@
+<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.argeo.commons.security</groupId>
+               <version>0.2.3-SNAPSHOT</version>
+               <artifactId>plugins</artifactId>
+               <relativePath>..</relativePath>
+       </parent>
+       <artifactId>org.argeo.security.ui.application</artifactId>
+       <name>Commons Security UI Application</name>
+       <packaging>jar</packaging>
+       <build>
+               <plugins>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-compiler-plugin</artifactId>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-source-plugin</artifactId>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-jar-plugin</artifactId>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.apache.felix</groupId>
+                               <artifactId>maven-bundle-plugin</artifactId>
+                               <version>${version.maven-bundle-plugin}</version>
+                               <configuration>
+                                       <instructions>
+                                               <Bundle-Activator>org.argeo.security.ui.application.SecureApplicationActivator</Bundle-Activator>
+                                               <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
+                                               <Require-Bundle>org.eclipse.ui;resolution:=optional,org.eclipse.rap.ui;resolution:=optional,org.eclipse.core.runtime</Require-Bundle>
+                                               <Import-Package>*</Import-Package>
+                                       </instructions>
+                               </configuration>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.argeo.maven.plugins</groupId>
+                               <artifactId>maven-argeo-osgi-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <id>resolve-pde-sources</id>
+                                               <goals>
+                                                       <goal>pde-sources</goal>
+                                               </goals>
+                                               <phase>generate-resources</phase>
+                                       </execution>
+                                       <execution>
+                                               <id>generate-descriptors</id>
+                                               <goals>
+                                                       <goal>descriptors</goal>
+                                               </goals>
+                                               <phase>generate-resources</phase>
+                                       </execution>
+                                       <execution>
+                                               <id>check-osgi</id>
+                                               <phase>test</phase>
+                                               <goals>
+                                                       <goal>equinox</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <onlyCheck>true</onlyCheck>
+                                                       <argsToAppend>
+                                                               <arg>-clean</arg>
+                                                       </argsToAppend>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+               </plugins>
+       </build>
+       <dependencies>
+               <!-- Argeo Security -->
+               <dependency>
+                       <groupId>org.argeo.commons.security</groupId>
+                       <artifactId>org.argeo.security.ui</artifactId>
+                       <version>0.2.3-SNAPSHOT</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.argeo.commons.security</groupId>
+                       <artifactId>org.argeo.security.equinox</artifactId>
+                       <version>0.2.3-SNAPSHOT</version>
+               </dependency>
+
+               <!-- Argeo Eclipse distribution (common dependencies for both RAP and RCP) -->
+               <dependency>
+                       <groupId>org.argeo.commons.eclipse</groupId>
+                       <artifactId>org.argeo.eclipse.dep.rcp</artifactId>
+                       <version>0.2.3-SNAPSHOT</version>
+                       <scope>provided</scope>
+               </dependency>
+
+               <!-- Commons -->
+               <dependency>
+                       <groupId>org.argeo.commons.basic</groupId>
+                       <artifactId>org.argeo.basic.nodeps</artifactId>
+                       <version>0.2.3-SNAPSHOT</version>
+               </dependency>
+
+
+               <!-- Others -->
+               <dependency>
+                       <groupId>org.slf4j</groupId>
+                       <artifactId>com.springsource.slf4j.org.apache.commons.logging</artifactId>
+               </dependency>
+
+               <!-- For testing and target platform generation -->
+               <!--  LDAP server and security services -->
+               <dependency>
+                       <groupId>org.argeo.commons.security</groupId>
+                       <artifactId>org.argeo.security.dep.ads</artifactId>
+                       <version>${version.argeo-commons}</version>
+                       <type>pom</type>
+                       <scope>test</scope>
+               </dependency>
+       </dependencies>
+</project>
diff --git a/security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/AbstractSecureApplication.java b/security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/AbstractSecureApplication.java
new file mode 100644 (file)
index 0000000..a0a2f92
--- /dev/null
@@ -0,0 +1,117 @@
+package org.argeo.security.ui.application;
+
+import java.security.PrivilegedAction;
+
+import javax.security.auth.Subject;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.equinox.app.IApplicationContext;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.application.WorkbenchAdvisor;
+
+public abstract class AbstractSecureApplication implements IApplication {
+       private static final Log log = LogFactory
+                       .getLog(AbstractSecureApplication.class);
+
+       protected abstract WorkbenchAdvisor createWorkbenchAdvisor();
+
+       @SuppressWarnings("unchecked")
+       public Object start(IApplicationContext context) throws Exception {
+
+               Integer returnCode = null;
+               Display display = PlatformUI.createDisplay();
+
+               // Force login
+
+               try {
+                       String username = null;
+                       Exception loginException = null;
+                       Subject subject = null;
+                       try {
+                               SecureApplicationActivator.getLoginContext().login();
+                               subject = SecureApplicationActivator.getLoginContext()
+                                               .getSubject();
+
+                               // username = CurrentUser.getUsername();
+                       } catch (Exception e) {
+                               loginException = e;
+                               e.printStackTrace();
+                       }
+                       if (subject == null) {
+                               IStatus status = new Status(IStatus.ERROR,
+                                               "org.argeo.security.application", "Login is mandatory",
+                                               loginException);
+                               ErrorDialog.openError(null, "Error", "Shutdown...", status);
+                               return status.getSeverity();
+                       }
+                       if (log.isDebugEnabled())
+                               log.debug("Logged in as " + username);
+                       returnCode = (Integer) Subject.doAs(subject, getRunAction(display));
+                       SecureApplicationActivator.getLoginContext().logout();
+                       return processReturnCode(returnCode);
+               } catch (Exception e) {
+                       // e.printStackTrace();
+                       IStatus status = new Status(IStatus.ERROR,
+                                       "org.argeo.security.rcp", "Login failed", e);
+                       ErrorDialog.openError(null, "Error", "Shutdown...", status);
+                       return returnCode;
+               } finally {
+                       display.dispose();
+               }
+       }
+
+       protected Integer processReturnCode(Integer returnCode) {
+               return returnCode;
+       }
+
+       @SuppressWarnings("rawtypes")
+       private PrivilegedAction getRunAction(final Display display) {
+               return new PrivilegedAction() {
+
+                       public Object run() {
+                               int result = createAndRunWorkbench(display);
+                               return new Integer(result);
+                       }
+               };
+       }
+
+       protected Integer createAndRunWorkbench(Display display) {
+               return PlatformUI.createAndRunWorkbench(display,
+                               createWorkbenchAdvisor());
+       }
+
+       public void stop() {
+               final IWorkbench workbench;
+               try {
+                       workbench = PlatformUI.getWorkbench();
+               } catch (Exception e) {
+                       return;
+               }
+               if (workbench == null)
+                       return;
+               final Display display = workbench.getDisplay();
+               if (display != null && !display.isDisposed())
+                       display.syncExec(new Runnable() {
+
+                               public void run() {
+                                       if (!display.isDisposed())
+                                               workbench.close();
+                               }
+                       });
+
+               if (log.isDebugEnabled())
+                       log.debug("workbench stopped");
+               // String username = CurrentUser.getUsername();
+               // if (log.isDebugEnabled())
+               // log.debug("workbench stopped, logged in as " + username);
+
+       }
+
+}
diff --git a/security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/RapSecureWorkbenchWindowAdvisor.java b/security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/RapSecureWorkbenchWindowAdvisor.java
new file mode 100644 (file)
index 0000000..fb4911a
--- /dev/null
@@ -0,0 +1,37 @@
+package org.argeo.security.ui.application;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.application.ActionBarAdvisor;
+import org.eclipse.ui.application.IActionBarConfigurer;
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+
+public class RapSecureWorkbenchWindowAdvisor extends
+               SecureWorkbenchWindowAdvisor {
+       public RapSecureWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
+               super(configurer);
+       }
+
+       @Override
+       public ActionBarAdvisor createActionBarAdvisor(
+                       IActionBarConfigurer configurer) {
+               return new SecureActionBarAdvisor(configurer, false);
+       }
+
+       public void preWindowOpen() {
+               IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
+               configurer.setShowCoolBar(true);
+               configurer.setShowMenuBar(true);
+               configurer.setShowStatusLine(false);
+               configurer.setShowPerspectiveBar(true);
+               configurer.setTitle("Argeo Secure UI"); //$NON-NLS-1$
+               // Full screen, see
+               // http://dev.eclipse.org/newslists/news.eclipse.technology.rap/msg02697.html
+               configurer.setShellStyle(SWT.NONE);
+               Rectangle bounds = Display.getDefault().getBounds();
+               configurer.setInitialSize(new Point(bounds.width, bounds.height));
+       }
+
+}
diff --git a/security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureActionBarAdvisor.java b/security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureActionBarAdvisor.java
new file mode 100644 (file)
index 0000000..61a3c04
--- /dev/null
@@ -0,0 +1,94 @@
+package org.argeo.security.ui.application;
+
+import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.ICoolBarManager;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
+import org.eclipse.ui.application.ActionBarAdvisor;
+import org.eclipse.ui.application.IActionBarConfigurer;
+
+public class SecureActionBarAdvisor extends ActionBarAdvisor {
+       private IWorkbenchAction exitAction;
+       private IWorkbenchAction openPerspectiveDialogAction;
+       private IWorkbenchAction showViewMenuAction;
+       private IWorkbenchAction preferences;
+       private IWorkbenchAction saveAction;
+       private IWorkbenchAction saveAllAction;
+       private IWorkbenchAction closeAllAction;
+
+       // private final Boolean isRcp;
+
+       public SecureActionBarAdvisor(IActionBarConfigurer configurer, Boolean isRcp) {
+               super(configurer);
+               // this.isRcp = isRcp;
+       }
+
+       protected void makeActions(IWorkbenchWindow window) {
+               preferences = ActionFactory.PREFERENCES.create(window);
+               register(preferences);
+               openPerspectiveDialogAction = ActionFactory.OPEN_PERSPECTIVE_DIALOG
+                               .create(window);
+               register(openPerspectiveDialogAction);
+               showViewMenuAction = ActionFactory.SHOW_VIEW_MENU.create(window);
+               register(showViewMenuAction);
+
+               exitAction = ActionFactory.QUIT.create(window);
+               register(exitAction);
+
+               // Save semantiocs
+               saveAction = ActionFactory.SAVE.create(window);
+               register(saveAction);
+               saveAllAction = ActionFactory.SAVE_ALL.create(window);
+               register(saveAllAction);
+               closeAllAction = ActionFactory.CLOSE_ALL.create(window);
+               register(closeAllAction);
+
+       }
+
+       protected void fillMenuBar(IMenuManager menuBar) {
+               MenuManager fileMenu = new MenuManager("&File",
+                               IWorkbenchActionConstants.M_FILE);
+               MenuManager editMenu = new MenuManager("&Edit",
+                               IWorkbenchActionConstants.M_EDIT);
+               MenuManager windowMenu = new MenuManager("&Window",
+                               IWorkbenchActionConstants.M_WINDOW);
+
+               menuBar.add(fileMenu);
+               menuBar.add(editMenu);
+               menuBar.add(windowMenu);
+               // Add a group marker indicating where action set menus will appear.
+               menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
+
+               // File
+               fileMenu.add(saveAction);
+               fileMenu.add(saveAllAction);
+               fileMenu.add(closeAllAction);
+               fileMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
+               fileMenu.add(new Separator());
+               fileMenu.add(exitAction);
+
+               // Edit
+               editMenu.add(preferences);
+
+               // Window
+               windowMenu.add(openPerspectiveDialogAction);
+               windowMenu.add(showViewMenuAction);
+       }
+
+       @Override
+       protected void fillCoolBar(ICoolBarManager coolBar) {
+               IToolBarManager saveToolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
+               saveToolbar.add(saveAction);
+               saveToolbar.add(saveAllAction);
+               coolBar.add(saveToolbar);
+       }
+
+}
diff --git a/security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureApplicationActivator.java b/security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureApplicationActivator.java
new file mode 100644 (file)
index 0000000..ec5d625
--- /dev/null
@@ -0,0 +1,29 @@
+package org.argeo.security.ui.application;
+
+import java.net.URL;
+
+import org.eclipse.equinox.security.auth.ILoginContext;
+import org.eclipse.equinox.security.auth.LoginContextFactory;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class SecureApplicationActivator implements BundleActivator {
+
+       public final static String CONTEXT_SPRING = "SPRING";
+       private static final String JAAS_CONFIG_FILE = "/META-INF/jaas_default.txt";
+
+       private static ILoginContext loginContext = null;
+
+       public void start(BundleContext bundleContext) throws Exception {
+               URL configUrl = bundleContext.getBundle().getEntry(JAAS_CONFIG_FILE);
+               loginContext = LoginContextFactory.createContext(CONTEXT_SPRING,
+                               configUrl);
+       }
+
+       public void stop(BundleContext context) throws Exception {
+       }
+
+       static ILoginContext getLoginContext() {
+               return loginContext;
+       }
+}
diff --git a/security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureRap.java b/security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureRap.java
new file mode 100644 (file)
index 0000000..5f2ea3e
--- /dev/null
@@ -0,0 +1,38 @@
+package org.argeo.security.ui.application;
+
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+import org.eclipse.ui.application.WorkbenchAdvisor;
+import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+
+/** Generic secure application for RAP. */
+public class SecureRap extends AbstractSecureApplication {
+
+       @Override
+       protected WorkbenchAdvisor createWorkbenchAdvisor() {
+               return new SecureWorkbenchAdvisor() {
+                       public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
+                                       IWorkbenchWindowConfigurer configurer) {
+                               return new RapSecureWorkbenchWindowAdvisor(configurer);
+                       }
+
+               };
+       }
+
+       public void stop() {
+               final IWorkbench workbench = PlatformUI.getWorkbench();
+               if (workbench == null)
+                       return;
+               final Display display = workbench.getDisplay();
+               display.syncExec(new Runnable() {
+
+                       public void run() {
+                               if (!display.isDisposed())
+                                       workbench.close();
+                       }
+               });
+       }
+
+}
diff --git a/security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureRcp.java b/security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureRcp.java
new file mode 100644 (file)
index 0000000..b8576c4
--- /dev/null
@@ -0,0 +1,21 @@
+package org.argeo.security.ui.application;
+
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.application.WorkbenchAdvisor;
+
+public class SecureRcp extends AbstractSecureApplication {
+
+       @Override
+       protected WorkbenchAdvisor createWorkbenchAdvisor() {
+               return new SecureWorkbenchAdvisor();
+       }
+
+       protected Integer processReturnCode(Integer returnCode) {
+               if (returnCode == PlatformUI.RETURN_RESTART)
+                       return IApplication.EXIT_RESTART;
+               else
+                       return IApplication.EXIT_OK;
+       }
+
+}
diff --git a/security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureWorkbenchAdvisor.java b/security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureWorkbenchAdvisor.java
new file mode 100644 (file)
index 0000000..4179816
--- /dev/null
@@ -0,0 +1,23 @@
+package org.argeo.security.ui.application;
+
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+import org.eclipse.ui.application.WorkbenchAdvisor;
+import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+
+public class SecureWorkbenchAdvisor extends WorkbenchAdvisor {
+
+       static final String DEFAULT_PERSPECTIVE_ID = "org.argeo.security.ui.securityPerspective"; //$NON-NLS-1$
+
+       public final static String INITIAL_PERSPECTIVE_PROPERTY = "org.argeo.security.ui.initialPerspective";
+       private String initialPerspective = System.getProperty(
+                       INITIAL_PERSPECTIVE_PROPERTY, DEFAULT_PERSPECTIVE_ID);
+
+       public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
+                       IWorkbenchWindowConfigurer configurer) {
+               return new SecureWorkbenchWindowAdvisor(configurer);
+       }
+
+       public String getInitialWindowPerspectiveId() {
+               return initialPerspective;
+       }
+}
diff --git a/security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureWorkbenchWindowAdvisor.java b/security/plugins/org.argeo.security.ui.application/src/main/java/org/argeo/security/ui/application/SecureWorkbenchWindowAdvisor.java
new file mode 100644 (file)
index 0000000..1eb5c67
--- /dev/null
@@ -0,0 +1,32 @@
+package org.argeo.security.ui.application;
+
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.ui.application.ActionBarAdvisor;
+import org.eclipse.ui.application.IActionBarConfigurer;
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+
+public class SecureWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
+
+       public SecureWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
+               super(configurer);
+       }
+
+       public ActionBarAdvisor createActionBarAdvisor(
+                       IActionBarConfigurer configurer) {
+               return new SecureActionBarAdvisor(configurer, true);
+       }
+
+       public void preWindowOpen() {
+               IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
+               configurer.setInitialSize(new Point(1200, 900));
+               configurer.setShowCoolBar(true);
+               configurer.setShowMenuBar(true);
+               configurer.setShowStatusLine(false);
+
+               configurer.setShowPerspectiveBar(true);
+               configurer.setTitle("Argeo Secure UI"); //$NON-NLS-1$
+
+       }
+
+}
diff --git a/security/plugins/org.argeo.security.ui.rap/pom.xml b/security/plugins/org.argeo.security.ui.rap/pom.xml
new file mode 100644 (file)
index 0000000..764c63f
--- /dev/null
@@ -0,0 +1,132 @@
+<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.argeo.commons.security</groupId>
+               <version>0.2.3-SNAPSHOT</version>
+               <artifactId>plugins</artifactId>
+               <relativePath>..</relativePath>
+       </parent>
+       <artifactId>org.argeo.security.ui.rap</artifactId>
+       <name>Commons Security UI RAP</name>
+       <packaging>jar</packaging>
+       <build>
+               <plugins>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-compiler-plugin</artifactId>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-source-plugin</artifactId>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-jar-plugin</artifactId>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.argeo.maven.plugins</groupId>
+                               <artifactId>maven-argeo-osgi-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <id>resolve-pde-sources</id>
+                                               <goals>
+                                                       <goal>pde-sources</goal>
+                                               </goals>
+                                               <phase>generate-resources</phase>
+                                       </execution>
+                                       <execution>
+                                               <id>generate-descriptors</id>
+                                               <goals>
+                                                       <goal>descriptors</goal>
+                                               </goals>
+                                               <phase>generate-resources</phase>
+                                       </execution>
+                                       <execution>
+                                               <id>check-osgi</id>
+                                               <phase>test</phase>
+                                               <goals>
+                                                       <goal>equinox</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <onlyCheck>true</onlyCheck>
+                                                       <argsToAppend>
+                                                               <arg>-clean</arg>
+                                                       </argsToAppend>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
+               </plugins>
+       </build>
+       <dependencies>
+               <dependency>
+                       <groupId>org.argeo.commons.security</groupId>
+                       <artifactId>org.argeo.security.ui.application</artifactId>
+                       <version>0.2.3-SNAPSHOT</version>
+                       <exclusions>
+                               <exclusion>
+                                       <groupId>org.argeo.commons.eclipse</groupId>
+                                       <artifactId>org.argeo.eclipse.dep.rcp</artifactId>
+                               </exclusion>
+                       </exclusions>
+               </dependency>
+               <!-- RAP -->
+               <dependency>
+                       <groupId>org.argeo.commons.eclipse</groupId>
+                       <artifactId>org.argeo.eclipse.dep.rap</artifactId>
+                       <version>0.2.3-SNAPSHOT</version>
+               </dependency>
+
+
+               <!-- TODO: factorize with application.ui -->
+               <!-- For testing and target platform generation -->
+               <dependency>
+                       <groupId>org.argeo.commons.server</groupId>
+                       <artifactId>org.argeo.server.ads.server</artifactId>
+                       <version>${version.argeo-commons}</version>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.argeo.commons.security</groupId>
+                       <artifactId>org.argeo.security.services</artifactId>
+                       <version>${version.argeo-commons}</version>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.argeo.commons.security</groupId>
+                       <artifactId>org.argeo.security.ldap</artifactId>
+                       <version>${version.argeo-commons}</version>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.argeo.commons.security</groupId>
+                       <artifactId>org.argeo.security.manager.ldap</artifactId>
+                       <version>${version.argeo-commons}</version>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.argeo.commons.server</groupId>
+                       <artifactId>org.argeo.server.ads</artifactId>
+                       <version>0.2.3-SNAPSHOT</version>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.argeo.dep.osgi</groupId>
+                       <artifactId>org.argeo.dep.osgi.springframework.ldap</artifactId>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.argeo.commons.basic</groupId>
+                       <artifactId>org.argeo.basic.dep.log4j</artifactId>
+                       <version>0.2.3-SNAPSHOT</version>
+                       <type>pom</type>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>net.sourceforge.jdbm</groupId>
+                       <artifactId>com.springsource.jdbm</artifactId>
+                       <scope>test</scope>
+               </dependency>
+       </dependencies>
+</project>
diff --git a/security/plugins/org.argeo.security.ui/.classpath b/security/plugins/org.argeo.security.ui/.classpath
new file mode 100644 (file)
index 0000000..92f19d2
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry kind="src" path="src/main/java"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/security/plugins/org.argeo.security.ui/.project b/security/plugins/org.argeo.security.ui/.project
new file mode 100644 (file)
index 0000000..a052e9a
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.security.ui</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
diff --git a/security/plugins/org.argeo.security.ui/.settings/org.eclipse.jdt.core.prefs b/security/plugins/org.argeo.security.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644 (file)
index 0000000..aef0f52
--- /dev/null
@@ -0,0 +1,8 @@
+#Sat Jan 15 13:25:02 CET 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/security/plugins/org.argeo.security.ui/.settings/org.eclipse.pde.core.prefs b/security/plugins/org.argeo.security.ui/.settings/org.eclipse.pde.core.prefs
new file mode 100644 (file)
index 0000000..dfa507d
--- /dev/null
@@ -0,0 +1,3 @@
+#Sat Jan 15 18:15:48 CET 2011
+eclipse.preferences.version=1
+resolve.requirebundle=false
diff --git a/security/plugins/org.argeo.security.ui/META-INF/spring/commands.xml b/security/plugins/org.argeo.security.ui/META-INF/spring/commands.xml
new file mode 100644 (file)
index 0000000..a89876a
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+       <bean id="org.argeo.security.ui.openArgeoUserEditor" class="org.argeo.security.ui.commands.OpenArgeoUserEditor"
+               scope="prototype" />
+       <bean id="org.argeo.security.ui.newArgeoUserEditor" class="org.argeo.security.ui.commands.OpenArgeoUserEditor"
+               scope="prototype" />
+       <bean id="org.argeo.security.ui.addRole" class="org.argeo.security.ui.commands.AddRole"
+               scope="prototype">
+               <property name="securityService" ref="securityService" />
+       </bean>
+       <bean id="org.argeo.security.ui.openChangePasswordDialog" class="org.argeo.security.ui.commands.OpenChangePasswordDialog"
+               scope="prototype">
+               <property name="securityService" ref="securityService" />
+       </bean>
+       <bean id="org.argeo.security.ui.refreshUsersList" class="org.argeo.security.ui.commands.RefreshUsersList"
+               scope="prototype" />
+</beans>
diff --git a/security/plugins/org.argeo.security.ui/META-INF/spring/editors.xml b/security/plugins/org.argeo.security.ui/META-INF/spring/editors.xml
new file mode 100644 (file)
index 0000000..747c2b7
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+       <!-- Editors -->
+       <bean id="org.argeo.security.ui.argeoUserEditor" class="org.argeo.security.ui.editors.ArgeoUserEditor"
+               scope="prototype">
+               <property name="securityService" ref="securityService" />
+       </bean>
+</beans>
diff --git a/security/plugins/org.argeo.security.ui/META-INF/spring/osgi.xml b/security/plugins/org.argeo.security.ui/META-INF/spring/osgi.xml
new file mode 100644 (file)
index 0000000..6574cf1
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+       xmlns:osgi="http://www.springframework.org/schema/osgi"\r
+       xsi:schemaLocation="http://www.springframework.org/schema/osgi  \r
+       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+       http://www.springframework.org/schema/beans   \r
+       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"\r
+       osgi:default-timeout="30000">\r
+\r
+       <reference id="securityService" interface="org.argeo.security.ArgeoSecurityService" />\r
+</beans:beans>
\ No newline at end of file
diff --git a/security/plugins/org.argeo.security.ui/META-INF/spring/views.xml b/security/plugins/org.argeo.security.ui/META-INF/spring/views.xml
new file mode 100644 (file)
index 0000000..7ae3b62
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+       <bean id="org.argeo.security.ui.usersView" class="org.argeo.security.ui.views.UsersView"
+               scope="prototype">
+               <property name="securityService" ref="securityService" />
+       </bean>
+       <bean id="org.argeo.security.ui.rolesView" class="org.argeo.security.ui.views.RolesView"
+               scope="prototype">
+               <property name="securityService" ref="securityService" />
+       </bean>
+       <bean id="org.argeo.security.ui.currentUserView" class="org.argeo.security.ui.views.CurrentUserView"
+               scope="prototype">
+       </bean>
+</beans>
diff --git a/security/plugins/org.argeo.security.ui/build.properties b/security/plugins/org.argeo.security.ui/build.properties
new file mode 100644 (file)
index 0000000..3868784
--- /dev/null
@@ -0,0 +1,6 @@
+source.. = src/main/java/
+output.. = target/classes/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               icons/
diff --git a/security/plugins/org.argeo.security.ui/icons/add.gif b/security/plugins/org.argeo.security.ui/icons/add.gif
new file mode 100644 (file)
index 0000000..252d7eb
Binary files /dev/null and b/security/plugins/org.argeo.security.ui/icons/add.gif differ
diff --git a/security/plugins/org.argeo.security.ui/icons/password.gif b/security/plugins/org.argeo.security.ui/icons/password.gif
new file mode 100644 (file)
index 0000000..a6b251f
Binary files /dev/null and b/security/plugins/org.argeo.security.ui/icons/password.gif differ
diff --git a/security/plugins/org.argeo.security.ui/icons/refresh.png b/security/plugins/org.argeo.security.ui/icons/refresh.png
new file mode 100644 (file)
index 0000000..a3884fb
Binary files /dev/null and b/security/plugins/org.argeo.security.ui/icons/refresh.png differ
diff --git a/security/plugins/org.argeo.security.ui/icons/remove.gif b/security/plugins/org.argeo.security.ui/icons/remove.gif
new file mode 100644 (file)
index 0000000..0ae6dec
Binary files /dev/null and b/security/plugins/org.argeo.security.ui/icons/remove.gif differ
diff --git a/security/plugins/org.argeo.security.ui/icons/role.gif b/security/plugins/org.argeo.security.ui/icons/role.gif
new file mode 100644 (file)
index 0000000..274a850
Binary files /dev/null and b/security/plugins/org.argeo.security.ui/icons/role.gif differ
diff --git a/security/plugins/org.argeo.security.ui/icons/save.gif b/security/plugins/org.argeo.security.ui/icons/save.gif
new file mode 100644 (file)
index 0000000..654ad7b
Binary files /dev/null and b/security/plugins/org.argeo.security.ui/icons/save.gif differ
diff --git a/security/plugins/org.argeo.security.ui/icons/save_security.png b/security/plugins/org.argeo.security.ui/icons/save_security.png
new file mode 100644 (file)
index 0000000..ca41dc9
Binary files /dev/null and b/security/plugins/org.argeo.security.ui/icons/save_security.png differ
diff --git a/security/plugins/org.argeo.security.ui/icons/save_security_disabled.png b/security/plugins/org.argeo.security.ui/icons/save_security_disabled.png
new file mode 100644 (file)
index 0000000..fb7d08d
Binary files /dev/null and b/security/plugins/org.argeo.security.ui/icons/save_security_disabled.png differ
diff --git a/security/plugins/org.argeo.security.ui/icons/security.gif b/security/plugins/org.argeo.security.ui/icons/security.gif
new file mode 100644 (file)
index 0000000..57fb95e
Binary files /dev/null and b/security/plugins/org.argeo.security.ui/icons/security.gif differ
diff --git a/security/plugins/org.argeo.security.ui/icons/user.gif b/security/plugins/org.argeo.security.ui/icons/user.gif
new file mode 100644 (file)
index 0000000..90a0014
Binary files /dev/null and b/security/plugins/org.argeo.security.ui/icons/user.gif differ
diff --git a/security/plugins/org.argeo.security.ui/icons/users.gif b/security/plugins/org.argeo.security.ui/icons/users.gif
new file mode 100644 (file)
index 0000000..2de7edd
Binary files /dev/null and b/security/plugins/org.argeo.security.ui/icons/users.gif differ
diff --git a/security/plugins/org.argeo.security.ui/plugin.xml b/security/plugins/org.argeo.security.ui/plugin.xml
new file mode 100644 (file)
index 0000000..3a741cb
--- /dev/null
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.eclipse.ui.perspectives">
+      <perspective
+            class="org.argeo.security.ui.SecurityPerspective"
+            icon="icons/security.gif"
+            id="org.argeo.security.ui.securityPerspective"
+            name="Security">
+      </perspective>
+   </extension>
+   <extension
+         point="org.eclipse.ui.views">
+      <view
+            class="org.argeo.eclipse.spring.SpringExtensionFactory"
+            icon="icons/users.gif"
+            id="org.argeo.security.ui.usersView"
+            name="Users"
+            restorable="false">
+      </view>
+      <view
+            class="org.argeo.eclipse.spring.SpringExtensionFactory"
+            id="org.argeo.security.ui.currentUserView"
+            name="Current User"
+            restorable="false">
+      </view>
+      <view
+            class="org.argeo.eclipse.spring.SpringExtensionFactory"
+            icon="icons/role.gif"
+            id="org.argeo.security.ui.rolesView"
+            name="Roles"
+            restorable="false">
+      </view>
+   </extension>
+   
+   <!-- Security -->
+   <extension
+         id="defaultLoginDialog"
+         name="Default Login Dialog"
+         point="org.eclipse.equinox.security.callbackHandler">
+      <callbackHandler
+            class="org.argeo.security.ui.dialogs.DefaultLoginDialog">
+      </callbackHandler>
+   </extension>
+   <extension
+         point="org.eclipse.equinox.security.callbackHandlerMapping">
+      <callbackHandlerMapping
+            callbackHandlerId="org.argeo.security.ui.defaultLoginDialog"
+            configName="SPRING">
+      </callbackHandlerMapping>
+   </extension>
+   <extension
+         point="org.eclipse.equinox.security.callbackHandlerMapping">
+         <callbackHandlerMapping
+            callbackHandlerId="org.argeo.security.ui.defaultLoginDialog"
+            configName="UNIX">
+      </callbackHandlerMapping>
+   </extension>
+   <extension
+         point="org.eclipse.equinox.security.callbackHandlerMapping">
+      <callbackHandlerMapping
+            callbackHandlerId="org.argeo.security.ui.defaultLoginDialog"
+            configName="SPRING_SECURITY_CONTEXT">
+      </callbackHandlerMapping>
+   </extension>
+   <extension
+           point="org.eclipse.ui.editors">
+               <editor
+                 class="org.argeo.eclipse.spring.SpringExtensionFactory"
+              id="org.argeo.security.ui.argeoUserEditor"
+              name="User"
+              icon="icons/user.gif"
+              default="false">
+        </editor>
+     </extension>
+    <extension
+         point="org.eclipse.ui.commands">
+      <command
+            defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+            id="org.argeo.security.ui.openArgeoUserEditor"
+            name="OpenArgeoUserEditor">
+                       <commandParameter
+                       id="org.argeo.security.ui.username"
+                       name="Username">
+                       </commandParameter>
+      </command>
+      <command
+            defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+            id="org.argeo.security.ui.newArgeoUserEditor"
+            name="OpenArgeoUserEditor">
+      </command>
+      <command
+            defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+            id="org.argeo.security.ui.addRole"
+            name="AddRole">
+      </command>
+      <command
+            defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+            id="org.argeo.security.ui.openChangePasswordDialog"
+            name="OpenChangePasswordDialog">
+      </command>
+      <command
+            defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+            id="org.argeo.security.ui.refreshUsersList"
+            name="refreshUsersList">
+      </command>
+    </extension>
+     <extension
+         point="org.eclipse.ui.menus">
+       <menuContribution
+            locationURI="toolbar:org.argeo.security.ui.rolesView">
+            <command
+                  commandId="org.argeo.security.ui.addRole"
+                  icon="icons/add.gif"
+                  label="Add Role"
+                  tooltip="Add new role">
+            </command>
+        </menuContribution>
+       <menuContribution
+            locationURI="toolbar:org.argeo.security.ui.usersView">
+            <command
+                  commandId="org.argeo.security.ui.newArgeoUserEditor"
+                  icon="icons/add.gif"
+                  label="Add User"
+                  tooltip="Add new user">
+            </command>
+            <command
+                  commandId="org.argeo.security.ui.refreshUsersList"
+                  icon="icons/refresh.png"
+                  label="Refresh"
+                  tooltip="Refresh user list">
+            </command>
+        </menuContribution>
+        <menuContribution
+                allPopups="false"
+                locationURI="menu:file?after=additions">
+                <command
+                      commandId="org.argeo.security.ui.openChangePasswordDialog"
+                      disabledIcon="icons/password.gif"
+                      icon="icons/password.gif"
+                      label="Change password"
+                      style="push"
+                      tooltip="Change password">
+                </command>
+          </menuContribution>
+  </extension>
+     <extension
+           id="product"
+           point="org.eclipse.core.runtime.products">
+        <product
+              application="org.argeo.security.ui.application.secureUi"
+              name="Agfa Sebi">
+           <property
+                 name="appName"
+                 value="Agfa Sebi">
+           </property>
+        </product>
+     </extension>
+ </plugin>
diff --git a/security/plugins/org.argeo.security.ui/pom.xml b/security/plugins/org.argeo.security.ui/pom.xml
new file mode 100644 (file)
index 0000000..0d9ed31
--- /dev/null
@@ -0,0 +1,113 @@
+<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.argeo.commons.security</groupId>
+               <version>0.2.3-SNAPSHOT</version>
+               <artifactId>plugins</artifactId>
+               <relativePath>..</relativePath>
+       </parent>
+       <artifactId>org.argeo.security.ui</artifactId>
+       <name>Commons Security UI</name>
+       <packaging>jar</packaging>
+       <build>
+               <plugins>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-compiler-plugin</artifactId>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-source-plugin</artifactId>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-jar-plugin</artifactId>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.apache.felix</groupId>
+                               <artifactId>maven-bundle-plugin</artifactId>
+                               <version>${version.maven-bundle-plugin}</version>
+                               <configuration>
+                                       <!-- <instructions> -->
+                                       <!-- <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy> -->
+                                       <!-- <Bundle-Activator>org.argeo.security.ui.SecurityUiPlugin</Bundle-Activator> -->
+                                       <!-- <Require-Bundle>org.eclipse.ui;resolution:=optional,org.eclipse.rap.ui;resolution:=optional,org.eclipse.core.runtime</Require-Bundle> -->
+                                       <!-- <Import-Package> -->
+                                       <!-- org.argeo.eclipse.spring, -->
+                                       <!-- org.osgi.framework;version="0.0.0", -->
+                                       <!-- !org.eclipse.core.runtime, -->
+                                       <!-- !org.eclipse.core.commands, -->
+                                       <!-- !org.eclipse.ui.plugin, -->
+                                       <!-- !org.eclipse.ui, -->
+                                       <!-- !org.eclipse.ui.commands, -->
+                                       <!-- !org.eclipse.ui.handlers, -->
+                                       <!-- !org.eclipse.ui.part, -->
+                                       <!-- * -->
+                                       <!-- </Import-Package> -->
+                                       <!-- <Private-Package>icons</Private-Package> -->
+                                       <!-- <Export-Package>org.argeo.security.ui.*</Export-Package> -->
+                                       <!-- </instructions> -->
+                                       <instructions>
+                                               <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
+                                               <Bundle-Activator>org.argeo.security.ui.SecurityUiPlugin</Bundle-Activator>
+                                               <Require-Bundle>org.eclipse.ui;resolution:=optional,org.eclipse.rap.ui;resolution:=optional,org.eclipse.core.runtime</Require-Bundle>
+                                               <Import-Package>
+                                                       org.argeo.eclipse.spring,
+                                                       *
+                                               </Import-Package>
+                                       </instructions>
+                               </configuration>
+                       </plugin>
+               </plugins>
+       </build>
+       <dependencies>
+               <!-- Argeo Security -->
+               <dependency>
+                       <groupId>org.argeo.commons.security</groupId>
+                       <artifactId>org.argeo.security.core</artifactId>
+                       <version>0.2.3-SNAPSHOT</version>
+               </dependency>
+
+               <!-- Argeo Eclipse -->
+               <dependency>
+                       <groupId>org.argeo.commons.eclipse</groupId>
+                       <artifactId>org.argeo.eclipse.ui</artifactId>
+                       <version>0.2.3-SNAPSHOT</version>
+               </dependency>
+
+               <!-- Argeo Eclipse distribution (common dependencies for both RAP and RCP) -->
+               <dependency>
+                       <groupId>org.argeo.commons.eclipse</groupId>
+                       <artifactId>org.argeo.eclipse.dep.common</artifactId>
+                       <version>0.2.3-SNAPSHOT</version>
+               </dependency>
+
+               <!-- RCP only dependency, needed at compile time -->
+               <dependency>
+                       <groupId>org.argeo.commons.eclipse</groupId>
+                       <artifactId>org.argeo.eclipse.dep.rcp</artifactId>
+                       <version>0.2.3-SNAPSHOT</version>
+                       <scope>provided</scope>
+               </dependency>
+
+               <!-- Commons -->
+               <dependency>
+                       <groupId>org.argeo.commons.basic</groupId>
+                       <artifactId>org.argeo.basic.nodeps</artifactId>
+                       <version>0.2.3-SNAPSHOT</version>
+               </dependency>
+
+               <!-- Spring -->
+               <dependency>
+                       <groupId>org.springframework.security</groupId>
+                       <artifactId>org.springframework.security.core</artifactId>
+               </dependency>
+
+               <!-- Others -->
+               <dependency>
+                       <groupId>org.slf4j</groupId>
+                       <artifactId>com.springsource.slf4j.org.apache.commons.logging</artifactId>
+               </dependency>
+       </dependencies>
+</project>
diff --git a/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/CurrentUser.java b/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/CurrentUser.java
new file mode 100644 (file)
index 0000000..a864c3a
--- /dev/null
@@ -0,0 +1,43 @@
+package org.argeo.security.ui;
+
+import java.security.AccessController;
+import java.security.Principal;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.security.auth.Subject;
+
+import org.argeo.ArgeoException;
+import org.springframework.security.Authentication;
+import org.springframework.security.GrantedAuthority;
+
+public class CurrentUser {
+       public final static String getUsername() {
+               Subject subject = getSubject();
+               if (subject == null)
+                       return null;
+               Principal principal = subject.getPrincipals().iterator().next();
+               return principal.getName();
+
+       }
+
+       public final static Set<String> roles() {
+               Principal principal = getSubject().getPrincipals().iterator().next();
+               Authentication authentication = (Authentication) principal;
+               Set<String> roles = Collections.synchronizedSet(new HashSet<String>());
+               for (GrantedAuthority ga : authentication.getAuthorities()) {
+                       roles.add(ga.getAuthority());
+               }
+               return Collections.unmodifiableSet(roles);
+       }
+
+       public final static Subject getSubject() {
+
+               Subject subject = Subject.getSubject(AccessController.getContext());
+               if (subject == null)
+                       throw new ArgeoException("Not authenticated.");
+               return subject;
+
+       }
+}
diff --git a/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/SecurityPerspective.java b/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/SecurityPerspective.java
new file mode 100644 (file)
index 0000000..3b3b9b8
--- /dev/null
@@ -0,0 +1,37 @@
+package org.argeo.security.ui;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+public class SecurityPerspective implements IPerspectiveFactory {
+       private String adminRole = "ROLE_ADMIN";
+
+       public void createInitialLayout(IPageLayout layout) {
+               if (!CurrentUser.roles().contains(adminRole)) {
+                       MessageDialog
+                                       .openError(Display.getCurrent().getActiveShell(),
+                                                       "Forbidden",
+                                                       "You are not allowed to access this resource.");
+                       return;
+               }
+
+               String editorArea = layout.getEditorArea();
+               layout.setEditorAreaVisible(true);
+               layout.setFixed(false);
+
+               IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT,
+                               0.4f, editorArea);
+
+               left.addView("org.argeo.security.ui.usersView");
+               left.addView("org.argeo.security.ui.rolesView");
+               // left.addView("org.argeo.security.ui.currentUserView");
+       }
+
+       public void setAdminRole(String adminRole) {
+               this.adminRole = adminRole;
+       }
+
+}
diff --git a/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/SecurityUiPlugin.java b/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/SecurityUiPlugin.java
new file mode 100644 (file)
index 0000000..bc05495
--- /dev/null
@@ -0,0 +1,60 @@
+package org.argeo.security.ui;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class SecurityUiPlugin extends AbstractUIPlugin {
+
+       // The plug-in ID
+       public static final String PLUGIN_ID = "org.argeo.security.ui"; //$NON-NLS-1$
+
+       // The shared instance
+       private static SecurityUiPlugin plugin;
+
+       /**
+        * The constructor
+        */
+       public SecurityUiPlugin() {
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see
+        * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
+        * )
+        */
+       public void start(BundleContext context) throws Exception {
+               super.start(context);
+               plugin = this;
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see
+        * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
+        * )
+        */
+       public void stop(BundleContext context) throws Exception {
+               plugin = null;
+               super.stop(context);
+       }
+
+       /**
+        * Returns the shared instance
+        * 
+        * @return the shared instance
+        */
+       public static SecurityUiPlugin getDefault() {
+               return plugin;
+       }
+
+       public static ImageDescriptor getImageDescriptor(String path) {
+               return imageDescriptorFromPlugin(PLUGIN_ID, path);
+       }
+}
diff --git a/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/AddRole.java b/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/AddRole.java
new file mode 100644 (file)
index 0000000..1873a13
--- /dev/null
@@ -0,0 +1,40 @@
+package org.argeo.security.ui.commands;
+
+import org.argeo.ArgeoException;
+import org.argeo.security.ArgeoSecurityService;
+import org.argeo.security.ui.views.RolesView;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/** Add a new role. */
+public class AddRole extends AbstractHandler {
+       public final static String COMMAND_ID = "org.argeo.security.ui.addRole";
+       private ArgeoSecurityService securityService;
+       private String rolePrefix = "ROLE_";
+
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               RolesView rolesView = (RolesView) HandlerUtil
+                               .getActiveWorkbenchWindow(event).getActivePage()
+                               .findView(RolesView.ID);
+               String role = rolesView.getNewRole();
+               if (role.trim().equals(""))
+                       return null;
+               if (role.equals(rolesView.getAddNewRoleText()))
+                       return null;
+               role = role.trim().toUpperCase();
+               if (!role.startsWith(rolePrefix))
+                       role = rolePrefix + role;
+               if (securityService.listEditableRoles().contains(role))
+                       throw new ArgeoException("Role " + role + " already exists");
+               securityService.newRole(role);
+               rolesView.refresh();
+               return null;
+       }
+
+       public void setSecurityService(ArgeoSecurityService securityService) {
+               this.securityService = securityService;
+       }
+
+}
diff --git a/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/OpenArgeoUserEditor.java b/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/OpenArgeoUserEditor.java
new file mode 100644 (file)
index 0000000..c9bd25f
--- /dev/null
@@ -0,0 +1,28 @@
+package org.argeo.security.ui.commands;
+
+import org.argeo.security.ui.editors.ArgeoUserEditor;
+import org.argeo.security.ui.editors.ArgeoUserEditorInput;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/** Command handler to set visible or open a Argeo user. */
+public class OpenArgeoUserEditor extends AbstractHandler {
+       public final static String COMMAND_ID = "org.argeo.security.ui.openArgeoUserEditor";
+       public final static String PARAM_USERNAME = "org.argeo.security.ui.username";
+
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               try {
+                       ArgeoUserEditorInput editorInput = new ArgeoUserEditorInput(
+                                       event.getParameter(PARAM_USERNAME));
+                       IWorkbenchPage activePage = HandlerUtil.getActiveWorkbenchWindow(
+                                       event).getActivePage();
+                       activePage.openEditor(editorInput, ArgeoUserEditor.ID);
+               } catch (Exception e) {
+                       throw new ExecutionException("Cannot open editor", e);
+               }
+               return null;
+       }
+}
diff --git a/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/OpenChangePasswordDialog.java b/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/OpenChangePasswordDialog.java
new file mode 100644 (file)
index 0000000..7047115
--- /dev/null
@@ -0,0 +1,25 @@
+package org.argeo.security.ui.commands;
+
+import org.argeo.security.ArgeoSecurityService;
+import org.argeo.security.ui.dialogs.ChangePasswordDialog;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/** Opens the change password dialog. */
+public class OpenChangePasswordDialog extends AbstractHandler {
+       private ArgeoSecurityService securityService;
+
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               ChangePasswordDialog dialog = new ChangePasswordDialog(
+                               HandlerUtil.getActiveShell(event), securityService);
+               dialog.open();
+               return null;
+       }
+
+       public void setSecurityService(ArgeoSecurityService securityService) {
+               this.securityService = securityService;
+       }
+
+}
diff --git a/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/RefreshUsersList.java b/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/RefreshUsersList.java
new file mode 100644 (file)
index 0000000..a385eb9
--- /dev/null
@@ -0,0 +1,20 @@
+package org.argeo.security.ui.commands;
+
+import org.argeo.security.ui.views.UsersView;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/** Refresh the main EBI list. */
+public class RefreshUsersList extends AbstractHandler {
+
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               UsersView view = (UsersView) HandlerUtil
+                               .getActiveWorkbenchWindow(event).getActivePage()
+                               .findView(UsersView.ID);
+               view.refresh();
+               return null;
+       }
+
+}
\ No newline at end of file
diff --git a/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/SaveArgeoUser.java b/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/commands/SaveArgeoUser.java
new file mode 100644 (file)
index 0000000..7d81743
--- /dev/null
@@ -0,0 +1,32 @@
+package org.argeo.security.ui.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/** Save the currently edited Argeo user. */
+public class SaveArgeoUser extends AbstractHandler {
+       public final static String COMMAND_ID = "org.argeo.security.ui.saveArgeoUser";
+
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               try {
+                       IWorkbenchPart iwp = HandlerUtil.getActiveWorkbenchWindow(event)
+                                       .getActivePage().getActivePart();
+
+                       if (!(iwp instanceof IEditorPart))
+                               return null;
+                       IEditorPart editor = (IEditorPart) iwp;
+                       editor.doSave(null);
+               } catch (Exception e) {
+                       MessageDialog.openError(Display.getDefault().getActiveShell(),
+                                       "Error", "Cannot save user: " + e.getMessage());
+               }
+               return null;
+       }
+
+}
diff --git a/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/dialogs/AbstractLoginDialog.java b/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/dialogs/AbstractLoginDialog.java
new file mode 100644 (file)
index 0000000..d3d1be3
--- /dev/null
@@ -0,0 +1,127 @@
+package org.argeo.security.ui.dialogs;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.operation.ModalContext;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+public abstract class AbstractLoginDialog extends TitleAreaDialog implements
+               CallbackHandler {
+
+       boolean processCallbacks = false;
+       boolean isCancelled = false;
+       Callback[] callbackArray;
+
+       protected final Callback[] getCallbacks() {
+               return this.callbackArray;
+       }
+
+       public abstract void internalHandle();
+
+       public boolean isCancelled() {
+               return isCancelled;
+       }
+
+       protected AbstractLoginDialog(Shell parentShell) {
+               super(parentShell);
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see
+        * javax.security.auth.callback.CallbackHandler#handle(javax.security.auth
+        * .callback.Callback[])
+        */
+       public void handle(final Callback[] callbacks) throws IOException {
+               this.callbackArray = callbacks;
+               final Display display = Display.getDefault();
+               display.syncExec(new Runnable() {
+
+                       public void run() {
+                               isCancelled = false;
+                               setBlockOnOpen(false);
+                               open();
+                               final Button okButton = getButton(IDialogConstants.OK_ID);
+                               okButton.setText("Login");
+                               okButton.addSelectionListener(new SelectionListener() {
+
+                                       public void widgetSelected(final SelectionEvent event) {
+                                               processCallbacks = true;
+                                       }
+
+                                       public void widgetDefaultSelected(final SelectionEvent event) {
+                                               // nothing to do
+                                       }
+                               });
+                               final Button cancel = getButton(IDialogConstants.CANCEL_ID);
+                               cancel.addSelectionListener(new SelectionListener() {
+
+                                       public void widgetSelected(final SelectionEvent event) {
+                                               isCancelled = true;
+                                               processCallbacks = true;
+                                       }
+
+                                       public void widgetDefaultSelected(final SelectionEvent event) {
+                                               // nothing to do
+                                       }
+                               });
+                       }
+               });
+               try {
+                       ModalContext.setAllowReadAndDispatch(true); // Works for now.
+                       ModalContext.run(new IRunnableWithProgress() {
+
+                               public void run(final IProgressMonitor monitor) {
+                                       // Wait here until OK or cancel is pressed, then let it rip.
+                                       // The event
+                                       // listener
+                                       // is responsible for closing the dialog (in the
+                                       // loginSucceeded
+                                       // event).
+                                       while (!processCallbacks) {
+                                               try {
+                                                       Thread.sleep(100);
+                                               } catch (final Exception e) {
+                                                       // do nothing
+                                               }
+                                       }
+                                       processCallbacks = false;
+                                       // Call the adapter to handle the callbacks
+                                       if (!isCancelled())
+                                               internalHandle();
+                                       else
+                                               // clear callbacks are when cancelling
+                                               for (Callback callback : callbacks)
+                                                       if (callback instanceof PasswordCallback)
+                                                               ((PasswordCallback) callback).setPassword(null);
+                                                       else if (callback instanceof NameCallback)
+                                                               ((NameCallback) callback).setName(null);
+                               }
+                       }, true, new NullProgressMonitor(), Display.getDefault());
+               } catch (final Exception e) {
+                       final IOException ioe = new IOException();
+                       ioe.initCause(e);
+                       throw ioe;
+               }
+       }
+
+       protected void configureShell(Shell shell) {
+               super.configureShell(shell);
+               shell.setText("Login");
+       }
+}
diff --git a/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/dialogs/ChangePasswordDialog.java b/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/dialogs/ChangePasswordDialog.java
new file mode 100644 (file)
index 0000000..e2e78e8
--- /dev/null
@@ -0,0 +1,70 @@
+package org.argeo.security.ui.dialogs;
+
+import org.argeo.ArgeoException;
+import org.argeo.security.ArgeoSecurityService;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+/** Dialog to change the current user password */
+public class ChangePasswordDialog extends TitleAreaDialog {
+       private Text currentPassword, newPassword1, newPassword2;
+       private ArgeoSecurityService securityService;
+
+       public ChangePasswordDialog(Shell parentShell,
+                       ArgeoSecurityService securityService) {
+               super(parentShell);
+               this.securityService = securityService;
+       }
+
+       protected Point getInitialSize() {
+               return new Point(300, 250);
+       }
+
+       protected Control createDialogArea(Composite parent) {
+               Composite dialogarea = (Composite) super.createDialogArea(parent);
+               dialogarea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+               Composite composite = new Composite(dialogarea, SWT.NONE);
+               composite.setLayout(new GridLayout(2, false));
+               composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+               currentPassword = createLP(composite, "Current password");
+               newPassword1 = createLP(composite, "New password");
+               newPassword2 = createLP(composite, "Repeat new password");
+
+               setMessage("Change password", IMessageProvider.INFORMATION);
+               parent.pack();
+               return composite;
+       }
+
+       @Override
+       protected void okPressed() {
+               if (!newPassword1.getText().equals(newPassword2.getText()))
+                       throw new ArgeoException("Passwords are different");
+               securityService.updateCurrentUserPassword(currentPassword.getText(),
+                               newPassword1.getText());
+               close();
+       }
+
+       /** Creates label and password. */
+       protected Text createLP(Composite parent, String label) {
+               new Label(parent, SWT.NONE).setText(label);
+               Text text = new Text(parent, SWT.SINGLE | SWT.LEAD | SWT.PASSWORD
+                               | SWT.BORDER);
+               text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+               return text;
+       }
+
+       protected void configureShell(Shell shell) {
+               super.configureShell(shell);
+               shell.setText("Change password");
+       }
+
+}
diff --git a/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/dialogs/DefaultLoginDialog.java b/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/dialogs/DefaultLoginDialog.java
new file mode 100644 (file)
index 0000000..d00e961
--- /dev/null
@@ -0,0 +1,114 @@
+package org.argeo.security.ui.dialogs;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.auth.callback.TextOutputCallback;
+
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+public class DefaultLoginDialog extends AbstractLoginDialog {
+
+       public DefaultLoginDialog() {
+               this(Display.getDefault().getActiveShell());
+       }
+
+       protected DefaultLoginDialog(Shell parentShell) {
+               super(parentShell);
+       }
+
+       protected Point getInitialSize() {
+               return new Point(300, 250);
+       }
+
+       protected Control createDialogArea(Composite parent) {
+               Composite dialogarea = (Composite) super.createDialogArea(parent);
+               // dialogarea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
+               // true));
+               Composite composite = new Composite(dialogarea, SWT.NONE);
+               composite.setLayout(new GridLayout(2, false));
+               composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+               createCallbackHandlers(composite);
+               parent.pack();
+               return composite;
+       }
+
+       private void createCallbackHandlers(Composite composite) {
+               Callback[] callbacks = getCallbacks();
+               for (int i = 0; i < callbacks.length; i++) {
+                       Callback callback = callbacks[i];
+                       if (callback instanceof TextOutputCallback) {
+                               createTextoutputHandler(composite,
+                                               (TextOutputCallback) callback);
+                       } else if (callback instanceof NameCallback) {
+                               createNameHandler(composite, (NameCallback) callback);
+                       } else if (callback instanceof PasswordCallback) {
+                               createPasswordHandler(composite, (PasswordCallback) callback);
+                       }
+               }
+       }
+
+       private void createPasswordHandler(Composite composite,
+                       final PasswordCallback callback) {
+               Label label = new Label(composite, SWT.NONE);
+               label.setText(callback.getPrompt());
+               final Text passwordText = new Text(composite, SWT.SINGLE | SWT.LEAD
+                               | SWT.PASSWORD | SWT.BORDER);
+               passwordText
+                               .setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+               passwordText.addModifyListener(new ModifyListener() {
+
+                       public void modifyText(ModifyEvent event) {
+                               callback.setPassword(passwordText.getText().toCharArray());
+                       }
+               });
+       }
+
+       private void createNameHandler(Composite composite,
+                       final NameCallback callback) {
+               Label label = new Label(composite, SWT.NONE);
+               label.setText(callback.getPrompt());
+               final Text text = new Text(composite, SWT.SINGLE | SWT.LEAD
+                               | SWT.BORDER);
+               text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+               text.addModifyListener(new ModifyListener() {
+
+                       public void modifyText(ModifyEvent event) {
+                               callback.setName(text.getText());
+                       }
+               });
+       }
+
+       private void createTextoutputHandler(Composite composite,
+                       TextOutputCallback callback) {
+               int messageType = callback.getMessageType();
+               int dialogMessageType = IMessageProvider.NONE;
+               switch (messageType) {
+               case TextOutputCallback.INFORMATION:
+                       dialogMessageType = IMessageProvider.INFORMATION;
+                       break;
+               case TextOutputCallback.WARNING:
+                       dialogMessageType = IMessageProvider.WARNING;
+                       break;
+               case TextOutputCallback.ERROR:
+                       dialogMessageType = IMessageProvider.ERROR;
+                       break;
+               }
+               setMessage(callback.getMessage(), dialogMessageType);
+       }
+
+       public void internalHandle() {
+       }
+}
diff --git a/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/editors/ArgeoUserEditor.java b/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/editors/ArgeoUserEditor.java
new file mode 100644 (file)
index 0000000..99a4652
--- /dev/null
@@ -0,0 +1,72 @@
+package org.argeo.security.ui.editors;
+
+import org.argeo.ArgeoException;
+import org.argeo.security.ArgeoSecurityService;
+import org.argeo.security.ArgeoUser;
+import org.argeo.security.SimpleArgeoUser;
+import org.argeo.security.nature.SimpleUserNature;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.forms.editor.FormEditor;
+
+/** Editor for an Argeo user. */
+public class ArgeoUserEditor extends FormEditor {
+       public final static String ID = "org.argeo.security.ui.argeoUserEditor";
+
+       private ArgeoUser user;
+       private ArgeoSecurityService securityService;
+
+       public void init(IEditorSite site, IEditorInput input)
+                       throws PartInitException {
+               super.init(site, input);
+               String username = ((ArgeoUserEditorInput) getEditorInput())
+                               .getUsername();
+               if (username == null) {// new
+                       user = new SimpleArgeoUser();
+                       user.getUserNatures().put(SimpleUserNature.TYPE,
+                                       new SimpleUserNature());
+               } else
+                       user = securityService.getUser(username);
+               this.setPartProperty("name", username != null ? username : "<new user>");
+               setPartName(username != null ? username : "<new user>");
+       }
+
+       protected void addPages() {
+               try {
+                       addPage(new DefaultUserMainPage(this, securityService, user));
+
+               } catch (PartInitException e) {
+                       throw new ArgeoException("Not able to add page ", e);
+               }
+       }
+
+       @Override
+       public void doSave(IProgressMonitor monitor) {
+               // list pages
+               // TODO: make it more generic
+               findPage(DefaultUserMainPage.ID).doSave(monitor);
+
+               if (securityService.userExists(user.getUsername()))
+                       securityService.updateUser(user);
+               else {
+                       securityService.newUser(user);
+                       setPartName(user.getUsername());
+               }
+               firePropertyChange(PROP_DIRTY);
+       }
+
+       @Override
+       public void doSaveAs() {
+       }
+
+       @Override
+       public boolean isSaveAsAllowed() {
+               return false;
+       }
+
+       public void setSecurityService(ArgeoSecurityService securityService) {
+               this.securityService = securityService;
+       }
+}
diff --git a/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/editors/ArgeoUserEditorInput.java b/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/editors/ArgeoUserEditorInput.java
new file mode 100644 (file)
index 0000000..9d61e9f
--- /dev/null
@@ -0,0 +1,51 @@
+package org.argeo.security.ui.editors;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+/** Editor input for an Argeo user. */
+public class ArgeoUserEditorInput implements IEditorInput {
+       private final String username;
+
+       public ArgeoUserEditorInput(String username) {
+               this.username = username;
+       }
+
+       public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
+               return null;
+       }
+
+       public boolean exists() {
+               return username != null;
+       }
+
+       public ImageDescriptor getImageDescriptor() {
+               return null;
+       }
+
+       public String getName() {
+               return username != null ? username : "<new user>";
+       }
+
+       public IPersistableElement getPersistable() {
+               return null;
+       }
+
+       public String getToolTipText() {
+               return username != null ? username : "<new user>";
+       }
+
+       public boolean equals(Object obj) {
+               if (!(obj instanceof ArgeoUserEditorInput))
+                       return false;
+               if (((ArgeoUserEditorInput) obj).getUsername() == null)
+                       return false;
+               return ((ArgeoUserEditorInput) obj).getUsername().equals(username);
+       }
+
+       public String getUsername() {
+               return username;
+       }
+
+}
diff --git a/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/editors/DefaultUserMainPage.java b/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/editors/DefaultUserMainPage.java
new file mode 100644 (file)
index 0000000..6180de4
--- /dev/null
@@ -0,0 +1,337 @@
+package org.argeo.security.ui.editors;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.security.ArgeoSecurityService;
+import org.argeo.security.ArgeoUser;
+import org.argeo.security.SimpleArgeoUser;
+import org.argeo.security.nature.SimpleUserNature;
+import org.argeo.security.ui.SecurityUiPlugin;
+import org.eclipse.jface.viewers.CellEditor;
+import org.eclipse.jface.viewers.CheckboxCellEditor;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.EditingSupport;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.AbstractFormPart;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.SectionPart;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.ColumnLayout;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * Display/edit the properties common to all {@link ArgeoUser} (username and
+ * roles) as well as the properties of the {@link SimpleUserNature}.
+ */
+public class DefaultUserMainPage extends FormPage {
+       final static String ID = "argeoUserEditor.mainPage";
+
+       private final static Log log = LogFactory.getLog(DefaultUserMainPage.class);
+       private final static Image ROLE_CHECKED = SecurityUiPlugin
+                       .getImageDescriptor("icons/security.gif").createImage();
+
+       private ArgeoUser user;
+       private SimpleUserNature simpleNature;
+       private String simpleNatureType;
+       private ArgeoSecurityService securityService;
+
+       public DefaultUserMainPage(FormEditor editor,
+                       ArgeoSecurityService securityService, ArgeoUser user) {
+               super(editor, ID, "Main");
+               this.securityService = securityService;
+               this.user = user;
+               this.simpleNature = SimpleUserNature.findSimpleUserNature(user,
+                               simpleNatureType);
+       }
+
+       protected void createFormContent(final IManagedForm mf) {
+               ScrolledForm form = mf.getForm();
+               form.setText(simpleNature.getFirstName() + " "
+                               + simpleNature.getLastName());
+               ColumnLayout mainLayout = new ColumnLayout();
+               mainLayout.minNumColumns = 1;
+               mainLayout.maxNumColumns = 4;
+               mainLayout.topMargin = 0;
+               mainLayout.bottomMargin = 5;
+               mainLayout.leftMargin = mainLayout.rightMargin = mainLayout.horizontalSpacing = mainLayout.verticalSpacing = 10;
+               form.getBody().setLayout(mainLayout);
+
+               createGeneralPart(form.getBody());
+               createRolesPart(form.getBody());
+               createPassworPart(form.getBody());
+       }
+
+       /** Creates the general section */
+       protected void createGeneralPart(Composite parent) {
+               FormToolkit tk = getManagedForm().getToolkit();
+               Section section = tk.createSection(parent, Section.TITLE_BAR);
+               section.setText("General");
+
+               Composite body = tk.createComposite(section, SWT.WRAP);
+               section.setClient(body);
+               GridLayout layout = new GridLayout();
+               layout.marginWidth = layout.marginHeight = 0;
+               layout.numColumns = 2;
+               body.setLayout(layout);
+
+               // add widgets (view)
+               final Text username;
+               if (user.getUsername() != null) {
+                       tk.createLabel(body, "Username");
+                       tk.createLabel(body, user.getUsername());
+                       username = null;
+               } else {
+                       username = createLT(body, "Username", "");
+               }
+               final Text firstName = createLT(body, "First name",
+                               simpleNature.getFirstName());
+               final Text lastName = createLT(body, "Last name",
+                               simpleNature.getLastName());
+               final Text email = createLT(body, "Email", simpleNature.getEmail());
+               final Text description = createLT(body, "Description",
+                               simpleNature.getDescription());
+
+               // create form part (controller)
+               AbstractFormPart part = new SectionPart(section) {
+                       public void commit(boolean onSave) {
+                               if (username != null) {
+                                       ((SimpleArgeoUser) user).setUsername(username.getText());
+                                       username.setEditable(false);
+                                       username.setEnabled(false);
+                               }
+                               simpleNature.setFirstName(firstName.getText());
+                               simpleNature.setLastName(lastName.getText());
+                               simpleNature.setEmail(email.getText());
+                               simpleNature.setDescription(description.getText());
+                               super.commit(onSave);
+                               if (log.isTraceEnabled())
+                                       log.trace("General part committed");
+                       }
+               };
+               if (username != null)
+                       username.addModifyListener(new FormPartML(part));
+               firstName.addModifyListener(new FormPartML(part));
+               lastName.addModifyListener(new FormPartML(part));
+               email.addModifyListener(new FormPartML(part));
+               description.addModifyListener(new FormPartML(part));
+               getManagedForm().addPart(part);
+       }
+
+       /** Creates the password section */
+       protected void createPassworPart(Composite parent) {
+               FormToolkit tk = getManagedForm().getToolkit();
+               Section section = tk.createSection(parent, Section.TITLE_BAR);
+               section.setText("Password");
+
+               Composite body = tk.createComposite(section, SWT.WRAP);
+               section.setClient(body);
+               GridLayout layout = new GridLayout();
+               layout.marginWidth = layout.marginHeight = 0;
+               layout.numColumns = 2;
+               body.setLayout(layout);
+
+               // add widgets (view)
+               final Text password1 = createLP(body, "New password", "");
+               final Text password2 = createLP(body, "Repeat password", "");
+               // create form part (controller)
+               AbstractFormPart part = new SectionPart(section) {
+                       public void commit(boolean onSave) {
+                               if (!password1.getText().equals("")
+                                               && password1.getText().equals(password2.getText())) {
+                                       ((SimpleArgeoUser) user).setPassword(password1.getText());
+                               }
+                               super.commit(onSave);
+                               if (log.isTraceEnabled())
+                                       log.trace("Password part committed");
+                       }
+               };
+               password1.addModifyListener(new FormPartML(part));
+               password2.addModifyListener(new FormPartML(part));
+               getManagedForm().addPart(part);
+       }
+
+       /** Creates the role section */
+       protected void createRolesPart(Composite parent) {
+               FormToolkit tk = getManagedForm().getToolkit();
+               Section section = tk.createSection(parent, Section.DESCRIPTION
+                               | Section.TITLE_BAR);
+               section.setText("Roles");
+               section.setDescription("Roles define "
+                               + "the authorizations for this user.");
+               Table table = new Table(section, SWT.MULTI | SWT.H_SCROLL
+                               | SWT.V_SCROLL);
+               section.setClient(table);
+
+               AbstractFormPart part = new SectionPart(section) {
+                       public void commit(boolean onSave) {
+                               // roles have already been modified in editing
+                               super.commit(onSave);
+                               if (log.isTraceEnabled())
+                                       log.trace("Role part committed");
+                       }
+               };
+               getManagedForm().addPart(part);
+
+               GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+               gridData.verticalSpan = 20;
+               table.setLayoutData(gridData);
+               table.setLinesVisible(true);
+               table.setHeaderVisible(false);
+               TableViewer viewer = new TableViewer(table);
+
+               // check column
+               TableViewerColumn column = createTableViewerColumn(viewer, "checked",
+                               20);
+               column.setLabelProvider(new ColumnLabelProvider() {
+                       public String getText(Object element) {
+                               return null;
+                       }
+
+                       public Image getImage(Object element) {
+                               String role = element.toString();
+                               if (user.getRoles().contains(role)) {
+                                       return ROLE_CHECKED;
+                               } else {
+                                       return null;
+                               }
+                       }
+               });
+               column.setEditingSupport(new RoleEditingSupport(viewer, part));
+
+               // role column
+               column = createTableViewerColumn(viewer, "Role", 200);
+               column.setLabelProvider(new ColumnLabelProvider() {
+                       public String getText(Object element) {
+                               return element.toString();
+                       }
+
+                       public Image getImage(Object element) {
+                               return null;
+                       }
+               });
+               viewer.setContentProvider(new RolesContentProvider());
+               viewer.setInput(getEditorSite());
+       }
+
+       protected TableViewerColumn createTableViewerColumn(TableViewer viewer,
+                       String title, int bound) {
+               final TableViewerColumn viewerColumn = new TableViewerColumn(viewer,
+                               SWT.NONE);
+               final TableColumn column = viewerColumn.getColumn();
+               column.setText(title);
+               column.setWidth(bound);
+               column.setResizable(true);
+               column.setMoveable(true);
+               return viewerColumn;
+
+       }
+
+       /** Creates label and text. */
+       protected Text createLT(Composite body, String label, String value) {
+               FormToolkit toolkit = getManagedForm().getToolkit();
+               toolkit.createLabel(body, label);
+               Text text = toolkit.createText(body, value, SWT.BORDER);
+               text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+               return text;
+       }
+
+       /** Creates label and password. */
+       protected Text createLP(Composite body, String label, String value) {
+               FormToolkit toolkit = getManagedForm().getToolkit();
+               toolkit.createLabel(body, label);
+               Text text = toolkit.createText(body, value, SWT.BORDER | SWT.PASSWORD);
+               text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+               return text;
+       }
+
+       public void setSimpleNatureType(String simpleNatureType) {
+               this.simpleNatureType = simpleNatureType;
+       }
+
+       private class FormPartML implements ModifyListener {
+               private AbstractFormPart formPart;
+
+               public FormPartML(AbstractFormPart generalPart) {
+                       this.formPart = generalPart;
+               }
+
+               public void modifyText(ModifyEvent e) {
+                       formPart.markDirty();
+               }
+
+       }
+
+       private class RolesContentProvider implements IStructuredContentProvider {
+               public Object[] getElements(Object inputElement) {
+                       return securityService.listEditableRoles().toArray();
+               }
+
+               public void dispose() {
+               }
+
+               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+               }
+       }
+
+       /** Select the columns by editing the checkbox in the first column */
+       class RoleEditingSupport extends EditingSupport {
+
+               private final TableViewer viewer;
+               private final AbstractFormPart formPart;
+
+               public RoleEditingSupport(TableViewer viewer, AbstractFormPart formPart) {
+                       super(viewer);
+                       this.viewer = viewer;
+                       this.formPart = formPart;
+               }
+
+               @Override
+               protected CellEditor getCellEditor(Object element) {
+                       return new CheckboxCellEditor(null, SWT.CHECK | SWT.READ_ONLY);
+
+               }
+
+               @Override
+               protected boolean canEdit(Object element) {
+                       return true;
+               }
+
+               @Override
+               protected Object getValue(Object element) {
+                       String role = element.toString();
+                       return user.getRoles().contains(role);
+
+               }
+
+               @Override
+               protected void setValue(Object element, Object value) {
+                       Boolean inRole = (Boolean) value;
+                       String role = element.toString();
+                       if (inRole && !user.getRoles().contains(role)) {
+                               user.getRoles().add(role);
+                               formPart.markDirty();
+                       } else if (!inRole && user.getRoles().contains(role)) {
+                               user.getRoles().remove(role);
+                               formPart.markDirty();
+                       }
+                       viewer.refresh();
+               }
+       }
+
+}
diff --git a/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/views/CurrentUserView.java b/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/views/CurrentUserView.java
new file mode 100644 (file)
index 0000000..5b04928
--- /dev/null
@@ -0,0 +1,129 @@
+package org.argeo.security.ui.views;
+
+import org.argeo.security.ui.CurrentUser;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.part.ViewPart;
+
+public class CurrentUserView extends ViewPart {
+       private TableViewer viewer;
+
+       @Override
+       public void createPartControl(Composite parent) {
+
+               // viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL
+               // | SWT.V_SCROLL);
+               viewer = new TableViewer(createTable(parent));
+               viewer.setContentProvider(new UsersContentProvider());
+               viewer.setLabelProvider(new UsersLabelProvider());
+               viewer.setInput(getViewSite());
+               // viewer.setInput(SecurityContextHolder.getContext());
+       }
+
+       protected Table createTable(Composite parent) {
+               int style = SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL;
+
+               Table table = new Table(parent, style);
+
+               // GridData gridData = new GridData(GridData.FILL_BOTH);
+               // gridData.grabExcessVerticalSpace = true;
+               // gridData.grabExcessHorizontalSpace = true;
+               // gridData.horizontalSpan = 3;
+               // table.setLayoutData(gridData);
+
+               table.setLinesVisible(true);
+               table.setHeaderVisible(true);
+
+               TableColumn column = new TableColumn(table, SWT.LEFT, 0);
+               column.setText("ID");
+               column.setWidth(100);
+
+               // column = new TableColumn(table, SWT.LEFT, 1);
+               // column.setText("Password");
+               // column.setWidth(200);
+
+               // column = new TableColumn(table, SWT.LEFT, 2);
+               // column.setText("Roles");
+               // column.setWidth(300);
+
+               return table;
+       }
+
+       @Override
+       public void setFocus() {
+               viewer.getTable().setFocus();
+       }
+
+       private class UsersContentProvider implements IStructuredContentProvider {
+
+               public Object[] getElements(Object inputElement) {
+                       return getChildren(inputElement);
+               }
+
+               public Object[] getChildren(Object parentElement) {
+                       // ILoginContext secureContext = LoginContextFactory
+                       // .createContext("SPRING");
+                       // try {
+                       // secureContext.login();
+                       // } catch (LoginException e) {
+                       // // login failed
+                       // }
+                       //
+                       // Subject subject = null;
+                       // // subject = Subject.getSubject(AccessController.getContext());
+                       // try {
+                       // subject = secureContext.getSubject();
+                       // } catch (Exception e) {
+                       // e.printStackTrace();
+                       // throw new ArgeoException("Cannot retrieve subject", e);
+                       // }
+                       //
+                       // if (subject == null)
+                       // throw new ArgeoException("No subject found");
+                       // return subject.getPrincipals().toArray();
+                       return CurrentUser.roles().toArray();
+               }
+
+               public void dispose() {
+                       // TODO Auto-generated method stub
+
+               }
+
+               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+                       // TODO Auto-generated method stub
+
+               }
+
+       }
+
+       private class UsersLabelProvider extends LabelProvider implements
+                       ITableLabelProvider {
+               public String getColumnText(Object element, int columnIndex) {
+                       // Principal argeoUser = (Principal) element;
+                       // switch (columnIndex) {
+                       // case 0:
+                       // return argeoUser.getName();
+                       // case 1:
+                       // return argeoUser.toString();
+                       // default:
+                       // throw new ArgeoException("Unmanaged column " + columnIndex);
+                       // }
+                       return element.toString();
+               }
+
+               public Image getColumnImage(Object element, int columnIndex) {
+                       // TODO Auto-generated method stub
+                       return null;
+               }
+
+       }
+
+}
diff --git a/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/views/RolesView.java b/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/views/RolesView.java
new file mode 100644 (file)
index 0000000..a58675e
--- /dev/null
@@ -0,0 +1,177 @@
+package org.argeo.security.ui.views;
+
+import java.util.ArrayList;
+
+import org.argeo.ArgeoException;
+import org.argeo.security.ArgeoSecurityService;
+import org.argeo.security.ArgeoUser;
+import org.argeo.security.ui.SecurityUiPlugin;
+import org.argeo.security.ui.commands.AddRole;
+import org.argeo.security.ui.commands.OpenArgeoUserEditor;
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.IParameter;
+import org.eclipse.core.commands.Parameterization;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.handlers.IHandlerService;
+import org.eclipse.ui.part.ViewPart;
+
+/** List all roles. */
+public class RolesView extends ViewPart {
+       public final static String ID = "org.argeo.security.ui.rolesView";
+
+       private Text newRole;
+
+       private TableViewer viewer;
+       private ArgeoSecurityService securityService;
+
+       private String addNewRoleText = "<add new role here>";
+
+       @Override
+       public void createPartControl(Composite parent) {
+               parent.setLayout(new GridLayout(1, false));
+
+               // new role text field
+               newRole = new Text(parent, SWT.BORDER);
+               newRole.setText(addNewRoleText);
+               newRole.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+               // default action is add role
+               newRole.addListener(SWT.DefaultSelection, new Listener() {
+                       public void handleEvent(Event evt) {
+                               IWorkbench iw = SecurityUiPlugin.getDefault().getWorkbench();
+                               IHandlerService handlerService = (IHandlerService) iw
+                                               .getService(IHandlerService.class);
+                               try {
+                                       handlerService.executeCommand(AddRole.COMMAND_ID, evt);
+                               } catch (Exception e) {
+                                       throw new ArgeoException("Cannot execute add role command",
+                                                       e);
+                               }
+                       }
+               });
+               // select all on focus
+               newRole.addListener(SWT.FocusIn, new Listener() {
+                       public void handleEvent(Event e) {
+                               newRole.selectAll();
+                       }
+               });
+
+               // roles table
+               Table table = new Table(parent, SWT.V_SCROLL | SWT.BORDER);
+               table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+               table.setLinesVisible(false);
+               table.setHeaderVisible(false);
+               viewer = new TableViewer(table);
+               viewer.setContentProvider(new RolesContentProvider());
+               viewer.setLabelProvider(new UsersLabelProvider());
+               viewer.setInput(getViewSite());
+               viewer.addDoubleClickListener(new ViewDoubleClickListener());
+       }
+
+       @Override
+       public void setFocus() {
+               viewer.getTable().setFocus();
+       }
+
+       public void setSecurityService(ArgeoSecurityService securityService) {
+               this.securityService = securityService;
+       }
+
+       public String getAddNewRoleText() {
+               return addNewRoleText;
+       }
+
+       private class RolesContentProvider implements IStructuredContentProvider {
+
+               public Object[] getElements(Object inputElement) {
+                       return securityService.listEditableRoles().toArray();
+               }
+
+               public void dispose() {
+               }
+
+               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+               }
+
+       }
+
+       private class UsersLabelProvider extends LabelProvider implements
+                       ITableLabelProvider {
+               public String getColumnText(Object element, int columnIndex) {
+                       return element.toString();
+               }
+
+               public Image getColumnImage(Object element, int columnIndex) {
+                       return null;
+               }
+
+       }
+
+       class ViewDoubleClickListener implements IDoubleClickListener {
+               public void doubleClick(DoubleClickEvent evt) {
+                       Object obj = ((IStructuredSelection) evt.getSelection())
+                                       .getFirstElement();
+
+                       if (obj instanceof ArgeoUser) {
+                               ArgeoUser argeoUser = (ArgeoUser) obj;
+
+                               IWorkbench iw = SecurityUiPlugin.getDefault().getWorkbench();
+                               IHandlerService handlerService = (IHandlerService) iw
+                                               .getService(IHandlerService.class);
+                               try {
+                                       String commandId = OpenArgeoUserEditor.COMMAND_ID;
+                                       String paramName = OpenArgeoUserEditor.PARAM_USERNAME;
+
+                                       // TODO: factorize this
+                                       // execute related command
+                                       IWorkbenchWindow window = iw.getActiveWorkbenchWindow();
+                                       ICommandService cmdService = (ICommandService) window
+                                                       .getService(ICommandService.class);
+                                       Command cmd = cmdService.getCommand(commandId);
+                                       ArrayList<Parameterization> parameters = new ArrayList<Parameterization>();
+                                       IParameter iparam = cmd.getParameter(paramName);
+                                       Parameterization param = new Parameterization(iparam,
+                                                       argeoUser.getUsername());
+                                       parameters.add(param);
+                                       ParameterizedCommand pc = new ParameterizedCommand(cmd,
+                                                       parameters.toArray(new Parameterization[parameters
+                                                                       .size()]));
+                                       handlerService = (IHandlerService) window
+                                                       .getService(IHandlerService.class);
+                                       handlerService.executeCommand(pc, null);
+                               } catch (Exception e) {
+                                       throw new ArgeoException("Cannot open editor", e);
+                               }
+
+                       }
+               }
+       }
+
+       public String getNewRole() {
+               return newRole.getText();
+       }
+
+       public void refresh() {
+               viewer.refresh();
+               newRole.setText(addNewRoleText);
+       }
+}
diff --git a/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/views/UsersView.java b/security/plugins/org.argeo.security.ui/src/main/java/org/argeo/security/ui/views/UsersView.java
new file mode 100644 (file)
index 0000000..5d78178
--- /dev/null
@@ -0,0 +1,174 @@
+package org.argeo.security.ui.views;
+
+import java.util.ArrayList;
+
+import org.argeo.ArgeoException;
+import org.argeo.security.ArgeoSecurityService;
+import org.argeo.security.ArgeoUser;
+import org.argeo.security.nature.SimpleUserNature;
+import org.argeo.security.ui.CurrentUser;
+import org.argeo.security.ui.SecurityUiPlugin;
+import org.argeo.security.ui.commands.OpenArgeoUserEditor;
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.IParameter;
+import org.eclipse.core.commands.Parameterization;
+import org.eclipse.core.commands.ParameterizedCommand;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.handlers.IHandlerService;
+import org.eclipse.ui.part.ViewPart;
+
+/** List all users. */
+public class UsersView extends ViewPart {
+       public final static String ID = "org.argeo.security.ui.usersView";
+
+       private TableViewer viewer;
+       private ArgeoSecurityService securityService;
+
+       private String simpleNatureType = null;
+
+       @Override
+       public void createPartControl(Composite parent) {
+               viewer = new TableViewer(createTable(parent));
+               viewer.setContentProvider(new UsersContentProvider());
+               viewer.setLabelProvider(new UsersLabelProvider());
+               viewer.addDoubleClickListener(new ViewDoubleClickListener());
+               viewer.setInput(getViewSite());
+       }
+
+       protected Table createTable(Composite parent) {
+               Table table = new Table(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+               table.setLinesVisible(true);
+               table.setHeaderVisible(true);
+               TableColumn column = new TableColumn(table, SWT.LEFT, 0);
+               column.setText("User");
+               column.setWidth(50);
+               column = new TableColumn(table, SWT.LEFT, 1);
+               column.setText("First Name");
+               column.setWidth(100);
+               column = new TableColumn(table, SWT.LEFT, 2);
+               column.setText("Last Name");
+               column.setWidth(100);
+               column = new TableColumn(table, SWT.LEFT, 3);
+               column.setText("E-mail");
+               column.setWidth(100);
+               return table;
+       }
+
+       @Override
+       public void setFocus() {
+               viewer.getTable().setFocus();
+       }
+
+       public void setSecurityService(ArgeoSecurityService securityService) {
+               this.securityService = securityService;
+       }
+
+       public void setSimpleNatureType(String simpleNatureType) {
+               this.simpleNatureType = simpleNatureType;
+       }
+
+       public void refresh() {
+               viewer.refresh();
+       }
+
+       private class UsersContentProvider implements IStructuredContentProvider {
+
+               public Object[] getElements(Object inputElement) {
+                       return securityService.listUsers().toArray();
+               }
+
+               public void dispose() {
+               }
+
+               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+               }
+
+       }
+
+       private class UsersLabelProvider extends LabelProvider implements
+                       ITableLabelProvider {
+               public String getColumnText(Object element, int columnIndex) {
+                       String currentUsername = CurrentUser.getUsername();
+                       ArgeoUser user = (ArgeoUser) element;
+                       SimpleUserNature simpleNature = SimpleUserNature
+                                       .findSimpleUserNature(user, simpleNatureType);
+                       switch (columnIndex) {
+                       case 0:
+                               String userName = user.getUsername();
+                               if (userName.equals(currentUsername))
+                                       userName = userName + "*";
+                               return userName;
+                       case 1:
+                               return simpleNature.getFirstName();
+                       case 2:
+                               return simpleNature.getLastName();
+                       case 3:
+                               return simpleNature.getEmail();
+                       default:
+                               throw new ArgeoException("Unmanaged column " + columnIndex);
+                       }
+               }
+
+               public Image getColumnImage(Object element, int columnIndex) {
+                       // TODO Auto-generated method stub
+                       return null;
+               }
+
+       }
+
+       class ViewDoubleClickListener implements IDoubleClickListener {
+               public void doubleClick(DoubleClickEvent evt) {
+                       Object obj = ((IStructuredSelection) evt.getSelection())
+                                       .getFirstElement();
+
+                       if (obj instanceof ArgeoUser) {
+                               ArgeoUser argeoUser = (ArgeoUser) obj;
+
+                               IWorkbench iw = SecurityUiPlugin.getDefault().getWorkbench();
+                               IHandlerService handlerService = (IHandlerService) iw
+                                               .getService(IHandlerService.class);
+                               try {
+                                       String commandId = OpenArgeoUserEditor.COMMAND_ID;
+                                       String paramName = OpenArgeoUserEditor.PARAM_USERNAME;
+
+                                       // TODO: factorize this
+                                       // execute related command
+                                       IWorkbenchWindow window = iw.getActiveWorkbenchWindow();
+                                       ICommandService cmdService = (ICommandService) window
+                                                       .getService(ICommandService.class);
+                                       Command cmd = cmdService.getCommand(commandId);
+                                       ArrayList<Parameterization> parameters = new ArrayList<Parameterization>();
+                                       IParameter iparam = cmd.getParameter(paramName);
+                                       Parameterization param = new Parameterization(iparam,
+                                                       argeoUser.getUsername());
+                                       parameters.add(param);
+                                       ParameterizedCommand pc = new ParameterizedCommand(cmd,
+                                                       parameters.toArray(new Parameterization[parameters
+                                                                       .size()]));
+                                       handlerService = (IHandlerService) window
+                                                       .getService(IHandlerService.class);
+                                       handlerService.executeCommand(pc, null);
+                               } catch (Exception e) {
+                                       throw new ArgeoException("Cannot open editor", e);
+                               }
+
+                       }
+               }
+       }
+
+}
diff --git a/security/plugins/pom.xml b/security/plugins/pom.xml
new file mode 100644 (file)
index 0000000..ab837fe
--- /dev/null
@@ -0,0 +1,89 @@
+<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.argeo.commons.security</groupId>
+               <version>0.2.3-SNAPSHOT</version>
+               <artifactId>eclipse</artifactId>
+               <relativePath>..</relativePath>
+       </parent>
+       <artifactId>plugins</artifactId>
+       <name>Commons Security Eclipse plugins</name>
+       <packaging>pom</packaging>
+       <modules>
+               <module>org.argeo.security.equinox</module>
+               <module>org.argeo.security.ui</module>
+               <module>org.argeo.security.ui.application</module>
+               <module>org.argeo.security.ui.rap</module>
+       </modules>
+       <build>
+               <resources>
+                       <resource>
+                               <directory>src/main/resources</directory>
+                       </resource>
+                       <resource>
+                               <directory>.</directory>
+                               <includes>
+                                       <include>plugin.xml</include>
+                                       <include>META-INF/**</include>
+                                       <include>jaas/**</include>
+                                       <include>icons/**</include>
+                               </includes>
+                       </resource>
+               </resources>
+               <plugins>
+                       <plugin>
+                               <artifactId>maven-clean-plugin</artifactId>
+                               <configuration>
+                                       <filesets>
+                                               <fileset>
+                                                       <directory>META-INF</directory>
+                                                       <includes>
+                                                               <include>MANIFEST.MF</include>
+                                                       </includes>
+                                               </fileset>
+                                       </filesets>
+                               </configuration>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-jar-plugin</artifactId>
+                               <configuration>
+                                       <archive>
+                                               <manifestFile>META-INF/MANIFEST.MF</manifestFile>
+                                       </archive>
+                               </configuration>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-source-plugin</artifactId>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-surefire-plugin</artifactId>
+                       </plugin>
+                       <plugin>
+                               <groupId>org.apache.felix</groupId>
+                               <artifactId>maven-bundle-plugin</artifactId>
+                               <configuration>
+                                       <manifestLocation>META-INF</manifestLocation>
+                                       <instructions>
+                                               <Bundle-SymbolicName>${pom.artifactId};singleton:=true</Bundle-SymbolicName>
+                                       </instructions>
+                               </configuration>
+                       </plugin>
+               </plugins>
+       </build>
+       <dependencies>
+               <dependency>
+                       <groupId>org.argeo.commons.osgi</groupId>
+                       <artifactId>org.argeo.osgi.boot</artifactId>
+                       <version>0.2.3-SNAPSHOT</version>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>javax.xml.stream</groupId>
+                       <artifactId>com.springsource.javax.xml.stream</artifactId>
+                       <scope>test</scope>
+               </dependency>
+       </dependencies>
+</project>