chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1745773 - in /chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench: ./ src/main/assembly/ src/main/java/org/apache/chemistry/opencmis/script/ src/main/java/org/apache/chemistry/opencmis/workbench/ src/main/jav...
Date Fri, 27 May 2016 16:50:50 GMT
Author: fmui
Date: Fri May 27 16:50:50 2016
New Revision: 1745773

URL: http://svn.apache.org/viewvc?rev=1745773&view=rev
Log:
Workbench improvements
- command line script execution
- help messages in login dialog

Added:
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/script/
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/script/ScriptExecutor.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/icons/QuestionIcon.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/start/runscript.bat
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/start/runscript.sh
Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/pom.xml
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/assembly/workbench-assembly.xml
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/assembly/workbench-mac-assembly.xml
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/AbstractSpringLoginTab.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/BasicLoginTab.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/start/workbench.bat
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/start/workbench.sh

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/pom.xml
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/pom.xml?rev=1745773&r1=1745772&r2=1745773&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/pom.xml
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/pom.xml
Fri May 27 16:50:50 2016
@@ -255,7 +255,7 @@
         <dependency>
             <groupId>com.google.zxing</groupId>
             <artifactId>javase</artifactId>
-            <version>3.2.0</version>
+            <version>3.2.1</version>
         </dependency>
         <!-- CXF -->
         <dependency>

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/assembly/workbench-assembly.xml
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/assembly/workbench-assembly.xml?rev=1745773&r1=1745772&r2=1745773&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/assembly/workbench-assembly.xml
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/assembly/workbench-assembly.xml
Fri May 27 16:50:50 2016
@@ -63,6 +63,17 @@
             <outputDirectory></outputDirectory>
             <lineEnding>dos</lineEnding>
         </file>
+        <file>
+            <source>target/start/runscript.sh</source>
+            <outputDirectory></outputDirectory>
+            <lineEnding>unix</lineEnding>
+            <fileMode>0755</fileMode>
+        </file>
+        <file>
+            <source>target/start/runscript.bat</source>
+            <outputDirectory></outputDirectory>
+            <lineEnding>dos</lineEnding>
+        </file>
     </files>
     <dependencySets>
         <dependencySet>

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/assembly/workbench-mac-assembly.xml
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/assembly/workbench-mac-assembly.xml?rev=1745773&r1=1745772&r2=1745773&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/assembly/workbench-mac-assembly.xml
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/assembly/workbench-mac-assembly.xml
Fri May 27 16:50:50 2016
@@ -59,6 +59,12 @@
             <fileMode>0755</fileMode>
         </file>
         <file>
+            <source>target/start/runscript.sh</source>
+            <outputDirectory>/Contents/Resources</outputDirectory>
+            <lineEnding>unix</lineEnding>
+            <fileMode>0755</fileMode>
+        </file>
+        <file>
             <source>target/start/run.sh</source>
             <outputDirectory>/Contents/MacOS</outputDirectory>
             <lineEnding>unix</lineEnding>

