syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [1/5] syncope git commit: [SYNCOPE-718] archetype
Date Tue, 10 Nov 2015 17:33:30 GMT
Repository: syncope
Updated Branches:
  refs/heads/master b206d9b32 -> e8eceae0f


[SYNCOPE-718] archetype


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/02bd1e39
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/02bd1e39
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/02bd1e39

Branch: refs/heads/master
Commit: 02bd1e390d99962f1d7e9f574b94f1e2474b0d2d
Parents: b206d9b
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Tue Nov 10 17:06:33 2015 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Tue Nov 10 17:06:33 2015 +0100

----------------------------------------------------------------------
 archetype/pom.xml                               |  29 ++-
 .../META-INF/maven/archetype-metadata.xml       |  13 +
 .../archetype-resources/enduser/pom.xml         | 246 +++++++++++++++++++
 archetype/src/main/resources/meta-pom.xml       |   7 +
 .../console/SyncopeConsoleApplication.java      |   6 +-
 .../enduser/SyncopeEnduserApplication.java      |  89 ++++++-
 .../client/enduser/SyncopeEnduserSession.java   | 129 ++--------
 .../resources/UserSelfCreateResource.java       |   4 +-
 .../src/main/resources/enduser.properties       |  17 +-
 .../enduser/SyncopeEnduserApplicationTest.java  |   9 +-
 .../src/main/resources/log4j2.xml               |   4 -
 fit/enduser-reference/pom.xml                   |  29 +--
 .../src/main/resources/enduser.properties       |  17 +-
 .../src/main/resources/log4j2.xml               |  12 +-
 14 files changed, 434 insertions(+), 177 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/02bd1e39/archetype/pom.xml
----------------------------------------------------------------------
diff --git a/archetype/pom.xml b/archetype/pom.xml
index c62180e..9e9d18f 100644
--- a/archetype/pom.xml
+++ b/archetype/pom.xml
@@ -51,7 +51,7 @@ under the License.
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-archetype-plugin</artifactId>
-          <version>2.3</version>
+          <version>2.4</version>
           <extensions>true</extensions>
         </plugin>
       </plugins>
@@ -201,7 +201,6 @@ under the License.
         <directory>../client/console/src/main/resources</directory>
         <targetPath>${project.build.outputDirectory}/archetype-resources/console/src/main/resources</targetPath>
         <includes>
-          <include>consoleContext.xml</include>
           <include>console.properties</include>
         </includes>
       </resource>
@@ -225,6 +224,32 @@ under the License.
         <directory>../fit/console-reference/src/main/webapp/WEB-INF</directory>
         <targetPath>${project.build.outputDirectory}/archetype-resources/console/src/main/webapp/WEB-INF</targetPath>
       </resource>
+      
+      <resource>
+        <directory>../client/enduser/src/main/resources</directory>
+        <targetPath>${project.build.outputDirectory}/archetype-resources/enduser/src/main/resources</targetPath>
+        <includes>
+          <include>enduser.properties</include>
+        </includes>
+      </resource>
+      <resource>
+        <directory>../fit/enduser-reference/src/main/resources</directory>
+        <targetPath>${project.build.outputDirectory}/archetype-resources/enduser/src/main/resources</targetPath>
+        <includes>
+          <include>log4j2.xml</include>
+        </includes>
+      </resource>
+      <resource>
+        <directory>../fit/enduser-reference/src/main/resources</directory>
+        <targetPath>${project.build.outputDirectory}/archetype-resources/enduser/src/test/resources</targetPath>
+        <includes>
+          <include>enduser.properties</include>
+        </includes>
+      </resource>
+      <resource>
+        <directory>../fit/enduser-reference/src/main/webapp/WEB-INF</directory>
+        <targetPath>${project.build.outputDirectory}/archetype-resources/enduser/src/main/webapp/WEB-INF</targetPath>
+      </resource>
     </resources>
   </build>
   

http://git-wip-us.apache.org/repos/asf/syncope/blob/02bd1e39/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
index 99d107b..fc39cb5 100644
--- a/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -62,5 +62,18 @@ under the License.
         </fileSet>
       </fileSets>
     </module>
