syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject [1/4] syncope git commit: Activiti option, SYNCOPE-637
Date Tue, 15 Dec 2015 17:08:22 GMT
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 <massimiliano.perrone@tirasa.net>
Authored: Tue Dec 15 18:03:59 2015 +0100
Committer: Massimiliano Perrone <massimiliano.perrone@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>
   


Mime
View raw message