Added: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/script/ScriptExecutor.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/script/ScriptExecutor.java?rev=1745773&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/script/ScriptExecutor.java
(added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/script/ScriptExecutor.java
Fri May 27 16:50:50 2016
@@ -0,0 +1,220 @@
+/*
+ * 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.chemistry.opencmis.script;
+
+import groovy.lang.Binding;
+import groovy.lang.GroovyShell;
+
+import java.io.Console;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStreamReader;
+
+import org.apache.chemistry.opencmis.client.SessionParameterMap;
+import org.apache.chemistry.opencmis.client.api.Session;
+import org.apache.chemistry.opencmis.client.api.SessionFactory;
+import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;
+import org.apache.chemistry.opencmis.commons.SessionParameter;
+import org.codehaus.groovy.control.CompilationFailedException;
+
+/**
+ * Command line tool that creates a session and executes a Groovy script.
+ */
+public class ScriptExecutor {
+
+    public static void main(String[] args) {
+        boolean verbose = false;
+
+        try {
+            // check arguments
+            int parameterParametersFile = 0;
+            int parameterScriptFile = 1;
+            boolean readPassword = false;
+
+            if (args.length > 0) {
+                int i = 0;
+                while (args[i].startsWith("-")) {
+                    if (args[i].equals("-p")) {
+                        readPassword = true;
+                    } else if (args[i].equals("-v")) {
+                        verbose = true;
+                    } else {
+
+                        System.err.println("Unknown argument '" + args[i] + "'.");
+                        return;
+                    }
+
+                    parameterParametersFile++;
+                    parameterScriptFile++;
+                    i++;
+                }
+            }
+
+            if (args.length < parameterScriptFile + 1) {
+                System.out.println("OpenCMIS Script Executor\n");
+                System.out.println("Usage: [-p] [-v] <path-to-session-parameters-file>
<path-to-groovy-script-file>\n");
+                System.out.println("Parameters:\n");
+                System.out.println(" -p                                 ask for password");
+                System.out.println(" -v                                 verbose output");
+                System.out.println(" <path-to-session-parameters-file>  "
+                        + "path of the properties file that contains the session parameters");
+                System.out.println(" <path-to-groovy-script-file>       path of the
groovy script file");
+                return;
+            }
+
+            // check parameter file
+            File parametersFile = new File(args[parameterParametersFile]);
+            if (!parametersFile.exists()) {
+                System.err.println("Session parameters file does not exist: " + parametersFile.getAbsolutePath());
+                return;
+            }
+            if (!parametersFile.isFile()) {
+                System.err.println("Session parameters file is not a file: " + parametersFile.getAbsolutePath());
+                return;
+            }
+
+            // check script file
+            File scriptFile = new File(args[parameterScriptFile]);
+            if (!scriptFile.exists()) {
+                System.err.println("Script file does not exist: " + scriptFile.getAbsolutePath());
+                return;
+            }
+            if (!scriptFile.isFile()) {
+                System.err.println("Script file is not a file: " + scriptFile.getAbsolutePath());
+                return;
+            }
+
+            // create session
+            char[] password = null;
+            if (readPassword) {
+                password = readPassword();
+                if (password == null) {
+                    System.err.println("Please enter a password!");
+                    return;
+                }
+            }
+
+            if (verbose) {
+                System.out.println("Connecting...");
+            }
+
+            Session session = createSession(parametersFile, password);
+
+            if (verbose) {
+                System.out.println("Connected to " + session.getRepositoryInfo().getName()
+ " ("
+                        + session.getRepositoryInfo().getId() + ")\n");
+            }
+
+            // run script, if we have session
+            if (session != null) {
+                String[] scriptArgs = new String[args.length - (parameterScriptFile + 1)];
+                if (scriptArgs.length > 0) {
+                    System.arraycopy(args, parameterScriptFile + 1, scriptArgs, 0, scriptArgs.length);
+                }
+
+                runGroovyScript(session, scriptFile, scriptArgs);
+            }
+
+            System.exit(0);
+        } catch (Exception ex) {
+            System.err.println("Error: " + ex.toString());
+            if (verbose) {
+                System.err.println("\nStacktrace:");
+                ex.printStackTrace(System.err);
+            }
+
+            System.exit(1);
+        }
+    }
+
+    /**
+     * Reads a password from the console.
+     */
+    private static char[] readPassword() {
+        Console console = System.console();
+        if (console == null) {
+            try {
+                System.out.println("WARNING: Password will be echoed on screen!");
+                System.out.print("Password: ");
+
+                InputStreamReader reader = new InputStreamReader(System.in);
+                char[] buffer = new char[128];
+
+                int l = reader.read(buffer) - 1;
+                if (l > 0) {
+                    char[] result = new char[l];
+                    System.arraycopy(buffer, 0, result, 0, l);
+                    return result;
+                } else {
+                    return null;
+                }
+            } catch (IOException ioe) {
+                return null;
+            }
+        } else {
+            return console.readPassword("Password: ");
+        }
+    }
+
+    /**
+     * Creates an OpenCMIS session from session parameters in a file.
+     */
+    private static Session createSession(File parametersFile, char[] password) {
+        SessionParameterMap parameters = new SessionParameterMap();
+
+        // read session parameters
+        try {
+            parameters.load(parametersFile);
+        } catch (IOException ioe) {
+            System.err.println("Cannot read session parameters file: " + ioe.toString());
+            return null;
+        }
+
+        // set password
+        if (password != null) {
+            parameters.put(SessionParameter.PASSWORD, new String(password));
+        }
+
+        // create session
+        SessionFactory factory = SessionFactoryImpl.newInstance();
+        Session session = factory.createSession(parameters);
+
+        return session;
+    }
+
+    /**
+     * Runs a Groovy Script.
+     */
+    private static void runGroovyScript(Session session, File scriptFile, String[] scriptArgs)
+            throws CompilationFailedException, IOException {
+        // create Groovy shell
+        Binding binding = new Binding();
+        binding.setVariable("session", session);
+        binding.setVariable("binding", session.getBinding());
+        binding.setVariable("out", System.out);
+
+        GroovyShell shell = new GroovyShell(ScriptExecutor.class.getClassLoader(), binding);
+
+        // ... and execute
+        Object result = shell.run(scriptFile, scriptArgs);
+        if (result != null) {
+            System.out.println(result);
+        }
+    }
+}

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/AbstractSpringLoginTab.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/AbstractSpringLoginTab.java?rev=1745773&r1=1745772&r2=1745773&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/AbstractSpringLoginTab.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/AbstractSpringLoginTab.java
Fri May 27 16:50:50 2016
@@ -21,8 +21,12 @@ package org.apache.chemistry.opencmis.wo
 import java.awt.Component;
 import java.awt.Container;
 import java.awt.Dimension;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
 import java.text.NumberFormat;
 
+import javax.swing.Icon;
+import javax.swing.JComponent;
 import javax.swing.JFormattedTextField;
 import javax.swing.JLabel;
 import javax.swing.JPasswordField;
@@ -30,6 +34,9 @@ import javax.swing.JTextField;
 import javax.swing.Spring;
 import javax.swing.SpringLayout;
 import javax.swing.SwingConstants;
+import javax.swing.ToolTipManager;
+
+import org.apache.chemistry.opencmis.workbench.icons.QuestionIcon;
 
 /**
  * Convenience methods for spring layout tabs.
@@ -38,46 +45,93 @@ public abstract class AbstractSpringLogi
 
     private static final long serialVersionUID = 1L;
 
+    protected static final Icon HELP_ICON = new QuestionIcon(WorkbenchScale.scaleInt(12),
WorkbenchScale.scaleInt(12));
+
     protected JTextField createTextField(Container pane, String label) {
+        return createTextField(pane, label, null);
+    }
+
+    protected JTextField createTextField(Container pane, String label, String help) {
         JTextField textField = new JTextField(60);
         JLabel textLabel = new JLabel(label, SwingConstants.TRAILING);
         textLabel.setLabelFor(textField);
 
         pane.add(textLabel);
+        pane.add(createHelp(help));
         pane.add(textField);
 
         return textField;
     }
 
     protected JFormattedTextField createIntegerField(Container pane, String label) {
+        return createIntegerField(pane, label, null);
+    }
+
+    protected JFormattedTextField createIntegerField(Container pane, String label, String
help) {
         NumberFormat format = NumberFormat.getIntegerInstance();
         JFormattedTextField intField = new JFormattedTextField(format);
         JLabel intLabel = new JLabel(label, SwingConstants.TRAILING);
         intLabel.setLabelFor(intField);
 
         pane.add(intLabel);
+        pane.add(createHelp(help));
         pane.add(intField);
 
         return intField;
     }
 
     protected JPasswordField createPasswordField(Container pane, String label) {
+        return createPasswordField(pane, label, null);
+    }
+
+    protected JPasswordField createPasswordField(Container pane, String label, String help)
{
         JPasswordField textField = new JPasswordField(60);
         JLabel textLabel = new JLabel(label, SwingConstants.TRAILING);
         textLabel.setLabelFor(textField);
 
         pane.add(textLabel);
+        pane.add(createHelp(help));
         pane.add(textField);
 
         return textField;
     }
 
+    protected JComponent createHelp(String help) {
+        if (help == null) {
+            return new JLabel("");
+        } else {
+            JLabel label = new JLabel(HELP_ICON);
+            label.setToolTipText(help);
+
+            label.addMouseListener(new MouseAdapter() {
+                private final int defaultDismissDelay = ToolTipManager.sharedInstance().getDismissDelay();
+                private final static int DISMIASS_DELAY = 120 * 1000;
+
+                @Override
+                public void mouseEntered(MouseEvent me) {
+                    ToolTipManager.sharedInstance().setDismissDelay(DISMIASS_DELAY);
+                }
+
+                @Override
+                public void mouseExited(MouseEvent me) {
+                    ToolTipManager.sharedInstance().setDismissDelay(defaultDismissDelay);
+                }
+            });
+
+            return label;
+        }
+    }
+
     private SpringLayout.Constraints getConstraintsForCell(int row, int col, Container parent,
int cols) {
         SpringLayout layout = (SpringLayout) parent.getLayout();
         Component c = parent.getComponent(row * cols + col);
         return layout.getConstraints(c);
     }
 
+    protected void makeCompactGrid(int rows) {
+        makeCompactGrid(this, rows, 3, 5, 10, 5, 5);
+    }
+
     protected void makeCompactGrid(Container parent, int rows, int cols, int initialX, int
initialY, int xPad, int yPad) {
         SpringLayout layout = (SpringLayout) parent.getLayout();
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/BasicLoginTab.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/BasicLoginTab.java?rev=1745773&r1=1745772&r2=1745773&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/BasicLoginTab.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/BasicLoginTab.java
Fri May 27 16:50:50 2016
@@ -82,15 +82,16 @@ public class BasicLoginTab extends Abstr
     private void createGUI() {
         setLayout(new SpringLayout());
 
-        urlField = createTextField(this, "URL:");
+        urlField = createTextField(this, "URL:",
+                "<html>Enter the URL of the CMIS endpoint. It depends on the selected
binding. ");
         urlField.setText(System.getProperty(SYSPROP_URL, "").trim());
 
         createBindingButtons(this);
 
-        usernameField = createTextField(this, "Username:");
+        usernameField = createTextField(this, "Username:", "Enter the user name.");
         usernameField.setText(System.getProperty(SYSPROP_USER, ""));
 
-        passwordField = createPasswordField(this, "Password:");
+        passwordField = createPasswordField(this, "Password:", "Enter the users password.");
         passwordField.setText(System.getProperty(SYSPROP_PASSWORD, ""));
 
         createAuthenticationButtons(this);
@@ -101,24 +102,27 @@ public class BasicLoginTab extends Abstr
 
         createCookieButtons(this);
 
-        csrfHeaderField = createTextField(this, "CSRF Header:");
+        csrfHeaderField = createTextField(this, "CSRF Header:", "<html>Enter <b>CSRF
header</b> name.<br>"
+                + "If the server needs a CSRF header, enter the name of the header, otherwise
leave this field blank.");
         csrfHeaderField.setText(System.getProperty(SYSPROP_CSRF_HEADER, ""));
 
-        connectTimeoutField = createIntegerField(this, "Connect timeout (secs):");
+        connectTimeoutField = createIntegerField(this, "Connect timeout (secs):",
+                "<html>Enter the <b>connect timeout</b> in seconds.<br>This
is the time the client waits to connect to the server.");
         try {
             connectTimeoutField.setValue(Long.parseLong(System.getProperty(SYSPROP_CONN_TIMEOUT,
"30")));
         } catch (NumberFormatException e) {
             connectTimeoutField.setValue(30);
         }
 
-        readTimeoutField = createIntegerField(this, "Read timeout (secs):");
+        readTimeoutField = createIntegerField(this, "Read timeout (secs):",
+                "<html>Enter the <b>read timeout</b> in seconds.<br>This
is the time the client waits for a response from the server.");
         try {
             readTimeoutField.setValue(Long.parseLong(System.getProperty(SYSPROP_READ_TIMEOUT,
"600")));
         } catch (NumberFormatException e) {
             readTimeoutField.setValue(600);
         }
 
-        makeCompactGrid(this, 11, 2, 5, 10, 5, 5);
+        makeCompactGrid(11);
     }
 
     private void createBindingButtons(Container pane) {
@@ -143,6 +147,10 @@ public class BasicLoginTab extends Abstr
         JLabel bindingLabel = new JLabel("Binding:", SwingConstants.TRAILING);
 
         pane.add(bindingLabel);
+        pane.add(createHelp("<html>Select the CMIS binding.<br>"
+                + "The <b>Browser binding</b> is the fastest binding and should
be used for CMIS 1.1 repositories.<br>"
+                + "The <b>AtomPub binding</b> is the second fastest binding and
should be used for CMIS 1.0 repositories.<br>"
+                + "The <b>Web Services binding</b> is the last restort and should
be avoided, if possible."));
         pane.add(bindingContainer);
     }
 
@@ -173,6 +181,11 @@ public class BasicLoginTab extends Abstr
         JLabel authenticatioLabel = new JLabel("Authentication:", SwingConstants.TRAILING);
 
         pane.add(authenticatioLabel);
+        pane.add(createHelp("<html>Select the authentication method.<br>"
+                + "The <b>Standard authentication</b> is Basic Auth and should
work with most repositories.<br>"
+                + "The <b>NTLM authentication</b> should be used with caution!
It's very likely that some CMIS operations will fail.<br>"
+                + "The <b>OAuth authentication</b> requires a bearer token in
the username field. The token will not be refreshed when it expires."
+                + "Use the OAuthAuthenticationProvider for full OAuth support."));
         pane.add(authenticationContainer);
     }
 
@@ -191,6 +204,8 @@ public class BasicLoginTab extends Abstr
         JLabel compressionLabel = new JLabel("Compression:", SwingConstants.TRAILING);
 
         pane.add(compressionLabel);
+        pane.add(createHelp("<html>Turn <b>server compression</b> on or
off.<br>"
+                + "It is save to turn server compression always on. The client will still
work if the server doesn't support it."));
         pane.add(compressionContainer);
     }
 
@@ -209,6 +224,8 @@ public class BasicLoginTab extends Abstr
         JLabel clientCompressionLabel = new JLabel("Client Compression:", SwingConstants.TRAILING);
 
         pane.add(clientCompressionLabel);
+        pane.add(createHelp("<html>Turn <b>client compression</b> on or
off.<br>"
+                + "If the server doesn't support client compression, the communication wil
fail."));
         pane.add(clientCompressionContainer);
     }
 
@@ -227,6 +244,8 @@ public class BasicLoginTab extends Abstr
         JLabel cookiesLabel = new JLabel("Cookies:", SwingConstants.TRAILING);
 
         pane.add(cookiesLabel);
+        pane.add(createHelp("<html>Turn <b>cookies</b> on or off.<br>"
+                + "It is recommended to turn cookies always on. Nothing bad happens if the
server doesn't need or support cookies."));
         pane.add(cookiesContainer);
     }
 

Added: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/icons/QuestionIcon.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/icons/QuestionIcon.java?rev=1745773&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/icons/QuestionIcon.java
(added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/icons/QuestionIcon.java
Fri May 27 16:50:50 2016
@@ -0,0 +1,97 @@
+/*
+ * 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.chemistry.opencmis.workbench.icons;
+
+import java.awt.Graphics2D;
+import java.awt.geom.GeneralPath;
+
+public class QuestionIcon extends AbstractWorkbenchIcon {
+
+    public QuestionIcon() {
+        super();
+    }
+
+    public QuestionIcon(int width, int height) {
+        super(width, height);
+    }
+
+    public QuestionIcon(int width, int height, boolean enabled) {
+        super(width, height, enabled);
+    }
+
+    @Override
+    protected int getOrginalHeight() {
+        return 64;
+    }
+
+    @Override
+    protected int getOrginalWidth() {
+        return 64;
+    }
+
+    @Override
+    protected void paint(Graphics2D g) {
+        GeneralPath shape = new GeneralPath();
+
+        shape = new GeneralPath();
+        shape.moveTo(32.0, 0.0);
+        shape.curveTo(14.327, 0.0, 0.0, 14.327, 0.0, 32.0);
+        shape.curveTo(0.0, 49.673, 14.327, 64.0, 32.0, 64.0);
+        shape.curveTo(49.673, 64.0, 64.0, 49.673, 64.0, 32.0);
+        shape.curveTo(64.0, 14.327, 49.673, 0.0, 32.0, 0.0);
+        shape.closePath();
+        shape.moveTo(32.0, 58.0);
+        shape.curveTo(17.641, 58.0, 6.0, 46.359, 6.0, 32.0);
+        shape.curveTo(6.0, 17.64, 17.641, 6.0, 32.0, 6.0);
+        shape.curveTo(46.359, 6.0, 58.0, 17.64, 58.0, 32.0);
+        shape.curveTo(58.0, 46.359, 46.359, 58.0, 32.0, 58.0);
+        shape.closePath();
+
+        g.setPaint(getColor());
+        g.fill(shape);
+
+        shape = new GeneralPath();
+        shape.moveTo(31.95612, 40.470966);
+        shape.lineTo(29.742579, 40.470966);
+        shape.lineTo(29.742579, 38.87591);
+        shape.curveTo(29.742579, 36.53216, 29.954166, 35.23008, 30.442448, 33.83034);
+        shape.curveTo(31.093489, 32.07253, 31.093489, 32.07253, 34.80443, 27.026955);
+        shape.curveTo(35.797264, 25.578388, 36.39948, 23.674091, 36.39948, 21.62331);
+        shape.curveTo(36.39948, 17.782164, 34.348698, 15.470966, 30.80052, 15.470966);
+        shape.curveTo(28.407944, 15.470966, 26.1944, 16.675394, 26.1944, 17.977476);
+        shape.curveTo(26.1944, 18.368101, 26.243229, 18.482035, 26.991928, 19.067972);
+        shape.curveTo(27.952213, 19.881773, 28.456772, 20.728128, 28.456772, 21.720966);
+        shape.curveTo(28.456772, 23.26719, 27.203516, 24.471617, 25.592188, 24.471617);
+        shape.curveTo(23.752995, 24.471617, 22.353256, 22.827738, 22.353256, 20.630472);
+        shape.curveTo(22.353256, 16.31732, 26.454819, 13.224873, 32.102604, 13.224873);
+        shape.curveTo(37.799217, 13.224873, 41.65664, 16.724222, 41.65664, 21.932554);
+        shape.curveTo(41.65664, 25.431904, 40.54987, 27.12461, 35.65078, 31.470314);
+        shape.curveTo(32.4444, 34.220966, 31.907291, 35.571877, 31.95612, 40.470966);
+        shape.closePath();
+        shape.moveTo(30.751692, 44.5237);
+        shape.curveTo(32.4444, 44.5237, 33.84414, 45.92344, 33.84414, 47.632423);
+        shape.curveTo(33.84414, 49.37396, 32.4444, 50.7737, 30.702864, 50.7737);
+        shape.curveTo(28.993881, 50.7737, 27.594141, 49.37396, 27.594141, 47.632423);
+        shape.curveTo(27.594141, 45.92344, 28.993881, 44.5237, 30.751692, 44.5237);
+        shape.closePath();
+
+        g.setPaint(getColor());
+        g.fill(shape);
+    }
+}

Added: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/start/runscript.bat
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/start/runscript.bat?rev=1745773&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/start/runscript.bat
(added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/start/runscript.bat
Fri May 27 16:50:50 2016
@@ -0,0 +1,31 @@
+@echo off
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements.  See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License.  You may obtain a copy of the License at
+rem
+rem     http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+rem @version@
+
+rem use variable CUSTOM_JAVA_OPTS to set additional JAVA options
+
+rem uncomment the following lines to configure HTTP proxy
+
+rem set http_proxy=http://<proxy>:<port>
+rem set https_proxy=https://<proxy>:<port>
+rem set no_proxy=localhost,127.0.0.0,.local
+
+
+for /F "delims=/" %%x in ('"java -classpath .;%~dp0\lib\* org.apache.chemistry.opencmis.workbench.ProxyDetector
-j -s"') do set "JAVA_PROXY_CONF=%%x"
+set JAVA_OPTS=%JAVA_PROXY_CONF%
+
+java %JAVA_OPTS% %CUSTOM_JAVA_OPTS% -classpath ".;%~dp0\lib\*" org.apache.chemistry.opencmis.script.ScriptExecutor
%*
\ No newline at end of file

Added: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/start/runscript.sh
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/start/runscript.sh?rev=1745773&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/start/runscript.sh
(added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/start/runscript.sh
Fri May 27 16:50:50 2016
@@ -0,0 +1,58 @@
+# #!/bin/sh
+
+# 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.
+
+# @version@
+
+if [ -z "$JAVA_HOME" ]; then
+  j=$(which java 2>/dev/null)
+  if [ -z "$j" ]; then
+ 	echo "Unable to locate Java!"
+    exit 1
+  else
+    JAVA="$j"
+  fi
+else
+  JAVA="$JAVA_HOME/bin/java"
+fi
+
+
+SCRIPT_DIR=$(dirname "$0")
+
+pushd "$SCRIPT_DIR"
+
+cd "$SCRIPT_DIR/lib"
+
+WCP="."
+for i in *.jar; do
+  WCP="$SCRIPT_DIR/lib/$i:${WCP}"
+done
+
+popd
+
+# use variable CUSTOM_JAVA_OPTS to set additional JAVA options
+
+# uncomment the following lines to configure HTTP proxy
+
+# export http_proxy=http://<proxy>:<port>
+# export https_proxy=https://<proxy>:<port>
+# export no_proxy=localhost,127.0.0.0,.local
+
+
+JAVA_PROXY_CONF=$($JAVA -classpath $WCP org.apache.chemistry.opencmis.workbench.ProxyDetector
-j -s)
+JAVA_OPTS="$JAVA_PROXY_CONF"
+
+exec $JAVA $JAVA_OPTS $CUSTOM_JAVA_OPTS -classpath $WCP org.apache.chemistry.opencmis.script.ScriptExecutor
"$@"
\ No newline at end of file

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/start/workbench.bat
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/start/workbench.bat?rev=1745773&r1=1745772&r2=1745773&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/start/workbench.bat
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/start/workbench.bat
Fri May 27 16:50:50 2016
@@ -16,8 +16,6 @@ rem limitations under the License.
 
 rem @version@
 
-cd %~dp0\lib
-
 rem use variable CUSTOM_JAVA_OPTS to set additional JAVA options
 
 rem uncomment the following lines to configure HTTP proxy
@@ -27,7 +25,7 @@ rem set https_proxy=https://<proxy>:<por
 rem set no_proxy=localhost,127.0.0.0,.local
 
 
-for /F "delims=/" %%x in ('"java -classpath .;* org.apache.chemistry.opencmis.workbench.ProxyDetector
-j -s"') do set "JAVA_PROXY_CONF=%%x"
+for /F "delims=/" %%x in ('"java -classpath .;%~dp0\lib\* org.apache.chemistry.opencmis.workbench.ProxyDetector
-j -s"') do set "JAVA_PROXY_CONF=%%x"
 set JAVA_OPTS=%JAVA_PROXY_CONF%
 
-start /B javaw %JAVA_OPTS% %CUSTOM_JAVA_OPTS% -classpath ".;*" org.apache.chemistry.opencmis.workbench.Workbench
\ No newline at end of file
+start /B javaw %JAVA_OPTS% %CUSTOM_JAVA_OPTS% -classpath ".;%~dp0\lib\*" org.apache.chemistry.opencmis.workbench.Workbench
\ No newline at end of file

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/start/workbench.sh
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/start/workbench.sh?rev=1745773&r1=1745772&r2=1745773&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/start/workbench.sh
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/start/workbench.sh
Fri May 27 16:50:50 2016
@@ -31,13 +31,18 @@ fi
 
 
 SCRIPT_DIR=$(dirname "$0")
+
+pushd "$SCRIPT_DIR"
+
 cd "$SCRIPT_DIR/lib"
 
 WCP="."
 for i in *.jar; do
-  WCP="$i:${WCP}"
+  WCP="$SCRIPT_DIR/lib/$i:${WCP}"
 done
 
+popd
+
 # use variable CUSTOM_JAVA_OPTS to set additional JAVA options
 
 # uncomment the following lines to configure HTTP proxy




Mime
View raw message