You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2015/01/01 19:11:58 UTC
[03/32] syncope git commit: [SYNOPE-610][SYNCOPE-616] Fixing and
improving the management of the xml and properties files inside the installer
[SYNOPE-610][SYNCOPE-616] Fixing and improving the management of the xml and properties files inside the installer
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/5e013aa4
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/5e013aa4
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/5e013aa4
Branch: refs/heads/2_0_X
Commit: 5e013aa44bec914bb27115105f0585e6437c8316
Parents: 4a2e843
Author: Marco Di Sabatino Di Diodoro <md...@apache.org>
Authored: Mon Dec 22 17:56:11 2014 +0100
Committer: Marco Di Sabatino Di Diodoro <md...@apache.org>
Committed: Mon Dec 22 17:56:11 2014 +0100
----------------------------------------------------------------------
installer/pom.xml | 20 +++
.../installer/containers/jboss/JBoss.java | 12 +-
.../org/apache/syncope/installer/enums/DBs.java | 3 +
.../installer/files/ConsoleProperties.java | 31 ++++
.../syncope/installer/files/CoreWebXml.java | 76 ++------
.../installer/files/GlassfishCoreWebXml.java | 38 +---
.../files/JBossDeploymentStructureXml.java | 40 +----
.../syncope/installer/files/ParentPom.java | 176 +------------------
.../files/PersistenceContextEMFactoryXml.java | 47 +----
.../installer/files/PersistenceProperties.java | 27 +--
.../installer/processes/ArchetypeProcess.java | 41 +++--
.../installer/processes/BaseProcess.java | 54 ++++++
.../installer/processes/ContainerProcess.java | 171 ++++++++++++++----
.../installer/processes/PersistenceProcess.java | 25 ++-
.../installer/utilities/FileSystemUtils.java | 45 +++++
.../syncope/installer/utilities/MavenUtils.java | 31 +---
.../src/main/resources/configuration.properties | 31 ++++
.../main/resources/izpack/ProcessPanel.Spec.xml | 40 +++--
installer/src/main/resources/izpack/install.xml | 6 +-
.../main/resources/izpack/userInputLang.xml_eng | 4 +
.../main/resources/izpack/userInputLang.xml_ita | 4 +
.../src/main/resources/izpack/userInputSpec.xml | 20 ++-
installer/src/main/resources/modelerPom.xml | 116 ++++++++++++
23 files changed, 589 insertions(+), 469 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/pom.xml
----------------------------------------------------------------------
diff --git a/installer/pom.xml b/installer/pom.xml
index e6675de..7f6e8b0 100644
--- a/installer/pom.xml
+++ b/installer/pom.xml
@@ -173,6 +173,18 @@ under the License.
<resources>
<resource>
+ <directory>${basedir}/../core/src/main/resources/</directory>
+ <includes>
+ <include>**/orm*</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>${basedir}/../core/src/test/resources/</directory>
+ <includes>
+ <include>**/persistenceContextEMFactory.xml</include>
+ </includes>
+ </resource>
+ <resource>
<directory>${basedir}</directory>
<targetPath>META-INF</targetPath>
<includes>
@@ -180,6 +192,14 @@ under the License.
<include>NOTICE</include>
</includes>
</resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/configuration.properties</include>
+ <include>**/modelerPom.xml</include>
+ </includes>
+ <filtering>true</filtering>
+ </resource>
</resources>
</build>
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/containers/jboss/JBoss.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/containers/jboss/JBoss.java b/installer/src/main/java/org/apache/syncope/installer/containers/jboss/JBoss.java
index c3f7429..c0e6722 100644
--- a/installer/src/main/java/org/apache/syncope/installer/containers/jboss/JBoss.java
+++ b/installer/src/main/java/org/apache/syncope/installer/containers/jboss/JBoss.java
@@ -33,7 +33,7 @@ public class JBoss extends AbstractContainer {
private final String jbossHost;
- private final String jbossPort;
+ private final String jbossManagementPort;
private final String installPath;
@@ -41,15 +41,15 @@ public class JBoss extends AbstractContainer {
private final HttpUtils httpUtils;
- public JBoss(final boolean jbossSsl, final String jbossHost, final String jbossPort,
+ public JBoss(final boolean jbossSsl, final String jbossHost, final String jbossManagementPort,
final String jbossAdminUsername, final String jbossAdminPassword,
final String installPath, final String artifactId, final AbstractUIProcessHandler handler) {
this.jbossSsl = jbossSsl;
this.jbossHost = jbossHost;
- this.jbossPort = jbossPort;
+ this.jbossManagementPort = jbossManagementPort;
this.installPath = installPath;
this.artifactId = artifactId;
- httpUtils = new HttpUtils(jbossSsl, jbossHost, jbossPort, jbossAdminUsername, jbossAdminPassword, handler);
+ httpUtils = new HttpUtils(jbossSsl, jbossHost, jbossManagementPort, jbossAdminUsername, jbossAdminPassword, handler);
}
@@ -63,7 +63,7 @@ public class JBoss extends AbstractContainer {
public boolean deploy(final String whatDeploy, final String warName) {
final String responseBodyAsString = httpUtils.postWithDigestAuth(
- String.format(addContentUrl, jbossHost, jbossPort),
+ String.format(addContentUrl, jbossHost, jbossManagementPort),
String.format(whatDeploy, installPath, artifactId));
final JBossAddResponse jBossAddResponse = JsonUtils.jBossAddResponse(responseBodyAsString);
@@ -72,7 +72,7 @@ public class JBoss extends AbstractContainer {
jBossAddResponse.getResult().getBYTES_VALUE(), warName);
int status = httpUtils.
- postWithStringEntity(String.format(enableUrl, jbossHost, jbossPort),
+ postWithStringEntity(String.format(enableUrl, jbossHost, jbossManagementPort),
JsonUtils.jBossDeployRequestContent(jBossDeployRequestContent));
return status == 200;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/enums/DBs.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/enums/DBs.java b/installer/src/main/java/org/apache/syncope/installer/enums/DBs.java
index 714e888..db7f8ec 100644
--- a/installer/src/main/java/org/apache/syncope/installer/enums/DBs.java
+++ b/installer/src/main/java/org/apache/syncope/installer/enums/DBs.java
@@ -43,7 +43,10 @@ public enum DBs {
db = MYSQL;
} else if (ORACLE.getName().equalsIgnoreCase(containerName)) {
db = ORACLE;
+ } else {
+ db = SQLSERVER;
}
+
return db;
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/files/ConsoleProperties.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/files/ConsoleProperties.java b/installer/src/main/java/org/apache/syncope/installer/files/ConsoleProperties.java
new file mode 100644
index 0000000..d6d2deb
--- /dev/null
+++ b/installer/src/main/java/org/apache/syncope/installer/files/ConsoleProperties.java
@@ -0,0 +1,31 @@
+/*
+ * 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 class ConsoleProperties {
+
+ public static final String PLACEHOLDER = "scheme=http\n"
+ + "host=localhost\n"
+ + "port=8080";
+
+ public static final String CONSOLE = "scheme=%s\n"
+ + "host=%s\n"
+ + "port=%s";
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/files/CoreWebXml.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/files/CoreWebXml.java b/installer/src/main/java/org/apache/syncope/installer/files/CoreWebXml.java
index a22c79a..1f78dbc 100644
--- a/installer/src/main/java/org/apache/syncope/installer/files/CoreWebXml.java
+++ b/installer/src/main/java/org/apache/syncope/installer/files/CoreWebXml.java
@@ -20,78 +20,30 @@ package org.apache.syncope.installer.files;
public class CoreWebXml {
- public static final String PATH = "/core/src/main/webapp/WEB-INF/web.xml";
+ public static final String PLACEHOLDER = "</web-app>";
- public static String withDataSource() {
- return String.format(FILE, withDataSource);
- }
-
- public static String withDataSourceForJBoss() {
- return String.format(FILE, withDataSourceForJBoss);
- }
-
- private static final String FILE = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--\n"
- + "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" + "-->\n"
- + "<web-app xmlns=\"http://java.sun.com/xml/ns/javaee\"\n"
- + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
- + " xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee \n"
- + " http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd\"\n"
- + " version=\"3.0\">\n" + "\n" + " <display-name>Apache Syncope core</display-name>\n" + "\n"
- + " <context-param>\n" + " <param-name>contextConfigLocation</param-name>\n"
- + " <param-value>classpath*:/*Context.xml</param-value>\n" + " </context-param>\n" + "\n"
- + " <listener>\n"
- + " <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>\n"
- + " </listener>\n" + " <listener>\n"
- + " <listener-class>org.apache.syncope.core.init.ThreadLocalCleanupListener</listener-class>\n"
- + " </listener>\n" + " \n" + " <servlet>\n" + " <servlet-name>CXFServlet</servlet-name>\n"
- + " <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>\n"
- + " <load-on-startup>1</load-on-startup> \n" + " </servlet>\n" + " <servlet-mapping>\n"
- + " <servlet-name>CXFServlet</servlet-name>\n" + " <url-pattern>/rest/*</url-pattern>\n"
- + " </servlet-mapping>\n" + " <servlet>\n" + " <servlet-name>WADLServlet</servlet-name>\n"
- + " <servlet-class>org.apache.syncope.core.rest.WADLServlet</servlet-class>\n"
- + " <load-on-startup>2</load-on-startup> \n" + " </servlet>\n" + " <servlet-mapping>\n"
- + " <servlet-name>WADLServlet</servlet-name>\n" + " <url-pattern>/rest/doc/*</url-pattern>\n"
- + " </servlet-mapping>\n" + "\n" + " <filter>\n" + " <filter-name>encodingFilter</filter-name>\n"
- + " <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>\n"
- + " <init-param>\n" + " <param-name>encoding</param-name>\n"
- + " <param-value>UTF-8</param-value>\n" + " </init-param>\n" + " <init-param>\n"
- + " <param-name>forceEncoding</param-name>\n" + " <param-value>true</param-value>\n"
- + " </init-param>\n" + " </filter>\n" + " <filter>\n"
- + " <filter-name>springSecurityFilterChain</filter-name>\n"
- + " <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>\n"
- + " </filter>\n" + "\n" + " <filter-mapping>\n" + " <filter-name>encodingFilter</filter-name>\n"
- + " <url-pattern>/*</url-pattern>\n" + " </filter-mapping>\n" + " <filter-mapping>\n"
- + " <filter-name>springSecurityFilterChain</filter-name>\n" + " <url-pattern>/*</url-pattern>\n"
- + " </filter-mapping>\n" + "\n" + " <login-config>\n" + " <auth-method>CLIENT-CERT</auth-method>\n"
- + " </login-config>\n" + " \n" + " <!-- Uncomment this when using JNDI DataSource -->\n"
- + "%s"
- + "</web-app>\n";
-
- private static final String withDataSource = "<!-- Uncomment this when using JNDI DataSource -->\n"
+ private static final String WITH_DATA_SOURCE = "<!-- Uncomment this when using JNDI DataSource -->\n"
+ " <resource-ref>\n"
+ " <res-ref-name>jdbc/syncopeDataSource</res-ref-name>\n"
+ " <res-type>javax.sql.DataSource</res-type>\n"
+ " <res-auth>Container</res-auth>\n"
- + " </resource-ref>\n" + "\n";
+ + " </resource-ref>\n"
+ + "</web-app>";
- private static final String withDataSourceForJBoss = "<!-- Uncomment this when using JNDI DataSource -->\n"
+ private static final String WITH_DATA_SOURCE_FOR_JBOSS = "<!-- Uncomment this when using JNDI DataSource -->\n"
+ " <resource-ref>\n"
+ " <res-ref-name>jdbc/syncopeDataSource</res-ref-name>\n"
+ " <res-type>javax.sql.DataSource</res-type>\n"
+ " <res-auth>Container</res-auth>\n"
+ " <lookup-name>java:/syncopeDataSource</lookup-name>\n"
- + " </resource-ref>\n" + "\n";
+ + " </resource-ref>\n"
+ + "</web-app>";
+
+ public static String withDataSource(final String content) {
+ return content.replace(PLACEHOLDER, WITH_DATA_SOURCE);
+ }
+ public static String withDataSourceForJBoss(final String content) {
+ return content.replace(PLACEHOLDER, WITH_DATA_SOURCE_FOR_JBOSS);
+ }
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/files/GlassfishCoreWebXml.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/files/GlassfishCoreWebXml.java b/installer/src/main/java/org/apache/syncope/installer/files/GlassfishCoreWebXml.java
index 0541209..9eadedd 100644
--- a/installer/src/main/java/org/apache/syncope/installer/files/GlassfishCoreWebXml.java
+++ b/installer/src/main/java/org/apache/syncope/installer/files/GlassfishCoreWebXml.java
@@ -20,38 +20,14 @@ package org.apache.syncope.installer.files;
public class GlassfishCoreWebXml {
- public static final String PATH = "/core/src/main/webapp/WEB-INF/glassfish-web.xml";
-
- public static String withDataSource() {
- return String.format(FILE, dataSource);
- }
-
- private final static String FILE = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--\n"
- + "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" + "\n" + "-->\n"
- + "<!DOCTYPE glassfish-web-app PUBLIC \"-//GlassFish.org//DTD \n"
- + "GlassFish Application Server 3.1 Servlet 3.0//EN\" \"http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd\">\n"
- + "<glassfish-web-app>\n" + " <context-root>/syncope</context-root>\n"
- + "%s"
- + " <class-loader delegate=\"false\"/>\n" + " <jsp-config>\n"
- + " <property name=\"httpMethods\" value=\"GET,POST,HEAD,PUT,DELETE\"/>\n" + " </jsp-config>\n"
- + "</glassfish-web-app>";
-
- private static final String dataSource = "<!-- Uncomment this when using JNDI DataSource -->\n"
- + " <resource-ref>\n"
+ public static final String PLACEHOLDER = " <!--<resource-ref>\n"
+ " <res-ref-name>jdbc/syncopeDataSource</res-ref-name>\n"
+ " <jndi-name>jdbc/syncopeDataSource</jndi-name>\n"
- + " </resource-ref>\n";
+ + " </resource-ref>-->";
+
+ public static final String DATA_SOURCE = " <resource-ref>\n"
+ + " <res-ref-name>jdbc/syncopeDataSource</res-ref-name>\n"
+ + " <jndi-name>jdbc/syncopeDataSource</jndi-name>\n"
+ + " </resource-ref>";
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/files/JBossDeploymentStructureXml.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/files/JBossDeploymentStructureXml.java b/installer/src/main/java/org/apache/syncope/installer/files/JBossDeploymentStructureXml.java
index 7a06b34..1d70e36 100644
--- a/installer/src/main/java/org/apache/syncope/installer/files/JBossDeploymentStructureXml.java
+++ b/installer/src/main/java/org/apache/syncope/installer/files/JBossDeploymentStructureXml.java
@@ -19,42 +19,10 @@
package org.apache.syncope.installer.files;
public class JBossDeploymentStructureXml {
+
+ public static final String PLACEHOLDER = "<module name=\"org.apache.xalan\"/>";
- public static final String PATH = "/core/src/main/webapp/WEB-INF/jboss-deployment-structure.xml";
-
- public static final String FILE = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--\n"
- + "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" + "\n" + "-->\n"
- + "<jboss-deployment-structure xmlns=\"urn:jboss:deployment-structure:1.2\">\n"
- + " <deployment>\n"
- + " <exclude-subsystems>\n"
- + " <subsystem name=\"webservices\"/>\n"
- + " <subsystem name=\"jaxrs\"/>\n"
- + " </exclude-subsystems>"
- + " <dependencies>\n"
- + " <module name=\"org.apache.xalan\"/>\n"
- + " <module name=\"%s\"/>\n"
- + " </dependencies>\n"
- + " <exclusions>\n"
- + " <module name=\"org.hibernate\"/>\n"
- + " <module name=\"org.slf4j\"/>\n"
- + " <module name=\"org.slf4j.impl\"/>\n"
- + " <module name=\"javax.ws.rs.api\"/>\n"
- + " <module name=\"org.apache.cxf\"/>\n"
- + " <module name=\"org.apache.cxf.impl\"/>\n"
- + " </exclusions>\n"
- + " </deployment>\n"
- + "</jboss-deployment-structure>";
+ public static final String JBOSSMODULE = "<module name=\"org.apache.xalan\"/>\n"
+ + "<module name=\"%s\"/>";
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/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 edca681..49c05f3 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
@@ -19,176 +19,18 @@
package org.apache.syncope.installer.files;
public class ParentPom {
+
+ public static final String PLACEHOLDER = "</project>";
- public static final String PATH = "/pom.xml";
-
- public static final String FILE = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><!--\n"
- + "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"
- + "-->\n"
- + "<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n"
- + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
- + " xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n"
- + " \n"
- + " <modelVersion>4.0.0</modelVersion>\n"
- + " \n"
- + " <parent>\n"
- + " <groupId>org.apache.syncope</groupId>\n"
- + " <artifactId>syncope</artifactId>\n"
- + " <version>%s</version>\n"
- + " </parent>\n"
- + " \n"
- + " <properties>\n"
- + " <syncope.version>%s</syncope.version>\n"
- + " <secretKey>ahsdgausygdausygduasygd</secretKey>\n"
- + " <anonymousKey>asdasdasdasd</anonymousKey>\n"
- + " </properties>\n"
- + " \n"
- + " <name>Apache Syncope sample project</name>\n"
- + " <groupId>%s</groupId>\n"
- + " <artifactId>%s</artifactId>\n"
- + " <version>1.0-SNAPSHOT</version>\n"
- + " <packaging>pom</packaging>\n"
- + " \n"
- + " <dependencyManagement>\n"
- + " <dependencies>\n"
- + " <dependency>\n"
- + " <groupId>org.apache.syncope</groupId>\n"
- + " <artifactId>syncope-common</artifactId>\n"
- + " <version>${syncope.version}</version>\n"
- + " </dependency> \n"
- + " \n"
- + " <dependency>\n"
- + " <groupId>org.apache.syncope</groupId>\n"
- + " <artifactId>syncope-common</artifactId>\n"
- + " <version>${syncope.version}</version>\n"
- + " <classifier>javadoc</classifier>\n"
- + " </dependency>\n"
- + " \n"
- + " <dependency>\n"
- + " <groupId>org.apache.syncope</groupId>\n"
- + " <artifactId>syncope-client</artifactId>\n"
- + " <version>${syncope.version}</version>\n"
- + " </dependency> \n"
- + " \n"
- + " <dependency>\n"
- + " <groupId>org.apache.syncope</groupId>\n"
- + " <artifactId>syncope-build-tools</artifactId>\n"
- + " <version>${syncope.version}</version>\n"
- + " <type>war</type>\n"
- + " <scope>test</scope>\n"
- + " </dependency> \n"
- + " \n"
- + " <dependency>\n"
- + " <groupId>org.apache.syncope</groupId>\n"
- + " <artifactId>syncope-core</artifactId>\n"
- + " <version>${syncope.version}</version>\n"
- + " <type>war</type>\n"
- + " </dependency> \n"
- + " <dependency>\n"
- + " <groupId>org.apache.syncope</groupId>\n"
- + " <artifactId>syncope-core</artifactId>\n"
- + " <version>${syncope.version}</version>\n"
- + " <classifier>classes</classifier>\n"
- + " <scope>provided</scope>\n"
- + " </dependency> \n"
- + " \n"
- + " <dependency>\n"
- + " <groupId>org.apache.syncope</groupId>\n"
- + " <artifactId>syncope-console</artifactId>\n"
- + " <version>${syncope.version}</version>\n"
- + " <type>war</type>\n"
- + " </dependency> \n"
- + " <dependency>\n"
- + " <groupId>org.apache.syncope</groupId>\n"
- + " <artifactId>syncope-console</artifactId>\n"
- + " <version>${syncope.version}</version>\n"
- + " <classifier>classes</classifier>\n"
- + " <scope>provided</scope>\n"
- + " </dependency> \n"
- + " </dependencies>\n"
- + " </dependencyManagement>\n"
- + " \n"
- + " <build>\n"
- + " \n"
- + " <pluginManagement>\n"
- + " <plugins>\n"
- + " <!-- Disable LICENSE / NOTICE inclusion: see SYNCOPE-84 -->\n"
- + " <plugin>\n"
- + " <groupId>org.apache.maven.plugins</groupId>\n"
- + " <artifactId>maven-war-plugin</artifactId>\n"
- + " <inherited>false</inherited>\n"
- + " <configuration>\n"
- + " <webResources>\n"
- + " <resource>\n"
- + " <directory>src/main/webapp</directory>\n"
- + " <includes>\n"
- + " <include>**/*.jsp</include>\n"
- + " </includes>\n"
- + " <filtering>true</filtering>\n"
- + " </resource>\n"
- + " </webResources>\n"
- + " </configuration>\n"
- + " </plugin>\n"
- + " </plugins>\n"
- + " </pluginManagement>\n"
- + " \n"
- + " <!-- Disable legal check for generated projects: see SYNCOPE-84 -->\n"
- + " <plugins>\n"
- + " <plugin>\n"
- + " <groupId>org.codehaus.mojo</groupId>\n"
- + " <artifactId>ianal-maven-plugin</artifactId>\n"
- + " <inherited>true</inherited>\n"
- + " <executions>\n"
- + " <execution> \n"
- + " <goals>\n"
- + " <goal>verify-legal-files</goal>\n"
- + " </goals>\n"
- + " <phase>none</phase>\n"
- + " </execution>\n"
- + " </executions>\n"
- + " </plugin>\n"
- + " <plugin>\n"
- + " <groupId>org.apache.rat</groupId>\n"
- + " <artifactId>apache-rat-plugin</artifactId>\n"
- + " <inherited>true</inherited>\n"
- + " <executions>\n"
- + " <execution>\n"
- + " <goals>\n"
- + " <goal>check</goal>\n"
- + " </goals>\n"
- + " <phase>none</phase>\n"
- + " </execution>\n"
- + " </executions>\n"
- + " </plugin>\n"
- + " </plugins>\n"
- + " </build>\n"
- + " \n"
- + " <modules>\n"
- + " <module>core</module>\n"
- + " <module>console</module>\n"
- + " </modules>\n"
- + " \n"
- + " <repositories>\n"
- + " <repository>\n"
+ public static final String REPOSITORY =
+ " <repositories>\n"
+ + " <repository>\n"
+ " <id>ASF</id>\n"
- + " <url>https://repository.apache.org/content/repositories/snapshots/</url>\n"
+ + " <url>https://repository.apache.org/content/repositories/snapshots/</url>\n"
+ " <snapshots>\n"
- + " <enabled>true</enabled>\n"
- + " </snapshots>\n"
- + " </repository>\n"
+ + " <enabled>true</enabled>\n"
+ + " </snapshots>\n"
+ + " </repository>\n"
+ "</repositories>\n"
+ "</project>\n";
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/files/PersistenceContextEMFactoryXml.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/files/PersistenceContextEMFactoryXml.java b/installer/src/main/java/org/apache/syncope/installer/files/PersistenceContextEMFactoryXml.java
index 0dd12c4..a64ea36 100644
--- a/installer/src/main/java/org/apache/syncope/installer/files/PersistenceContextEMFactoryXml.java
+++ b/installer/src/main/java/org/apache/syncope/installer/files/PersistenceContextEMFactoryXml.java
@@ -20,45 +20,12 @@ package org.apache.syncope.installer.files;
public class PersistenceContextEMFactoryXml {
- public static final String PATH = "/core/src/main/resources/persistenceContextEMFactory.xml";
+ public static final String PLACEHOLDER = "<entry key=\"openjpa.MetaDataFactory\"\n"
+ + " value=\"jpa(URLs=vfs:${project.build.directory}/cargo/configurations/wildfly8x/"
+ + "deployments/${project.build.finalName}.war/WEB-INF/classes/, Resources=META-INF/orm.xml)\"/>";
+
+ public static final String JBOSS =
+ "<entry key=\"openjpa.MetaDataFactory\" value=\"jpa(URLs=vfs:/content/${project.build.finalName}.war/"
+ + "WEB-INF/classes/, Resources=META-INF/orm.xml)\"/>";
- public static final String FILE = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<!--\n"
- + "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" + "-->\n"
- + "<beans xmlns=\"http://www.springframework.org/schema/beans\"\n"
- + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
- + " xsi:schemaLocation=\"http://www.springframework.org/schema/beans\n"
- + " http://www.springframework.org/schema/beans/spring-beans.xsd\">\n" + "\n"
- + " <bean id=\"entityManagerFactory\"\n"
- + " class=\"org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean\">\n"
- + " <property name=\"persistenceXmlLocation\" value=\"classpath*:META-INF/spring-persistence.xml\"/>\n"
- + " <property name=\"persistenceUnitName\" value=\"syncopePersistenceUnit\"/>\n"
- + " <property name=\"dataSource\" ref=\"dataSource\"/>\n" + " <property name=\"jpaVendorAdapter\">\n"
- + " <bean class=\"org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter\">\n"
- + " <property name=\"showSql\" value=\"false\"/>\n"
- + " <property name=\"generateDdl\" value=\"true\"/>\n"
- + " <property name=\"databasePlatform\" value=\"${jpa.dialect}\"/>\n" + " </bean>\n"
- + " </property>\n" + " <property name=\"jpaPropertyMap\">\n" + " <map>\n"
- + " <!--<entry key=\"openjpa.Log\" value=\"SQL=TRACE\"/>\n"
- + " <entry key=\"openjpa.ConnectionFactoryProperties\" \n"
- + " value=\"PrintParameters=true, PrettyPrint=true, PrettyPrintLineLength=80\"/>-->\n"
- + " \n" + " <entry key=\"openjpa.NontransactionalWrite\" value=\"false\"/>\n"
- + " <entry key=\"openjpa.AutoDetach\" value=\"close, commit, nontx-read, rollback\"/>\n" + "\n"
- + " <entry key=\"openjpa.jdbc.SchemaFactory\" value=\"native(ForeignKeys=true)\"/>\n"
- + " <entry key=\"openjpa.jdbc.MappingDefaults\" value=\"ForeignKeyDeleteAction=restrict, JoinForeignKeyDeleteAction=restrict\"/>\n"
- + " \n" + " <entry key=\"openjpa.DataCache\" value=\"true\"/>\n"
- + " <entry key=\"openjpa.QueryCache\" value=\"true\"/>\n"
- + " <entry key=\"openjpa.RemoteCommitProvider\" value=\"sjvm\"/>\n" + " </map>\n"
- + " </property>\n" + " </bean>\n" + "\n" + "</beans>\n";
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/files/PersistenceProperties.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/files/PersistenceProperties.java b/installer/src/main/java/org/apache/syncope/installer/files/PersistenceProperties.java
index c27ac35..cba0b61 100644
--- a/installer/src/main/java/org/apache/syncope/installer/files/PersistenceProperties.java
+++ b/installer/src/main/java/org/apache/syncope/installer/files/PersistenceProperties.java
@@ -20,8 +20,6 @@ package org.apache.syncope.installer.files;
public class PersistenceProperties {
- public static final String PATH = "/core/src/main/resources/persistence.properties";
-
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"
@@ -59,28 +57,31 @@ public class PersistenceProperties {
+ "audit.sql=audit.sql\n"
+ "database.schema=\n";
- public static final String ORACLE = ""
- + "jpa.driverClassName=oracle.jdbc.OracleDriver\n"
+ public static final String ORACLE = "jpa.driverClassName=oracle.jdbc.OracleDriver\n"
+ "jpa.url=%s\n"
+ "jpa.username=%s\n"
+ "jpa.password=%s\n"
+ "jpa.dialect=org.apache.openjpa.jdbc.sql.OracleDictionary\n"
- + "jpa.pool.validationQuery=SELECT 1\n"
+ + "jpa.pool.validationQuery=SELECT 1 FROM DUAL\n"
+ + "#note: other connection pool settings can also be configured here, see persistenceContext.xml\n"
+ "quartz.jobstore=org.quartz.impl.jdbcjobstore.oracle.OracleDelegate\n"
+ + "quartz.scheduler.idleWaitTime=5000\n"
+ "quartz.sql=tables_oracle.sql\n"
- + "audit.sql=audit.sql\n"
+ + "audit.sql=audit_oracle.sql\n"
+ "database.schema=%s\n";
- public static final String SQLSERVER = ""
- + "jpa.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver\n"
+ public static final String SQLSERVER = "jpa.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver\n"
+ "jpa.url=%s\n"
+ "jpa.username=%s\n"
+ "jpa.password=%s\n"
- + "jpa.dialect=org.apache.openjpa.jdbc.sql.SQLServerDictionary\n"
- + "quartz.jobstore=org.quartz.impl.jdbcjobstore.MSSQLDelegate\n"
- + "quartz.sql=tables_sqlServer.sql\n"
- + "audit.sql=audit.sql\n"
- + "database.schema=\n";
+ + "jpa.dialect=org.apache.openjpa.jdbc.sql.SQLServerDictionary\n"
+ + "jpa.pool.validationQuery=SELECT 1\n"
+ + "#note: other connection pool settings can also be configured here, see persistenceContext.xml\n"
+ + "quartz.jobstore=org.quartz.impl.jdbcjobstore.MSSQLDelegate\n"
+ + "quartz.scheduler.idleWaitTime=5000\n"
+ + "quartz.sql=tables_sqlServer.sql\n"
+ + "audit.sql=audit_sqlserver.sql\n"
+ + "database.schema=";
public static final String QUARTZ_INNO_DB = "quartz.sql=tables_mysql_innodb.sql";
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/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 45569e7..0c7bdea 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
@@ -22,16 +22,15 @@ import org.apache.syncope.installer.utilities.FileSystemUtils;
import com.izforge.izpack.panels.process.AbstractUIProcessHandler;
import java.io.File;
import java.io.IOException;
+import java.util.Properties;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;
-import org.apache.syncope.installer.files.ModelerPom;
-import org.apache.syncope.installer.files.ModelerTokenValueMap;
import org.apache.syncope.installer.files.ParentPom;
import org.apache.syncope.installer.utilities.InstallLog;
import org.apache.syncope.installer.utilities.MavenUtils;
import org.xml.sax.SAXException;
-public class ArchetypeProcess {
+public class ArchetypeProcess extends BaseProcess {
public void run(final AbstractUIProcessHandler handler, final String[] args) {
final String installPath = args[0];
@@ -52,6 +51,8 @@ public class ArchetypeProcess {
final String proxyUser = args[15];
final String proxyPwd = args[16];
final boolean mavenProxyAutoconf = Boolean.valueOf(args[17]);
+
+ setSyncopeInstallDir(installPath, artifactId);
final FileSystemUtils fileSystemUtils = new FileSystemUtils(handler);
fileSystemUtils.createDirectory(installPath);
@@ -97,21 +98,37 @@ public class ArchetypeProcess {
handler.logOutput("########################## IMPORTANT ##########################", true);
mavenUtils.archetypeGenerate(
syncopeVersion, groupId, artifactId, secretKey, anonymousKey, installPath, customMavenProxySettings);
-
+
if (syncopeVersion.contains("SNAPSHOT")) {
- fileSystemUtils.writeToFile(new File(installPath + "/" + artifactId + ParentPom.PATH),
- String.format(ParentPom.FILE, syncopeVersion, syncopeVersion, groupId, artifactId));
+ final File pomFile =
+ new File(syncopeInstallDir + properties.getProperty("pomFile"));
+ String contentPomFile = fileSystemUtils.readFile(pomFile);
+ fileSystemUtils.writeToFile(pomFile, contentPomFile.replace(ParentPom.PLACEHOLDER, ParentPom.REPOSITORY));
}
-
+
fileSystemUtils.createDirectory(confDirectory);
fileSystemUtils.createDirectory(logsDirectory);
fileSystemUtils.createDirectory(bundlesDirectory);
fileSystemUtils.createDirectory(modelerDirectory);
- fileSystemUtils.writeToFile(new File(modelerDirectory + ModelerPom.PATH),
- String.format(ModelerPom.FILE, modelerDirectory, modelerDirectory));
- fileSystemUtils.writeToFile(new File(modelerDirectory + ModelerTokenValueMap.PATH), ModelerTokenValueMap.FILE);
- mavenUtils.mvnCleanPackage(modelerDirectory, customMavenProxySettings);
+
+ fileSystemUtils.copyFileFromResources("/" + properties.getProperty("modelerPomFile"),
+ modelerDirectory + "/" + properties.getProperty("pomFile"), handler);
+
+ fileSystemUtils.copyFile(
+ syncopeInstallDir
+ + properties.getProperty("consoleResDirectory")
+ + "/" + properties.getProperty("tokenValueMapFile"),
+ modelerDirectory + "/" + properties.getProperty("tokenValueMapFile"));
+
+ final Properties modelerProperties = new Properties();
+ modelerProperties.setProperty("modeler.directory", modelerDirectory);
+ mavenUtils.mvnCleanPackageWithProperties(modelerDirectory, modelerProperties, customMavenProxySettings);
+
+ final Properties syncopeProperties = new Properties();
+ syncopeProperties.setProperty("conf.directory", confDirectory);
+ syncopeProperties.setProperty("log.directory", logsDirectory);
+ syncopeProperties.setProperty("bundles.directory", bundlesDirectory);
mavenUtils.mvnCleanPackageWithProperties(
- installPath + "/" + artifactId, confDirectory, logsDirectory, bundlesDirectory, customMavenProxySettings);
+ installPath + "/" + artifactId, syncopeProperties, customMavenProxySettings);
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/processes/BaseProcess.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/processes/BaseProcess.java b/installer/src/main/java/org/apache/syncope/installer/processes/BaseProcess.java
new file mode 100644
index 0000000..2058c12
--- /dev/null
+++ b/installer/src/main/java/org/apache/syncope/installer/processes/BaseProcess.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.processes;
+
+import static org.apache.syncope.installer.processes.ArchetypeProcess.properties;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+import org.apache.commons.io.IOUtils;
+
+public class BaseProcess {
+
+ protected final static Properties properties = new Properties();
+
+ protected String syncopeInstallDir;
+
+ private static InputStream is = null;
+
+ static {
+ try {
+ is = BaseProcess.class.getResourceAsStream("/configuration.properties");
+ properties.load(is);
+ } catch (final IOException e) {
+ } finally {
+ IOUtils.closeQuietly(is);
+ }
+ }
+
+ protected void setSyncopeInstallDir(final String installPath, final String artifactId) {
+ final StringBuilder path = new StringBuilder();
+ path.append(installPath);
+ path.append("/");
+ path.append(artifactId);
+ path.append("/");
+ syncopeInstallDir = path.toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java b/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java
index 62cd6d4..6b99918 100644
--- a/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java
+++ b/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java
@@ -22,21 +22,31 @@ import org.apache.syncope.installer.utilities.FileSystemUtils;
import com.izforge.izpack.panels.process.AbstractUIProcessHandler;
import java.io.File;
import java.io.IOException;
+import java.util.Properties;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;
import org.apache.syncope.installer.containers.Glassfish;
import org.apache.syncope.installer.containers.Tomcat;
import org.apache.syncope.installer.containers.jboss.JBoss;
import org.apache.syncope.installer.enums.Containers;
+import org.apache.syncope.installer.files.ConsoleProperties;
import org.apache.syncope.installer.files.GlassfishCoreWebXml;
import org.apache.syncope.installer.files.JBossDeploymentStructureXml;
-import org.apache.syncope.installer.files.PersistenceContextEMFactoryXml;
import org.apache.syncope.installer.files.CoreWebXml;
+import org.apache.syncope.installer.files.PersistenceContextEMFactoryXml;
import org.apache.syncope.installer.utilities.InstallLog;
import org.apache.syncope.installer.utilities.MavenUtils;
import org.xml.sax.SAXException;
-public class ContainerProcess {
+public class ContainerProcess extends BaseProcess {
+
+ private final static String HTTP = "http";
+
+ private final static String HTTPS = "https";
+
+ private final static String DEFAULT_HOST = "localhost";
+
+ private final static String DEFAULT_PORT = "8080";
private String installPath;
@@ -56,6 +66,12 @@ public class ContainerProcess {
private String glassfishDir;
+ private boolean glassfishSsl;
+
+ private String glassfishHost;
+
+ private String glassfishPort;
+
private String confDirectory;
private String logsDirectory;
@@ -76,6 +92,8 @@ public class ContainerProcess {
private String jbossAdminPassword;
+ private String jbossManagementPort;
+
private boolean isProxyEnabled;
private String proxyHost;
@@ -99,49 +117,104 @@ public class ContainerProcess {
tomcatPort = args[6];
tomcatUser = args[7];
tomcatPassword = args[8];
- glassfishDir = args[9];
- confDirectory = args[10];
- logsDirectory = args[11];
- bundlesDirectory = args[12];
- withDataSource = Boolean.valueOf(args[13]);
- jbossSsl = Boolean.valueOf(args[14]);
- jbossHost = args[15];
- jbossPort = args[16];
- jbossJdbcModuleName = args[17];
- jbossAdminUsername = args[18];
- jbossAdminPassword = args[19];
- isProxyEnabled = Boolean.valueOf(args[20]);
- proxyHost = args[21];
- proxyPort = args[22];
- proxyUser = args[23];
- proxyPwd = args[24];
- mavenProxyAutoconf = Boolean.valueOf(args[25]);
+ glassfishSsl = Boolean.valueOf(args[9]);
+ glassfishHost = args[10];
+ glassfishPort = args[11];
+ glassfishDir = args[12];
+ confDirectory = args[13];
+ logsDirectory = args[14];
+ bundlesDirectory = args[15];
+ withDataSource = Boolean.valueOf(args[16]);
+ jbossSsl = Boolean.valueOf(args[17]);
+ jbossHost = args[18];
+ jbossPort = args[19];
+ jbossJdbcModuleName = args[20];
+ jbossAdminUsername = args[21];
+ jbossAdminPassword = args[22];
+ jbossManagementPort = args[23];
+ isProxyEnabled = Boolean.valueOf(args[24]);
+ proxyHost = args[25];
+ proxyPort = args[26];
+ proxyUser = args[27];
+ proxyPwd = args[28];
+ mavenProxyAutoconf = Boolean.valueOf(args[28]);
final FileSystemUtils fileSystemUtils = new FileSystemUtils(handler);
-
+
handler.logOutput("Configure web.xml file according to " + selectedContainer + " properties", true);
InstallLog.getInstance().info("Configure web.xml file according to " + selectedContainer + " properties");
-
+
+ setSyncopeInstallDir(installPath, artifactId);
+
if (withDataSource) {
- fileSystemUtils.writeToFile(new File(installPath + "/" + artifactId + CoreWebXml.PATH), CoreWebXml.
- withDataSource());
+ final File coreWebXmlFile =
+ new File(syncopeInstallDir + properties.getProperty("coreWebXmlFile"));
+ final String contentCoreWebXmlFile = fileSystemUtils.readFile(coreWebXmlFile);
+
switch (selectedContainer) {
+ case TOMCAT:
+ fileSystemUtils.writeToFile(coreWebXmlFile, CoreWebXml.withDataSource(contentCoreWebXmlFile));
+ break;
case JBOSS:
- fileSystemUtils.writeToFile(new File(installPath + "/" + artifactId + CoreWebXml.PATH),
- CoreWebXml.withDataSourceForJBoss());
- fileSystemUtils.writeToFile(new File(installPath + "/" + artifactId
- + PersistenceContextEMFactoryXml.PATH), PersistenceContextEMFactoryXml.FILE);
- fileSystemUtils.writeToFile(new File(installPath + "/" + artifactId
- + JBossDeploymentStructureXml.PATH),
- String.format(JBossDeploymentStructureXml.FILE, jbossJdbcModuleName));
+ fileSystemUtils.
+ writeToFile(coreWebXmlFile, CoreWebXml.withDataSourceForJBoss(contentCoreWebXmlFile));
+ final File jbossDeploymentStructureFile =
+ new File(syncopeInstallDir + properties.getProperty("jBossDeploymentStructureXmlFile"));
+ final String contentJbossDeploymentStructureFile =
+ fileSystemUtils.readFile(jbossDeploymentStructureFile);
+ fileSystemUtils.writeToFile(
+ jbossDeploymentStructureFile,
+ contentJbossDeploymentStructureFile.replace(
+ JBossDeploymentStructureXml.PLACEHOLDER,
+ String.format(JBossDeploymentStructureXml.JBOSSMODULE, jbossJdbcModuleName)));
break;
case GLASSFISH:
- fileSystemUtils.writeToFile(new File(installPath + "/" + artifactId + GlassfishCoreWebXml.PATH),
- GlassfishCoreWebXml.withDataSource());
+ final File glassfishCoreWebXmlFile =
+ new File(syncopeInstallDir + properties.getProperty("glassfishCoreWebXmlFile"));
+ final String contentGlassfishWebXmlFile = fileSystemUtils.readFile(glassfishCoreWebXmlFile);
+ fileSystemUtils.writeToFile(glassfishCoreWebXmlFile,
+ contentGlassfishWebXmlFile.replace(GlassfishCoreWebXml.PLACEHOLDER,
+ GlassfishCoreWebXml.DATA_SOURCE));
break;
}
}
+ final File consolePropertiesFile =
+ new File(syncopeInstallDir
+ + properties.getProperty("consoleResDirectory")
+ + "/" + properties.getProperty("consolePropertiesFile"));
+ final String contentConsolePropertiesFile = fileSystemUtils.readFile(consolePropertiesFile);
+
+ final String scheme;
+ final String host;
+ final String port;
+ switch (selectedContainer) {
+ case TOMCAT:
+ scheme = tomcatSsl ? HTTPS : HTTP;
+ host = tomcatHost;
+ port = tomcatPort;
+ break;
+ case JBOSS:
+ scheme = jbossSsl ? HTTPS : HTTP;
+ host = jbossHost;
+ port = jbossPort;
+ persistenceContextEMFactory(fileSystemUtils, handler);
+ break;
+ case GLASSFISH:
+ scheme = glassfishSsl ? HTTPS : HTTP;
+ host = glassfishHost;
+ port = glassfishPort;
+ break;
+ default:
+ scheme = HTTP;
+ host = DEFAULT_HOST;
+ port = DEFAULT_PORT;
+ }
+
+ fileSystemUtils.writeToFile(consolePropertiesFile,
+ contentConsolePropertiesFile.replace(ConsoleProperties.PLACEHOLDER,
+ String.format(ConsoleProperties.CONSOLE, scheme, host, port)));
+
final MavenUtils mavenUtils = new MavenUtils(mavenDir, handler);
File customMavenProxySettings = null;
try {
@@ -178,8 +251,14 @@ public class ContainerProcess {
InstallLog.getInstance().error(messageError.append(ex.getMessage() == null ? "" : ex.getMessage()).
toString());
}
- mavenUtils.mvnCleanPackageWithProperties(installPath + "/" + artifactId, confDirectory, logsDirectory, bundlesDirectory,
- customMavenProxySettings);
+
+ final Properties mvnProperties = new Properties();
+ mvnProperties.setProperty("conf.directory", confDirectory);
+ mvnProperties.setProperty("log.directory", logsDirectory);
+ mvnProperties.setProperty("bundles.directory", bundlesDirectory);
+ mavenUtils.mvnCleanPackageWithProperties(
+ installPath + "/" + artifactId, mvnProperties, customMavenProxySettings);
+
if (isProxyEnabled && mavenProxyAutoconf) {
FileSystemUtils.delete(customMavenProxySettings);
}
@@ -187,7 +266,8 @@ public class ContainerProcess {
switch (selectedContainer) {
case TOMCAT:
final Tomcat tomcat = new Tomcat(
- tomcatSsl, tomcatHost, tomcatPort, installPath, artifactId, tomcatUser, tomcatPassword, handler);
+ tomcatSsl, tomcatHost, tomcatPort, installPath, artifactId, tomcatUser, tomcatPassword,
+ handler);
boolean deployCoreResult = tomcat.deployCore();
if (deployCoreResult) {
handler.logOutput("Core successfully deployed ", true);
@@ -210,7 +290,7 @@ public class ContainerProcess {
break;
case JBOSS:
final JBoss jBoss = new JBoss(
- jbossSsl, jbossHost, jbossPort, jbossAdminUsername,
+ jbossSsl, jbossHost, jbossManagementPort, jbossAdminUsername,
jbossAdminPassword, installPath, artifactId, handler);
boolean deployCoreJboss = jBoss.deployCore();
@@ -239,10 +319,25 @@ public class ContainerProcess {
final Glassfish glassfish = new Glassfish(installPath, artifactId);
- fileSystemUtils.exec("sh " + glassfishDir + Glassfish.DEPLOY_COMMAND + glassfish.deployCore(), null);
- fileSystemUtils.exec("sh " + glassfishDir + Glassfish.DEPLOY_COMMAND + glassfish.deployConsole(), null);
+ fileSystemUtils.exec("sh " + glassfishDir
+ + Glassfish.DEPLOY_COMMAND + glassfish.deployCore(), null);
+ fileSystemUtils.exec("sh " + glassfishDir
+ + Glassfish.DEPLOY_COMMAND + glassfish.deployConsole(), null);
break;
}
}
+ private void persistenceContextEMFactory(
+ final FileSystemUtils fileSystemUtils, final AbstractUIProcessHandler handler) {
+ fileSystemUtils.copyFileFromResources("/jboss/persistenceContextEMFactory.xml",
+ syncopeInstallDir
+ + properties.getProperty("persistenceContextEMFactoryFile"), handler);
+ final File persistenceContextEMFactoryFile = new File(
+ syncopeInstallDir + properties.getProperty("persistenceContextEMFactoryFile"));
+ final String contentPersistenceContextEMFactory = fileSystemUtils.readFile(persistenceContextEMFactoryFile);
+ fileSystemUtils.writeToFile(
+ persistenceContextEMFactoryFile,
+ contentPersistenceContextEMFactory.replace(PersistenceContextEMFactoryXml.PLACEHOLDER,
+ PersistenceContextEMFactoryXml.JBOSS));
+ }
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/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 983e3e8..33356f6 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
@@ -22,11 +22,10 @@ import org.apache.syncope.installer.utilities.FileSystemUtils;
import com.izforge.izpack.panels.process.AbstractUIProcessHandler;
import java.io.File;
import org.apache.syncope.installer.enums.DBs;
-import org.apache.syncope.installer.files.OrmXml;
import org.apache.syncope.installer.files.PersistenceProperties;
import org.apache.syncope.installer.utilities.InstallLog;
-public class PersistenceProcess {
+public class PersistenceProcess extends BaseProcess {
private String installPath;
@@ -56,8 +55,8 @@ public class PersistenceProcess {
oracleTableSpace = args[7];
final FileSystemUtils fileSystemUtils = new FileSystemUtils(handler);
-
final StringBuilder persistenceProperties = new StringBuilder(PersistenceProperties.HEADER);
+ setSyncopeInstallDir(installPath, artifactId);
handler.logOutput("Configure persistence file according to " + dbSelected + " properties", true);
InstallLog.getInstance().info("Configure persistence file according to " + dbSelected + " properties");
@@ -80,24 +79,22 @@ public class PersistenceProcess {
persistenceProperties.append(String.format(
PersistenceProperties.ORACLE, persistenceUrl, persistenceUser, persistencePassword,
oracleTableSpace));
- writeOrmFile(fileSystemUtils, OrmXml.ORACLE_ORM);
+ fileSystemUtils.copyFileFromResources("/META-INF/orm.xml.oracle",
+ syncopeInstallDir + properties.getProperty("coreMetaInfDirectory")
+ + "/" + properties.getProperty("ormXmlFile"), handler);
break;
case SQLSERVER:
persistenceProperties.append(String.format(
PersistenceProperties.SQLSERVER, persistenceUrl, persistenceUser, persistencePassword));
- writeOrmFile(fileSystemUtils, OrmXml.SQLSERVER_ORM);
+ fileSystemUtils.copyFileFromResources("/META-INF/orm.xml.sqlserver",
+ syncopeInstallDir
+ + properties.getProperty("coreMetaInfDirectory")
+ + "/" + properties.getProperty("ormXmlFile"), handler);
break;
}
fileSystemUtils.writeToFile(new File(
- installPath + "/" + artifactId + PersistenceProperties.PATH), persistenceProperties.toString());
-
- }
-
- private void writeOrmFile(final FileSystemUtils fileSystemUtils, final String content) {
- fileSystemUtils.createDirectory(
- installPath + File.separator + artifactId + OrmXml.PATH_DIR);
- fileSystemUtils.writeToFile(
- new File(installPath + File.separator + artifactId + OrmXml.PATH_COMPLETE), content);
+ syncopeInstallDir + properties.getProperty("persistencePropertiesFile")),
+ persistenceProperties.toString());
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/utilities/FileSystemUtils.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/utilities/FileSystemUtils.java b/installer/src/main/java/org/apache/syncope/installer/utilities/FileSystemUtils.java
index aea1c95..4381c1e 100644
--- a/installer/src/main/java/org/apache/syncope/installer/utilities/FileSystemUtils.java
+++ b/installer/src/main/java/org/apache/syncope/installer/utilities/FileSystemUtils.java
@@ -29,6 +29,11 @@ import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
+import java.net.URL;
+import java.nio.file.CopyOption;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
@@ -54,6 +59,21 @@ public class FileSystemUtils {
}
}
+ public void copyFile(final String sourceFilePath, final String targetFilePath) {
+ try {
+ final CopyOption[] options = new CopyOption[] {
+ StandardCopyOption.REPLACE_EXISTING,
+ StandardCopyOption.COPY_ATTRIBUTES
+ };
+ Files.copy(Paths.get(sourceFilePath), Paths.get(targetFilePath), options);
+ } catch (final IOException ex) {
+ final String errorMessage =
+ "Error copy file " + sourceFilePath + " to " + targetFilePath;
+ handler.emitError(errorMessage, errorMessage);
+ InstallLog.getInstance().error(errorMessage);
+ }
+ }
+
public void exec(final String cmd, final String path) {
try {
handler.logOutput("Executing " + cmd, true);
@@ -96,6 +116,18 @@ public class FileSystemUtils {
}
}
+ public String readFile(final File file) {
+ String content = "";
+ try {
+ content = FileUtils.readFileToString(file);
+ } catch (IOException ex) {
+ final String errorMessage = "Error reading file " + file.getAbsolutePath() + ": " + ex.getMessage();
+ handler.emitError(errorMessage, errorMessage);
+ InstallLog.getInstance().error(errorMessage);
+ }
+ return content;
+ }
+
public void appendToFile(final File file, final String content) {
try {
if (!file.exists()) {
@@ -131,4 +163,17 @@ public class FileSystemUtils {
public static void delete(final File file) {
FileUtils.deleteQuietly(file);
}
+
+ public void copyFileFromResources(final String filePath,
+ final String destination, final AbstractUIProcessHandler handler) {
+ try {
+ final URL url = getClass().getResource(filePath);
+ final File dest = new File(destination);
+ FileUtils.copyURLToFile(url, dest);
+ } catch (IOException ex) {
+ final String errorMessage = "Error copy file " + filePath;
+ handler.emitError(errorMessage, errorMessage);
+ InstallLog.getInstance().error(errorMessage);
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java b/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java
index e842ea7..f39d4b4 100644
--- a/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java
+++ b/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java
@@ -65,8 +65,8 @@ public class MavenUtils {
final InvocationRequest request = new DefaultInvocationRequest();
request.setGoals(Collections.singletonList("archetype:generate"));
request.setInteractive(false);
- final Properties properties
- = archetypeProperties(archetypeVersion, groupId, artifactId, secretKey, anonymousKey);
+ final Properties properties =
+ archetypeProperties(archetypeVersion, groupId, artifactId, secretKey, anonymousKey);
request.setProperties(properties);
if (customSettingsFile != null && FileUtils.sizeOf(customSettingsFile) > 0) {
request.setUserSettingsFile(customSettingsFile);
@@ -94,24 +94,8 @@ public class MavenUtils {
return properties;
}
- public void mvnCleanPackage(final String path, final File customSettingsFile) {
+ public void mvnCleanPackageWithProperties(final String path, final Properties properties, final File customSettingsFile) {
final InvocationRequest request = new DefaultInvocationRequest();
- if (customSettingsFile != null && FileUtils.sizeOf(customSettingsFile) > 0) {
- request.setUserSettingsFile(customSettingsFile);
- }
- final List<String> mavenGoals = new ArrayList<String>();
- mavenGoals.add("clean");
- mavenGoals.add("package");
- request.setGoals(mavenGoals);
- logToHandler(request.getGoals(), new Properties());
- logToFile(request.getGoals(), new Properties());
- invoke(request, path);
- }
-
- public void mvnCleanPackageWithProperties(final String path, final String confDirectory,
- final String logDirectory, final String bundlesDirectory, final File customSettingsFile) {
- final InvocationRequest request = new DefaultInvocationRequest();
- final Properties properties = packageProperties(confDirectory, logDirectory, bundlesDirectory);
request.setProperties(properties);
if (customSettingsFile != null && FileUtils.sizeOf(customSettingsFile) > 0) {
request.setUserSettingsFile(customSettingsFile);
@@ -149,15 +133,6 @@ public class MavenUtils {
}
}
- private Properties packageProperties(final String confDirectory, final String logDirectory,
- final String bundlesDirectory) {
- final Properties properties = new Properties();
- properties.setProperty("conf.directory", confDirectory);
- properties.setProperty("log.directory", logDirectory);
- properties.setProperty("bundles.directory", bundlesDirectory);
- return properties;
- }
-
private InvocationResult invoke(final InvocationRequest request, final String path) {
InvocationResult result = null;
final Invoker invoker = new DefaultInvoker();
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/resources/configuration.properties
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/configuration.properties b/installer/src/main/resources/configuration.properties
new file mode 100644
index 0000000..e06fe57
--- /dev/null
+++ b/installer/src/main/resources/configuration.properties
@@ -0,0 +1,31 @@
+# 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.
+
+coreWebXmlFile=core/src/main/webapp/WEB-INF/web.xml
+jBossDeploymentStructureXmlFile=core/src/main/webapp/WEB-INF/jboss-deployment-structure.xml
+glassfishCoreWebXmlFile=core/src/main/webapp/WEB-INF/glassfish-web.xml
+tokenValueMapFile=oryx.debug.js-tokenValueMap.properties
+consoleResDirectory=console/src/main/resources
+pomFile=pom.xml
+persistenceContextEMFactoryFile=core/src/main/resources/persistenceContextEMFactory.xml
+coreMetaInfDirectory=core/src/main/resources/META-INF
+ormXmlFile=orm.xml
+ormXmlOracle=orm.xml.oracle
+ormXmlOracleSqlServer=orm.xml.sqlserver
+persistencePropertiesFile=core/src/main/resources/persistence.properties
+consolePropertiesFile=console.properties
+modelerPomFile=modelerPom.xml
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/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 db1a64f..859ec18 100644
--- a/installer/src/main/resources/izpack/ProcessPanel.Spec.xml
+++ b/installer/src/main/resources/izpack/ProcessPanel.Spec.xml
@@ -64,23 +64,29 @@ under the License.
<arg>$tomcat.container.port</arg><!-- 6 -->
<arg>$tomcat.container.user</arg><!-- 7 -->
<arg>$tomcat.container.pwd</arg><!-- 8 -->
- <arg>$glassfish.container.dir</arg><!-- 9 -->
- <arg>$mvn.conf.directory</arg><!-- 10 -->
- <arg>$mvn.log.directory</arg><!-- 11 -->
- <arg>$mvn.bundle.directory</arg><!-- 12 -->
- <arg>$with.datasuorce</arg><!-- 13 -->
- <arg>$jboss.container.ssl</arg><!-- 14 -->
- <arg>$jboss.container.host</arg><!-- 15 -->
- <arg>$jboss.container.port</arg><!-- 16 -->
- <arg>$jboss.container.jdbc.module</arg><!-- 17 -->
- <arg>$jboss.container.user</arg><!-- 18 -->
- <arg>$jboss.container.pwd</arg><!-- 19 -->
- <arg>$mvn.proxy</arg><!-- 20 -->
- <arg>$mvn.proxy.host</arg><!-- 21 -->
- <arg>$mvn.proxy.port</arg><!-- 22 -->
- <arg>$mvn.proxy.user</arg><!-- 23 -->
- <arg>$mvn.proxy.pwd</arg><!-- 24 -->
- <arg>$mvn.proxy.autoconf</arg><!-- 25 -->
+ <arg>$glassfish.container.ssl</arg><!-- 9 -->
+ <arg>$glassfish.container.host</arg><!-- 10 -->
+ <arg>$glassfish.container.port</arg><!--11 -->
+ <arg>$glassfish.container.dir</arg><!-- 12 -->
+ <arg>$mvn.conf.directory</arg><!-- 13 -->
+ <arg>$mvn.log.directory</arg><!-- 14 -->
+ <arg>$mvn.bundle.directory</arg><!-- 15 -->
+ <arg>$with.datasuorce</arg><!-- 16 -->
+ <arg>$jboss.container.ssl</arg><!-- 17 -->
+ <arg>$jboss.container.host</arg><!-- 18 -->
+ <arg>$jboss.container.port</arg><!-- 19 -->
+ <arg>$jboss.container.jdbc.module</arg><!-- 20 -->
+ <arg>$jboss.container.user</arg><!-- 21 -->
+ <arg>$jboss.container.pwd</arg><!-- 22 -->
+ <arg>$jboss.container.management.port</arg><!-- 23 -->
+ <arg>$mvn.proxy</arg><!-- 24 -->
+ <arg>$mvn.proxy.host</arg><!-- 25 -->
+ <arg>$mvn.proxy.port</arg><!-- 26 -->
+ <arg>$mvn.proxy.user</arg><!-- 27 -->
+ <arg>$mvn.proxy.pwd</arg><!-- 28 -->
+ <arg>$mvn.proxy.autoconf</arg><!-- 29 -->
+ <arg>$mvn.proxy.autoconf</arg><!-- 30 -->
+ <arg>$mvn.proxy.autoconf</arg><!-- 31 -->
</executeclass>
</job>
<onFail previous="true" next="false" />
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/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 c7795f8..f2c35b8 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="800" height="600">
<modifier key="useButtonIcons" value="yes"/>
<modifier key="useLabelIcons" value="no"/>
<modifier key="labelGap" value="2"/>
@@ -55,7 +55,7 @@ under the License.
<variable name="InstallerFrame.logfilePath" value="Default"/>
<variable name="WELCOME_TEXT" value="Apache Syncope Installer"/>
<variable name="WELCOME_VERSION" value="${appversion}"/>
- <variable name="TargetPanel.dir.unix" value="/tmp/syncope"/>
+ <variable name="TargetPanel.dir.unix" value="/var/tmp/syncope"/>
<variable name="TargetPanel.dir.windows" value="C:\Program Files"/>
</variables>
@@ -170,6 +170,6 @@ under the License.
<pack name="Apache Syncope" required="yes">
<description>Apache Syncope Installer</description>
</pack>
- </packs>
+ </packs>
</izpack:installation>
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/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 65ab5c9..00f183f 100644
--- a/installer/src/main/resources/izpack/userInputLang.xml_eng
+++ b/installer/src/main/resources/izpack/userInputLang.xml_eng
@@ -52,6 +52,9 @@ under the License.
<str id="tomcat.container.pwd.id" txt="Tomcat password:"/>
<str id="glassfish.container.dir.id" txt="Glassfish home directory:"/>
+ <str id="glassfish.container.ssl.id" txt="Https"/>
+ <str id="glassfish.container.host.id" txt="Glassfish host:"/>
+ <str id="glassfish.container.port.id" txt="Glassfish port:"/>
<str id="jboss.container.ssl.id" txt="Https"/>
<str id="jboss.container.host.id" txt="Jboss host:"/>
@@ -59,4 +62,5 @@ under the License.
<str id="jboss.container.jdbc.module.id" txt="Jboss JDBC module name:"/>
<str id="jboss.container.user.id" txt="Jboss admin username:"/>
<str id="jboss.container.pwd.id" txt="Jboss admin password:"/>
+ <str id='jboss.container.management.port.id' txt="Jboss management port"/>
</langpack>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/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 d60fc56..65dc51f 100644
--- a/installer/src/main/resources/izpack/userInputLang.xml_ita
+++ b/installer/src/main/resources/izpack/userInputLang.xml_ita
@@ -52,6 +52,9 @@ under the License.
<str id="tomcat.container.pwd.id" txt="Tomcat password:"/>
<str id="glassfish.container.dir.id" txt="Glassfish home directory:"/>
+ <str id="glassfish.container.ssl.id" txt="Https"/>
+ <str id="glassfish.container.host.id" txt="Glassfish host:"/>
+ <str id="glassfish.container.port.id" txt="Glassfish port:"/>
<str id="jboss.container.ssl.id" txt="Https"/>
<str id="jboss.container.host.id" txt="Jboss host:"/>
@@ -59,4 +62,5 @@ under the License.
<str id="jboss.container.jdbc.module.id" txt="Jboss JDBC module name:"/>
<str id="jboss.container.user.id" txt="Jboss admin username:"/>
<str id="jboss.container.pwd.id" txt="Jboss admin password:"/>
+ <str id='jboss.container.management.port.id' txt="Jbos management port"/>
</langpack>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/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 bf1ce27..0253a33 100644
--- a/installer/src/main/resources/izpack/userInputSpec.xml
+++ b/installer/src/main/resources/izpack/userInputSpec.xml
@@ -131,7 +131,7 @@ under the License.
<spec id="persistence.jdbc.url" size="20" set="jdbc:oracle:thin:@localhost:1521:orcl"/>
</field>
<field type="text" variable="persistence.url" conditionid="sqlserver.choice">
- <spec id="persistence.jdbc.url" size="20" set="jdbc:sqlserver://localhost:1344;database=syncope;selectMethod=cursor;sendStringParametersAsUnicode=false"/>
+ <spec id="persistence.jdbc.url" size="20" set="jdbc:sqlserver://localhost:1433;database=syncope;selectMethod=cursor;sendStringParametersAsUnicode=false"/>
</field>
<field type="space"/>
<field type="text" variable="persistence.dbuser">
@@ -200,6 +200,18 @@ under the License.
<spec id="tomcat.container.pwd.id" size="20" set="s3cret"/>
</field>
+ <field type="check" variable="glassfish.container.ssl" conditionid="glassfish.choice">
+ <spec id="glassfish.container.ssl.id" true="true" false="false" set="false"/>
+ </field>
+ <field type="space"/>
+ <field type="text" variable="glassfish.container.host" conditionid="glassfish.choice">
+ <spec id="glassfish.container.host.id" size="20" set="localhost"/>
+ </field>
+ <field type="space"/>
+ <field type="text" variable="glassfish.container.port" conditionid="glassfish.choice">
+ <spec id="glassfish.container.port.id" size="20" set="8080"/>
+ </field>
+ <field type="space"/>
<field type="text" variable="glassfish.container.dir" conditionid="glassfish.choice">
<spec id="glassfish.container.dir.id" size="20" set="/opt/glassfish4/"/>
</field>
@@ -213,7 +225,7 @@ under the License.
</field>
<field type="space"/>
<field type="text" variable="jboss.container.port" conditionid="jboss.choice">
- <spec id="jboss.container.port.id" size="20" set="9990"/>
+ <spec id="jboss.container.port.id" size="20" set="8080"/>
</field>
<field type="space"/>
<field type="text" variable="jboss.container.jdbc.module" conditionid="jboss.choice">
@@ -227,5 +239,9 @@ under the License.
<field type="text" variable="jboss.container.pwd" conditionid="jboss.choice">
<spec id="jboss.container.pwd.id" size="20" set="password"/>
</field>
+ <field type="space"/>
+ <field type="text" variable="jboss.container.management.port" conditionid="jboss.choice">
+ <spec id="jboss.container.management.port.id" size="20" set="9990"/>
+ </field>
</panel>
</userInput>
http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/resources/modelerPom.xml
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/modelerPom.xml b/installer/src/main/resources/modelerPom.xml
new file mode 100644
index 0000000..8b65ba6
--- /dev/null
+++ b/installer/src/main/resources/modelerPom.xml
@@ -0,0 +1,116 @@
+<?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>
+
+ <groupId>org.apache.syncope</groupId>
+ <artifactId>activitiModelerSetup</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
+
+ <properties>
+ <activiti.version>5.16.2</activiti.version>
+ <activiti-modeler.directory>${modeler.directory}</activiti-modeler.directory>
+ <tokenValueMap>${modeler.directory}/oryx.debug.js-tokenValueMap.properties</tokenValueMap>
+
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.activiti</groupId>
+ <artifactId>activiti-webapp-explorer2</artifactId>
+ <version>${activiti.version}</version>
+ <type>war</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.7</version>
+ <executions>
+ <execution>
+ <id>setupActivitiModeler</id>
+ <phase>process-resources</phase>
+ <configuration>
+ <target>
+ <unzip src="${settings.localRepository}/org/activiti/activiti-webapp-explorer2/${activiti.version}/activiti-webapp-explorer2-${activiti.version}.war"
+ dest="${project.build.directory}/activiti-webapp-explorer2" />
+
+ <mkdir dir="${activiti-modeler.directory}" />
+
+ <mkdir dir="${activiti-modeler.directory}/editor" />
+ <copy todir="${activiti-modeler.directory}/editor">
+ <fileset dir="${project.build.directory}/activiti-webapp-explorer2/editor">
+ <exclude name="oryx.js" />
+ </fileset>
+ </copy>
+ <copy file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/plugins.xml"
+ todir="${activiti-modeler.directory}/editor" />
+ <copy file="${project.build.directory}/activiti-webapp-explorer2/WEB-INF/classes/stencilset.json"
+ todir="${activiti-modeler.directory}/editor" />
+
+ <mkdir dir="${activiti-modeler.directory}/explorer" />
+ <copy todir="${activiti-modeler.directory}/explorer">
+ <fileset dir="${project.build.directory}/activiti-webapp-explorer2/explorer" />
+ </copy>
+
+ <mkdir dir="${activiti-modeler.directory}/libs" />
+ <copy todir="${activiti-modeler.directory}/libs">
+ <fileset dir="${project.build.directory}/activiti-webapp-explorer2/libs" />
+ </copy>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>com.google.code.maven-replacer-plugin</groupId>
+ <artifactId>replacer</artifactId>
+ <version>1.5.3</version>
+ <executions>
+ <execution>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>replace</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <file>${activiti-modeler.directory}/editor/oryx.debug.js</file>
+ <tokenValueMap>${tokenValueMap}</tokenValueMap>
+ <unescape>true</unescape>
+ <regex>false</regex>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>