http://git-wip-us.apache.org/repos/asf/syncope/blob/f5017841/syncope620/installer/src/main/java/org/apache/syncope/installer/utilities/HttpUtils.java ---------------------------------------------------------------------- diff --git a/syncope620/installer/src/main/java/org/apache/syncope/installer/utilities/HttpUtils.java b/syncope620/installer/src/main/java/org/apache/syncope/installer/utilities/HttpUtils.java new file mode 100644 index 0000000..1e8e94c --- /dev/null +++ b/syncope620/installer/src/main/java/org/apache/syncope/installer/utilities/HttpUtils.java @@ -0,0 +1,212 @@ +/* + * 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.utilities; + +import com.izforge.izpack.panels.process.AbstractUIProcessHandler; +import java.io.File; +import java.io.IOException; +import java.security.KeyManagementException; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpEntity; +import org.apache.http.HttpHost; +import org.apache.http.auth.AuthScheme; +import org.apache.http.auth.AuthScope; +import org.apache.http.auth.UsernamePasswordCredentials; +import org.apache.http.client.AuthCache; +import org.apache.http.client.CredentialsProvider; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.protocol.HttpClientContext; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.conn.ssl.SSLContextBuilder; +import org.apache.http.conn.ssl.TrustSelfSignedStrategy; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.entity.mime.content.FileBody; +import org.apache.http.impl.auth.BasicScheme; +import org.apache.http.impl.auth.DigestScheme; +import org.apache.http.impl.client.BasicAuthCache; +import org.apache.http.impl.client.BasicCredentialsProvider; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; + +public class HttpUtils { + + private static final String HTTPS_URL_TEMPLATE = "https://%s:%s"; + + private static final String HTTP_URL_TEMPLATE = "http://%s:%s"; + + private final CloseableHttpClient httpClient; + + private final boolean isSsl; + + private final String host; + + private final int port; + + private final String username; + + private final String password; + + private final HttpHost targetHost; + + private final AbstractUIProcessHandler handler; + + public HttpUtils(final boolean isSsl, final String host, + final String port, final String username, final String password, final AbstractUIProcessHandler handler) { + + this.isSsl = isSsl; + this.host = host; + this.port = Integer.valueOf(port); + + if (isSsl) { + httpClient = createHttpsClient(); + this.targetHost = new HttpHost(this.host, this.port, "https"); + } else { + httpClient = HttpClients.createDefault(); + this.targetHost = new HttpHost(this.host, this.port, "http"); + } + + this.username = username; + this.password = password; + + this.handler = handler; + } + + public int getWithBasicAuth(final String path) { + final HttpGet httpGet; + if (isSsl) { + httpGet = new HttpGet(String.format(HTTPS_URL_TEMPLATE, host, port) + path); + } else { + httpGet = new HttpGet(String.format(HTTP_URL_TEMPLATE, host, port) + path); + } + int status = 0; + try { + handler.logOutput("Calling " + httpGet.getURI(), true); + InstallLog.getInstance().info("Calling " + httpGet.getURI()); + final CloseableHttpResponse response = httpClient.execute( + targetHost, httpGet, setAuth(targetHost, new BasicScheme())); + status = response.getStatusLine().getStatusCode(); + handler.logOutput("Calling status " + status, true); + InstallLog.getInstance().info("Calling status " + status); + response.close(); + } catch (final IOException ex) { + final String messageError = "Error in " + path + ": " + ex.getMessage(); + handler.emitError(messageError, messageError); + InstallLog.getInstance().error(messageError); + } + return status; + } + + public String postWithDigestAuth(final String url, final String file) { + String responseBodyAsString = ""; + try { + final CloseableHttpResponse response = httpClient.execute(targetHost, + httpPost(url, MultipartEntityBuilder.create().addPart("bin", new FileBody(new File(file))).build()), + setAuth(targetHost, new DigestScheme())); + responseBodyAsString = IOUtils.toString(response.getEntity().getContent()); + handler.logOutput("Http status: " + response.getStatusLine().getStatusCode(), true); + InstallLog.getInstance().info("Http status: " + response.getStatusLine().getStatusCode()); + response.close(); + } catch (final IOException ex) { + final String messageError = "Error calling " + url + ": " + ex.getMessage(); + handler.emitError(messageError, messageError); + InstallLog.getInstance().error(messageError); + } + + return responseBodyAsString; + } + + public int postWithStringEntity(final String url, final String stringEntity) { + int status = 0; + try { + final HttpPost httPost = httpPost(url, new StringEntity(stringEntity)); + httPost.addHeader("Content-Type", ContentType.APPLICATION_JSON.getMimeType()); + final CloseableHttpResponse response = httpClient.execute( + targetHost, httPost, setAuth(targetHost, new DigestScheme())); + status = response.getStatusLine().getStatusCode(); + handler.logOutput("Http status: " + status, true); + InstallLog.getInstance().info("Http status: " + status); + + response.close(); + } catch (final IOException ioe) { + final String messageError = "Error calling " + url + ": " + ioe.getMessage(); + handler.emitError(messageError, messageError); + InstallLog.getInstance().error(messageError); + + } + return status; + } + + private HttpClientContext setAuth(final HttpHost targetHost, final AuthScheme authScheme) { + final CredentialsProvider credsProvider = new BasicCredentialsProvider(); + credsProvider.setCredentials(new AuthScope(targetHost.getHostName(), targetHost.getPort()), + new UsernamePasswordCredentials(username, password)); + final HttpClientContext context = HttpClientContext.create(); + final AuthCache authCache = new BasicAuthCache(); + authCache.put(targetHost, authScheme); + context.setAuthCache(authCache); + context.setCredentialsProvider(credsProvider); + return context; + } + + private HttpPost httpPost(final String url, final HttpEntity reqEntity) { + final HttpPost httppost = new HttpPost(url); + httppost.setEntity(reqEntity); + handler.logOutput("Calling " + httppost.getURI(), true); + InstallLog.getInstance().info("Calling " + httppost.getURI()); + return httppost; + } + + public static int ping(final boolean isSsl, final String host, final String port) { + int status = 0; + try { + if (isSsl) { + status = createHttpsClient().execute( + new HttpGet(String.format(HTTPS_URL_TEMPLATE, host, port))).getStatusLine(). + getStatusCode(); + } else { + status = HttpClients.createDefault().execute( + new HttpGet(String.format(HTTP_URL_TEMPLATE, host, port))).getStatusLine().getStatusCode(); + } + } catch (IOException ex) { + } + + return status; + } + + private static CloseableHttpClient createHttpsClient() { + CloseableHttpClient chc = null; + try { + final SSLContextBuilder builder = new SSLContextBuilder(); + builder.loadTrustMaterial(null, new TrustSelfSignedStrategy()); + chc = HttpClients.custom().setSSLSocketFactory( + new SSLConnectionSocketFactory(builder.build(), + SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER)).build(); + } catch (KeyManagementException ex) { + } catch (NoSuchAlgorithmException ex) { + } catch (KeyStoreException ex) { + } + return chc; + } +}
http://git-wip-us.apache.org/repos/asf/syncope/blob/f5017841/syncope620/installer/src/main/java/org/apache/syncope/installer/utilities/InstallLog.java ---------------------------------------------------------------------- diff --git a/syncope620/installer/src/main/java/org/apache/syncope/installer/utilities/InstallLog.java b/syncope620/installer/src/main/java/org/apache/syncope/installer/utilities/InstallLog.java new file mode 100644 index 0000000..91c03df --- /dev/null +++ b/syncope620/installer/src/main/java/org/apache/syncope/installer/utilities/InstallLog.java @@ -0,0 +1,70 @@ +/* + * 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.utilities; + +import com.izforge.izpack.panels.process.AbstractUIProcessHandler; +import java.io.File; +import java.util.Date; + +public class InstallLog { + + private static InstallLog installLog = null; + + private final File log; + + private final FileSystemUtils fileSystemUtils; + + private final String fileAbsolutePath; + + private InstallLog(final String installPath, final AbstractUIProcessHandler handler) { + fileAbsolutePath = installPath + "/install.log"; + log = new File(fileAbsolutePath); + fileSystemUtils = new FileSystemUtils(handler); + } + + public static InstallLog initialize(final String installPath, final AbstractUIProcessHandler handler) { + synchronized (InstallLog.class) { + if (installLog == null) { + installLog = new InstallLog(installPath, handler); + } + } + return installLog; + } + + public static InstallLog getInstance() { + return installLog; + } + + public void error(final String msg) { + writeToFile("Error", msg); + } + + public void info(final String msg) { + writeToFile("Info", msg); + } + + public String getFileAbsolutePath() { + return fileAbsolutePath; + } + + private void writeToFile(final String what, final String msg) { + fileSystemUtils.appendToFile(log, new Date() + " | " + what + ": " + msg); + } + +} http://git-wip-us.apache.org/repos/asf/syncope/blob/f5017841/syncope620/installer/src/main/java/org/apache/syncope/installer/utilities/JsonUtils.java ---------------------------------------------------------------------- diff --git a/syncope620/installer/src/main/java/org/apache/syncope/installer/utilities/JsonUtils.java b/syncope620/installer/src/main/java/org/apache/syncope/installer/utilities/JsonUtils.java new file mode 100644 index 0000000..f8f6b64 --- /dev/null +++ b/syncope620/installer/src/main/java/org/apache/syncope/installer/utilities/JsonUtils.java @@ -0,0 +1,48 @@ +/* + * 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.utilities; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import org.apache.syncope.installer.containers.jboss.JBossAddResponse; +import org.apache.syncope.installer.containers.jboss.JBossDeployRequestContent; + +public class JsonUtils { + + private final static ObjectMapper objectMapper = new ObjectMapper(); + + public static JBossAddResponse jBossAddResponse(final String responseBodyAsString) { + JBossAddResponse jBossAddResponse = null; + try { + jBossAddResponse = objectMapper.readValue(responseBodyAsString, JBossAddResponse.class); + } catch (IOException ioe) { + } + return jBossAddResponse; + } + + public static String jBossDeployRequestContent(final JBossDeployRequestContent jBossDeployRequestContent) { + String jBossDeployRequestContentString = ""; + try { + jBossDeployRequestContentString = objectMapper.writeValueAsString(jBossDeployRequestContent); + } catch (JsonProcessingException ioe) { + } + return jBossDeployRequestContentString; + } +} http://git-wip-us.apache.org/repos/asf/syncope/blob/f5017841/syncope620/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java ---------------------------------------------------------------------- diff --git a/syncope620/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java b/syncope620/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java new file mode 100644 index 0000000..f39d4b4 --- /dev/null +++ b/syncope620/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java @@ -0,0 +1,210 @@ +/* + * 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.utilities; + +import com.izforge.izpack.panels.process.AbstractUIProcessHandler; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Properties; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.TransformerException; +import org.apache.commons.io.FileUtils; +import org.apache.maven.shared.invoker.DefaultInvocationRequest; +import org.apache.maven.shared.invoker.DefaultInvoker; +import org.apache.maven.shared.invoker.InvocationRequest; +import org.apache.maven.shared.invoker.InvocationResult; +import org.apache.maven.shared.invoker.Invoker; +import org.apache.maven.shared.invoker.MavenInvocationException; +import org.apache.maven.shared.invoker.PrintStreamHandler; +import org.apache.maven.shared.invoker.PrintStreamLogger; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.xml.sax.SAXException; + +public class MavenUtils { + + private static final String MAVEN_HOME_PROPERTY = "maven.home"; + + private final AbstractUIProcessHandler handler; + + public MavenUtils(final String mavenHomeDirectory, final AbstractUIProcessHandler handler) { + if (System.getProperty(MAVEN_HOME_PROPERTY) == null || System.getProperty(MAVEN_HOME_PROPERTY).isEmpty()) { + System.setProperty(MAVEN_HOME_PROPERTY, mavenHomeDirectory); + } + this.handler = handler; + } + + public void archetypeGenerate(final String archetypeVersion, final String groupId, + final String artifactId, final String secretKey, final String anonymousKey, final String installPath, + final File customSettingsFile) { + + final InvocationRequest request = new DefaultInvocationRequest(); + request.setGoals(Collections.singletonList("archetype:generate")); + request.setInteractive(false); + final Properties properties = + archetypeProperties(archetypeVersion, groupId, artifactId, secretKey, anonymousKey); + request.setProperties(properties); + if (customSettingsFile != null && FileUtils.sizeOf(customSettingsFile) > 0) { + request.setUserSettingsFile(customSettingsFile); + } + logToHandler(request.getGoals(), properties); + logToFile(request.getGoals(), properties); + invoke(request, installPath); + } + + private Properties archetypeProperties(final String archetypeVersion, final String groupId, + final String artifactId, final String secretKey, final String anonymousKey) { + final Properties properties = new Properties(); + properties.setProperty("archetypeGroupId", "org.apache.syncope"); + properties.setProperty("archetypeArtifactId", "syncope-archetype"); + if (archetypeVersion.contains("SNAPSHOT")) { + properties.setProperty("archetypeRepository", "http://repository.apache.org/content/repositories/snapshots"); + } else { + properties.setProperty("archetypeRepository", "http://repo1.maven.org/maven2"); + } + properties.setProperty("archetypeVersion", archetypeVersion); + properties.setProperty("groupId", groupId); + properties.setProperty("artifactId", artifactId); + properties.setProperty("secretKey", secretKey); + properties.setProperty("anonymousKey", anonymousKey); + return properties; + } + + public void mvnCleanPackageWithProperties(final String path, final Properties properties, final File customSettingsFile) { + final InvocationRequest request = new DefaultInvocationRequest(); + request.setProperties(properties); + 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(), properties); + logToFile(request.getGoals(), properties); + invoke(request, path); + } + + private void logToHandler(final List<String> goals, final Properties properties) { + handler.logOutput("Executing maven command:", true); + final StringBuilder mavenCommand = new StringBuilder("mvn "); + for (final String goal : goals) { + mavenCommand.append(goal).append(" "); + } + handler.logOutput(mavenCommand.toString(), true); + for (final String propertyName : properties.stringPropertyNames()) { + handler.logOutput("-D " + propertyName + "=" + properties.getProperty(propertyName), true); + } + } + + private void logToFile(final List<String> goals, final Properties properties) { + InstallLog.getInstance().info("Executing maven command:"); + final StringBuilder mavenCommand = new StringBuilder("mvn "); + for (final String goal : goals) { + mavenCommand.append(goal).append(" "); + } + InstallLog.getInstance().info(mavenCommand.toString()); + for (final String propertyName : properties.stringPropertyNames()) { + InstallLog.getInstance().info("-D " + propertyName + "=" + properties.getProperty(propertyName)); + } + } + + private InvocationResult invoke(final InvocationRequest request, final String path) { + InvocationResult result = null; + final Invoker invoker = new DefaultInvoker(); + try { + invoker.setLogger(new PrintStreamLogger( + new PrintStream(InstallLog.getInstance().getFileAbsolutePath()), 1000)); + invoker.setOutputHandler(new PrintStreamHandler( + new PrintStream(InstallLog.getInstance().getFileAbsolutePath()), true)); + invoker.setWorkingDirectory(new File(path)); + result = invoker.execute(request); + } catch (MavenInvocationException ex) { + final String messageError = "Maven exception: " + ex.getMessage(); + handler.emitError(messageError, messageError); + InstallLog.getInstance().info(messageError); + } catch (FileNotFoundException ex) { + final String messageError = "Maven exception: " + ex.getMessage(); + handler.emitError(messageError, messageError); + InstallLog.getInstance().info(messageError); + } + return result; + } + + public static File createSettingsWithProxy(final String path, final String proxyHost, final String proxyPort, + final String proxyUser, final String proxyPassword) throws IOException, ParserConfigurationException, + TransformerException, SAXException { + final File settingsXML = new File(System.getProperty(MAVEN_HOME_PROPERTY) + (System.getProperty( + MAVEN_HOME_PROPERTY).endsWith("/") ? "conf/settings.xml" : "/conf/settings.xml")); + final File tempSettingsXML = new File(path + (path.endsWith("/") ? "settings_temp.xml" : "/settings_temp.xml")); + if (settingsXML.canRead() && !tempSettingsXML.exists()) { + tempSettingsXML.createNewFile(); + + final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + final DocumentBuilder builder = dbf.newDocumentBuilder(); + // parse settings.xml + final Document settings = builder.parse(settingsXML); + + final Element proxies = (Element) settings.getDocumentElement().getElementsByTagName("proxies").item(0); + + final Element proxy = settings.createElement("proxy"); + + final Element id = settings.createElement("id"); + final Element active = settings.createElement("active"); + final Element protocol = settings.createElement("protocol"); + final Element host = settings.createElement("host"); + final Element port = settings.createElement("port"); + final Element nonProxyHosts = settings.createElement("nonProxyHosts"); + id.appendChild(settings.createTextNode("optional")); + active.appendChild(settings.createTextNode("true")); + protocol.appendChild(settings.createTextNode("http")); + host.appendChild(settings.createTextNode(proxyHost)); + port.appendChild(settings.createTextNode(proxyPort)); + proxy.appendChild(id); + proxy.appendChild(active); + proxy.appendChild(protocol); + // create username and password tags only if required + if (proxyUser != null && !proxyUser.isEmpty() && proxyPassword != null) { + final Element username = settings.createElement("username"); + final Element password = settings.createElement("password"); + username.appendChild(settings.createTextNode(proxyUser)); + password.appendChild(settings.createTextNode(proxyPassword)); + proxy.appendChild(username); + proxy.appendChild(password); + } + proxy.appendChild(host); + proxy.appendChild(port); + proxy.appendChild(nonProxyHosts); + + proxies.appendChild(proxy); + + FileSystemUtils.writeXML(settings, new FileOutputStream(tempSettingsXML)); + + } + return tempSettingsXML; + } +} http://git-wip-us.apache.org/repos/asf/syncope/blob/f5017841/syncope620/installer/src/main/java/org/apache/syncope/installer/utilities/PasswordGenerator.java ---------------------------------------------------------------------- diff --git a/syncope620/installer/src/main/java/org/apache/syncope/installer/utilities/PasswordGenerator.java b/syncope620/installer/src/main/java/org/apache/syncope/installer/utilities/PasswordGenerator.java new file mode 100644 index 0000000..be661a7 --- /dev/null +++ b/syncope620/installer/src/main/java/org/apache/syncope/installer/utilities/PasswordGenerator.java @@ -0,0 +1,41 @@ +/* + * 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.utilities; + +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.apache.commons.codec.binary.Hex; + +public class PasswordGenerator { + + public static String password(final String password, final String digest) { + String pwd = ""; + try { + final MessageDigest cript = MessageDigest.getInstance("SHA-1"); + pwd = new String(Hex.encodeHex(cript.digest())); + } catch (final NoSuchAlgorithmException ex) { + Logger.getLogger(PasswordGenerator.class.getName()).log(Level.SEVERE, "NoSuchAlgorithmException", ex); + + } + return pwd; + } + +} http://git-wip-us.apache.org/repos/asf/syncope/blob/f5017841/syncope620/installer/src/main/java/org/apache/syncope/installer/validators/AbstractValidator.java ---------------------------------------------------------------------- diff --git a/syncope620/installer/src/main/java/org/apache/syncope/installer/validators/AbstractValidator.java b/syncope620/installer/src/main/java/org/apache/syncope/installer/validators/AbstractValidator.java new file mode 100644 index 0000000..6ff54e9 --- /dev/null +++ b/syncope620/installer/src/main/java/org/apache/syncope/installer/validators/AbstractValidator.java @@ -0,0 +1,28 @@ +/* + * 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.validators; + +import com.izforge.izpack.api.installer.DataValidator; + +public abstract class AbstractValidator implements DataValidator { + + protected boolean isEmpty(final String string) { + return !(string != null && string.length() != 0); + } +} http://git-wip-us.apache.org/repos/asf/syncope/blob/f5017841/syncope620/installer/src/main/java/org/apache/syncope/installer/validators/ArchetypeValidator.java ---------------------------------------------------------------------- diff --git a/syncope620/installer/src/main/java/org/apache/syncope/installer/validators/ArchetypeValidator.java b/syncope620/installer/src/main/java/org/apache/syncope/installer/validators/ArchetypeValidator.java new file mode 100644 index 0000000..4fe3363 --- /dev/null +++ b/syncope620/installer/src/main/java/org/apache/syncope/installer/validators/ArchetypeValidator.java @@ -0,0 +1,91 @@ +/* + * 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.validators; + +import com.izforge.izpack.api.data.InstallData; +import java.io.File; + +public class ArchetypeValidator extends AbstractValidator { + + private StringBuilder error; + + @Override + public Status validateData(final InstallData installData) { + + final String mavenDir = installData.getVariable("mvn.directory"); + final String mavenGroupId = installData.getVariable("mvn.groupid"); + final String mavenArtifactId = installData.getVariable("mvn.artifactid"); + final String mavenSecretKey = installData.getVariable("mvn.secretkey"); + final String mavenAnonymousKey = installData.getVariable("mvn.anonymous.key"); + final String mavenLogDirectory = installData.getVariable("mvn.log.directory"); + final String mavenBundleDirectory = installData.getVariable("mvn.bundle.directory"); + + boolean verified = true; + error = new StringBuilder("Required fields:\n"); + if (isEmpty(mavenDir)) { + error.append("Maven home directory\n"); + verified = false; + } else if (!new File(mavenDir + "/bin/mvn").exists()){ + error.append("Maven home directory not valid, check it please...\n"); + verified = false; + } + if (isEmpty(mavenGroupId)) { + error.append("GroupID\n"); + verified = false; + } + if (isEmpty(mavenArtifactId)) { + error.append("ArtifactID\n"); + verified = false; + } + if (isEmpty(mavenSecretKey)) { + error.append("SecretKey\n"); + verified = false; + } + if (isEmpty(mavenAnonymousKey)) { + error.append("AnonymousKey\n"); + verified = false; + } + if (isEmpty(mavenLogDirectory)) { + error.append("Logs directory\n"); + verified = false; + } + if (isEmpty(mavenBundleDirectory)) { + error.append("Bundles directory\n"); + verified = false; + } + + return verified ? Status.OK : Status.ERROR; + } + + @Override + public String getErrorMessageId() { + return error.toString(); + } + + @Override + public String getWarningMessageId() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getDefaultAnswer() { + throw new UnsupportedOperationException("Not supported yet."); + } + +} http://git-wip-us.apache.org/repos/asf/syncope/blob/f5017841/syncope620/installer/src/main/java/org/apache/syncope/installer/validators/ContainerValidator.java ---------------------------------------------------------------------- diff --git a/syncope620/installer/src/main/java/org/apache/syncope/installer/validators/ContainerValidator.java b/syncope620/installer/src/main/java/org/apache/syncope/installer/validators/ContainerValidator.java new file mode 100644 index 0000000..02c7b5a --- /dev/null +++ b/syncope620/installer/src/main/java/org/apache/syncope/installer/validators/ContainerValidator.java @@ -0,0 +1,158 @@ +/* + * 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.validators; + +import com.izforge.izpack.api.data.InstallData; +import java.io.File; +import org.apache.syncope.installer.enums.Containers; +import org.apache.syncope.installer.utilities.HttpUtils; + +public class ContainerValidator extends AbstractValidator { + + private StringBuilder error; + + @Override + public Status validateData(final InstallData installData) { + + final Containers selectedContainer = Containers.fromContainerName( + installData.getVariable("install.container.selection")); + final String tomcatSsl = installData.getVariable("tomcat.container.ssl"); + final String tomcatHost = installData.getVariable("tomcat.container.host"); + final String tomcatPort = installData.getVariable("tomcat.container.port"); + final String tomcatUser = installData.getVariable("tomcat.container.user"); + final String tomcatPassword = installData.getVariable("tomcat.container.pwd"); + final String glassfishDir = installData.getVariable("glassfish.container.dir"); + final String jbossSsl = installData.getVariable("jboss.container.ssl"); + final String jbossHost = installData.getVariable("jboss.container.host"); + final String jbossPort = installData.getVariable("jboss.container.port"); + final String jbossJdbcModule = installData.getVariable("jboss.container.jdbc.module"); + final String jbossAdminUsername = installData.getVariable("jboss.container.user"); + final String jbossAdminPassword = installData.getVariable("jboss.container.pwd"); + + switch (selectedContainer) { + case TOMCAT: + + boolean verified = true; + error = new StringBuilder("Required fields:\n"); + if (isEmpty(tomcatHost)) { + error.append("Tomcat host\n"); + verified = false; + } + if (isEmpty(tomcatPort)) { + error.append("Tomcat port\n"); + verified = false; + } + if (isEmpty(tomcatUser)) { + error.append("Tomcat user\n"); + verified = false; + } + if (isEmpty(tomcatPassword)) { + error.append("Tomcat password\n"); + verified = false; + } + + if (!verified) { + return Status.ERROR; + } + + int responseCode = HttpUtils.ping(Boolean.valueOf(tomcatSsl), tomcatHost, tomcatPort); + + if (responseCode == 200) { + return Status.OK; + } else { + error = new StringBuilder("Tomcat URL is offline"); + return Status.ERROR; + } + case JBOSS: + boolean virified = true; + error = new StringBuilder("Required fields:\n"); + if (isEmpty(jbossHost)) { + error.append("JBoss Host\n"); + virified = false; + } + if (isEmpty(jbossPort)) { + error.append("JBoss Port\n"); + virified = false; + } + if (isEmpty(jbossJdbcModule)) { + error.append("JBoss JDBC module name\n"); + virified = false; + } + if (isEmpty(jbossAdminUsername)) { + error.append("JBoss admin username\n"); + virified = false; + } + if (isEmpty(jbossAdminPassword)) { + error.append("JBoss admin password\n"); + virified = false; + } + + if (!virified) { + return Status.ERROR; + } + + int jResponseCode = HttpUtils.ping(Boolean.valueOf(jbossSsl), jbossHost, jbossPort); + + if (jResponseCode == 200) { + return Status.OK; + } else { + error = new StringBuilder("JBoss URL is offline"); + return Status.ERROR; + } + case GLASSFISH: + error = new StringBuilder("Required fields:\n"); + if (isEmpty(glassfishDir)) { + error.append("Glassfish directory\n"); + return Status.ERROR; + } + + final File dir = new File(glassfishDir); + + if (!dir.exists()) { + error.append("Glassfish directory not found"); + return Status.ERROR; + } + + if (!dir.isDirectory()) { + error.append("Glassfish directory is not a directory"); + return Status.ERROR; + } + return Status.OK; + default: + error = new StringBuilder("Container not supported yet"); + return Status.ERROR; + } + } + + @Override + public String getErrorMessageId() { + return error.toString(); + } + + @Override + public String getWarningMessageId() { + throw new UnsupportedOperationException("Not supported yet."); + } + + @Override + public boolean getDefaultAnswer() { + throw new UnsupportedOperationException("Not supported yet."); + } + +} http://git-wip-us.apache.org/repos/asf/syncope/blob/f5017841/syncope620/installer/src/main/java/org/apache/syncope/installer/validators/PersistenceValidator.java ---------------------------------------------------------------------- diff --git a/syncope620/installer/src/main/java/org/apache/syncope/installer/validators/PersistenceValidator.java b/syncope620/installer/src/main/java/org/apache/syncope/installer/validators/PersistenceValidator.java new file mode 100644 index 0000000..33608a9 --- /dev/null +++ b/syncope620/installer/src/main/java/org/apache/syncope/installer/validators/PersistenceValidator.java @@ -0,0 +1,134 @@ +/* + * 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.validators; + +import com.izforge.izpack.api.data.InstallData; +import java.sql.Driver; +import java.util.Properties; +import org.apache.syncope.installer.enums.DBs; +import org.apache.syncope.installer.utilities.DriverLoader; + +public class PersistenceValidator extends AbstractValidator { + + private String persistenceUrl; + + private String persistenceDbuser; + + private String persistenceDbPassword; + + private StringBuilder error; + + private StringBuilder warning; + + private boolean isProxyEnabled; + + private String proxyHost; + + private String proxyPort; + + private String proxyUser; + + private String proxyPwd; + + @Override + public Status validateData(final InstallData installData) { + + final DBs selectedDB = DBs.fromDbName( + installData.getVariable("install.type.selection")); + + persistenceUrl = installData.getVariable("persistence.url"); + persistenceDbuser = installData.getVariable("persistence.dbuser"); + persistenceDbPassword = installData.getVariable("persistence.dbpassword"); + isProxyEnabled = Boolean.valueOf(installData.getVariable("mvn.proxy")); + proxyHost = installData.getVariable("mvn.proxy.host"); + proxyPort = installData.getVariable("mvn.proxy.port"); + proxyUser = installData.getVariable("mvn.proxy.user"); + proxyPwd = installData.getVariable("mvn.proxy.pwd"); + + boolean verified = true; + error = new StringBuilder("Required fields:\n"); + if (isEmpty(persistenceUrl)) { + error.append("Persistence URL\n"); + verified = false; + } + if (isEmpty(persistenceDbuser)) { + error.append("Persistence user\n"); + verified = false; + } + if (isEmpty(persistenceDbPassword)) { + error.append("Persistence password\n"); + verified = false; + } + + if (!verified) { + return Status.ERROR; + } + + switch (selectedDB) { + case POSTGRES: + return checkConnection(selectedDB); + case MYSQL: + return checkConnection(selectedDB); + case SQLSERVER: + warning = new StringBuilder("Remember to check your SqlServer db connection"); + return Status.WARNING; + case ORACLE: + warning = new StringBuilder("Remember to check your Oracle db connection"); + return Status.WARNING; + default: + error = new StringBuilder("DB not supported yet"); + return Status.ERROR; + } + } + + private Status checkConnection(final DBs selectedDb) { + Driver driver = null; + try { + driver = DriverLoader.load(selectedDb, isProxyEnabled, proxyHost, proxyPort, proxyUser, proxyPwd); + final Properties props = new Properties(); + props.put("user", persistenceDbuser); + props.put("password", persistenceDbPassword); + driver.connect(persistenceUrl, props); + return Status.OK; + } catch (Exception ex) { + error = new StringBuilder( + "Error during connection to database: please check inserted data."); + error.append(driver == null + ? new StringBuilder(" Unable to get ").append(selectedDb.getName()).append(" driver!").toString() + : ""); + return Status.ERROR; + } + } + + @Override + public String getErrorMessageId() { + return error.toString(); + } + + @Override + public String getWarningMessageId() { + return warning.toString(); + } + + @Override + public boolean getDefaultAnswer() { + return true; + } + +} http://git-wip-us.apache.org/repos/asf/syncope/blob/f5017841/syncope620/installer/src/main/resources/installer.properties ---------------------------------------------------------------------- diff --git a/syncope620/installer/src/main/resources/installer.properties b/syncope620/installer/src/main/resources/installer.properties new file mode 100644 index 0000000..e18bfea --- /dev/null +++ b/syncope620/installer/src/main/resources/installer.properties @@ -0,0 +1,26 @@ +# 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. +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 +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/f5017841/syncope620/installer/src/main/resources/izpack/ProcessPanel.Spec.xml ---------------------------------------------------------------------- diff --git a/syncope620/installer/src/main/resources/izpack/ProcessPanel.Spec.xml b/syncope620/installer/src/main/resources/izpack/ProcessPanel.Spec.xml new file mode 100644 index 0000000..859ec18 --- /dev/null +++ b/syncope620/installer/src/main/resources/izpack/ProcessPanel.Spec.xml @@ -0,0 +1,94 @@ +<?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. +--> +<processing> + <logfiledir>$INSTALL_PATH</logfiledir> + <job name="Archetype creation..."> + <executeclass name="org.apache.syncope.installer.processes.ArchetypeProcess"> + <arg>$INSTALL_PATH</arg><!-- 0 --> + <arg>$mvn.directory</arg><!-- 1 --> + <arg>$mvn.groupid</arg><!-- 2 --> + <arg>$mvn.artifactid</arg><!-- 3 --> + <arg>$mvn.secretkey</arg><!-- 4 --> + <arg>$mvn.anonymous.key</arg><!-- 5 --> + <arg>$mvn.conf.directory</arg><!-- 6 --> + <arg>$mvn.log.directory</arg><!-- 7 --> + <arg>$mvn.bundle.directory</arg><!-- 8 --> + <arg>$mvn.modeler.directory</arg><!-- 9 --> + <arg>$mvn.syncope.version</arg><!-- 10 --> + <arg>$mvn.syncope.admin.password</arg><!-- 11 --> + <arg>$mvn.proxy</arg><!-- 12 --> + <arg>$mvn.proxy.host</arg><!-- 13 --> + <arg>$mvn.proxy.port</arg><!-- 14 --> + <arg>$mvn.proxy.user</arg><!-- 15 --> + <arg>$mvn.proxy.pwd</arg><!-- 16 --> + <arg>$mvn.proxy.autoconf</arg><!-- 17 --> + </executeclass> + </job> + <job name="Persistence configuration..."> + <executeclass name="org.apache.syncope.installer.processes.PersistenceProcess"> + <arg>$INSTALL_PATH</arg><!-- 0 --> + <arg>$mvn.artifactid</arg><!-- 1 --> + <arg>$install.type.selection</arg><!-- 2 --> + <arg>$persistence.url</arg><!-- 3 --> + <arg>$persistence.dbuser</arg><!-- 4 --> + <arg>$persistence.dbpassword</arg><!-- 5 --> + <arg>$is.innodb</arg><!-- 6 --> + <arg>$persistence.tablespace</arg><!-- 7 --> + </executeclass> + </job> + <job name="Deploy..."> + <executeclass name="org.apache.syncope.installer.processes.ContainerProcess"> + <arg>$INSTALL_PATH</arg><!-- 0 --> + <arg>$mvn.directory</arg><!-- 1 --> + <arg>$mvn.artifactid</arg><!-- 2 --> + <arg>$install.container.selection</arg><!-- 3 --> + <arg>$tomcat.container.ssl</arg><!-- 4 --> + <arg>$tomcat.container.host</arg><!-- 5 --> + <arg>$tomcat.container.port</arg><!-- 6 --> + <arg>$tomcat.container.user</arg><!-- 7 --> + <arg>$tomcat.container.pwd</arg><!-- 8 --> + <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" /> + <onSuccess previous="false" next="true" /> +</processing> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/syncope/blob/f5017841/syncope620/installer/src/main/resources/izpack/html/prerequisites.html ---------------------------------------------------------------------- diff --git a/syncope620/installer/src/main/resources/izpack/html/prerequisites.html b/syncope620/installer/src/main/resources/izpack/html/prerequisites.html new file mode 100644 index 0000000..6b3e42c --- /dev/null +++ b/syncope620/installer/src/main/resources/izpack/html/prerequisites.html @@ -0,0 +1,66 @@ +<!-- +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. +--> +<!DOCTYPE html> +<html> + <head> + <title>Apache Syncope Installation</title> + <!-- <link rel="stylesheet" href="../css/style.css" />--> + </head> + <body> + <div id="page-wrap"> + <h1 style="text-align: center">Prerequisites</h1> + <div> + <div> + <h3>Introduction</h3> + <p> + The preferred way to create a Syncope project is to generate a Maven project starting from a published archetype. + <br/> + </p> + </div> + <div> + Hence you need: + <ol> + <li class="prerequisite">Java SE Development Kit 6 (version 1.6.0-23 or higher) installed;</li> + <li class="prerequisite"><a href="http://maven.apache.org/">Apache Maven (version 3.0.3 or higher) installed;</a></li> + <li class="prerequisite">Some basic knowledge about Maven;</li> + <li class="prerequisite">Some basic knowledge about <a href="http://maven.apache.org/plugins/maven-war-plugin/overlays.html">Maven WAR overlays;</a></li> + <li class="prerequisite">Some basic knowledge about <a href="http://maven.apache.org/guides/introduction/introduction-to-archetypes.html">Maven archetypes.</a></li> + </ol> + </div> + </div> + <div> + <div> + <h3>Reminder</h3> + <p> + Please carefully read the following points before installing Apache Syncope: + <br/> + </p> + </div> + <div> + <ul> + <li class="prerequisite"><a href="https://cwiki.apache.org/confluence/display/SYNCOPE/Run+Syncope+in+real+environments#RunSyncopeinrealenvironments-UseDataSource"> + Configure</a> the data source in your application server;</li> + <li>Make sure you have the DB up and running;</li> + <li>Make sure you have the container up and running.</li> + </ul> + </div> + </div> + </div> + </body> +</html> http://git-wip-us.apache.org/repos/asf/syncope/blob/f5017841/syncope620/installer/src/main/resources/izpack/html/welcome.html ---------------------------------------------------------------------- diff --git a/syncope620/installer/src/main/resources/izpack/html/welcome.html b/syncope620/installer/src/main/resources/izpack/html/welcome.html new file mode 100644 index 0000000..578868f --- /dev/null +++ b/syncope620/installer/src/main/resources/izpack/html/welcome.html @@ -0,0 +1,50 @@ +<!-- +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. +--> +<!DOCTYPE html> +<html> + <head> + <title>Apache Syncope Installer</title> + <style> + div { + font-size: 45px; + font-family: sans-serif; + color: #558b53; + width: 100%; + height: 100%; + line-height: 100px; + text-align: center; + } + + span { + position: relative; + top: 33%; + } + </style> + </head> + <body style="background-image: welcome_background; + background-repeat: no-repeat; + opacity: 0.4;"> + <div> + <br/> + <br/> + <br/> + <span><strong>$WELCOME_TEXT</strong></span> + </div> + </body> +</html> http://git-wip-us.apache.org/repos/asf/syncope/blob/f5017841/syncope620/installer/src/main/resources/izpack/img/apache-syncope-vert.png ---------------------------------------------------------------------- diff --git a/syncope620/installer/src/main/resources/izpack/img/apache-syncope-vert.png b/syncope620/installer/src/main/resources/izpack/img/apache-syncope-vert.png new file mode 100644 index 0000000..c8b0d23 Binary files /dev/null and b/syncope620/installer/src/main/resources/izpack/img/apache-syncope-vert.png differ http://git-wip-us.apache.org/repos/asf/syncope/blob/f5017841/syncope620/installer/src/main/resources/izpack/img/welcome_background.jpg ---------------------------------------------------------------------- diff --git a/syncope620/installer/src/main/resources/izpack/img/welcome_background.jpg b/syncope620/installer/src/main/resources/izpack/img/welcome_background.jpg new file mode 100644 index 0000000..8620bd7 Binary files /dev/null and b/syncope620/installer/src/main/resources/izpack/img/welcome_background.jpg differ http://git-wip-us.apache.org/repos/asf/syncope/blob/f5017841/syncope620/installer/src/main/resources/izpack/install.xml ---------------------------------------------------------------------- diff --git a/syncope620/installer/src/main/resources/izpack/install.xml b/syncope620/installer/src/main/resources/izpack/install.xml new file mode 100644 index 0000000..e2f46a6 --- /dev/null +++ b/syncope620/installer/src/main/resources/izpack/install.xml @@ -0,0 +1,174 @@ +<?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. +--> +<izpack:installation version="5.0" + xmlns:izpack="http://izpack.org/schema/installation" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://izpack.org/schema/installation + http://izpack.org/schema/5.0/izpack-installation-5.0.xsd"> + + <info> + <appname>Apache Syncope</appname> + <appversion>@{syncope.version}</appversion> + <url>http://syncope.apache.org</url> + <authors> + <author name="Apache Syncope" email="[email protected]"/> + </authors> + <javaversion>${targetJdk}</javaversion> + </info> + + <guiprefs resizable="no" width="800" height="600"> + <modifier key="useButtonIcons" value="yes"/> + <modifier key="useLabelIcons" value="no"/> + <modifier key="labelGap" value="2"/> + <modifier key="layoutAnchor" value="NORTHWEST"/> + <modifier key="useHeadingPanel" value="no"/> + <modifier key="headingImageOnLeft" value="yes"/> + <modifier key="headingLineCount" value="1"/> + <modifier key="headingFontSize" value="1.5"/> + <modifier key="headingBackgroundColor" value="0x00ffffff"/> + <modifier key="headingPanelCounter" value="progressbar"/> + <modifier key="headingPanelCounterPos" value="inNavigationPanel"/> + </guiprefs> + + <locale> + <langpack iso3="eng"/> + </locale> + + <variables> + <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="/var/tmp/syncope"/> + <variable name="TargetPanel.dir.windows" value="C:\Program Files"/> + </variables> + + <dynamicvariables> + <variable name="TARGET" value="${project.build.directory}"/> + </dynamicvariables> + + <conditions> + + <condition type="variable" id="mvn.choice.proxy"> + <name>mvn.proxy</name> + <value>true</value> + </condition> + + <condition type="variable" id="postgres.choice"> + <name>install.type.selection</name> + <value>postgres</value> + </condition> + + <condition type="variable" id="sqlserver.choice"> + <name>install.type.selection</name> + <value>sqlserver</value> + </condition> + + <condition type="variable" id="mysql.choice"> + <name>install.type.selection</name> + <value>mysql</value> + </condition> + + <condition type="variable" id="oracle.choice"> + <name>install.type.selection</name> + <value>oracle</value> + </condition> + + <condition type="or" id="database_advanced"> + <condition type="ref" refid="oracle.choice"/> + <condition type="ref" refid="mysql.choice"/> + </condition> + + <condition type="variable" id="tomcat.choice"> + <name>install.container.selection</name> + <value>tomcat</value> + </condition> + <condition type="variable" id="glassfish.choice"> + <name>install.container.selection</name> + <value>glassfish</value> + </condition> + <condition type="variable" id="jboss.choice"> + <name>install.container.selection</name> + <value>jboss</value> + </condition> + </conditions> + + <resources> + <res id="installer.jar" src="../syncope-installer-@{syncope.version}.jar"/> + + <res id="Installer.image" src="img/apache-syncope-vert.png" /> + + <res id="welcome_background" src="img/welcome_background.jpg" /> + <res id="HTMLHelloPanel.welcome" src="html/welcome.html"/> + <res id="LicencePanel.licence" src="LICENSE"/> + <res id="HTMLInfoPanel.info" src="html/prerequisites.html"/> + <res id="userInputSpec.xml" src="userInputSpec.xml" /> + <res id="userInputLang.xml_eng" src="userInputLang.xml_eng" /> + <res id="userInputLang.xml_ita" src="userInputLang.xml_ita" /> + <res id="ProcessPanel.Spec.xml" src="ProcessPanel.Spec.xml"/> + </resources> + + <jar src="../syncope-installer-@{syncope.version}.jar" stage="install"/> + <jar src="lib/commons-logging-@{commons.logging.version}.jar"/> + <jar src="lib/commons-codec-@{commons-codec.version}.jar"/> + <jar src="lib/commons-io-2.4.jar"/> + <jar src="lib/httpclient-@{httpclient.version}.jar"/> + <jar src="lib/httpmime-@{httpclient.version}.jar"/> + <jar src="lib/httpcore-4.3.3.jar"/> + <jar src="lib/jackson-databind-@{jackson.version}.jar"/> + <jar src="lib/jackson-core-@{jackson.version}.jar"/> + <jar src="lib/jackson-annotations-@{jackson.version}.jar"/> + + <jar src="lib/maven-invoker-@{maven-invoker.version}.jar"/> + <jar src="lib/plexus-utils-3.0.8.jar"/> + + <panels> + <panel classname="HTMLHelloPanel" id="welcome"/> + + <panel classname="LicencePanel" id="license"/> + <panel classname="HTMLInfoPanel" id="info"/> + + <panel classname="TargetPanel" id="install_dir"/> + + <panel classname="UserInputPanel" id="archetype"> + <validator classname="org.apache.syncope.installer.validators.ArchetypeValidator"/> + </panel> + <panel classname="UserInputPanel" id="persistence"/> + <panel classname="UserInputPanel" id="persistence_advanced"> + <validator classname="org.apache.syncope.installer.validators.PersistenceValidator"/> + </panel> + + <panel classname="UserInputPanel" id="container"/> + + <panel classname="UserInputPanel" id="container_advanced"> + <validator classname="org.apache.syncope.installer.validators.ContainerValidator"/> + </panel> + + <panel classname="ProcessPanel" id="archetype_proc"/> + + <panel classname="SimpleFinishPanel" id="finish"/> + </panels> + + <packs> + <pack name="Apache Syncope" required="yes"> + <description>Apache Syncope Installer</description> + </pack> + </packs> + +</izpack:installation> http://git-wip-us.apache.org/repos/asf/syncope/blob/f5017841/syncope620/installer/src/main/resources/izpack/userInputLang.xml_eng ---------------------------------------------------------------------- diff --git a/syncope620/installer/src/main/resources/izpack/userInputLang.xml_eng b/syncope620/installer/src/main/resources/izpack/userInputLang.xml_eng new file mode 100644 index 0000000..00f183f --- /dev/null +++ b/syncope620/installer/src/main/resources/izpack/userInputLang.xml_eng @@ -0,0 +1,66 @@ +<?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. +--> +<langpack> + <str id="mvn.directory.id" txt="Maven home directory:"/> + <str id="archetype.mvn.groupid" txt="GroupId:"/> + <str id="archetype.mvn.artifactid" txt="ArtifactId:"/> + <str id="archetype.mvn.secretkey" txt="SecretKey:"/> + <str id="mvn.anonymous.key.id" txt="Anonymous Key:"/> + <str id="archetype.mvn.conf.directory" txt="Conf directory name:"/> + <str id="archetype.mvn.log.directory" txt="Log directory name:"/> + <str id="archetype.mvn.bundle.directory" txt="Bundle directory name:"/> + <str id="archetype.mvn.modeler.directory" txt="Activity modeler directory name:"/> + <str id="mvn.syncope.version.id" txt="Syncope Version:"/> + <str id="mvn.syncope.admin.password.id" txt="Admin Password:"/> + <str id="mvn.proxy.id" txt="Use Proxy Server:"/> + <str id="mvn.proxy.autoconf.id" txt="Automatically configure Maven proxy"/> + <str id="mvn.proxy.autoconf.desc.id" txt="Check this field if Maven is not yet configured to use proxy:"/> + <str id="mvn.proxy.host.id" txt="Proxy Host:"/> + <str id="mvn.proxy.port.id" txt="Proxy Port:"/> + <str id="mvn.proxy.user.id" txt="Proxy User (if required):"/> + <str id="mvn.proxy.pwd.id" txt="Proxy Password (if required):"/> + + <str id="persistence.jdbc.url" txt="Database JDBC url:"/> + <str id="persistence.db.user" txt="Username:"/> + <str id="persistence.db.password" txt="Password:"/> + <str id="persistence.mysql.is.innodb" txt="INNODB"/> + <str id="persistence.oracle.tablespace" txt="Oracle tablespace:"/> + + <str id="with.datasuorce.id" txt="DataSource with JNDI name 'java:/syncopeDataSource':"/> + + <str id="tomcat.container.ssl.id" txt="Https"/> + <str id="tomcat.container.host.id" txt="Tomcat host:"/> + <str id="tomcat.container.port.id" txt="Tomcat port:"/> + <str id="tomcat.container.user.id" txt="Tomcat username:"/> + <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:"/> + <str id="jboss.container.port.id" txt="Jboss port:"/> + <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/f5017841/syncope620/installer/src/main/resources/izpack/userInputLang.xml_ita ---------------------------------------------------------------------- diff --git a/syncope620/installer/src/main/resources/izpack/userInputLang.xml_ita b/syncope620/installer/src/main/resources/izpack/userInputLang.xml_ita new file mode 100644 index 0000000..65dc51f --- /dev/null +++ b/syncope620/installer/src/main/resources/izpack/userInputLang.xml_ita @@ -0,0 +1,66 @@ +<?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. +--> +<langpack> + <str id="mvn.directory.id" txt="Maven home directory:"/> + <str id="archetype.mvn.groupid" txt="GroupId:"/> + <str id="archetype.mvn.artifactid" txt="ArtifactId:"/> + <str id="archetype.mvn.secretkey" txt="SecretKey:"/> + <str id="mvn.anonymous.key.id" txt="Anonymous Key:"/> + <str id="archetype.mvn.conf.directory" txt="Conf directory name:"/> + <str id="archetype.mvn.log.directory" txt="Log directory name:"/> + <str id="archetype.mvn.bundle.directory" txt="Bundle directory name:"/> + <str id="archetype.mvn.modeler.directory" txt="Activity modeler directory name:"/> + <str id="mvn.syncope.version.id" txt="Syncope Version:"/> + <str id="mvn.syncope.admin.password.id" txt="Admin Password:"/> + <str id="mvn.proxy.id" txt="Usa un Server Proxy:"/> + <str id="mvn.proxy.autoconf.id" txt="Configura automaticamente il proxy per Maven"/> + <str id="mvn.proxy.autoconf.desc.id" txt="Seleziona questo campo se Maven non è configurato per usare un proxy:"/> + <str id="mvn.proxy.host.id" txt="Proxy Host:"/> + <str id="mvn.proxy.port.id" txt="Proxy Port:"/> + <str id="mvn.proxy.user.id" txt="Proxy User (se richiesto):"/> + <str id="mvn.proxy.pwd.id" txt="Proxy Password (se richiesta):"/> + + <str id="persistence.jdbc.url" txt="Database JDBC url:"/> + <str id="persistence.db.user" txt="Username:"/> + <str id="persistence.db.password" txt="Password:"/> + <str id="persistence.mysql.is.innodb" txt="INNODB"/> + <str id="persistence.oracle.tablespace" txt="Oracle tablespace:"/> + + <str id="with.datasuorce.id" txt="DataSource with JNDI name 'java:/syncopeDataSource':"/> + + <str id="tomcat.container.ssl.id" txt="Https"/> + <str id="tomcat.container.host.id" txt="Tomcat host:"/> + <str id="tomcat.container.port.id" txt="Tomcat port:"/> + <str id="tomcat.container.user.id" txt="Tomcat username:"/> + <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:"/> + <str id="jboss.container.port.id" txt="Jboss port:"/> + <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/f5017841/syncope620/installer/src/main/resources/izpack/userInputSpec.xml ---------------------------------------------------------------------- diff --git a/syncope620/installer/src/main/resources/izpack/userInputSpec.xml b/syncope620/installer/src/main/resources/izpack/userInputSpec.xml new file mode 100644 index 0000000..0253a33 --- /dev/null +++ b/syncope620/installer/src/main/resources/izpack/userInputSpec.xml @@ -0,0 +1,247 @@ +<?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. +--> +<userInput> + <panel id="archetype" order="1" border="false"> + <field type="title" txt="Maven" bold="true" size="2" /> + + <field type="divider"/> + <field type="space"/> + + <field type="dir" variable="mvn.directory"> + <spec id="mvn.directory.id" size="20" set="${ENV[M2_HOME]}"/> + </field> + <field type="space"/> + <field type="text" variable="mvn.groupid"> + <spec id="archetype.mvn.groupid" size="20" set="net.tirasa"/> + </field> + <field type="space"/> + <field type="text" variable="mvn.artifactid"> + <spec id="archetype.mvn.artifactid" size="20" set="syncope"/> + </field> + <field type="space"/> + <field type="text" variable="mvn.secretkey"> + <spec id="archetype.mvn.secretkey" size="20" set="123456789asdfghj"/> + </field> + <field type="space"/> + <field type="text" variable="mvn.anonymous.key"> + <spec id="mvn.anonymous.key.id" size="20" set="123456789asdfghj"/> + </field> + <field type="space"/> + <field type="dir" variable="mvn.conf.directory"> + <spec id="archetype.mvn.conf.directory" size="20" set="/var/tmp/syncope/conf" mustExist="false" create="true"/> + </field> + <field type="space"/> + <field type="dir" variable="mvn.log.directory"> + <spec id="archetype.mvn.log.directory" size="20" set="/var/tmp/syncope/log" mustExist="false" create="true"/> + </field> + <field type="space"/> + <field type="dir" variable="mvn.modeler.directory"> + <spec id="archetype.mvn.modeler.directory" size="20" set="/var/tmp/syncope/modeler" mustExist="false" create="true"/> + </field> + <field type="space"/> + <field type="dir" variable="mvn.bundle.directory"> + <spec id="archetype.mvn.bundle.directory" size="20" set="/var/tmp/syncope/bundles" mustExist="false" create="true"/> + </field> + <field type="space"/> + <field type="text" variable="mvn.syncope.version"> + <spec id="mvn.syncope.version.id" size="20" set="${syncope.version}"/> + </field> + <!-- <field type="space"/> + <field type="password" variable="mvn.syncope.admin.password"> + <spec> + <pwd id="mvn.syncope.admin.password.id" size="20" set="password"/> + </spec> + </field>--> + <field type="space"/> + <field type="divider" align="top"/> + <field type="check" variable="mvn.proxy"> + <spec id="mvn.proxy.id" true="true" false="false" set="false"/> + </field> + <field type="space"/> + <field type="check" variable="mvn.proxy.autoconf" conditionid="mvn.choice.proxy"> + <description id="mvn.proxy.autoconf.desc.id"/> + <spec id="mvn.proxy.autoconf.id" true="true" false="false" set="false"/> + </field> + <field type="space"/> + <field type="text" variable="mvn.proxy.host" conditionid="mvn.choice.proxy"> + <spec id="mvn.proxy.host.id" size="20" set="localhost"/> + </field> + <field type="space"/> + <field type="text" variable="mvn.proxy.port" conditionid="mvn.choice.proxy"> + <spec id="mvn.proxy.port.id" size="5" set="3128"/> + </field> + <field type="space"/> + <field type="text" variable="mvn.proxy.user" conditionid="mvn.choice.proxy"> + <spec id="mvn.proxy.user.id" size="20"/> + </field> + <field type="space"/> + <field type="password" variable="mvn.proxy.pwd" conditionid="mvn.choice.proxy"> + <spec> + <pwd id="mvn.proxy.pwd.id" size="20"/> + </spec> + </field> + </panel> + + <panel id="persistence" order="2" border="false"> + <field type="title" txt="Database options" bold="true" size="2" /> + + <field type="divider"/> + <field type="space"/> + + <field type="staticText" align="left" txt="Database technologies:" /> + <field type="radio" variable="install.type.selection"> + <spec> + <choice txt="Postgres" value="postgres" set="true" /> + <choice txt="MySQL" value="mysql"/> + <choice txt="Oracle" value="oracle"/> + <choice txt="SQLServer" value="sqlserver"/> + </spec> + </field> + </panel> + + <panel id="persistence_advanced" order="2" border="false"> + <field type="title" txt="Database advanced options" bold="true" size="2" /> + + <field type="divider"/> + <field type="space"/> + <field type="text" variable="persistence.url" conditionid="postgres.choice"> + <spec id="persistence.jdbc.url" size="20" set="jdbc:postgresql://localhost:5432/syncope"/> + </field> + <field type="text" variable="persistence.url" conditionid="mysql.choice"> + <spec id="persistence.jdbc.url" size="20" set="jdbc:mysql://localhost:3306/syncope?characterEncoding=UTF-8"/> + </field> + <field type="text" variable="persistence.url" conditionid="oracle.choice"> + <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:1433;database=syncope;selectMethod=cursor;sendStringParametersAsUnicode=false"/> + </field> + <field type="space"/> + <field type="text" variable="persistence.dbuser"> + <spec id="persistence.db.user" size="20" set="syncope"/> + </field> + <field type="space"/> + <field type="text" variable="persistence.dbpassword"> + <spec id="persistence.db.password" size="20" set="syncope"/> + </field> + <field type="space"/> + + <field type="check" variable="is.innodb" conditionid="mysql.choice"> + <spec id="persistence.mysql.is.innodb" true="true" false="false" set="true"/> + </field> + + <field type="text" variable="persistence.tablespace" conditionid="oracle.choice"> + <spec id="persistence.oracle.tablespace" size="20" set="SYNCOPE"/> + </field> + </panel> + + <panel id="container" order="3" border="false"> + <field type="title" txt="Application Server" bold="true" size="2" /> + + <field type="divider"/> + <field type="space"/> + + <field type="staticText" align="left" txt="Application server:" /> + <field type="radio" variable="install.container.selection"> + <spec> + <choice txt="Tomcat" value="tomcat" set="true" /> + <choice txt="Glassfish" value="glassfish"/> + <choice txt="Jboss" value="jboss"/> + </spec> + </field> + + <field type="space"/> + + <field type="check" variable="with.datasuorce"> + <spec id="with.datasuorce.id" true="true" false="false" set="true"/> + </field> + </panel> + + <panel id="container_advanced" order="3" border="false"> + <field type="title" txt="Application Server" bold="true" size="2" /> + + <field type="divider"/> + <field type="space"/> + + <field type="check" variable="tomcat.container.ssl" conditionid="tomcat.choice"> + <spec id="tomcat.container.ssl.id" true="true" false="false" set="false"/> + </field> + <field type="space"/> + <field type="text" variable="tomcat.container.host" conditionid="tomcat.choice"> + <spec id="tomcat.container.host.id" size="20" set="localhost"/> + </field> + <field type="space"/> + <field type="text" variable="tomcat.container.port" conditionid="tomcat.choice"> + <spec id="tomcat.container.port.id" size="20" set="8080"/> + </field> + <field type="space"/> + <field type="text" variable="tomcat.container.user" conditionid="tomcat.choice"> + <spec id="tomcat.container.user.id" size="20" set="manager"/> + </field> + <field type="space"/> + <field type="text" variable="tomcat.container.pwd" conditionid="tomcat.choice"> + <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> + + <field type="check" variable="jboss.container.ssl" conditionid="jboss.choice"> + <spec id="jboss.container.ssl.id" true="true" false="false" set="false"/> + </field> + <field type="space"/> + <field type="text" variable="jboss.container.host" conditionid="jboss.choice"> + <spec id="jboss.container.host.id" size="20" set="localhost"/> + </field> + <field type="space"/> + <field type="text" variable="jboss.container.port" conditionid="jboss.choice"> + <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"> + <spec id="jboss.container.jdbc.module.id" size="20" set="org.postgres"/> + </field> + <field type="space"/> + <field type="text" variable="jboss.container.user" conditionid="jboss.choice"> + <spec id="jboss.container.user.id" size="20" set="admin"/> + </field> + <field type="space"/> + <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>
