You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by ma...@apache.org on 2015/12/15 18:08:22 UTC

[1/4] syncope git commit: Activiti option, SYNCOPE-637

Repository: syncope
Updated Branches:
  refs/heads/master ce7cad4e1 -> 3395c6ed6


Activiti option, SYNCOPE-637


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

Branch: refs/heads/master
Commit: 3395c6ed6a53f6b52ac0cb66d458e52d2c1c3bf1
Parents: 335d7f6
Author: Massimiliano Perrone <ma...@tirasa.net>
Authored: Tue Dec 15 18:03:59 2015 +0100
Committer: Massimiliano Perrone <ma...@tirasa.net>
Committed: Tue Dec 15 18:08:02 2015 +0100

----------------------------------------------------------------------
 installer/pom.xml                               |  6 ++
 .../apache/syncope/installer/files/CorePom.java |  5 ++
 .../installer/processes/ArchetypeProcess.java   | 69 ++++++++++++--------
 .../src/main/resources/installer.properties     |  1 +
 installer/src/main/resources/izpack/install.xml |  5 ++
 .../src/main/resources/izpack/userInputSpec.xml | 10 +--
 6 files changed, 64 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/3395c6ed/installer/pom.xml
----------------------------------------------------------------------
diff --git a/installer/pom.xml b/installer/pom.xml
index c69b4b4..3f0ae2c 100644
--- a/installer/pom.xml
+++ b/installer/pom.xml
@@ -195,6 +195,12 @@ under the License.
         </includes>
       </resource>
       <resource>
+        <directory>${basedir}/../fit/core-reference/src/main/resources</directory>
+        <includes>
+          <include>workflow.properties</include>
+        </includes>
+      </resource>
+      <resource>
         <directory>${basedir}</directory>
         <targetPath>META-INF</targetPath>
         <includes>