+    <module id="enduser" dir="enduser" name="enduser">
+      <fileSets>
+        <fileSet filtered="false" encoding="UTF-8">
+          <directory>src/main/resources</directory>
+        </fileSet>
+        <fileSet filtered="false" encoding="UTF-8">
+          <directory>src/main/webapp</directory>
+        </fileSet>
+        <fileSet filtered="false" encoding="UTF-8">
+          <directory>src/test/resources</directory>
+        </fileSet>
+      </fileSets>
+    </module>
   </modules>
 </archetype-descriptor>

http://git-wip-us.apache.org/repos/asf/syncope/blob/02bd1e39/archetype/src/main/resources/archetype-resources/enduser/pom.xml
----------------------------------------------------------------------
diff --git a/archetype/src/main/resources/archetype-resources/enduser/pom.xml b/archetype/src/main/resources/archetype-resources/enduser/pom.xml
new file mode 100644
index 0000000..8a079a9
--- /dev/null
+++ b/archetype/src/main/resources/archetype-resources/enduser/pom.xml
@@ -0,0 +1,246 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<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/xsd/maven-4.0.0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>${groupId}</groupId>
+    <artifactId>${rootArtifactId}</artifactId>
+    <version>${version}</version>
+  </parent>
+
+  <name>Apache Syncope sample project - Enduser</name>
+  <groupId>${groupId}</groupId>
+  <artifactId>${artifactId}</artifactId>
+  <packaging>war</packaging>
+
+  <dependencies>
+
+    <dependency> 
+      <groupId>javax.servlet</groupId> 
+      <artifactId>javax.servlet-api</artifactId> 
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet.jsp</groupId>
+      <artifactId>javax.servlet.jsp-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>jstl</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>${groupId}</groupId>
+      <artifactId>common</artifactId>
+      <version>${project.version}</version>
+    </dependency>  
+    
+    <dependency>
+      <groupId>org.apache.syncope.client</groupId>
+      <artifactId>syncope-client-enduser</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-core</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.lmax</groupId>
+      <artifactId>disruptor</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-slf4j-impl</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>jcl-over-slf4j</artifactId>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <finalName>syncope-enduser</finalName>
+
+    <plugins>      
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-war-plugin</artifactId>
+        <inherited>true</inherited>
+        <configuration>
+          <failOnMissingWebXml>false</failOnMissingWebXml>
+        </configuration>
+      </plugin>
+    </plugins>
+
+    <resources>
+      <resource>
+        <directory>src/main/resources</directory>
+        <filtering>true</filtering>
+      </resource>
+    </resources>
+
+    <testResources>
+      <testResource>
+        <directory>src/test/resources</directory>
+        <filtering>true</filtering>
+      </testResource>
+    </testResources>
+  </build>
+
+  <profiles>
+    <profile>
+      <id>embedded</id>
+      
+      <properties>
+        <conf.directory>${project.build.directory}/test-classes</conf.directory>
+      </properties>
+      
+      <dependencies>
+        <dependency>
+          <groupId>org.apache.syncope.fit</groupId>
+          <artifactId>syncope-fit-build-tools</artifactId>
+          <version>${syncope.version}</version>
+          <type>war</type>
+          <scope>test</scope>
+        </dependency>
+        <dependency>
+          <groupId>net.tirasa.connid.bundles.soap</groupId>
+          <artifactId>wssample</artifactId>
+          <type>war</type>
+          <scope>test</scope>
+        </dependency>
+        <dependency>
+          <groupId>com.h2database</groupId>
+          <artifactId>h2</artifactId>
+          <scope>test</scope>
+        </dependency>
+      </dependencies>
+      
+      <build>
+        <defaultGoal>clean verify cargo:run</defaultGoal>  
+        
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-antrun-plugin</artifactId>
+            <inherited>true</inherited>
+            <executions>
+              <execution>
+                <id>setupEmbeddedConf</id>
+                <phase>package</phase>
+                <configuration>
+                  <target>
+                    <delete dir="../core/target/syncope/WEB-INF/classes/domains"/>
+                    <copy todir="../core/target/syncope/WEB-INF/classes/domains">
+                      <fileset dir="../core/target/test-classes/domains"/>
+                    </copy>
+                    <copy file="../core/target/test-classes/connid.properties" 
+                          todir="../core/target/syncope/WEB-INF/classes" 
+                          overwrite="true"/>
+                    <copy file="../core/target/test-classes/db.jsp" 
+                          todir="../core/target/syncope" 
+                          overwrite="true"/>
+
+                    <copy file="${project.build.directory}/test-classes/enduser.properties"

