Repository: syncope
Updated Branches:
  refs/heads/master 417eb401b -> 26c3e413f


The installer works for 2_0_X version


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

Branch: refs/heads/master
Commit: 26c3e413fa2ec1077fc8d848c1c9b7c346820e67
Parents: 417eb40
Author: Massimiliano Perrone <massimiliano.perr...@tirasa.net>
Authored: Mon Dec 14 18:48:27 2015 +0100
Committer: Massimiliano Perrone <massimiliano.perr...@tirasa.net>
Committed: Mon Dec 14 18:48:38 2015 +0100

----------------------------------------------------------------------
 .../installer/files/ProvisioningProperties.java | 20 --------------------
 .../installer/processes/ArchetypeProcess.java   | 11 +++++++++--
 .../installer/processes/PersistenceProcess.java | 18 ++++++++++++++++--
 installer/src/main/resources/izpack/install.xml |  2 +-
 installer/src/main/resources/modelerPom.xml     | 18 ++++++++++++------
 5 files changed, 38 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/26c3e413/installer/src/main/java/org/apache/syncope/installer/files/ProvisioningProperties.java
----------------------------------------------------------------------
diff --git 
a/installer/src/main/java/org/apache/syncope/installer/files/ProvisioningProperties.java
 
b/installer/src/main/java/org/apache/syncope/installer/files/ProvisioningProperties.java
index 020efcb..605fc6a 100644
--- 
a/installer/src/main/java/org/apache/syncope/installer/files/ProvisioningProperties.java
+++ 
b/installer/src/main/java/org/apache/syncope/installer/files/ProvisioningProperties.java
@@ -20,26 +20,6 @@ package org.apache.syncope.installer.files;
 
 public final class ProvisioningProperties {
 
-    public static final String HEADER = "# Licensed to the Apache Software 
Foundation (ASF) under one\n"
-            + "# or more contributor license agreements.  See the NOTICE 
file\n"
-            + "# distributed with this work for additional information\n"
-            + "# regarding copyright ownership.  The ASF licenses this file\n"
-            + "# to you under the Apache License, Version 2.0 (the\n"
-            + "# \"License\"); you may not use this file except in 
compliance\n"
-            + "# with the License.  You may obtain a copy of the License at\n" 
+ "#\n"
-            + "#   http://www.apache.org/licenses/LICENSE-2.0\n"; + "#\n"
-            + "# Unless required by applicable law or agreed to in writing,\n"
-            + "# software distributed under the License is distributed on an\n"
-            + "# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n"
-            + "# KIND, either express or implied.  See the License for the\n"
-            + "# specific language governing permissions and limitations\n"
-            + "# under the License.\n"
-            + 
"userProvisioningManager=org.apache.syncope.core.provisioning.java.DefaultUserProvisioningManager\n"
-            + 
"groupProvisioningManager=org.apache.syncope.core.provisioning.java.DefaultGroupProvisioningManager\n"
-            + "anyObjectProvisioningManager="
-            + 
"org.apache.syncope.core.provisioning.java.DefaultAnyObjectProvisioningManager\n"
-            + 
"virAttrCache=org.apache.syncope.core.provisioning.java.cache.MemoryVirAttrCache\n";
-
     public static final String POSTGRES = ""
             + 
"quartz.jobstore=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate\n"
             + "quartz.sql=tables_postgres.sql\n";

http://git-wip-us.apache.org/repos/asf/syncope/blob/26c3e413/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 4f17035..d3cc987 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
@@ -93,8 +93,7 @@ public class ArchetypeProcess extends BaseProcess {
                 syncopeVersion, groupId, artifactId, secretKey, anonymousKey, 
installPath, customMavenProxySettings);
 
         if (syncopeVersion.contains("SNAPSHOT")) {
-            final File pomFile =
-                    new File(syncopeInstallDir + 
PROPERTIES.getProperty("pomFile"));
+            final File pomFile = new File(syncopeInstallDir + 
PROPERTIES.getProperty("pomFile"));
             String contentPomFile = fileSystemUtils.readFile(pomFile);
             fileSystemUtils.
                     writeToFile(pomFile, 
contentPomFile.replace(ParentPom.PLACEHOLDER, ParentPom.REPOSITORY));
@@ -108,6 +107,12 @@ public class ArchetypeProcess extends BaseProcess {
         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"));
+
+        final String contentModelerPomFile = 
fileSystemUtils.readFile(modelerPomFile);
+        fileSystemUtils.
+                writeToFile(modelerPomFile, 
String.format(contentModelerPomFile, modelerDirectory));
+
         fileSystemUtils.copyFile(
                 syncopeInstallDir
                 + PROPERTIES.getProperty("consoleResDirectory")
@@ -129,5 +134,7 @@ 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/26c3e413/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 8cc528b..94ce093 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
@@ -21,6 +21,7 @@ package org.apache.syncope.installer.processes;
 import org.apache.syncope.installer.utilities.FileSystemUtils;
 import com.izforge.izpack.panels.process.AbstractUIProcessHandler;
 import java.io.File;
+import java.nio.channels.FileChannel;
 import org.apache.syncope.installer.enums.DBs;
 import org.apache.syncope.installer.files.MasterProperties;
 import org.apache.syncope.installer.files.ProvisioningProperties;
@@ -55,11 +56,15 @@ public class PersistenceProcess extends BaseProcess {
         mysqlInnoDB = Boolean.valueOf(args[6]);
         schema = args[7];
 
-        FileSystemUtils fileSystemUtils = new FileSystemUtils(handler);
-        StringBuilder provisioningProperties = new 
StringBuilder(ProvisioningProperties.HEADER);
         StringBuilder masterProperties = new 
StringBuilder(MasterProperties.HEADER);
         setSyncopeInstallDir(installPath, artifactId);
 
+        FileSystemUtils fileSystemUtils = new FileSystemUtils(handler);
+        final File provisioningFile = new File(
+                syncopeInstallDir + 
PROPERTIES.getProperty("provisioningPropertiesFile"));
+
+        final StringBuilder provisioningProperties
+                = new 
StringBuilder(removeLastTwoLine(fileSystemUtils.readFile(provisioningFile)));
         handler.logOutput("Configure persistence for " + dbSelected, false);
         InstallLog.getInstance().info("Configure persistence for " + 
dbSelected);
 
@@ -107,4 +112,13 @@ 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/26c3e413/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 cef97bb..9a2326e 100644
--- a/installer/src/main/resources/izpack/install.xml
+++ b/installer/src/main/resources/izpack/install.xml
@@ -33,7 +33,7 @@ under the License.
     <javaversion>${targetJdk}</javaversion>
   </info>
   
-  <guiprefs resizable="no" width="800" height="600">    
+  <guiprefs resizable="no" width="850" height="600">    
     <modifier key="useButtonIcons" value="yes"/>
     <modifier key="useLabelIcons" value="no"/>
     <modifier key="labelGap" value="2"/>

http://git-wip-us.apache.org/repos/asf/syncope/blob/26c3e413/installer/src/main/resources/modelerPom.xml
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/modelerPom.xml 
b/installer/src/main/resources/modelerPom.xml
index af1704e..58cf647 100644
--- a/installer/src/main/resources/modelerPom.xml
+++ b/installer/src/main/resources/modelerPom.xml
@@ -28,8 +28,9 @@ under the License.
   <packaging>jar</packaging>
    
   <properties>
-    <activiti.version>5.19.0.1</activiti.version>
-    
<activiti-modeler.directory>${modeler.directory}</activiti-modeler.directory>
+    <activiti-modeler.version>${activiti.version}</activiti-modeler.version>
+    <!--<h2-modeler.version>${h2.version}</h2-modeler.version>-->
+    <activiti-modeler.directory>%s</activiti-modeler.directory>
      
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   </properties>
@@ -38,10 +39,15 @@ under the License.
     <dependency>
       <groupId>org.activiti</groupId>
       <artifactId>activiti-webapp-explorer2</artifactId>
-      <version>${activiti.version}</version>
+      <version>${activiti-modeler.version}</version>
       <type>war</type>
       <scope>test</scope>
-    </dependency>   
+    </dependency>
+<!--    <dependency>
+      <groupId>com.h2database</groupId>
+      <artifactId>h2</artifactId>
+      <version>${h2-modeler.version}</version>
+    </dependency>-->
   </dependencies>
    
   <build>   
@@ -92,10 +98,10 @@ ORYX.Editor.createByUrl = function(modelUrl){"/>
                          token="window.location.href = &quot;./&quot;;"
                          value="window.close();"/>
                                                
-                <copy file="${basedir}/src/main/resources/url-config.js" 
+                <copy file="url-config.js" 
                       
todir="${activiti-modeler.directory}/editor-app/configuration"
                       overwrite="true" />
-                <copy file="${basedir}/src/main/resources/save-model.html" 
+                <copy file="save-model.html" 
                       todir="${activiti-modeler.directory}/editor-app/popups"
                       overwrite="true" />
               </target>

Reply via email to