chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1714194 - in /chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main: java/org/apache/chemistry/opencmis/workbench/ resources/configs/
Date Fri, 13 Nov 2015 12:14:38 GMT
Author: fmui
Date: Fri Nov 13 12:14:38 2015
New Revision: 1714194

URL: http://svn.apache.org/viewvc?rev=1714194&view=rev
Log:
Workbench improvements

Added:
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sap-mobile-documents-browser.properties
Modified:
    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/ClientHelper.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/DiscoverLoginTab.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/config-library.properties

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=1714194&r1=1714193&r2=1714194&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 Nov 13 12:14:38 2015
@@ -20,6 +20,7 @@ package org.apache.chemistry.opencmis.wo
 
 import java.awt.Component;
 import java.awt.Container;
+import java.awt.Dimension;
 import java.text.NumberFormat;
 
 import javax.swing.JFormattedTextField;
@@ -109,5 +110,7 @@ public abstract class AbstractSpringLogi
         }
 
         layout.getConstraints(parent).setConstraint(SpringLayout.EAST, x);
+        layout.getConstraints(parent).setConstraint(SpringLayout.NORTH, y);
+        parent.setPreferredSize(new Dimension(x.getPreferredValue(), y.getPreferredValue()));
     }
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java?rev=1714194&r1=1714193&r2=1714194&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientHelper.java
Fri Nov 13 12:14:38 2015
@@ -436,6 +436,10 @@ public final class ClientHelper {
     }
 
     public static String encodeHtml(StringBuilder sb, String s) {
+        if (s == null) {
+            return "";
+        }
+
         for (int i = 0; i < s.length(); i++) {
             char c = s.charAt(i);
             if (c == '<') {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/DiscoverLoginTab.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/DiscoverLoginTab.java?rev=1714194&r1=1714193&r2=1714194&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/DiscoverLoginTab.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/DiscoverLoginTab.java
Fri Nov 13 12:14:38 2015
@@ -22,6 +22,7 @@ import java.awt.BorderLayout;
 import java.awt.Component;
 import java.awt.Cursor;
 import java.awt.Desktop;
+import java.awt.Dimension;
 import java.awt.Toolkit;
 import java.awt.datatransfer.Clipboard;
 import java.awt.datatransfer.StringSelection;
@@ -104,8 +105,34 @@ public class DiscoverLoginTab extends Ab
                 try {
                     setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
 
+                    URL url = new URL(urlField.getText());
+
                     // read the endpoint document from URL
-                    CmisEndpointsDocument doc = reader.read(new URL(urlField.getText()));
+                    CmisEndpointsDocument doc = null;
+                    try {
+                        doc = reader.read(url);
+                    } catch (Exception re1) {
+                        // there was no endpoint document at this URL
+                        // try adding "cmis-endpoints.json" to the URL
+                        if (!urlField.getText().endsWith("/cmis-endpoints.json")) {
+                            String newUrl = urlField.getText();
+                            if (newUrl.endsWith("/")) {
+                                newUrl = newUrl + "cmis-endpoints.json";
+                            } else {
+                                newUrl = newUrl + "/cmis-endpoints.json";
+                            }
+
+                            try {
+                                doc = reader.read(new URL(newUrl));
+                                urlField.setText(newUrl);
+                            } catch (Exception re2) {
+                                // ignore second exception
+                                throw re1;
+                            }
+                        } else {
+                            throw re1;
+                        }
+                    }
 
                     // fill the table
                     ((CmisAuthenticationModel) authTable.getModel()).setCmisEndpointDocument(doc);
@@ -115,7 +142,7 @@ public class DiscoverLoginTab extends Ab
                         authTable.setRowSelectionInterval(0, 0);
                     }
                 } catch (Exception ex) {
-                    ClientHelper.showError(DiscoverLoginTab.this, ex);
+                    ClientHelper.showError(null, ex);
                 } finally {
                     setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
                 }
@@ -179,9 +206,12 @@ public class DiscoverLoginTab extends Ab
 
             setModel(new CmisAuthenticationModel());
             setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-            setAutoResizeMode(AUTO_RESIZE_OFF);
             setAutoCreateRowSorter(true);
 
+            setRowHeight((int) (getFontMetrics(getFont()).getHeight() * 1.1));
+
+            setFillsViewportHeight(true);
+
             setDefaultRenderer(CmisAuthentication.class, new CmisAuthenticationRenderer());
 
             for (int i = 0; i < COLUMN_WIDTHS.length; i++) {
@@ -189,6 +219,8 @@ public class DiscoverLoginTab extends Ab
                 column.setPreferredWidth(WorkbenchScale.scaleInt(COLUMN_WIDTHS[i]));
             }
 
+            setPreferredScrollableViewportSize(new Dimension(Short.MAX_VALUE, getRowHeight()
* 4));
+
             final JPopupMenu popup = new JPopupMenu();
 
             // copy to expert login

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java?rev=1714194&r1=1714193&r2=1714194&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java
Fri Nov 13 12:14:38 2015
@@ -203,6 +203,15 @@ public class LoginDialog extends JDialog
 
         setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
         pack();
+
+        // if a login tab is too big...
+        if (loginTabs.getPreferredSize().height - loginTabs.getSize().height > 0) {
+            // ... resize the dialog
+            setPreferredSize(new Dimension(getSize().width, getSize().height
+                    + (loginTabs.getPreferredSize().height - loginTabs.getSize().height)));
+            pack();
+        }
+
         setLocationRelativeTo(null);
     }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/config-library.properties
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/config-library.properties?rev=1714194&r1=1714193&r2=1714194&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/config-library.properties
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/config-library.properties
Fri Nov 13 12:14:38 2015
@@ -60,4 +60,6 @@ opencmis-fileshare-webservices.propertie
 
 sap-hana-cloud-atompub.properties=SAP HANA Cloud Document Service AtomPub
 sap-hana-cloud-webservices.properties=SAP HANA Cloud Document Service Web Services
-sap-hana-cloud-browser.properties=SAP HANA Cloud Document Service Browser
\ No newline at end of file
+sap-hana-cloud-browser.properties=SAP HANA Cloud Document Service Browser
+
+sap-mobile-documents-browser.properties=SAP Mobile Documents
\ No newline at end of file

Added: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sap-mobile-documents-browser.properties
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sap-mobile-documents-browser.properties?rev=1714194&view=auto
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sap-mobile-documents-browser.properties
(added)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sap-mobile-documents-browser.properties
Fri Nov 13 12:14:38 2015
@@ -0,0 +1,30 @@
+#
+#
+# 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.
+#
+#
+
+# SAP Mobile Documents
+
+org.apache.chemistry.opencmis.binding.spi.type=browser
+org.apache.chemistry.opencmis.binding.browser.url=https://<name>.ondemand.com/mcm/b/json
+org.apache.chemistry.opencmis.user=<user>
+org.apache.chemistry.opencmis.password=<password>
+
+org.apache.chemistry.opencmis.binding.cookies=true
+org.apache.chemistry.opencmis.binding.csrfheader=X-CSRF-Token
\ No newline at end of file



Mime
View raw message