You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by ma...@apache.org on 2015/12/15 18:08:23 UTC
[2/4] syncope git commit: Swagger option, SYNCOPE-637
Swagger option, SYNCOPE-637
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/e2158717
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/e2158717
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/e2158717
Branch: refs/heads/master
Commit: e21587171946ae764b820d4db9c7f731e84e871f
Parents: 54db189
Author: Massimiliano Perrone <ma...@tirasa.net>
Authored: Tue Dec 15 12:04:19 2015 +0100
Committer: Massimiliano Perrone <ma...@tirasa.net>
Committed: Tue Dec 15 18:08:02 2015 +0100
----------------------------------------------------------------------
.../syncope/installer/files/ParentPom.java | 14 +++++++--
.../installer/processes/ArchetypeProcess.java | 19 +++++++++---
.../main/resources/izpack/ProcessPanel.Spec.xml | 3 ++
installer/src/main/resources/izpack/install.xml | 2 ++
.../main/resources/izpack/userInputLang.xml_eng | 4 +++
.../main/resources/izpack/userInputLang.xml_ita | 4 +++
.../src/main/resources/izpack/userInputSpec.xml | 32 +++++++++++++++-----
7 files changed, 64 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/e2158717/installer/src/main/java/org/apache/syncope/installer/files/ParentPom.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/files/ParentPom.java b/installer/src/main/java/org/apache/syncope/installer/files/ParentPom.java
index 4653224..867b925 100644
--- a/installer/src/main/java/org/apache/syncope/installer/files/ParentPom.java
+++ b/installer/src/main/java/org/apache/syncope/installer/files/ParentPom.java
@@ -20,10 +20,18 @@ package org.apache.syncope.installer.files;
public final class ParentPom {
- public static final String PLACEHOLDER = "</project>";
+ public static final String SWAGGER_PLACEHOLDER = "<dependencies>";
- public static final String REPOSITORY =
- " <repositories>\n"
+ public static final String SWAGGER_CONTENT_TO_ADD = "<dependencies>\n"
+ + " <dependency>\n"
+ + " <groupId>org.apache.syncope.ext</groupId>\n"
+ + " <artifactId>syncope-ext-swagger-ui</artifactId>\n"
+ + " <version>${syncope.version}</version>\n"
+ + " </dependency>\n";
+
+ public static final String REPOSITORY_PLACEHOLDER = "</project>";
+
+ public static final String REPOSITORY_CONTENT_TO_ADD = " <repositories>\n"
+ " <repository>\n"
+ " <id>ASF</id>\n"
+ " <url>https://repository.apache.org/content/repositories/snapshots/</url>\n"
http://git-wip-us.apache.org/repos/asf/syncope/blob/e2158717/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
----------------------------------------------------------------------
diff --git a/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java b/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
index d3cc987..30a7270 100644
--- a/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
+++ b/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
@@ -52,6 +52,9 @@ public class ArchetypeProcess extends BaseProcess {
final String proxyUser = args[15];
final String proxyPwd = args[16];
final boolean mavenProxyAutoconf = Boolean.valueOf(args[17]);
+ final boolean swagger = Boolean.valueOf(args[18]);
+ final boolean activiti = Boolean.valueOf(args[19]);
+ final boolean camel = Boolean.valueOf(args[20]);
setSyncopeInstallDir(installPath, artifactId);
@@ -92,11 +95,19 @@ public class ArchetypeProcess extends BaseProcess {
mavenUtils.archetypeGenerate(
syncopeVersion, groupId, artifactId, secretKey, anonymousKey, installPath, customMavenProxySettings);
- if (syncopeVersion.contains("SNAPSHOT")) {
- final File pomFile = new File(syncopeInstallDir + PROPERTIES.getProperty("pomFile"));
+ if (swagger) {
+ final File pomFile = new File(
+ syncopeInstallDir
+ + File.separator
+ + "core"
+ + File.separator
+ + PROPERTIES.getProperty("pomFile"));
String contentPomFile = fileSystemUtils.readFile(pomFile);
- fileSystemUtils.
- writeToFile(pomFile, contentPomFile.replace(ParentPom.PLACEHOLDER, ParentPom.REPOSITORY));
+ contentPomFile = contentPomFile.replace(
+ ParentPom.REPOSITORY_PLACEHOLDER, ParentPom.REPOSITORY_CONTENT_TO_ADD);
+ contentPomFile = contentPomFile.replace(ParentPom.SWAGGER_PLACEHOLDER, ParentPom.SWAGGER_CONTENT_TO_ADD);
+
+ fileSystemUtils.writeToFile(pomFile, contentPomFile);
}
fileSystemUtils.createDirectory(confDirectory);
http://git-wip-us.apache.org/repos/asf/syncope/blob/e2158717/installer/src/main/resources/izpack/ProcessPanel.Spec.xml
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/ProcessPanel.Spec.xml b/installer/src/main/resources/izpack/ProcessPanel.Spec.xml
index 1f8e272..7539e91 100644
--- a/installer/src/main/resources/izpack/ProcessPanel.Spec.xml
+++ b/installer/src/main/resources/izpack/ProcessPanel.Spec.xml
@@ -39,6 +39,9 @@ under the License.
<arg>$mvn.proxy.user</arg><!-- 15 -->
<arg>$mvn.proxy.pwd</arg><!-- 16 -->
<arg>$mvn.proxy.autoconf</arg><!-- 17 -->
+ <arg>$options.swagger</arg><!-- 18 -->
+ <arg>$options.activiti.workflow.adapter</arg><!-- 19 -->
+ <arg>$options.camel</arg><!-- 20 -->
</executeclass>
</job>
<job name="Persistence configuration...">
http://git-wip-us.apache.org/repos/asf/syncope/blob/e2158717/installer/src/main/resources/izpack/install.xml
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/install.xml b/installer/src/main/resources/izpack/install.xml
index 9a2326e..f0dfed5 100644
--- a/installer/src/main/resources/izpack/install.xml
+++ b/installer/src/main/resources/izpack/install.xml
@@ -149,6 +149,8 @@ under the License.
<panel classname="UserInputPanel" id="archetype">
<validator classname="org.apache.syncope.installer.validators.ArchetypeValidator"/>
</panel>
+ <panel classname="UserInputPanel" id="syncope_options"/>
+
<panel classname="UserInputPanel" id="persistence"/>
<panel classname="UserInputPanel" id="persistence_advanced">
<validator classname="org.apache.syncope.installer.validators.PersistenceValidator"/>
http://git-wip-us.apache.org/repos/asf/syncope/blob/e2158717/installer/src/main/resources/izpack/userInputLang.xml_eng
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/userInputLang.xml_eng b/installer/src/main/resources/izpack/userInputLang.xml_eng
index 00f183f..3e9ee88 100644
--- a/installer/src/main/resources/izpack/userInputLang.xml_eng
+++ b/installer/src/main/resources/izpack/userInputLang.xml_eng
@@ -37,6 +37,10 @@ under the License.
<str id="mvn.proxy.user.id" txt="Proxy User (if required):"/>
<str id="mvn.proxy.pwd.id" txt="Proxy Password (if required):"/>
+ <str id="options.swagger.id" txt="Swagger"/>
+ <str id="options.activiti.workflow.adapter.id" txt="Activiti workflow adapter"/>
+ <str id="options.camel.id" txt="Camel"/>
+
<str id="persistence.jdbc.url" txt="Database JDBC url:"/>
<str id="persistence.db.user" txt="Username:"/>
<str id="persistence.db.password" txt="Password:"/>
http://git-wip-us.apache.org/repos/asf/syncope/blob/e2158717/installer/src/main/resources/izpack/userInputLang.xml_ita
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/userInputLang.xml_ita b/installer/src/main/resources/izpack/userInputLang.xml_ita
index 65dc51f..580a17d 100644
--- a/installer/src/main/resources/izpack/userInputLang.xml_ita
+++ b/installer/src/main/resources/izpack/userInputLang.xml_ita
@@ -37,6 +37,10 @@ under the License.
<str id="mvn.proxy.user.id" txt="Proxy User (se richiesto):"/>
<str id="mvn.proxy.pwd.id" txt="Proxy Password (se richiesta):"/>
+ <str id="options.swagger.id" txt="Swagger"/>
+ <str id="options.activiti.workflow.adapter.id" txt="Activiti workflow adapter"/>
+ <str id="options.camel.id" txt="Camel"/>
+
<str id="persistence.jdbc.url" txt="Database JDBC url:"/>
<str id="persistence.db.user" txt="Username:"/>
<str id="persistence.db.password" txt="Password:"/>
http://git-wip-us.apache.org/repos/asf/syncope/blob/e2158717/installer/src/main/resources/izpack/userInputSpec.xml
----------------------------------------------------------------------
diff --git a/installer/src/main/resources/izpack/userInputSpec.xml b/installer/src/main/resources/izpack/userInputSpec.xml
index 0253a33..72648b0 100644
--- a/installer/src/main/resources/izpack/userInputSpec.xml
+++ b/installer/src/main/resources/izpack/userInputSpec.xml
@@ -99,8 +99,26 @@ under the License.
</field>
</panel>
- <panel id="persistence" order="2" border="false">
- <field type="title" txt="Database options" bold="true" size="2" />
+ <panel id="syncope_options" order="2" border="false">
+ <field type="title" txt="Syncope options" bold="true" size="2" />
+
+ <field type="divider"/>
+ <field type="space"/>
+
+ <field type="staticText" align="left" txt="Options" />
+ <field type="check" variable="options.swagger">
+ <spec id="options.swagger.id" true="true" false="false" set="false"/>
+ </field>
+ <field type="check" variable="options.activiti.workflow.adapter">
+ <spec id="options.activiti.workflow.adapter.id" true="true" false="false" set="false"/>
+ </field>
+ <field type="check" variable="options.camel">
+ <spec id="options.camel.id" true="true" false="false" set="false"/>
+ </field>
+ </panel>
+
+ <panel id="persistence" order="3" border="false">
+ <field type="title" txt="Database" bold="true" size="2" />
<field type="divider"/>
<field type="space"/>
@@ -116,8 +134,8 @@ under the License.
</field>
</panel>
- <panel id="persistence_advanced" order="2" border="false">
- <field type="title" txt="Database advanced options" bold="true" size="2" />
+ <panel id="persistence_advanced" order="3" border="false">
+ <field type="title" txt="Database settings" bold="true" size="2" />
<field type="divider"/>
<field type="space"/>
@@ -152,7 +170,7 @@ under the License.
</field>
</panel>
- <panel id="container" order="3" border="false">
+ <panel id="container" order="4" border="false">
<field type="title" txt="Application Server" bold="true" size="2" />
<field type="divider"/>
@@ -174,8 +192,8 @@ under the License.
</field>
</panel>
- <panel id="container_advanced" order="3" border="false">
- <field type="title" txt="Application Server" bold="true" size="2" />
+ <panel id="container_advanced" order="4" border="false">
+ <field type="title" txt="Application Server Settings" bold="true" size="2" />
<field type="divider"/>
<field type="space"/>