chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1553381 - in /chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench: ./ details/ model/
Date Wed, 25 Dec 2013 13:45:06 GMT
Author: fmui
Date: Wed Dec 25 13:45:06 2013
New Revision: 1553381

URL: http://svn.apache.org/r1553381
Log:
Workbench: simple OAuth Bearer token support and other improvements

Modified:
    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/java/org/apache/chemistry/opencmis/workbench/FolderPanel.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/FolderTable.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/AbstractDetailsTable.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ActionsPanel.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ExtensionsPanel.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ObjectPanel.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/TypesPanel.java
    chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientSession.java

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=1553381&r1=1553380&r2=1553381&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
Wed Dec 25 13:45:06 2013
@@ -58,6 +58,7 @@ public class BasicLoginTab extends Abstr
     private JRadioButton authenticationNoneButton;
     private JRadioButton authenticationStandardButton;
     private JRadioButton authenticationNTLMButton;
+    private JRadioButton authenticationOAuthButton;
     private JRadioButton compressionOnButton;
     private JRadioButton compressionOffButton;
     private JRadioButton clientCompressionOnButton;
@@ -126,19 +127,24 @@ public class BasicLoginTab extends Abstr
         boolean standard = (System.getProperty(SYSPROP_AUTHENTICATION, "standard").toLowerCase(Locale.ENGLISH)
                 .equals("standard"));
         boolean ntlm = (System.getProperty(SYSPROP_AUTHENTICATION, "").toLowerCase(Locale.ENGLISH).equals("ntlm"));
+        boolean oauth = (System.getProperty(SYSPROP_AUTHENTICATION, "").toLowerCase(Locale.ENGLISH).equals("oauth"));
         boolean none = !standard && !ntlm;
         authenticationNoneButton = new JRadioButton("None", none);
         authenticationStandardButton = new JRadioButton("Standard", standard);
         authenticationNTLMButton = new JRadioButton("NTLM", ntlm);
+        authenticationOAuthButton = new JRadioButton("OAuth 2.0 (Bearer Token)", oauth);
         ButtonGroup authenticationGroup = new ButtonGroup();
         authenticationGroup.add(authenticationNoneButton);
         authenticationGroup.add(authenticationStandardButton);
         authenticationGroup.add(authenticationNTLMButton);
+        authenticationGroup.add(authenticationOAuthButton);
         authenticationContainer.add(authenticationNoneButton);
         authenticationContainer.add(Box.createRigidArea(new Dimension(10, 0)));
         authenticationContainer.add(authenticationStandardButton);
         authenticationContainer.add(Box.createRigidArea(new Dimension(10, 0)));
         authenticationContainer.add(authenticationNTLMButton);
+        authenticationContainer.add(Box.createRigidArea(new Dimension(10, 0)));
+        authenticationContainer.add(authenticationOAuthButton);
         JLabel authenticatioLabel = new JLabel("Authentication:", JLabel.TRAILING);
 
         pane.add(authenticatioLabel);
@@ -223,8 +229,9 @@ public class BasicLoginTab extends Abstr
             authentication = ClientSession.Authentication.STANDARD;
         } else if (authenticationNTLMButton.isSelected()) {
             authentication = ClientSession.Authentication.NTLM;
+        } else if (authenticationOAuthButton.isSelected()) {
+            authentication = ClientSession.Authentication.OAUTH_BEARER;
         }
-
         return ClientSession.createSessionParameters(url, binding, username, password, authentication,
                 compressionOnButton.isSelected(), clientCompressionOnButton.isSelected(),
cookiesOnButton.isSelected());
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/FolderPanel.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/FolderPanel.java?rev=1553381&r1=1553380&r2=1553381&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/FolderPanel.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/FolderPanel.java
Wed Dec 25 13:45:06 2013
@@ -31,6 +31,7 @@ import javax.swing.JButton;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.JTextField;
+import javax.swing.SwingUtilities;
 
 import org.apache.chemistry.opencmis.client.api.Folder;
 import org.apache.chemistry.opencmis.client.api.ObjectId;
@@ -61,26 +62,30 @@ public class FolderPanel extends JPanel 
         createGUI();
     }
 