+                          todir="${project.build.directory}/${project.build.finalName}/WEB-INF/classes"

+                          overwrite="true"/>
+                  </target>
+                </configuration>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+      
+          <plugin>
+            <groupId>org.codehaus.cargo</groupId>
+            <artifactId>cargo-maven2-plugin</artifactId>
+            <inherited>true</inherited>
+            <configuration>
+              <container>
+                <dependencies>
+                  <dependency>
+                    <groupId>com.h2database</groupId>
+                    <artifactId>h2</artifactId>
+                  </dependency>
+                </dependencies>
+              </container>
+              <configuration>
+                <type>standalone</type>
+                <properties>
+                  <cargo.servlet.port>${cargo.servlet.port}</cargo.servlet.port>
+                  <cargo.tomcat.ajp.port>${cargo.tomcat.ajp.port}</cargo.tomcat.ajp.port>
+                  <cargo.rmi.port>${cargo.rmi.port}</cargo.rmi.port>
+
+                  <cargo.jvmargs>-noverify -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC
-XX:MaxPermSize=256m</cargo.jvmargs>
+                </properties>
+              </configuration>
+              <deployables>
+                <deployable>
+                  <groupId>net.tirasa.connid.bundles.soap</groupId>
+                  <artifactId>wssample</artifactId>
+                  <type>war</type>
+                  <properties>
+                    <context>wssample</context>
+                  </properties>
+                </deployable>
+                <deployable>
+                  <groupId>org.apache.syncope.fit</groupId>
+                  <artifactId>syncope-fit-build-tools</artifactId>
+                  <type>war</type>
+                  <properties>
+                    <context>syncope-fit-build-tools</context>
+                  </properties>
+                </deployable>
+                <deployable>
+                  <location>../core/target/syncope</location>
+                  <properties>
+                    <context>syncope</context>
+                  </properties>
+                </deployable>
+                <deployable>
+                  <location>${project.build.directory}/${project.build.finalName}</location>
+                  <properties>
+                    <context>syncope-enduser</context>
+                  </properties>
+                </deployable>
+              </deployables>
+            </configuration>
+          </plugin>
+        </plugins>  
+      </build>
+    </profile>
+  </profiles>
+</project>

http://git-wip-us.apache.org/repos/asf/syncope/blob/02bd1e39/archetype/src/main/resources/meta-pom.xml
----------------------------------------------------------------------
diff --git a/archetype/src/main/resources/meta-pom.xml b/archetype/src/main/resources/meta-pom.xml
index e7a6487..47a2d5e 100644
--- a/archetype/src/main/resources/meta-pom.xml
+++ b/archetype/src/main/resources/meta-pom.xml
@@ -79,6 +79,12 @@ under the License.
         <artifactId>syncope-client-console</artifactId>
         <version>${syncope.version}</version>
       </dependency>
+
+      <dependency>
+        <groupId>org.apache.syncope.client</groupId>
+        <artifactId>syncope-client-enduser</artifactId>
+        <version>${syncope.version}</version>
+      </dependency>
     </dependencies>
   </dependencyManagement>
     
@@ -104,6 +110,7 @@ under the License.
     <module>common</module>
     <module>core</module>
     <module>console</module>
+    <module>enduser</module>
   </modules>
 
 </project>