http://git-wip-us.apache.org/repos/asf/syncope/blob/3395c6ed/installer/src/main/java/org/apache/syncope/installer/files/CorePom.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/files/CorePom.java b/installer/src/main/java/org/apache/syncope/installer/files/CorePom.java
index 54f5685..36b4d37 100644
--- a/installer/src/main/java/org/apache/syncope/installer/files/CorePom.java
+++ b/installer/src/main/java/org/apache/syncope/installer/files/CorePom.java
@@ -48,6 +48,11 @@ public final class CorePom {
             + "    </dependency>\n"
             + "  </dependencies>\n";
 
+    public static final String ACTIVITI_PLACEHOLDER = "    <dependency>\n"
+            + "      <groupId>org.apache.syncope.core</groupId>\n"
+            + "      <artifactId>syncope-core-workflow-activiti</artifactId>\n"
+            + "    </dependency>\n";
+
     private CorePom() {
         // private constructor for static utility class
     }

http://git-wip-us.apache.org/repos/asf/syncope/blob/3395c6ed/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java b/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
index 9c3f184..66ca035 100644
--- a/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
+++ b/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
@@ -98,11 +98,12 @@ public class ArchetypeProcess extends BaseProcess {
 
         if (syncopeVersion.contains("SNAPSHOT")) {
             final File pomFile = new File(syncopeInstallDir + PROPERTIES.getProperty("pomFile"));
-            String contentPomFile = fileSystemUtils.readFile(pomFile);       
+            String contentPomFile = fileSystemUtils.readFile(pomFile);
             fileSystemUtils.
-                    writeToFile(pomFile, contentPomFile.replace(ParentPom.REPOSITORY_PLACEHOLDER, ParentPom.REPOSITORY_CONTENT_TO_ADD));
+                    writeToFile(pomFile, contentPomFile.replace(ParentPom.REPOSITORY_PLACEHOLDER,
+                            ParentPom.REPOSITORY_CONTENT_TO_ADD));
         }
-        
+
         if (swagger) {
             final File pomFile = new File(
                     syncopeInstallDir
@@ -115,7 +116,7 @@ public class ArchetypeProcess extends BaseProcess {
 
             fileSystemUtils.writeToFile(pomFile, contentPomFile);
         }
-        
+
         if (camel) {
             final File pomFile = new File(
                     syncopeInstallDir
@@ -128,7 +129,7 @@ public class ArchetypeProcess extends BaseProcess {
 
             fileSystemUtils.writeToFile(pomFile, contentPomFile);
             fileSystemUtils.copyFileFromResources("/provisioning.properties",
-                syncopeInstallDir + PROPERTIES.getProperty("provisioningPropertiesFile"), handler);
+                    syncopeInstallDir + PROPERTIES.getProperty("provisioningPropertiesFile"), handler);
         }
 
         fileSystemUtils.createDirectory(confDirectory);
@@ -136,29 +137,45 @@ public class ArchetypeProcess extends BaseProcess {
         fileSystemUtils.createDirectory(bundlesDirectory);
         fileSystemUtils.createDirectory(modelerDirectory);
 
-        fileSystemUtils.copyFileFromResources(File.separator + PROPERTIES.getProperty("modelerPomFile"),
-                modelerDirectory + File.separator + PROPERTIES.getProperty("pomFile"), handler);
-
-        final File modelerPomFile = new File(modelerDirectory + File.separator + PROPERTIES.getProperty("pomFile"));
+        if (activiti) {
+            fileSystemUtils.copyFileFromResources(File.separator + PROPERTIES.getProperty("modelerPomFile"),
+                    modelerDirectory + File.separator + PROPERTIES.getProperty("pomFile"), handler);
 
-        final String contentModelerPomFile = fileSystemUtils.readFile(modelerPomFile);
-        fileSystemUtils.
-                writeToFile(modelerPomFile, String.format(contentModelerPomFile, modelerDirectory));
+            final File modelerPomFile = new File(modelerDirectory + File.separator + PROPERTIES.getProperty("pomFile"));
 
-        fileSystemUtils.copyFile(
-                syncopeInstallDir
-                + PROPERTIES.getProperty("consoleResDirectory")
-                + File.separator + PROPERTIES.getProperty("urlConfig"),
-                modelerDirectory + File.separator + PROPERTIES.getProperty("urlConfig"));
-        fileSystemUtils.copyFile(
-                syncopeInstallDir
-                + PROPERTIES.getProperty("consoleResDirectory")
-                + File.separator + PROPERTIES.getProperty("saveModel"),
-                modelerDirectory + File.separator + PROPERTIES.getProperty("saveModel"));
+            final String contentModelerPomFile = fileSystemUtils.readFile(modelerPomFile);
+            fileSystemUtils.
+                    writeToFile(modelerPomFile, String.format(contentModelerPomFile, modelerDirectory));
+            fileSystemUtils.copyFile(
+                    syncopeInstallDir
+                    + PROPERTIES.getProperty("consoleResDirectory")
+                    + File.separator + PROPERTIES.getProperty("urlConfig"),
+                    modelerDirectory + File.separator + PROPERTIES.getProperty("urlConfig"));
+            fileSystemUtils.copyFile(
+                    syncopeInstallDir
+                    + PROPERTIES.getProperty("consoleResDirectory")
+                    + File.separator + PROPERTIES.getProperty("saveModel"),
+                    modelerDirectory + File.separator + PROPERTIES.getProperty("saveModel"));
+
+            final Properties modelerProperties = new Properties();
+            modelerProperties.setProperty("modeler.directory", modelerDirectory);
+            mavenUtils.mvnCleanPackageWithProperties(modelerDirectory, modelerProperties, customMavenProxySettings);
+            FileSystemUtils.delete(new File(modelerDirectory + File.separator + PROPERTIES.getProperty("saveModel")));
+            FileSystemUtils.delete(new File(modelerDirectory + File.separator + PROPERTIES.getProperty("urlConfig")));
+        } else {
+            final File pomFile = new File(
+                    syncopeInstallDir
+                    + File.separator
+                    + "core"
+                    + File.separator
+                    + PROPERTIES.getProperty("pomFile"));
+            String contentPomFile = fileSystemUtils.readFile(pomFile);
+            contentPomFile = contentPomFile.replace(CorePom.ACTIVITI_PLACEHOLDER, "");
+            fileSystemUtils.writeToFile(pomFile, contentPomFile);
 
-        final Properties modelerProperties = new Properties();
-        modelerProperties.setProperty("modeler.directory", modelerDirectory);
-        mavenUtils.mvnCleanPackageWithProperties(modelerDirectory, modelerProperties, customMavenProxySettings);
+            fileSystemUtils.copyFileFromResources("/workflow.properties",
+                    syncopeInstallDir + PROPERTIES.getProperty("workflowPropertiesFile"), handler);
+        }
 
         final Properties syncopeProperties = new Properties();
         syncopeProperties.setProperty("conf.directory", confDirectory);
@@ -166,7 +183,5 @@ public class ArchetypeProcess extends BaseProcess {
         syncopeProperties.setProperty("bundles.directory", bundlesDirectory);
         mavenUtils.mvnCleanPackageWithProperties(
                 installPath + File.separator + artifactId, syncopeProperties, customMavenProxySettings);
-        FileSystemUtils.delete(new File(modelerDirectory + File.separator + PROPERTIES.getProperty("saveModel")));
-        FileSystemUtils.delete(new File(modelerDirectory + File.separator + PROPERTIES.getProperty("urlConfig")));
     }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/3395c6ed/installer/src/main/resources/installer.properties
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/installer.properties b/installer/src/main/resources/installer.properties
index 3df89d7..febfa0b 100644
--- a/installer/src/main/resources/installer.properties
+++ b/installer/src/main/resources/installer.properties
@@ -23,6 +23,7 @@ enduserResDirectory=enduser/src/main/resources
 pomFile=pom.xml
 masterDomainFile=core/src/main/resources/domains/MasterDomain.xml
 coreMetaInfDirectory=core/src/main/resources/META-INF
+workflowPropertiesFile=core/src/main/resources/workflow.properties
 provisioningPropertiesFile=core/src/main/resources/provisioning.properties
 masterPropertiesFile=core/src/main/resources/domains/Master.properties
 consolePropertiesFile=console.properties

http://git-wip-us.apache.org/repos/asf/syncope/blob/3395c6ed/installer/src/main/resources/izpack/install.xml
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/install.xml b/installer/src/main/resources/izpack/install.xml
index f0dfed5..327cf10 100644
--- a/installer/src/main/resources/izpack/install.xml
+++ b/installer/src/main/resources/izpack/install.xml
@@ -70,6 +70,11 @@ under the License.
       <value>true</value>
     </condition>
     
+    <condition type="variable" id="options.choice.activiti">
+      <name>options.activiti.workflow.adapter</name>
+      <value>true</value>
+    </condition>
+    
     <condition type="variable" id="postgres.choice">
       <name>install.type.selection</name>
       <value>postgres</value>

http://git-wip-us.apache.org/repos/asf/syncope/blob/3395c6ed/installer/src/main/resources/izpack/userInputSpec.xml
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/userInputSpec.xml b/installer/src/main/resources/izpack/userInputSpec.xml
index 0691f2f..5e91249 100644
--- a/installer/src/main/resources/izpack/userInputSpec.xml
+++ b/installer/src/main/resources/izpack/userInputSpec.xml
@@ -52,10 +52,6 @@ under the License.
       <spec id="archetype.mvn.log.directory" size="20" set="/var/tmp/syncope/log" mustExist="false" create="true"/>
     </field>
     <field type="space"/>
-    <field type="dir" variable="mvn.modeler.directory">
-      <spec id="archetype.mvn.modeler.directory" size="20" set="/var/tmp/syncope/modeler" mustExist="false" create="true"/>
-    </field>
-    <field type="space"/>
     <field type="dir" variable="mvn.bundle.directory">
       <spec id="archetype.mvn.bundle.directory" size="20" set="/var/tmp/syncope/bundles" mustExist="false" create="true"/>
     </field>
@@ -113,7 +109,11 @@ under the License.
       <spec id="options.camel.id" true="true" false="false" set="false"/>
     </field>
     <field type="check" variable="options.activiti.workflow.adapter">
-      <spec id="options.activiti.workflow.adapter.id" true="true" false="false" set="false"/>
+      <spec id="options.activiti.workflow.adapter.id" true="true" false="false" set="true"/>
+    </field>
+    <field type="space"/>
+    <field type="dir" variable="mvn.modeler.directory" conditionid="options.choice.activiti">
+      <spec id="archetype.mvn.modeler.directory" size="20" set="/var/tmp/syncope/modeler" mustExist="false" create="true"/>
     </field>
   </panel>
   


[3/4] syncope git commit: Camel option, SYNCOPE-637

Posted by ma...@apache.org.
Camel option, SYNCOPE-637


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

Branch: refs/heads/master
Commit: 335d7f61ab7e60a4f87cd76ac179eda4f318d30c
Parents: e215871
Author: Massimiliano Perrone <ma...@tirasa.net>
Authored: Tue Dec 15 15:49:23 2015 +0100
Committer: Massimiliano Perrone <ma...@tirasa.net>
Committed: Tue Dec 15 18:08:02 2015 +0100

----------------------------------------------------------------------
 installer/pom.xml                               |  6 +++
 .../apache/syncope/installer/files/CorePom.java | 54 ++++++++++++++++++++
 .../syncope/installer/files/ParentPom.java      | 25 +++------
 .../installer/processes/ArchetypeProcess.java   | 27 ++++++++--
 .../installer/processes/PersistenceProcess.java | 18 ++-----
 .../src/main/resources/izpack/userInputSpec.xml |  6 +--
 6 files changed, 100 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/335d7f61/installer/pom.xml
----------------------------------------------------------------------
diff --git a/installer/pom.xml b/installer/pom.xml
index 7bfc0cf..c69b4b4 100644
--- a/installer/pom.xml
+++ b/installer/pom.xml
@@ -189,6 +189,12 @@ under the License.
         </includes>
       </resource>
       <resource>
+        <directory>${basedir}/../fit/core-reference/src/main/resources/all</directory>
+        <includes>
+          <include>provisioning.properties</include>
+        </includes>
+      </resource>
+      <resource>
         <directory>${basedir}</directory>
         <targetPath>META-INF</targetPath>
         <includes>

http://git-wip-us.apache.org/repos/asf/syncope/blob/335d7f61/installer/src/main/java/org/apache/syncope/installer/files/CorePom.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/files/CorePom.java b/installer/src/main/java/org/apache/syncope/installer/files/CorePom.java
new file mode 100644
index 0000000..54f5685
--- /dev/null
+++ b/installer/src/main/java/org/apache/syncope/installer/files/CorePom.java
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+package org.apache.syncope.installer.files;
+
+public final class CorePom {
+
+    public static final String SWAGGER_PLACEHOLDER = "</dependencies>";
+
+    public static final String SWAGGER_CONTENT_TO_ADD = "  <dependency>\n"
+            + "      <groupId>org.apache.syncope.ext</groupId>\n"
+            + "      <artifactId>syncope-ext-swagger-ui</artifactId>\n"
+            + "      <version>${syncope.version}</version>\n"
+            + "    </dependency>\n"
+            + "  </dependencies>\n";
+
+    public static final String CAMEL_PLACEHOLDER = "</dependencies>";
+
+    public static final String CAMEL_CONTENT_TO_ADD = "  <dependency>\n"
+            + "      <groupId>org.apache.syncope.ext.camel</groupId>\n"
+            + "      <artifactId>syncope-ext-camel-rest-cxf</artifactId>\n"
+            + "      <version>${syncope.version}</version>\n"
+            + "    </dependency>\n"
+            + "    <dependency>\n"
+            + "      <groupId>org.apache.syncope.ext.camel</groupId>\n"
+            + "      <artifactId>syncope-ext-camel-persistence-jpa</artifactId>\n"
+            + "      <version>${syncope.version}</version>\n"
+            + "    </dependency>\n"
+            + "    <dependency>\n"
+            + "      <groupId>org.apache.syncope.ext.camel</groupId>\n"
+            + "      <artifactId>syncope-ext-camel-provisioning</artifactId>\n"
+            + "      <version>${syncope.version}</version>\n"
+            + "    </dependency>\n"
+            + "  </dependencies>\n";
+
+    private CorePom() {
+        // private constructor for static utility class
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/335d7f61/installer/src/main/java/org/apache/syncope/installer/files/ParentPom.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/files/ParentPom.java b/installer/src/main/java/org/apache/syncope/installer/files/ParentPom.java
index 867b925..4f23ca7 100644
--- a/installer/src/main/java/org/apache/syncope/installer/files/ParentPom.java
+++ b/installer/src/main/java/org/apache/syncope/installer/files/ParentPom.java
@@ -20,26 +20,17 @@ package org.apache.syncope.installer.files;
 
 public final class ParentPom {
 
-    public static final String SWAGGER_PLACEHOLDER = "<dependencies>";
-
-    public static final String SWAGGER_CONTENT_TO_ADD = "<dependencies>\n"
-            + "    <dependency>\n"
-            + "      <groupId>org.apache.syncope.ext</groupId>\n"
-            + "      <artifactId>syncope-ext-swagger-ui</artifactId>\n"
-            + "      <version>${syncope.version}</version>\n"
-            + "    </dependency>\n";
-
     public static final String REPOSITORY_PLACEHOLDER = "</project>";
 
     public static final String REPOSITORY_CONTENT_TO_ADD = "  <repositories>\n"
-            + "  <repository>\n"
-            + "    <id>ASF</id>\n"
-            + "    <url>https://repository.apache.org/content/repositories/snapshots/</url>\n"
-            + "    <snapshots>\n"
-            + "      <enabled>true</enabled>\n"
-            + "    </snapshots>\n"
-            + "  </repository>\n"
-            + "</repositories>\n"
+            + "    <repository>\n"
+            + "      <id>ASF</id>\n"
+            + "      <url>https://repository.apache.org/content/repositories/snapshots/</url>\n"
+            + "      <snapshots>\n"
+            + "        <enabled>true</enabled>\n"
+            + "      </snapshots>\n"
+            + "    </repository>\n"
+            + "  </repositories>\n"
             + "</project>\n";
 
     private ParentPom() {

http://git-wip-us.apache.org/repos/asf/syncope/blob/335d7f61/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java b/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
index 30a7270..9c3f184 100644
--- a/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
+++ b/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
@@ -25,6 +25,7 @@ import java.io.IOException;
 import java.util.Properties;
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.transform.TransformerException;
+import org.apache.syncope.installer.files.CorePom;
 import org.apache.syncope.installer.files.ParentPom;
 import org.apache.syncope.installer.utilities.InstallLog;
 import org.apache.syncope.installer.utilities.MavenUtils;
@@ -95,6 +96,13 @@ public class ArchetypeProcess extends BaseProcess {
         mavenUtils.archetypeGenerate(
                 syncopeVersion, groupId, artifactId, secretKey, anonymousKey, installPath, customMavenProxySettings);
 
+        if (syncopeVersion.contains("SNAPSHOT")) {
+            final File pomFile = new File(syncopeInstallDir + PROPERTIES.getProperty("pomFile"));
+            String contentPomFile = fileSystemUtils.readFile(pomFile);       
+            fileSystemUtils.
+                    writeToFile(pomFile, contentPomFile.replace(ParentPom.REPOSITORY_PLACEHOLDER, ParentPom.REPOSITORY_CONTENT_TO_ADD));
+        }
+        
         if (swagger) {
             final File pomFile = new File(
                     syncopeInstallDir
@@ -103,11 +111,24 @@ public class ArchetypeProcess extends BaseProcess {
                     + File.separator
                     + PROPERTIES.getProperty("pomFile"));
             String contentPomFile = fileSystemUtils.readFile(pomFile);
-            contentPomFile = contentPomFile.replace(
-                    ParentPom.REPOSITORY_PLACEHOLDER, ParentPom.REPOSITORY_CONTENT_TO_ADD);
-            contentPomFile = contentPomFile.replace(ParentPom.SWAGGER_PLACEHOLDER, ParentPom.SWAGGER_CONTENT_TO_ADD);
+            contentPomFile = contentPomFile.replace(CorePom.SWAGGER_PLACEHOLDER, CorePom.SWAGGER_CONTENT_TO_ADD);
+
+            fileSystemUtils.writeToFile(pomFile, contentPomFile);
+        }
+        
+        if (camel) {
+            final File pomFile = new File(
+                    syncopeInstallDir
+                    + File.separator
+                    + "core"
+                    + File.separator
+                    + PROPERTIES.getProperty("pomFile"));
+            String contentPomFile = fileSystemUtils.readFile(pomFile);
+            contentPomFile = contentPomFile.replace(CorePom.CAMEL_PLACEHOLDER, CorePom.CAMEL_CONTENT_TO_ADD);
 
             fileSystemUtils.writeToFile(pomFile, contentPomFile);
+            fileSystemUtils.copyFileFromResources("/provisioning.properties",
+                syncopeInstallDir + PROPERTIES.getProperty("provisioningPropertiesFile"), handler);
         }
 
         fileSystemUtils.createDirectory(confDirectory);

http://git-wip-us.apache.org/repos/asf/syncope/blob/335d7f61/installer/src/main/java/org/apache/syncope/installer/processes/PersistenceProcess.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/processes/PersistenceProcess.java b/installer/src/main/java/org/apache/syncope/installer/processes/PersistenceProcess.java
index 8090173..a36b759 100644
--- a/installer/src/main/java/org/apache/syncope/installer/processes/PersistenceProcess.java
+++ b/installer/src/main/java/org/apache/syncope/installer/processes/PersistenceProcess.java
@@ -55,15 +55,16 @@ public class PersistenceProcess extends BaseProcess {
         mysqlInnoDB = Boolean.valueOf(args[6]);
         schema = args[7];
 
-        StringBuilder masterProperties = new StringBuilder(MasterProperties.HEADER);
+        final StringBuilder masterProperties = new StringBuilder(MasterProperties.HEADER);
         setSyncopeInstallDir(installPath, artifactId);
 
-        FileSystemUtils fileSystemUtils = new FileSystemUtils(handler);
+        final FileSystemUtils fileSystemUtils = new FileSystemUtils(handler);
         final File provisioningFile = new File(
                 syncopeInstallDir + PROPERTIES.getProperty("provisioningPropertiesFile"));
 
-        final StringBuilder provisioningProperties
-                = new StringBuilder(removeLastTwoLine(fileSystemUtils.readFile(provisioningFile)));
+        final String provisioningFileString = fileSystemUtils.readFile(provisioningFile);
+        final StringBuilder provisioningProperties = new StringBuilder(
+                provisioningFileString.substring(0, provisioningFileString.indexOf("quartz.jobstore")));
         handler.logOutput("Configure persistence for " + dbSelected, false);
         InstallLog.getInstance().info("Configure persistence for " + dbSelected);
 
@@ -111,13 +112,4 @@ public class PersistenceProcess extends BaseProcess {
                 syncopeInstallDir + PROPERTIES.getProperty("masterPropertiesFile")),
                 masterProperties.toString());
     }
-
-    private String removeLastTwoLine(final String string) {
-        int truncateIndex = string.length();
-
-        for (int i = 0; i < 3; i++) {
-            truncateIndex = string.lastIndexOf('\n', truncateIndex - 1);
-        }
-        return string.substring(0, truncateIndex);
-    }
 }

http://git-wip-us.apache.org/repos/asf/syncope/blob/335d7f61/installer/src/main/resources/izpack/userInputSpec.xml
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/userInputSpec.xml b/installer/src/main/resources/izpack/userInputSpec.xml
index 72648b0..0691f2f 100644
--- a/installer/src/main/resources/izpack/userInputSpec.xml
+++ b/installer/src/main/resources/izpack/userInputSpec.xml
@@ -109,12 +109,12 @@ under the License.
     <field type="check" variable="options.swagger">
       <spec id="options.swagger.id" true="true" false="false" set="false"/>
     </field>
-    <field type="check" variable="options.activiti.workflow.adapter">
-      <spec id="options.activiti.workflow.adapter.id" true="true" false="false" set="false"/>
-    </field>
     <field type="check" variable="options.camel">
       <spec id="options.camel.id" true="true" false="false" set="false"/>
     </field>
+    <field type="check" variable="options.activiti.workflow.adapter">
+      <spec id="options.activiti.workflow.adapter.id" true="true" false="false" set="false"/>
+    </field>
   </panel>
   
   <panel id="persistence" order="3" border="false">


[4/4] syncope git commit: swagger installation, SYNCOPE-700

Posted by ma...@apache.org.
swagger installation, SYNCOPE-700


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

Branch: refs/heads/master
Commit: 54db189335d308adc174a9993ca1ca6862b9f2c7
Parents: ce7cad4
Author: Massimiliano Perrone <ma...@tirasa.net>
Authored: Tue Dec 15 11:44:16 2015 +0100
Committer: Massimiliano Perrone <ma...@tirasa.net>
Committed: Tue Dec 15 18:08:02 2015 +0100

----------------------------------------------------------------------
 .../restfulservices/restful-reference.adoc            | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/54db1893/src/main/asciidoc/workingwithapachesyncope/restfulservices/restful-reference.adoc
----------------------------------------------------------------------
diff --git a/src/main/asciidoc/workingwithapachesyncope/restfulservices/restful-reference.adoc b/src/main/asciidoc/workingwithapachesyncope/restfulservices/restful-reference.adoc
index 73bcf83..3c9c145 100644
--- a/src/main/asciidoc/workingwithapachesyncope/restfulservices/restful-reference.adoc
+++ b/src/main/asciidoc/workingwithapachesyncope/restfulservices/restful-reference.adoc
@@ -35,6 +35,18 @@ image::restSchemaReferenceLogger.png[restSchemaReferenceLogger]
 
 ===== Swagger UI
 From the 2.0 version, Syncope offers also the Swagger UI to work with its services.
+
+The Swagger installation is really simple because you just add the Maven dependency to your core pom.xml file generated
+from the archetype operation; the dependency is:
+[source, xml]
+----
+<dependency>
+  <groupId>org.apache.syncope.ext</groupId>
+  <artifactId>syncope-ext-swagger-ui</artifactId>
+  <version>${syncope.version}</version>
+</dependency>
+----
+
 The swagger interface is available going to the URL
 [source]
 --
@@ -59,4 +71,4 @@ Now in version 2.0, Swagger is more enabling than ever. And it's 100% open sourc
 To be consistent with the example, below the image shows the Swagger UI used to read the configuration 
 of _org.apache.syncope.core.rest_
 
-image::swaggerLoggerRead.png[swaggerLoggerRead]
+image::swaggerLoggerRead.png[swaggerLoggerRead]
\ No newline at end of file


[2/4] syncope git commit: Swagger option, SYNCOPE-637

Posted by ma...@apache.org.
Swagger option, SYNCOPE-637


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

Branch: refs/heads/master
Commit: e21587171946ae764b820d4db9c7f731e84e871f
Parents: 54db189
Author: Massimiliano Perrone <ma...@tirasa.net>
Authored: Tue Dec 15 12:04:19 2015 +0100
Committer: Massimiliano Perrone <ma...@tirasa.net>
Committed: Tue Dec 15 18:08:02 2015 +0100

----------------------------------------------------------------------
 .../syncope/installer/files/ParentPom.java      | 14 +++++++--
 .../installer/processes/ArchetypeProcess.java   | 19 +++++++++---
 .../main/resources/izpack/ProcessPanel.Spec.xml |  3 ++
 installer/src/main/resources/izpack/install.xml |  2 ++
 .../main/resources/izpack/userInputLang.xml_eng |  4 +++
 .../main/resources/izpack/userInputLang.xml_ita |  4 +++
 .../src/main/resources/izpack/userInputSpec.xml | 32 +++++++++++++++-----
 7 files changed, 64 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/e2158717/installer/src/main/java/org/apache/syncope/installer/files/ParentPom.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/files/ParentPom.java b/installer/src/main/java/org/apache/syncope/installer/files/ParentPom.java
index 4653224..867b925 100644
--- a/installer/src/main/java/org/apache/syncope/installer/files/ParentPom.java
+++ b/installer/src/main/java/org/apache/syncope/installer/files/ParentPom.java
@@ -20,10 +20,18 @@ package org.apache.syncope.installer.files;
 
 public final class ParentPom {
 
-    public static final String PLACEHOLDER = "</project>";
+    public static final String SWAGGER_PLACEHOLDER = "<dependencies>";
 
-    public static final String REPOSITORY =
-            "  <repositories>\n"
+    public static final String SWAGGER_CONTENT_TO_ADD = "<dependencies>\n"
+            + "    <dependency>\n"
+            + "      <groupId>org.apache.syncope.ext</groupId>\n"
+            + "      <artifactId>syncope-ext-swagger-ui</artifactId>\n"
+            + "      <version>${syncope.version}</version>\n"
+            + "    </dependency>\n";
+
+    public static final String REPOSITORY_PLACEHOLDER = "</project>";
+
+    public static final String REPOSITORY_CONTENT_TO_ADD = "  <repositories>\n"
             + "  <repository>\n"
             + "    <id>ASF</id>\n"
             + "    <url>https://repository.apache.org/content/repositories/snapshots/</url>\n"

http://git-wip-us.apache.org/repos/asf/syncope/blob/e2158717/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java b/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
index d3cc987..30a7270 100644
--- a/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
+++ b/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
@@ -52,6 +52,9 @@ public class ArchetypeProcess extends BaseProcess {
         final String proxyUser = args[15];
         final String proxyPwd = args[16];
         final boolean mavenProxyAutoconf = Boolean.valueOf(args[17]);
+        final boolean swagger = Boolean.valueOf(args[18]);
+        final boolean activiti = Boolean.valueOf(args[19]);
+        final boolean camel = Boolean.valueOf(args[20]);
 
         setSyncopeInstallDir(installPath, artifactId);
 
@@ -92,11 +95,19 @@ public class ArchetypeProcess extends BaseProcess {
         mavenUtils.archetypeGenerate(
                 syncopeVersion, groupId, artifactId, secretKey, anonymousKey, installPath, customMavenProxySettings);
 
-        if (syncopeVersion.contains("SNAPSHOT")) {
-            final File pomFile = new File(syncopeInstallDir + PROPERTIES.getProperty("pomFile"));
+        if (swagger) {
+            final File pomFile = new File(
+                    syncopeInstallDir
+                    + File.separator
+                    + "core"
+                    + File.separator
+                    + PROPERTIES.getProperty("pomFile"));
             String contentPomFile = fileSystemUtils.readFile(pomFile);
-            fileSystemUtils.
-                    writeToFile(pomFile, contentPomFile.replace(ParentPom.PLACEHOLDER, ParentPom.REPOSITORY));
+            contentPomFile = contentPomFile.replace(
+                    ParentPom.REPOSITORY_PLACEHOLDER, ParentPom.REPOSITORY_CONTENT_TO_ADD);
+            contentPomFile = contentPomFile.replace(ParentPom.SWAGGER_PLACEHOLDER, ParentPom.SWAGGER_CONTENT_TO_ADD);
+
+            fileSystemUtils.writeToFile(pomFile, contentPomFile);
         }
 
         fileSystemUtils.createDirectory(confDirectory);

http://git-wip-us.apache.org/repos/asf/syncope/blob/e2158717/installer/src/main/resources/izpack/ProcessPanel.Spec.xml
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/ProcessPanel.Spec.xml b/installer/src/main/resources/izpack/ProcessPanel.Spec.xml
index 1f8e272..7539e91 100644
--- a/installer/src/main/resources/izpack/ProcessPanel.Spec.xml
+++ b/installer/src/main/resources/izpack/ProcessPanel.Spec.xml
@@ -39,6 +39,9 @@ under the License.
       <arg>$mvn.proxy.user</arg><!-- 15 -->
       <arg>$mvn.proxy.pwd</arg><!-- 16 -->
       <arg>$mvn.proxy.autoconf</arg><!-- 17 -->
+      <arg>$options.swagger</arg><!-- 18 -->
+      <arg>$options.activiti.workflow.adapter</arg><!-- 19 -->
+      <arg>$options.camel</arg><!-- 20 -->
     </executeclass>
   </job>
   <job name="Persistence configuration...">

http://git-wip-us.apache.org/repos/asf/syncope/blob/e2158717/installer/src/main/resources/izpack/install.xml
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/install.xml b/installer/src/main/resources/izpack/install.xml
index 9a2326e..f0dfed5 100644
--- a/installer/src/main/resources/izpack/install.xml
+++ b/installer/src/main/resources/izpack/install.xml
@@ -149,6 +149,8 @@ under the License.
     <panel classname="UserInputPanel" id="archetype">
       <validator classname="org.apache.syncope.installer.validators.ArchetypeValidator"/>
     </panel>
+    <panel classname="UserInputPanel" id="syncope_options"/>
+    
     <panel classname="UserInputPanel" id="persistence"/>
     <panel classname="UserInputPanel" id="persistence_advanced">
       <validator classname="org.apache.syncope.installer.validators.PersistenceValidator"/>

http://git-wip-us.apache.org/repos/asf/syncope/blob/e2158717/installer/src/main/resources/izpack/userInputLang.xml_eng
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/userInputLang.xml_eng b/installer/src/main/resources/izpack/userInputLang.xml_eng
index 00f183f..3e9ee88 100644
--- a/installer/src/main/resources/izpack/userInputLang.xml_eng
+++ b/installer/src/main/resources/izpack/userInputLang.xml_eng
@@ -37,6 +37,10 @@ under the License.
   <str id="mvn.proxy.user.id" txt="Proxy User (if required):"/>
   <str id="mvn.proxy.pwd.id" txt="Proxy Password (if required):"/>
   
+  <str id="options.swagger.id" txt="Swagger"/>
+  <str id="options.activiti.workflow.adapter.id" txt="Activiti workflow adapter"/>
+  <str id="options.camel.id" txt="Camel"/>
+  
   <str id="persistence.jdbc.url" txt="Database JDBC url:"/>
   <str id="persistence.db.user" txt="Username:"/>
   <str id="persistence.db.password" txt="Password:"/>

http://git-wip-us.apache.org/repos/asf/syncope/blob/e2158717/installer/src/main/resources/izpack/userInputLang.xml_ita
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/userInputLang.xml_ita b/installer/src/main/resources/izpack/userInputLang.xml_ita
index 65dc51f..580a17d 100644
--- a/installer/src/main/resources/izpack/userInputLang.xml_ita
+++ b/installer/src/main/resources/izpack/userInputLang.xml_ita
@@ -37,6 +37,10 @@ under the License.
   <str id="mvn.proxy.user.id" txt="Proxy User (se richiesto):"/>
   <str id="mvn.proxy.pwd.id" txt="Proxy Password (se richiesta):"/>
   
+  <str id="options.swagger.id" txt="Swagger"/>
+  <str id="options.activiti.workflow.adapter.id" txt="Activiti workflow adapter"/>
+  <str id="options.camel.id" txt="Camel"/>
+  
   <str id="persistence.jdbc.url" txt="Database JDBC url:"/>
   <str id="persistence.db.user" txt="Username:"/>
   <str id="persistence.db.password" txt="Password:"/>

http://git-wip-us.apache.org/repos/asf/syncope/blob/e2158717/installer/src/main/resources/izpack/userInputSpec.xml
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/userInputSpec.xml b/installer/src/main/resources/izpack/userInputSpec.xml
index 0253a33..72648b0 100644
--- a/installer/src/main/resources/izpack/userInputSpec.xml
+++ b/installer/src/main/resources/izpack/userInputSpec.xml
@@ -99,8 +99,26 @@ under the License.
     </field>
   </panel>
   
-  <panel id="persistence" order="2" border="false">
-    <field type="title" txt="Database options" bold="true" size="2" />
+  <panel id="syncope_options" order="2" border="false">
+    <field type="title" txt="Syncope options" bold="true" size="2" />
+    
+    <field type="divider"/>
+    <field type="space"/>
+    
+    <field type="staticText" align="left" txt="Options" />
+    <field type="check" variable="options.swagger">
+      <spec id="options.swagger.id" true="true" false="false" set="false"/>
+    </field>
+    <field type="check" variable="options.activiti.workflow.adapter">
+      <spec id="options.activiti.workflow.adapter.id" true="true" false="false" set="false"/>
+    </field>
+    <field type="check" variable="options.camel">
+      <spec id="options.camel.id" true="true" false="false" set="false"/>
+    </field>
+  </panel>
+  
+  <panel id="persistence" order="3" border="false">
+    <field type="title" txt="Database" bold="true" size="2" />
     
     <field type="divider"/>
     <field type="space"/>
@@ -116,8 +134,8 @@ under the License.
     </field>
   </panel>
   
-  <panel id="persistence_advanced" order="2" border="false">
-    <field type="title" txt="Database advanced options" bold="true" size="2" />
+  <panel id="persistence_advanced" order="3" border="false">
+    <field type="title" txt="Database settings" bold="true" size="2" />
     
     <field type="divider"/>
     <field type="space"/>
@@ -152,7 +170,7 @@ under the License.
     </field>
   </panel>
   
-  <panel id="container" order="3" border="false">
+  <panel id="container" order="4" border="false">
     <field type="title" txt="Application Server" bold="true" size="2" />
     
     <field type="divider"/>
@@ -174,8 +192,8 @@ under the License.
     </field>
   </panel>
   
-  <panel id="container_advanced" order="3" border="false">
-    <field type="title" txt="Application Server" bold="true" size="2" />
+  <panel id="container_advanced" order="4" border="false">
+    <field type="title" txt="Application Server Settings" bold="true" size="2" />
     
     <field type="divider"/>
     <field type="space"/>