-    public void folderLoaded(ClientModelEvent event) {
-        Folder currentFolder = event.getClientModel().getCurrentFolder();
-
-        if (currentFolder != null) {
-            String path = currentFolder.getPath();
-            pathField.setText(path);
-
-            Folder parent = currentFolder.getFolderParent();
-            if (parent == null) {
-                parentId = null;
-                upButton.setEnabled(false);
-            } else {
-                parentId = parent.getId();
-                upButton.setEnabled(true);
-            }
-        } else {
-            pathField.setText("???");
-            parentId = null;
-            upButton.setEnabled(false);
-        }
+    public void folderLoaded(final ClientModelEvent event) {
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                Folder currentFolder = event.getClientModel().getCurrentFolder();
+
+                if (currentFolder != null) {
+                    String path = currentFolder.getPath();
+                    pathField.setText(path);
+
+                    Folder parent = currentFolder.getFolderParent();
+                    if (parent == null) {
+                        parentId = null;
+                        upButton.setEnabled(false);
+                    } else {
+                        parentId = parent.getId();
+                        upButton.setEnabled(true);
+                    }
+                } else {
+                    pathField.setText("???");
+                    parentId = null;
+                    upButton.setEnabled(false);
+                }
+            }
+        });
     }
 
     public void objectLoaded(ClientModelEvent event) {
@@ -153,19 +158,23 @@ public class FolderPanel extends JPanel 
     }
 
     private void loadFolder() {
-        try {
-            setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
-            String id = pathField.getText().trim();
-            if (id.length() == 0) {
-                id = "/";
-            }
-            ObjectId objectId = model.loadFolder(id, id.charAt(0) == '/');
-            model.loadObject(objectId.getId());
-        } catch (Exception ex) {
-            ClientHelper.showError(null, ex);
-            return;
-        } finally {
-            setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
-        }
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                try {
+                    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+                    String id = pathField.getText().trim();
+                    if (id.length() == 0) {
+                        id = "/";
+                    }
+                    ObjectId objectId = model.loadFolder(id, id.charAt(0) == '/');
+                    model.loadObject(objectId.getId());
+                } catch (Exception ex) {
+                    ClientHelper.showError(null, ex);
+                    return;
+                } finally {
+                    setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+                }
+            }
+        });
     }
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/FolderTable.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/FolderTable.java?rev=1553381&r1=1553380&r2=1553381&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/FolderTable.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/FolderTable.java
Wed Dec 25 13:45:06 2013
@@ -43,6 +43,7 @@ import javax.swing.JMenuItem;
 import javax.swing.JPopupMenu;
 import javax.swing.JTable;
 import javax.swing.ListSelectionModel;
+import javax.swing.SwingUtilities;
 import javax.swing.TransferHandler;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
@@ -178,10 +179,13 @@ public class FolderTable extends JTable 
         pwcIcon = ClientHelper.getIcon("pwc.png");
     }
 
-    public void folderLoaded(ClientModelEvent event) {
-        event.getClientModel().getCurrentChildren();
-
-        ((FolderTableModel) getModel()).fireTableDataChanged();
+    public void folderLoaded(final ClientModelEvent event) {
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                event.getClientModel().getCurrentChildren();
+                ((FolderTableModel) getModel()).fireTableDataChanged();
+            }
+        });
     }
 
     private void doAction(boolean alternate) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/AbstractDetailsTable.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/AbstractDetailsTable.java?rev=1553381&r1=1553380&r2=1553381&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/AbstractDetailsTable.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/AbstractDetailsTable.java