http://git-wip-us.apache.org/repos/asf/syncope/blob/02bd1e39/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
index ec65024..34f7fe9 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/SyncopeConsoleApplication.java
@@ -53,14 +53,10 @@ import org.apache.wicket.protocol.http.WebApplication;
 import org.apache.wicket.request.resource.IResource;
 import org.apache.wicket.request.resource.ResourceReference;
 import org.apache.wicket.resource.DynamicJQueryResourceReference;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.springframework.util.Assert;
 
 public class SyncopeConsoleApplication extends AuthenticatedWebApplication {
 
-    private static final Logger LOG = LoggerFactory.getLogger(SyncopeConsoleApplication.class);
-
     private static final String CONSOLE_PROPERTIES = "console.properties";
 
     public static final List<Locale> SUPPORTED_LOCALES = Collections.unmodifiableList(Arrays.asList(
@@ -101,7 +97,7 @@ public class SyncopeConsoleApplication extends AuthenticatedWebApplication
{
                 File consoleDirProps = FileUtils.getFile(consoleDir, CONSOLE_PROPERTIES);
                 if (consoleDirProps.exists() && consoleDirProps.canRead() &&
consoleDirProps.isFile()) {
                     props.clear();
-                    props.load(FileUtils.openInputStream(consoleDir));
+                    props.load(FileUtils.openInputStream(consoleDirProps));
                 }
             }
         } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/02bd1e39/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
index 7d014d7..c708502 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserApplication.java
@@ -18,12 +18,15 @@
  */
 package org.apache.syncope.client.enduser;
 
+import java.io.File;
 import java.io.Serializable;
 import org.apache.syncope.client.enduser.pages.HomePage;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.Locale;
+import java.util.Properties;
+import org.apache.commons.io.FileUtils;
 import org.apache.syncope.client.enduser.resources.LoginResource;
 import org.apache.syncope.client.enduser.resources.LogoutResource;
 import org.apache.syncope.client.enduser.resources.SchemaResource;
@@ -31,31 +34,86 @@ import org.apache.syncope.client.enduser.resources.SecurityQuestionResource;
 import org.apache.syncope.client.enduser.resources.UserSelfCreateResource;
 import org.apache.syncope.client.enduser.resources.UserSelfReadResource;
 import org.apache.syncope.client.enduser.resources.UserSelfUpdateResource;
+import org.apache.syncope.client.lib.SyncopeClientFactoryBean;
 import org.apache.wicket.Page;
 import org.apache.wicket.Session;
+import org.apache.wicket.WicketRuntimeException;
 import org.apache.wicket.protocol.http.WebApplication;
 import org.apache.wicket.request.Request;
 import org.apache.wicket.request.Response;
 import org.apache.wicket.request.resource.IResource;
 import org.apache.wicket.request.resource.ResourceReference;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.springframework.util.Assert;
 
 public class SyncopeEnduserApplication extends WebApplication implements Serializable {
 
     private static final long serialVersionUID = -6445919351044845120L;
 
-    private static final Logger LOG = LoggerFactory.getLogger(SyncopeEnduserApplication.class);
+    private static final String ENDUSER_PROPERTIES = "enduser.properties";
 
     public static final List<Locale> SUPPORTED_LOCALES = Collections.unmodifiableList(Arrays.asList(
             new Locale[] {
                 Locale.ENGLISH, Locale.ITALIAN, new Locale("pt", "BR")
             }));
 
+    public static SyncopeEnduserApplication get() {
+        return (SyncopeEnduserApplication) WebApplication.get();
+    }
+
+    private String version;
+
+    private String site;
+
+    private String license;
+
+    private String anonymousUser;
+
+    private String anonymousKey;
+
+    private SyncopeClientFactoryBean clientFactory;
+
     @Override
     protected void init() {
         super.init();
 
+        // read enduser.properties
+        Properties props = new Properties();
+        try {
+            props.load(getClass().getResourceAsStream("/" + ENDUSER_PROPERTIES));
+            File enduserDir = new File(props.getProperty("enduser.directory"));
+            if (enduserDir.exists() && enduserDir.canRead() && enduserDir.isDirectory())
{
+                File enduserDirProps = FileUtils.getFile(enduserDir, ENDUSER_PROPERTIES);
+                if (enduserDirProps.exists() && enduserDirProps.canRead() &&
enduserDirProps.isFile()) {
+                    props.clear();
+                    props.load(FileUtils.openInputStream(enduserDirProps));
+                }
+            }
+        } catch (Exception e) {
+            throw new WicketRuntimeException("Could not read " + ENDUSER_PROPERTIES, e);
+        }
+        version = props.getProperty("version");
+        Assert.notNull(version, "<version> not set");
+        site = props.getProperty("site");
+        Assert.notNull(site, "<site> not set");
+        license = props.getProperty("license");
+        Assert.notNull(license, "<license> not set");
+        anonymousUser = props.getProperty("anonymousUser");
+        Assert.notNull(anonymousUser, "<anonymousUser> not set");
+        anonymousKey = props.getProperty("anonymousKey");
+        Assert.notNull(anonymousKey, "<anonymousKey> not set");
+
+        String scheme = props.getProperty("scheme");
+        Assert.notNull(scheme, "<scheme> not set");
+        String host = props.getProperty("host");
+        Assert.notNull(host, "<host> not set");
+        String port = props.getProperty("port");
+        Assert.notNull(port, "<port> not set");
+        String rootPath = props.getProperty("rootPath");
+        Assert.notNull(rootPath, "<rootPath> not set");
+
+        clientFactory = new SyncopeClientFactoryBean().setAddress(scheme + "://" + host +
":" + port + "/" + rootPath);
+        clientFactory.setContentType(SyncopeClientFactoryBean.ContentType.JSON);
+
         // resource to provide login functionality managed by wicket
         mountResource("/api/login", new ResourceReference("login") {
 
@@ -142,4 +200,29 @@ public class SyncopeEnduserApplication extends WebApplication implements
Seriali
     public Session newSession(final Request request, final Response response) {
         return new SyncopeEnduserSession(request);
     }
+
+    public String getVersion() {
+        return version;
+    }
+
+    public String getSite() {
+        return site;
+    }
+
+    public String getLicense() {
+        return license;
+    }
+
+    public String getAnonymousUser() {
+        return anonymousUser;
+    }
+
+    public String getAnonymousKey() {
+        return anonymousKey;
+    }
+
+    public SyncopeClientFactoryBean getClientFactory() {
+        return clientFactory;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/02bd1e39/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserSession.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserSession.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserSession.java
index f91a4d6..bbea57b 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserSession.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/SyncopeEnduserSession.java
@@ -18,17 +18,14 @@
  */
 package org.apache.syncope.client.enduser;
 
-import java.io.File;
 import java.text.DateFormat;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Locale;
 import java.util.Map;
-import java.util.Properties;
 import java.util.Set;
 import javax.ws.rs.core.EntityTag;
 import javax.ws.rs.core.MediaType;
-import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.cxf.jaxrs.client.WebClient;
 import org.apache.syncope.client.lib.SyncopeClient;
@@ -52,36 +49,14 @@ public class SyncopeEnduserSession extends WebSession {
 
     private static final Logger LOG = LoggerFactory.getLogger(SyncopeEnduserSession.class);
 
-    protected static final String ENDUSER_PROPERTIES = "enduser.properties";
+    private final SyncopeClient anonymousClient;
+
+    private SyncopeClient client;
 
     private String username;
 
     private String password;
 
-    private String scheme;
-
-    private String host;
-
-    private String port;
-
-    private String rootPath;
-
-    private String anonymousUser;
-
-    private String anonymousKey;
-
-    private Boolean storePassword;
-
-    private String version;
-
-    private String license;
-
-    private final SyncopeClientFactoryBean clientFactory;
-
-    private SyncopeClient client;
-
-    private final SyncopeClient anonymousClient;
-
     private final SyncopeTO syncopeTO;
 
     private UserTO selfTO;
@@ -95,21 +70,9 @@ public class SyncopeEnduserSession extends WebSession {
     public SyncopeEnduserSession(final Request request) {
         super(request);
 
-        // load properties from classpath file
-        loadProperties();
-
-        clientFactory = new SyncopeClientFactoryBean();
-        clientFactory.setAddress(new StringBuilder(scheme)
-                .append("://")
-                .append(host)
-                .append(":")
-                .append(port)
-                .append("/")
-                .append(rootPath)
-                .toString());
-        clientFactory.setContentType(SyncopeClientFactoryBean.ContentType.JSON);
-
-        anonymousClient = clientFactory.create(anonymousUser, anonymousKey);
+        anonymousClient = SyncopeEnduserApplication.get().getClientFactory().create(
+                SyncopeEnduserApplication.get().getAnonymousUser(),
+                SyncopeEnduserApplication.get().getAnonymousKey());
         syncopeTO = anonymousClient.getService(SyncopeService.class).info();
 
     }
@@ -118,7 +81,8 @@ public class SyncopeEnduserSession extends WebSession {
         boolean authenticated = false;
 
         try {
-            client = clientFactory.setDomain(SyncopeConstants.MASTER_DOMAIN).create(username,
password);
+            client = SyncopeEnduserApplication.get().getClientFactory().
+                    setDomain(SyncopeConstants.MASTER_DOMAIN).create(username, password);
 
             Pair<Map<String, Set<String>>, UserTO> self = client.self();
             selfTO = self.getValue();
@@ -169,12 +133,15 @@ public class SyncopeEnduserSession extends WebSession {
     public <T> T getService(final MediaType mediaType, final Class<T> serviceClass)
{
         T service;
 
-        synchronized (clientFactory) {
-            SyncopeClientFactoryBean.ContentType preType = clientFactory.getContentType();
+        synchronized (SyncopeEnduserApplication.get().getClientFactory()) {
+            SyncopeClientFactoryBean.ContentType preType = SyncopeEnduserApplication.get().getClientFactory().
+                    getContentType();
 
-            clientFactory.setContentType(SyncopeClientFactoryBean.ContentType.fromString(mediaType.toString()));
-            service = clientFactory.create(username, password).getService(serviceClass);
-            clientFactory.setContentType(preType);
+            SyncopeEnduserApplication.get().getClientFactory().
+                    setContentType(SyncopeClientFactoryBean.ContentType.fromString(mediaType.toString()));
+            service = SyncopeEnduserApplication.get().getClientFactory().
+                    create(username, password).getService(serviceClass);
+            SyncopeEnduserApplication.get().getClientFactory().setContentType(preType);
         }
 
         return service;
@@ -188,42 +155,6 @@ public class SyncopeEnduserSession extends WebSession {
         return password;
     }
 
-    public String getScheme() {
-        return scheme;
-    }
-
-    public String getHost() {
-        return host;
-    }
-
-    public String getPort() {
-        return port;
-    }
-
-    public String getRootPath() {
-        return rootPath;
-    }
-
-    public String getAnonymousUser() {
-        return anonymousUser;
-    }
-
-    public String getAnonymousKey() {
-        return anonymousKey;
-    }
-
-    public Boolean storePassword() {
-        return this.storePassword;
-    }
-
-    public String getVersion() {
-        return version;
-    }
-
-    public String getLicense() {
-        return license;
-    }
-
     public SyncopeTO getSyncopeTO() {
         return syncopeTO;
     }
@@ -242,32 +173,4 @@ public class SyncopeEnduserSession extends WebSession {
         return DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, locale);
     }
 
-    private void loadProperties() {
-        Properties properties = new Properties();
-
-        try {
-            properties.load(getClass().getResourceAsStream("/" + ENDUSER_PROPERTIES));
-            File enduserDir = new File(properties.getProperty("enduser.directory"));
-            if (enduserDir.exists() && enduserDir.canRead() && enduserDir.isDirectory())
{
-                File enduserDirProps = FileUtils.getFile(enduserDir, ENDUSER_PROPERTIES);
-                if (enduserDirProps.exists() && enduserDirProps.canRead() &&
enduserDirProps.isFile()) {
-                    properties.clear();
-                    properties.load(FileUtils.openInputStream(enduserDir));
-                }
-            }
-        } catch (Exception e) {
-            LOG.error("Error loading {} file", ENDUSER_PROPERTIES, e);
-        }
-
-        this.scheme = properties.getProperty("scheme");
-        this.host = properties.getProperty("host");
-        this.port = properties.getProperty("port");
-        this.rootPath = properties.getProperty("rootPath");
-        this.anonymousUser = properties.getProperty("anonymousUser");
-        this.anonymousKey = properties.getProperty("anonymousKey");
-        this.storePassword = Boolean.valueOf(properties.getProperty("storePassword"));
-        version = properties.getProperty("version");
-        license = properties.getProperty("license");
-    }
-
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/02bd1e39/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfCreateResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfCreateResource.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfCreateResource.java
index 08cedb2..7e9341b 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfCreateResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/UserSelfCreateResource.java
@@ -20,7 +20,6 @@ package org.apache.syncope.client.enduser.resources;
 
 import java.io.IOException;
 import javax.servlet.http.HttpServletRequest;
-import org.apache.syncope.client.enduser.SyncopeEnduserSession;
 import org.apache.syncope.client.enduser.adapters.UserTOAdapter;
 import org.apache.syncope.client.enduser.model.UserTORequest;
 import org.apache.syncope.common.rest.api.service.UserSelfService;
@@ -61,8 +60,7 @@ public class UserSelfCreateResource extends AbstractBaseResource {
                 LOG.debug("Received user self registration request for user: [{}]", userTORequest.getUsername());
                 LOG.trace("Received user self registration request is: [{}]", userTORequest);
                 // adapt request and create user
-                userSelfService.create(userTOAdapter.fromUserTORequest(userTORequest, null),
-                        SyncopeEnduserSession.get().storePassword());
+                userSelfService.create(userTOAdapter.fromUserTORequest(userTORequest, null),
true);
                 responseMessage.append("User").append(userTORequest.getUsername()).append("created
successfully");
             } else {
                 responseMessage.append(userTORequest == null

http://git-wip-us.apache.org/repos/asf/syncope/blob/02bd1e39/client/enduser/src/main/resources/enduser.properties
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/resources/enduser.properties b/client/enduser/src/main/resources/enduser.properties
index 4dd1cbe..30f4028 100644
--- a/client/enduser/src/main/resources/enduser.properties
+++ b/client/enduser/src/main/resources/enduser.properties
@@ -15,16 +15,15 @@
 # specific language governing permissions and limitations
 # under the License.
 enduser.directory=${conf.directory}
-scheme=http
-host=localhost
-port=8080
-rootPath=/syncope/rest/
-
-anonymousUser=${anonymousUser}
-anonymousKey=${anonymousKey}
-
-storePassword=true
 
 version=${syncope.version}
+site=${project.parent.url}
 license=${licenseUrl}
 
+anonymousUser=${anonymousUser}
+anonymousKey=${anonymousKey}
+
+scheme=http
+host=localhost
+port=8080
+rootPath=/syncope/rest/

http://git-wip-us.apache.org/repos/asf/syncope/blob/02bd1e39/client/enduser/src/test/java/org/apache/syncope/client/enduser/SyncopeEnduserApplicationTest.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/test/java/org/apache/syncope/client/enduser/SyncopeEnduserApplicationTest.java
b/client/enduser/src/test/java/org/apache/syncope/client/enduser/SyncopeEnduserApplicationTest.java
index 4a77739..860de89 100644
--- a/client/enduser/src/test/java/org/apache/syncope/client/enduser/SyncopeEnduserApplicationTest.java
+++ b/client/enduser/src/test/java/org/apache/syncope/client/enduser/SyncopeEnduserApplicationTest.java
@@ -38,7 +38,7 @@ public class SyncopeEnduserApplicationTest {
 
         private static final long serialVersionUID = -2500230416352618497L;
 
-        SyncopeEnduserMockSession(Request request) {
+        SyncopeEnduserMockSession(final Request request) {
             super(request);
         }
     }
@@ -50,7 +50,12 @@ public class SyncopeEnduserApplicationTest {
             private static final long serialVersionUID = 1445165406200746511L;
 
             @Override
-            public Session newSession(Request request, Response response) {
+            protected void init() {
+                // just skip over actual init
+            }
+
+            @Override
+            public Session newSession(final Request request, final Response response) {
                 return new SyncopeEnduserMockSession(request);
             }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/02bd1e39/fit/console-reference/src/main/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/fit/console-reference/src/main/resources/log4j2.xml b/fit/console-reference/src/main/resources/log4j2.xml
index a7c1fa6..18563df 100644
--- a/fit/console-reference/src/main/resources/log4j2.xml
+++ b/fit/console-reference/src/main/resources/log4j2.xml
@@ -48,10 +48,6 @@ under the License.
     <asyncLogger name="org.apache.wicket" additivity="false" level="ERROR">
       <appender-ref ref="main"/>
     </asyncLogger>
-
-    <asyncLogger name="org.springframework" additivity="false" level="ERROR">
-      <appender-ref ref="main"/>
-    </asyncLogger>
     
     <asyncLogger name="org.apache.cxf" additivity="false" level="ERROR">
       <appender-ref ref="main"/>

http://git-wip-us.apache.org/repos/asf/syncope/blob/02bd1e39/fit/enduser-reference/pom.xml
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/pom.xml b/fit/enduser-reference/pom.xml
index b88ce2d..a08ab4d 100644
--- a/fit/enduser-reference/pom.xml
+++ b/fit/enduser-reference/pom.xml
@@ -61,23 +61,19 @@ under the License.
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
-    </dependency><!--
--->    
+    </dependency>
     <dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-api</artifactId>
-    </dependency><!--
--->    
+    </dependency>
     <dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-core</artifactId>
-    </dependency><!--
--->    
+    </dependency>
     <dependency>
       <groupId>com.lmax</groupId>
       <artifactId>disruptor</artifactId>
-    </dependency><!--
--->    
+    </dependency>
     <dependency>
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-slf4j-impl</artifactId>
@@ -86,14 +82,13 @@ under the License.
       <groupId>commons-logging</groupId>
       <artifactId>commons-logging</artifactId>
       <scope>provided</scope>
-    </dependency><!--
--->    
+    </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>jcl-over-slf4j</artifactId>
     </dependency>
     
-    <!--   TEST -->
+    <!-- TEST -->
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
@@ -116,19 +111,7 @@ under the License.
       <groupId>com.h2database</groupId>
       <artifactId>h2</artifactId>
       <scope>test</scope>
-    </dependency><!--
-    
-     SELENIUM INTEGRATION TEST 
-    <dependency>
-      <groupId>org.seleniumhq.selenium</groupId>
-      <artifactId>selenium-java</artifactId>
-      <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>org.seleniumhq.selenium</groupId>
-      <artifactId>selenium-api</artifactId>
-      <scope>test</scope>
-    </dependency>-->
   </dependencies>
 
   <build>

http://git-wip-us.apache.org/repos/asf/syncope/blob/02bd1e39/fit/enduser-reference/src/main/resources/enduser.properties
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/main/resources/enduser.properties b/fit/enduser-reference/src/main/resources/enduser.properties
index 96b0dea..81d137e 100644
--- a/fit/enduser-reference/src/main/resources/enduser.properties
+++ b/fit/enduser-reference/src/main/resources/enduser.properties
@@ -15,16 +15,15 @@
 # specific language governing permissions and limitations
 # under the License.
 enduser.directory=${conf.directory}
-scheme=http
-host=localhost
-port=9080
-rootPath=/syncope/rest/
-
-anonymousUser=${anonymousUser}
-anonymousKey=${anonymousKey}
-
-storePassword=true
 
 version=${syncope.version}
+site=${project.parent.url}
 license=${licenseUrl}
 
+anonymousUser=${anonymousUser}
+anonymousKey=${anonymousKey}
+
+scheme=http
+host=localhost
+port=9080
+rootPath=/syncope/rest/

http://git-wip-us.apache.org/repos/asf/syncope/blob/02bd1e39/fit/enduser-reference/src/main/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/fit/enduser-reference/src/main/resources/log4j2.xml b/fit/enduser-reference/src/main/resources/log4j2.xml
index ced0e34..b0854a6 100644
--- a/fit/enduser-reference/src/main/resources/log4j2.xml
+++ b/fit/enduser-reference/src/main/resources/log4j2.xml
@@ -41,15 +41,19 @@ under the License.
       <appender-ref ref="main"/>
     </asyncLogger>
 
-    <asyncLogger name="org.apache.syncope.client.enduser" additivity="false" level="DEBUG">
+    <asyncLogger name="org.apache.syncope.client.console" additivity="false" level="ERROR">
       <appender-ref ref="main"/>
     </asyncLogger>
 
-    <asyncLogger name="org.apache.wicket" additivity="false" level="DEBUG">
+    <asyncLogger name="org.apache.wicket" additivity="false" level="ERROR">
       <appender-ref ref="main"/>
     </asyncLogger>
-
-    <root level="DEBUG">
+    
+    <asyncLogger name="org.apache.cxf" additivity="false" level="ERROR">
+      <appender-ref ref="main"/>
+    </asyncLogger>
+    
+    <root level="ERROR">
       <appender-ref ref="main"/>
     </root>
   


Mime
View raw message