001: /**
002: * LibreSource
003: * Copyright (C) 2004-2008 Artenum SARL / INRIA
004: * http://www.libresource.org - contact@artenum.com
005: *
006: * This file is part of the LibreSource software,
007: * which can be used and distributed under license conditions.
008: * The license conditions are provided in the LICENSE.TXT file
009: * at the root path of the packaging that enclose this file.
010: * More information can be found at
011: * - http://dev.libresource.org/home/license
012: *
013: * Initial authors :
014: *
015: * Guillaume Bort / INRIA
016: * Francois Charoy / Universite Nancy 2
017: * Julien Forest / Artenum
018: * Claude Godart / Universite Henry Poincare
019: * Florent Jouille / INRIA
020: * Sebastien Jourdain / INRIA / Artenum
021: * Yves Lerumeur / Artenum
022: * Pascal Molli / Universite Henry Poincare
023: * Gerald Oster / INRIA
024: * Mariarosa Penzi / Artenum
025: * Gerard Sookahet / Artenum
026: * Raphael Tani / INRIA
027: *
028: * Contributors :
029: *
030: * Stephane Bagnier / Artenum
031: * Amadou Dia / Artenum-IUP Blois
032: * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
033: */package org.libresource.so6.core.exec.ui.tools;
034:
035: import java.awt.Component;
036:
037: import java.io.IOException;
038:
039: import java.util.Hashtable;
040: import java.util.Properties;
041:
042: import javax.swing.JOptionPane;
043:
044: /**
045: * @author smack
046: */
047: public class CheckWscParameters extends LsClassicPropertiesEditor {
048: private Properties wscProps;
049:
050: public CheckWscParameters(String serviceUrl_, String queueId_,
051: String basePath_, String login_, String wsName_,
052: String clientName_, Properties clientProperties_)
053: throws IOException {
054: super ("Check your workspace connection Parameters...");
055: addTextPropertie("serviceUrl", "Service URL :", serviceUrl_,
056: false);
057: addTextPropertie("wsName", "Workspace Name :", wsName_, false);
058: addPathPropertie("basePath", "Base Path :", basePath_, false);
059: addTextPropertie("synchronizerURI", "Synchronizer URI :",
060: queueId_, false);
061: addTextPropertie("login", "Login :", login_, false);
062: addPasswordPropertie("password", "Password :", "", true);
063:
064: wscProps = new Properties();
065:
066: Hashtable props = editProperties();
067:
068: wscProps.putAll(props);
069: }
070:
071: public static void main(String[] args) throws Exception {
072: if (args.length > 1) {
073: System.err
074: .println("The only parameter required is the client class name");
075: System.err
076: .println("To set default value please use System properties");
077: System.err
078: .println(" (1) createLibresourceReplica.basePath = workspace base path");
079: System.err
080: .println(" (2) createLibresourceReplica.wsName = name of the workspace");
081: System.err
082: .println(" (3) createLibresourceReplica.queueId = the synchronizer URI");
083: System.err
084: .println(" (4) createLibresourceReplica.login = user login");
085: System.err
086: .println(" (5) createLibresourceReplica.password = user password");
087: } else if (args.length == 1) {
088: String serviceUrl = System.getProperties().getProperty(
089: "createLibresourceReplica.serviceUrl", "");
090: String queueId = System.getProperties().getProperty(
091: "createLibresourceReplica.queueId", "");
092: String basePath = System.getProperties().getProperty(
093: "createLibresourceReplica.basePath", "");
094: String login = System.getProperties().getProperty(
095: "createLibresourceReplica.login", "");
096: String password = System.getProperties().getProperty(
097: "createLibresourceReplica.password", "");
098: String wsName = System.getProperties().getProperty(
099: "createLibresourceReplica.wsName", "");
100: String clientName = args[0];
101:
102: new CheckWscParameters(serviceUrl, queueId, basePath,
103: login, wsName, clientName, null);
104: JOptionPane
105: .showMessageDialog(
106: null,
107: "<html>Your replica has been created localy.<br>(Refresh your browser to see it...)</html>");
108: System.exit(0);
109: }
110: }
111:
112: public Properties getWscProps() {
113: return wscProps;
114: }
115: }
|