Wed Dec 25 13:45:06 2013
@@ -132,7 +132,11 @@ public abstract class AbstractDetailsTab
     }
 
     public void objectLoaded(ClientModelEvent event) {
-        ((DetailsTableModel) getModel()).fireTableDataChanged();
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                ((DetailsTableModel) getModel()).fireTableDataChanged();
+            }
+        });
     }
 
     public CmisObject getObject() {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ActionsPanel.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ActionsPanel.java?rev=1553381&r1=1553380&r2=1553381&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ActionsPanel.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ActionsPanel.java
Wed Dec 25 13:45:06 2013
@@ -21,6 +21,7 @@ package org.apache.chemistry.opencmis.wo
 import javax.swing.BorderFactory;
 import javax.swing.BoxLayout;
 import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
 
 import org.apache.chemistry.opencmis.client.api.CmisObject;
 import org.apache.chemistry.opencmis.workbench.actions.AclUpdatePanel;
@@ -76,55 +77,59 @@ public class ActionsPanel extends JPanel
     }
 
     public void objectLoaded(ClientModelEvent event) {
-        CmisObject object = model.getCurrentObject();
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                CmisObject object = model.getCurrentObject();
 
-        propertyUpdatePanel.setObject(object);
-        propertyUpdatePanel.setVisible(propertyUpdatePanel.isAllowed());
+                propertyUpdatePanel.setObject(object);
+                propertyUpdatePanel.setVisible(propertyUpdatePanel.isAllowed());
 
-        deletePanel.setObject(object);
-        deletePanel.setVisible(deletePanel.isAllowed());
+                deletePanel.setObject(object);
+                deletePanel.setVisible(deletePanel.isAllowed());
 
-        deleteTreePanel.setObject(object);
-        deleteTreePanel.setVisible(deleteTreePanel.isAllowed());
+                deleteTreePanel.setObject(object);
+                deleteTreePanel.setVisible(deleteTreePanel.isAllowed());
 
-        copyPanel.setObject(object);
-        copyPanel.setVisible(copyPanel.isAllowed());
+                copyPanel.setObject(object);
+                copyPanel.setVisible(copyPanel.isAllowed());
 
-        movePanel.setObject(object);
-        movePanel.setVisible(movePanel.isAllowed());
+                movePanel.setObject(object);
+                movePanel.setVisible(movePanel.isAllowed());
 
-        checkOutPanel.setObject(object);
-        checkOutPanel.setVisible(checkOutPanel.isAllowed());
+                checkOutPanel.setObject(object);
+                checkOutPanel.setVisible(checkOutPanel.isAllowed());
 
-        cancelCheckOutPanel.setObject(object);
-        cancelCheckOutPanel.setVisible(cancelCheckOutPanel.isAllowed());
+                cancelCheckOutPanel.setObject(object);
+                cancelCheckOutPanel.setVisible(cancelCheckOutPanel.isAllowed());
 
-        checkInPanel.setObject(object);
-        checkInPanel.setVisible(checkInPanel.isAllowed());
+                checkInPanel.setObject(object);
+                checkInPanel.setVisible(checkInPanel.isAllowed());
 
-        setContentStreamPanel.setObject(object);
-        setContentStreamPanel.setVisible(setContentStreamPanel.isAllowed());
+                setContentStreamPanel.setObject(object);
+                setContentStreamPanel.setVisible(setContentStreamPanel.isAllowed());
 
-        appendContentStreamPanel.setObject(object);
-        appendContentStreamPanel.setVisible(appendContentStreamPanel.isAllowed());
+                appendContentStreamPanel.setObject(object);
+                appendContentStreamPanel.setVisible(appendContentStreamPanel.isAllowed());
 
-        deleteContentStreamPanel.setObject(object);
-        deleteContentStreamPanel.setVisible(deleteContentStreamPanel.isAllowed());
+                deleteContentStreamPanel.setObject(object);
+                deleteContentStreamPanel.setVisible(deleteContentStreamPanel.isAllowed());
 
-        addObjectToFolderPanel.setObject(object);
-        addObjectToFolderPanel.setVisible(addObjectToFolderPanel.isAllowed());
+                addObjectToFolderPanel.setObject(object);
+                addObjectToFolderPanel.setVisible(addObjectToFolderPanel.isAllowed());
 
-        removeObjectFromFolderPanel.setObject(object);
-        removeObjectFromFolderPanel.setVisible(removeObjectFromFolderPanel.isAllowed());
+                removeObjectFromFolderPanel.setObject(object);
+                removeObjectFromFolderPanel.setVisible(removeObjectFromFolderPanel.isAllowed());
 
-        aclUpdatePanel.setObject(object);
-        aclUpdatePanel.setVisible(aclUpdatePanel.isAllowed());
+                aclUpdatePanel.setObject(object);
+                aclUpdatePanel.setVisible(aclUpdatePanel.isAllowed());
 
-        applyPolicyPanel.setObject(object);
-        applyPolicyPanel.setVisible(applyPolicyPanel.isAllowed());
+                applyPolicyPanel.setObject(object);
+                applyPolicyPanel.setVisible(applyPolicyPanel.isAllowed());
 
-        removePolicyPanel.setObject(object);
-        removePolicyPanel.setVisible(removePolicyPanel.isAllowed());
+                removePolicyPanel.setObject(object);
+                removePolicyPanel.setVisible(removePolicyPanel.isAllowed());
+            }
+        });
     }
 
     private void createGUI() {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ExtensionsPanel.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ExtensionsPanel.java?rev=1553381&r1=1553380&r2=1553381&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ExtensionsPanel.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ExtensionsPanel.java
Wed Dec 25 13:45:06 2013
@@ -26,6 +26,7 @@ import javax.swing.BoxLayout;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.JTree;
+import javax.swing.SwingUtilities;
 import javax.swing.tree.DefaultMutableTreeNode;
 import javax.swing.tree.DefaultTreeModel;
 import javax.swing.tree.TreeSelectionModel;
@@ -56,57 +57,62 @@ public class ExtensionsPanel extends JPa
 
     @Override
     public void objectLoaded(ClientModelEvent event) {
-        CmisObject object = model.getCurrentObject();
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                CmisObject object = model.getCurrentObject();
+
+                DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode();
+
+                if (object != null) {
+                    List<CmisExtensionElement> extensions;
+
+                    // object extensions
+                    extensions = object.getExtensions(ExtensionLevel.OBJECT);
+                    if ((extensions != null) && (!extensions.isEmpty())) {
+                        DefaultMutableTreeNode objectRootNode = new DefaultMutableTreeNode("Object");
+                        addExtension(objectRootNode, extensions);
+                        rootNode.add(objectRootNode);
+                    }
+
+                    // property extensions
+                    extensions = object.getExtensions(ExtensionLevel.PROPERTIES);
+                    if ((extensions != null) && (!extensions.isEmpty())) {
+                        DefaultMutableTreeNode propertiesRootNode = new DefaultMutableTreeNode("Properties");
+                        addExtension(propertiesRootNode, extensions);
+                        rootNode.add(propertiesRootNode);
+                    }
+
+                    // allowable actions extensions
+                    extensions = object.getExtensions(ExtensionLevel.ALLOWABLE_ACTIONS);
+                    if ((extensions != null) && (!extensions.isEmpty())) {
+                        DefaultMutableTreeNode allowableActionsRootNode = new DefaultMutableTreeNode(
+                                "Allowable Actions");
+                        addExtension(allowableActionsRootNode, extensions);
+                        rootNode.add(allowableActionsRootNode);
+                    }
+
+                    // ACL extensions
+                    extensions = object.getExtensions(ExtensionLevel.ACL);
+                    if ((extensions != null) && (!extensions.isEmpty())) {
+                        DefaultMutableTreeNode aclRootNode = new DefaultMutableTreeNode("ACL");
+                        addExtension(aclRootNode, extensions);
+                        rootNode.add(aclRootNode);
+                    }
+
+                    // policies extensions
+                    extensions = object.getExtensions(ExtensionLevel.POLICIES);
+                    if ((extensions != null) && (!extensions.isEmpty())) {
+                        DefaultMutableTreeNode policiesRootNode = new DefaultMutableTreeNode("Policies");
+                        addExtension(policiesRootNode, extensions);
+                        rootNode.add(policiesRootNode);
+                    }
+                }
 
-        DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode();
+                DefaultTreeModel treeModel = new DefaultTreeModel(rootNode);
 
-        if (object != null) {
-            List<CmisExtensionElement> extensions;
-
-            // object extensions
-            extensions = object.getExtensions(ExtensionLevel.OBJECT);
-            if ((extensions != null) && (!extensions.isEmpty())) {
-                DefaultMutableTreeNode objectRootNode = new DefaultMutableTreeNode("Object");
-                addExtension(objectRootNode, extensions);
-                rootNode.add(objectRootNode);
-            }
-
-            // property extensions
-            extensions = object.getExtensions(ExtensionLevel.PROPERTIES);
-            if ((extensions != null) && (!extensions.isEmpty())) {
-                DefaultMutableTreeNode propertiesRootNode = new DefaultMutableTreeNode("Properties");
-                addExtension(propertiesRootNode, extensions);
-                rootNode.add(propertiesRootNode);
-            }
-
-            // allowable actions extensions
-            extensions = object.getExtensions(ExtensionLevel.ALLOWABLE_ACTIONS);
-            if ((extensions != null) && (!extensions.isEmpty())) {
-                DefaultMutableTreeNode allowableActionsRootNode = new DefaultMutableTreeNode("Allowable
Actions");
-                addExtension(allowableActionsRootNode, extensions);
-                rootNode.add(allowableActionsRootNode);
-            }
-
-            // ACL extensions
-            extensions = object.getExtensions(ExtensionLevel.ACL);
-            if ((extensions != null) && (!extensions.isEmpty())) {
-                DefaultMutableTreeNode aclRootNode = new DefaultMutableTreeNode("ACL");
-                addExtension(aclRootNode, extensions);
-                rootNode.add(aclRootNode);
-            }
-
-            // policies extensions
-            extensions = object.getExtensions(ExtensionLevel.POLICIES);
-            if ((extensions != null) && (!extensions.isEmpty())) {
-                DefaultMutableTreeNode policiesRootNode = new DefaultMutableTreeNode("Policies");
-                addExtension(policiesRootNode, extensions);
-                rootNode.add(policiesRootNode);
+                extensionsTree.setModel(treeModel);
             }
-        }
-
-        DefaultTreeModel treeModel = new DefaultTreeModel(rootNode);
-
-        extensionsTree.setModel(treeModel);
+        });
     }
 
     private void addExtension(DefaultMutableTreeNode parent, List<CmisExtensionElement>
extensions) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ObjectPanel.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ObjectPanel.java?rev=1553381&r1=1553380&r2=1553381&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ObjectPanel.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ObjectPanel.java
Wed Dec 25 13:45:06 2013
@@ -104,120 +104,124 @@ public class ObjectPanel extends InfoPan
     }
 
     public void objectLoaded(ClientModelEvent event) {
-        CmisObject object = getClientModel().getCurrentObject();
-
-        if (object == null) {
-            nameField.setText("");
-            idField.setText("");
-            typeField.setText("");
-            basetypeField.setText("");
-            secondaryTypesList.removeAll();
-            versionLabelField.setText("");
-            pwcField.setText("");
-            pathsList.removeAll();
-            contentUrlField.setText("");
-            allowableActionsList.removeAll();
-            refreshButton.setEnabled(false);
-            checkButton.setEnabled(false);
-            scriptPanel.setVisible(false);
-        } else {
-            try {
-                nameField.setText(object.getName());
-                idField.setText(object.getId());
-                typeField.setText(object.getType().getId());
-                basetypeField.setText(object.getBaseTypeId().toString());
-
-                if (object.getSecondaryTypes() != null) {
-                    List<String> secTypeIds = new ArrayList<String>();
-                    for (SecondaryType type : object.getSecondaryTypes()) {
-                        secTypeIds.add(type.getId());
-                    }
-                    secondaryTypesList.setList(secTypeIds);
-                } else {
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                CmisObject object = getClientModel().getCurrentObject();
+
+                if (object == null) {
+                    nameField.setText("");
+                    idField.setText("");
+                    typeField.setText("");
+                    basetypeField.setText("");
                     secondaryTypesList.removeAll();
-                }
+                    versionLabelField.setText("");
+                    pwcField.setText("");
+                    pathsList.removeAll();
+                    contentUrlField.setText("");
+                    allowableActionsList.removeAll();
+                    refreshButton.setEnabled(false);
+                    checkButton.setEnabled(false);
+                    scriptPanel.setVisible(false);
+                } else {
+                    try {
+                        nameField.setText(object.getName());
+                        idField.setText(object.getId());
+                        typeField.setText(object.getType().getId());
+                        basetypeField.setText(object.getBaseTypeId().toString());
+
+                        if (object.getSecondaryTypes() != null) {
+                            List<String> secTypeIds = new ArrayList<String>();
+                            for (SecondaryType type : object.getSecondaryTypes()) {
+                                secTypeIds.add(type.getId());
+                            }
+                            secondaryTypesList.setList(secTypeIds);
+                        } else {
+                            secondaryTypesList.removeAll();
+                        }
 
-                if (object instanceof Document) {
-                    Document doc = (Document) object;
+                        if (object instanceof Document) {
+                            Document doc = (Document) object;
 
-                    try {
-                        versionLabelField.setText(doc.getVersionLabel());
-                    } catch (Exception e) {
-                        versionLabelField.setText("???");
-                    }
+                            try {
+                                versionLabelField.setText(doc.getVersionLabel());
+                            } catch (Exception e) {
+                                versionLabelField.setText("???");
+                            }
 
-                    if (doc.isVersionSeriesCheckedOut() == null) {
-                        pwcField.setText("");
-                    } else if (doc.isVersionSeriesCheckedOut().booleanValue()) {
-                        pwcField.setText(doc.getVersionSeriesCheckedOutId());
-                    } else {
-                        pwcField.setText("(not checked out)");
-                    }
-                } else {
-                    pwcField.setText("");
-                    versionLabelField.setText("");
-                }
+                            if (doc.isVersionSeriesCheckedOut() == null) {
+                                pwcField.setText("");
+                            } else if (doc.isVersionSeriesCheckedOut().booleanValue()) {
+                                pwcField.setText(doc.getVersionSeriesCheckedOutId());
+                            } else {
+                                pwcField.setText("(not checked out)");
+                            }
+                        } else {
+                            pwcField.setText("");
+                            versionLabelField.setText("");
+                        }
 
-                if (object instanceof FileableCmisObject) {
-                    if (object instanceof Folder) {
-                        pathsList.setList(Collections.singletonList(((Folder) object).getPath()));
-                    } else {
-                        pathsList.setList(Collections.singletonList(""));
-                        final FileableCmisObject pathObject = (FileableCmisObject) object;
-                        SwingUtilities.invokeLater(new Runnable() {
-                            @Override
-                            public void run() {
-                                try {
-                                    List<String> paths = pathObject.getPaths();
-                                    if ((paths == null) || (paths.size() == 0)) {
-                                        pathsList.setList(Collections.singletonList("(unfiled)"));
-                                    } else {
-                                        pathsList.setList(paths);
+                        if (object instanceof FileableCmisObject) {
+                            if (object instanceof Folder) {
+                                pathsList.setList(Collections.singletonList(((Folder) object).getPath()));
+                            } else {
+                                pathsList.setList(Collections.singletonList(""));
+                                final FileableCmisObject pathObject = (FileableCmisObject)
object;
+                                SwingUtilities.invokeLater(new Runnable() {
+                                    @Override
+                                    public void run() {
+                                        try {
+                                            List<String> paths = pathObject.getPaths();
+                                            if ((paths == null) || (paths.size() == 0)) {
+                                                pathsList.setList(Collections.singletonList("(unfiled)"));
+                                            } else {
+                                                pathsList.setList(paths);
+                                            }
+                                        } catch (Exception e) {
+                                            pathsList.setList(Collections.singletonList("(???)"));
+                                            // ClientHelper.showError(null, e);
+                                        }
+                                        ObjectPanel.this.revalidate();
                                     }
-                                } catch (Exception e) {
-                                    pathsList.setList(Collections.singletonList("(???)"));
-                                    // ClientHelper.showError(null, e);
-                                }
-                                ObjectPanel.this.revalidate();
+                                });
                             }
-                        });
-                    }
-                } else {
-                    pathsList.setList(Collections.singletonList("(not filable)"));
-                }
+                        } else {
+                            pathsList.setList(Collections.singletonList("(not filable)"));
+                        }
 
-                String docUrl = getDocumentURL(object, getClientModel().getClientSession().getSession());
-                if (docUrl != null) {
-                    contentUrlField.setText(docUrl);
-                } else {
-                    contentUrlField.setText("(not available)");
-                }
+                        String docUrl = getDocumentURL(object, getClientModel().getClientSession().getSession());
+                        if (docUrl != null) {
+                            contentUrlField.setText(docUrl);
+                        } else {
+                            contentUrlField.setText("(not available)");
+                        }
 
-                if (object.getAllowableActions() != null) {
-                    allowableActionsList.setList(object.getAllowableActions().getAllowableActions());
-                } else {
-                    allowableActionsList.setList(Collections.singletonList("(missing)"));
-                }
+                        if (object.getAllowableActions() != null) {
+                            allowableActionsList.setList(object.getAllowableActions().getAllowableActions());
+                        } else {
+                            allowableActionsList.setList(Collections.singletonList("(missing)"));
+                        }
 
-                refreshButton.setEnabled(true);
-                checkButton.setEnabled(true);
+                        refreshButton.setEnabled(true);
+                        checkButton.setEnabled(true);
 
-                if (object instanceof Document) {
-                    String name = object.getName().toLowerCase(Locale.ENGLISH);
-                    int x = name.lastIndexOf('.');
-                    if ((x > -1) && (scriptExtensions.contains(name.substring(x
+ 1)))) {
-                        scriptPanel.setVisible(true);
-                        scriptOutput.setVisible(false);
-                    } else {
-                        scriptPanel.setVisible(false);
+                        if (object instanceof Document) {
+                            String name = object.getName().toLowerCase(Locale.ENGLISH);
+                            int x = name.lastIndexOf('.');
+                            if ((x > -1) && (scriptExtensions.contains(name.substring(x
+ 1)))) {
+                                scriptPanel.setVisible(true);
+                                scriptOutput.setVisible(false);
+                            } else {
+                                scriptPanel.setVisible(false);
+                            }
+                        }
+                    } catch (Exception e) {
+                        ClientHelper.showError(ObjectPanel.this, e);
                     }
                 }
-            } catch (Exception e) {
-                ClientHelper.showError(this, e);
-            }
-        }
 
-        revalidate();
+                revalidate();
+            }
+        });
     }
 
     private void createGUI() {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/TypesPanel.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/TypesPanel.java?rev=1553381&r1=1553380&r2=1553381&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/TypesPanel.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/TypesPanel.java
Wed Dec 25 13:45:06 2013
@@ -18,6 +18,8 @@
  */
 package org.apache.chemistry.opencmis.workbench.details;
 
+import javax.swing.SwingUtilities;
+
 import org.apache.chemistry.opencmis.client.api.CmisObject;
 import org.apache.chemistry.opencmis.workbench.TypeSplitPane;
 import org.apache.chemistry.opencmis.workbench.model.ClientModel;
@@ -35,12 +37,16 @@ public class TypesPanel extends TypeSpli
 
     @Override
     public void objectLoaded(ClientModelEvent event) {
-        CmisObject object = getClientModel().getCurrentObject();
-
-        if (object == null) {
-            setType(null);
-        } else {
-            setType(object.getType());
-        }
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                CmisObject object = getClientModel().getCurrentObject();
+
+                if (object == null) {
+                    setType(null);
+                } else {
+                    setType(object.getType());
+                }
+            }
+        });
     }
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientSession.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientSession.java?rev=1553381&r1=1553380&r2=1553381&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientSession.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientSession.java
Wed Dec 25 13:45:06 2013
@@ -63,7 +63,7 @@ public class ClientSession {
     public static final String ACCEPT_SELF_SIGNED_CERTIFICATES = WORKBENCH_PREFIX + "acceptSelfSignedCertificates";
 
     public enum Authentication {
-        NONE, STANDARD, NTLM
+        NONE, STANDARD, NTLM, OAUTH_BEARER
     }
 
     private static final Set<String> FOLDER_PROPERTY_SET = new HashSet<String>();
@@ -138,6 +138,9 @@ public class ClientSession {
         case NTLM:
             parameters.setNtlmAuthentication(username, password);
             break;
+        case OAUTH_BEARER:
+            parameters.setOAuthBearerTokenAuthentication(username);
+            break;
         default:
             parameters.setNoAuthentication();
         }



Mime
View raw message