chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1005006 [3/5] - in /incubator/chemistry/opencmis/trunk: ./ chemistry-opencmis-workbench/ chemistry-opencmis-workbench/chemistry-opencmis-workbench/ chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/ chemistry-opencmis-workbench...
Date Wed, 06 Oct 2010 12:32:26 GMT
Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/DeleteContentStreamPanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/DeletePanel.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/DeletePanel.java?rev=1005006&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/DeletePanel.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/DeletePanel.java Wed Oct  6 12:32:23 2010
@@ -0,0 +1,62 @@
+/*
+ * 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.actions;
+
+import javax.swing.JCheckBox;
+
+import org.apache.chemistry.opencmis.commons.enums.Action;
+import org.apache.chemistry.opencmis.workbench.model.ClientModel;
+import org.apache.chemistry.opencmis.workbench.swing.ActionPanel;
+
+public class DeletePanel extends ActionPanel {
+
+	private static final long serialVersionUID = 1L;
+
+	private JCheckBox allVersionsBox;
+
+	public DeletePanel(ClientModel model) {
+		super("Delete Object", "Delete", model);
+	}
+
+	@Override
+	protected void createActionComponents() {
+		allVersionsBox = new JCheckBox("delete all versions", true);
+		addActionComponent(allVersionsBox);
+	}
+
+	@Override
+	public boolean isAllowed() {
+		if (getObject() == null) {
+			return false;
+		}
+
+		if ((getObject().getAllowableActions() == null)
+				|| (getObject().getAllowableActions().getAllowableActions() == null)) {
+			return true;
+		}
+
+		return getObject().getAllowableActions().getAllowableActions()
+				.contains(Action.CAN_DELETE_OBJECT);
+	}
+
+	@Override
+	public void doAction() throws Exception {
+		getObject().delete(allVersionsBox.isSelected());
+	}
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/DeletePanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/DeleteTreePanel.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/DeleteTreePanel.java?rev=1005006&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/DeleteTreePanel.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/DeleteTreePanel.java Wed Oct  6 12:32:23 2010
@@ -0,0 +1,77 @@
+/*
+ * 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.actions;
+
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+
+import org.apache.chemistry.opencmis.client.api.Folder;
+import org.apache.chemistry.opencmis.commons.enums.Action;
+import org.apache.chemistry.opencmis.commons.enums.UnfileObject;
+import org.apache.chemistry.opencmis.workbench.model.ClientModel;
+import org.apache.chemistry.opencmis.workbench.swing.ActionPanel;
+
+public class DeleteTreePanel extends ActionPanel {
+
+	private static final long serialVersionUID = 1L;
+
+	private JCheckBox allVersionsBox;
+	private JComboBox unfileObjectsBox;
+	private JCheckBox continueOnFailureBox;
+
+	public DeleteTreePanel(ClientModel model) {
+		super("Delete Tree", "Delete", model);
+	}
+
+	@Override
+	protected void createActionComponents() {
+		allVersionsBox = new JCheckBox("delete all versions", true);
+		addActionComponent(allVersionsBox);
+
+		unfileObjectsBox = new JComboBox(new Object[] { UnfileObject.DELETE,
+				UnfileObject.DELETESINGLEFILED, UnfileObject.UNFILE });
+		unfileObjectsBox.setSelectedIndex(0);
+		addActionComponent(unfileObjectsBox);
+
+		continueOnFailureBox = new JCheckBox("continue on failure", true);
+		addActionComponent(allVersionsBox);
+	}
+
+	@Override
+	public boolean isAllowed() {
+		if ((getObject() == null) || !(getObject() instanceof Folder)) {
+			return false;
+		}
+
+		if ((getObject().getAllowableActions() == null)
+				|| (getObject().getAllowableActions().getAllowableActions() == null)) {
+			return true;
+		}
+
+		return getObject().getAllowableActions().getAllowableActions()
+				.contains(Action.CAN_DELETE_TREE);
+	}
+
+	@Override
+	public void doAction() throws Exception {
+		((Folder) getObject()).deleteTree(allVersionsBox.isSelected(),
+				(UnfileObject) unfileObjectsBox.getSelectedItem(),
+				continueOnFailureBox.isSelected());
+	}
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/DeleteTreePanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/MovePanel.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/MovePanel.java?rev=1005006&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/MovePanel.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/MovePanel.java Wed Oct  6 12:32:23 2010
@@ -0,0 +1,81 @@
+/*
+ * 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.actions;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import org.apache.chemistry.opencmis.client.api.FileableCmisObject;
+import org.apache.chemistry.opencmis.client.api.ObjectId;
+import org.apache.chemistry.opencmis.client.runtime.ObjectIdImpl;
+import org.apache.chemistry.opencmis.commons.enums.Action;
+import org.apache.chemistry.opencmis.workbench.model.ClientModel;
+import org.apache.chemistry.opencmis.workbench.swing.ActionPanel;
+
+public class MovePanel extends ActionPanel {
+
+	private static final long serialVersionUID = 1L;
+
+	private JTextField targetFolderField;
+
+	public MovePanel(ClientModel model) {
+		super("Move Object", "Move", model);
+	}
+
+	@Override
+	protected void createActionComponents() {
+		JPanel targetFolderPanel = new JPanel(new BorderLayout());
+		targetFolderPanel.setBackground(Color.WHITE);
+
+		targetFolderPanel.add(new JLabel("Target Folder Id:"),
+				BorderLayout.LINE_START);
+
+		targetFolderField = new JTextField(30);
+		targetFolderPanel.add(targetFolderField, BorderLayout.CENTER);
+
+		addActionComponent(targetFolderPanel);
+	}
+
+	@Override
+	public boolean isAllowed() {
+		if ((getObject() == null)
+				|| !(getObject() instanceof FileableCmisObject)) {
+			return false;
+		}
+
+		if ((getObject().getAllowableActions() == null)
+				|| (getObject().getAllowableActions().getAllowableActions() == null)) {
+			return true;
+		}
+
+		return getObject().getAllowableActions().getAllowableActions()
+				.contains(Action.CAN_MOVE_OBJECT);
+	}
+
+	@Override
+	public void doAction() throws Exception {
+		ObjectId targetFolderId = new ObjectIdImpl(targetFolderField.getText());
+		((FileableCmisObject) getObject()).move(getClientModel()
+				.getCurrentFolder(), targetFolderId);
+	}
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/MovePanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/SetContentStreamPanel.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/SetContentStreamPanel.java?rev=1005006&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/SetContentStreamPanel.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/SetContentStreamPanel.java Wed Oct  6 12:32:23 2010
@@ -0,0 +1,72 @@
+/*
+ * 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.actions;
+
+import javax.swing.JCheckBox;
+import javax.swing.JTextField;
+
+import org.apache.chemistry.opencmis.client.api.Document;
+import org.apache.chemistry.opencmis.commons.data.ContentStream;
+import org.apache.chemistry.opencmis.commons.enums.Action;
+import org.apache.chemistry.opencmis.workbench.model.ClientModel;
+import org.apache.chemistry.opencmis.workbench.swing.ActionPanel;
+
+public class SetContentStreamPanel extends ActionPanel {
+
+	private static final long serialVersionUID = 1L;
+
+	private JTextField filenameField;
+	private JCheckBox overwriteBox;
+
+	public SetContentStreamPanel(ClientModel model) {
+		super("Set Content Stream", "Set Content Stream", model);
+	}
+
+	@Override
+	protected void createActionComponents() {
+		filenameField = new JTextField(30);
+		addActionComponent(createFilenamePanel(filenameField));
+
+		overwriteBox = new JCheckBox("overwrite", true);
+		addActionComponent(overwriteBox);
+	}
+
+	@Override
+	public boolean isAllowed() {
+		if ((getObject() == null) || !(getObject() instanceof Document)) {
+			return false;
+		}
+
+		if ((getObject().getAllowableActions() == null)
+				|| (getObject().getAllowableActions().getAllowableActions() == null)) {
+			return true;
+		}
+
+		return getObject().getAllowableActions().getAllowableActions()
+				.contains(Action.CAN_SET_CONTENT_STREAM);
+	}
+
+	@Override
+	public void doAction() throws Exception {
+		ContentStream content = getClientModel().createContentStream(
+				filenameField.getText());
+		((Document) getObject()).setContentStream(content, overwriteBox
+				.isSelected());
+	}
+}
\ No newline at end of file

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/actions/SetContentStreamPanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ACLTable.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ACLTable.java?rev=1005006&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ACLTable.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ACLTable.java Wed Oct  6 12:32:23 2010
@@ -0,0 +1,71 @@
+/*
+ * 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.details;
+
+import java.util.Collection;
+
+import org.apache.chemistry.opencmis.commons.data.Ace;
+import org.apache.chemistry.opencmis.workbench.model.ClientModel;
+
+public class ACLTable extends AbstractDetailsTable {
+
+    private static final long serialVersionUID = 1L;
+
+    private static final String[] COLUMN_NAMES = { "Principal", "Permissions", "Direct" };
+    private static final int[] COLUMN_WIDTHS = { 200, 400, 50 };
+
+    public ACLTable(ClientModel model) {
+        super();
+        init(model, COLUMN_NAMES, COLUMN_WIDTHS);
+    }
+
+    public int getDetailRowCount() {
+        if ((getObject().getAcl() == null) || (getObject().getAcl().getAces() == null)) {
+            return 0;
+        }
+
+        return getObject().getAcl().getAces().size();
+    }
+
+    public Object getDetailValueAt(int rowIndex, int columnIndex) {
+        Ace ace = getObject().getAcl().getAces().get(rowIndex);
+
+        switch (columnIndex) {
+        case 0:
+            return ace.getPrincipalId();
+        case 1:
+            return ace.getPermissions();
+        case 2:
+            return ace.isDirect();
+        }
+
+        return null;
+    }
+
+    @Override
+    public Class<?> getDetailColumClass(int columnIndex) {
+        if (columnIndex == 1) {
+            return Collection.class;
+        } else if (columnIndex == 2) {
+            return Boolean.class;
+        }
+
+        return super.getDetailColumClass(columnIndex);
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ACLTable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/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/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/AbstractDetailsTable.java?rev=1005006&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/AbstractDetailsTable.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/AbstractDetailsTable.java Wed Oct  6 12:32:23 2010
@@ -0,0 +1,185 @@
+/*
+ * 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.details;
+
+import java.awt.Toolkit;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.StringSelection;
+import java.awt.datatransfer.Transferable;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.util.Collection;
+
+import javax.swing.JMenuItem;
+import javax.swing.JPopupMenu;
+import javax.swing.JTable;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.TableColumn;
+
+import org.apache.chemistry.opencmis.client.api.CmisObject;
+import org.apache.chemistry.opencmis.workbench.model.ClientModel;
+import org.apache.chemistry.opencmis.workbench.model.ClientModelEvent;
+import org.apache.chemistry.opencmis.workbench.model.ObjectListener;
+import org.apache.chemistry.opencmis.workbench.swing.CollectionRenderer;
+
+public abstract class AbstractDetailsTable extends JTable implements ObjectListener {
+
+    private static final long serialVersionUID = 1L;
+
+    private ClientModel model;
+    private String[] columnNames;
+
+    public void init(ClientModel model, String[] columnNames, int[] colummnWidths) {
+        this.model = model;
+        model.addObjectListener(this);
+
+        this.columnNames = columnNames;
+
+        setModel(new DetailsTableModel(this));
+
+        setDefaultRenderer(Collection.class, new CollectionRenderer());
+        setAutoResizeMode(AUTO_RESIZE_OFF);
+        setAutoCreateRowSorter(true);
+
+        for (int i = 0; i < colummnWidths.length; i++) {
+            TableColumn column = getColumnModel().getColumn(i);
+            column.setPreferredWidth(colummnWidths[i]);
+        }
+
+        setFillsViewportHeight(true);
+
+        final JPopupMenu popup = new JPopupMenu();
+        JMenuItem menuItem = new JMenuItem("Copy to clipboard");
+        popup.add(menuItem);
+
+        menuItem.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                StringBuilder sb = new StringBuilder();
+                int rows = getDetailRowCount();
+                for (int row = 0; row < rows; row++) {
+                    int cols = getColumnNames().length;
+                    for (int col = 0; col < cols; col++) {
+                        sb.append(getDetailValueAt(row, col));
+                        sb.append("|");
+                    }
+                    sb.append("\n");
+                }
+
+                Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
+                Transferable transferable = new StringSelection(sb.toString());
+                clipboard.setContents(transferable, null);
+            }
+        });
+
+        addMouseListener(new MouseListener() {
+            public void mouseExited(MouseEvent e) {
+            }
+
+            public void mouseEntered(MouseEvent e) {
+            }
+
+            public void mouseClicked(MouseEvent e) {
+                if (e.getClickCount() == 2) {
+                    int row = getSelectedRow();
+                    if ((row > -1) && (row < getModel().getRowCount())) {
+                        doubleClickAction(e, row);
+                    }
+                }
+            }
+
+            public void mousePressed(MouseEvent e) {
+                maybeShowPopup(e);
+            }
+
+            public void mouseReleased(MouseEvent e) {
+                maybeShowPopup(e);
+            }
+
+            private void maybeShowPopup(MouseEvent e) {
+                if (e.isPopupTrigger()) {
+                    popup.show(e.getComponent(), e.getX(), e.getY());
+                }
+            }
+        });
+    }
+
+    public void objectLoaded(ClientModelEvent event) {
+        ((DetailsTableModel) getModel()).fireTableDataChanged();
+    }
+
+    public CmisObject getObject() {
+        return model.getCurrentObject();
+    }
+
+    public String[] getColumnNames() {
+        return columnNames;
+    }
+
+    public abstract int getDetailRowCount();
+
+    public abstract Object getDetailValueAt(int rowIndex, int columnIndex);
+
+    public Class<?> getDetailColumClass(int columnIndex) {
+        return String.class;
+    }
+
+    public void doubleClickAction(MouseEvent e, int rowIndex) {
+    }
+
+    static class DetailsTableModel extends AbstractTableModel {
+
+        private AbstractDetailsTable table;
+
+        public DetailsTableModel(AbstractDetailsTable table) {
+            this.table = table;
+        }
+
+        private static final long serialVersionUID = 1L;
+
+        public String getColumnName(int columnIndex) {
+            return table.getColumnNames()[columnIndex];
+        }
+
+        public int getColumnCount() {
+            return table.getColumnNames().length;
+        }
+
+        public int getRowCount() {
+            if (table.getObject() == null) {
+                return 0;
+            }
+
+            return table.getDetailRowCount();
+        }
+
+        public Object getValueAt(int rowIndex, int columnIndex) {
+            if (table.getObject() == null) {
+                return null;
+            }
+
+            return table.getDetailValueAt(rowIndex, columnIndex);
+        }
+
+        public Class<?> getColumnClass(int columnIndex) {
+            return table.getDetailColumClass(columnIndex);
+        }
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/AbstractDetailsTable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/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/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ActionsPanel.java?rev=1005006&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ActionsPanel.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ActionsPanel.java Wed Oct  6 12:32:23 2010
@@ -0,0 +1,119 @@
+/*
+ * 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.details;
+
+import javax.swing.BorderFactory;
+import javax.swing.BoxLayout;
+import javax.swing.JPanel;
+
+import org.apache.chemistry.opencmis.client.api.CmisObject;
+import org.apache.chemistry.opencmis.workbench.actions.CancelCheckOutPanel;
+import org.apache.chemistry.opencmis.workbench.actions.CheckInPanel;
+import org.apache.chemistry.opencmis.workbench.actions.CheckOutPanel;
+import org.apache.chemistry.opencmis.workbench.actions.DeleteContentStreamPanel;
+import org.apache.chemistry.opencmis.workbench.actions.DeletePanel;
+import org.apache.chemistry.opencmis.workbench.actions.DeleteTreePanel;
+import org.apache.chemistry.opencmis.workbench.actions.MovePanel;
+import org.apache.chemistry.opencmis.workbench.actions.SetContentStreamPanel;
+import org.apache.chemistry.opencmis.workbench.model.ClientModel;
+import org.apache.chemistry.opencmis.workbench.model.ClientModelEvent;
+import org.apache.chemistry.opencmis.workbench.model.ObjectListener;
+
+public class ActionsPanel extends JPanel implements ObjectListener {
+
+	private static final long serialVersionUID = 1L;
+
+	private ClientModel model;
+
+	private DeletePanel deletePanel;
+	private DeleteTreePanel deleteTreePanel;
+	private MovePanel movePanel;
+	private CheckOutPanel checkOutPanel;
+	private CancelCheckOutPanel cancelCheckOutPanel;
+	private CheckInPanel checkInPanel;
+	private SetContentStreamPanel setContentStreamPanel;
+	private DeleteContentStreamPanel deleteContentStreamPanel;
+
+	public ActionsPanel(ClientModel model) {
+		super();
+
+		this.model = model;
+		model.addObjectListener(this);
+
+		createGUI();
+	}
+
+	public void objectLoaded(ClientModelEvent event) {
+		CmisObject object = model.getCurrentObject();
+
+		deletePanel.setObject(object);
+		deletePanel.setVisible(deletePanel.isAllowed());
+
+		deleteTreePanel.setObject(object);
+		deleteTreePanel.setVisible(deleteTreePanel.isAllowed());
+
+		movePanel.setObject(object);
+		movePanel.setVisible(movePanel.isAllowed());
+
+		checkOutPanel.setObject(object);
+		checkOutPanel.setVisible(checkOutPanel.isAllowed());
+
+		cancelCheckOutPanel.setObject(object);
+		cancelCheckOutPanel.setVisible(cancelCheckOutPanel.isAllowed());
+
+		checkInPanel.setObject(object);
+		checkInPanel.setVisible(checkInPanel.isAllowed());
+
+		setContentStreamPanel.setObject(object);
+		setContentStreamPanel.setVisible(setContentStreamPanel.isAllowed());
+
+		deleteContentStreamPanel.setObject(object);
+		deleteContentStreamPanel.setVisible(deleteContentStreamPanel
+				.isAllowed());
+	}
+
+	private void createGUI() {
+		setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
+		setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
+
+		deletePanel = new DeletePanel(model);
+		add(deletePanel);
+
+		deleteTreePanel = new DeleteTreePanel(model);
+		add(deleteTreePanel);
+
+		movePanel = new MovePanel(model);
+		add(movePanel);
+
+		checkOutPanel = new CheckOutPanel(model);
+		add(checkOutPanel);
+
+		cancelCheckOutPanel = new CancelCheckOutPanel(model);
+		add(cancelCheckOutPanel);
+
+		checkInPanel = new CheckInPanel(model);
+		add(checkInPanel);
+
+		setContentStreamPanel = new SetContentStreamPanel(model);
+		add(setContentStreamPanel);
+
+		deleteContentStreamPanel = new DeleteContentStreamPanel(model);
+		add(deleteContentStreamPanel);
+	}
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ActionsPanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/DetailsTabs.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/DetailsTabs.java?rev=1005006&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/DetailsTabs.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/DetailsTabs.java Wed Oct  6 12:32:23 2010
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.chemistry.opencmis.workbench.details;
+
+import javax.swing.JScrollPane;
+import javax.swing.JTabbedPane;
+
+import org.apache.chemistry.opencmis.workbench.model.ClientModel;
+
+public class DetailsTabs extends JTabbedPane {
+
+    private static final long serialVersionUID = 1L;
+
+    private ClientModel model;
+
+    private ObjectPanel objectPanel;
+    private ActionsPanel actionsPanel;
+    private PropertyTable propertyTable;
+    private RelationshipTable relationshipTable;
+    private RenditionTable renditionTable;
+    private ACLTable aclTable;
+    private PolicyTable policyTable;
+    private VersionTable versionTable;
+    private ExtensionsPanel extensionsPanel;
+
+    public DetailsTabs(ClientModel model) {
+        super(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
+
+        this.model = model;
+        createGUI();
+    }
+
+    private void createGUI() {
+        objectPanel = new ObjectPanel(model);
+        actionsPanel = new ActionsPanel(model);
+        propertyTable = new PropertyTable(model);
+        relationshipTable = new RelationshipTable(model);
+        renditionTable = new RenditionTable(model);
+        aclTable = new ACLTable(model);
+        policyTable = new PolicyTable(model);
+        versionTable = new VersionTable(model);
+        extensionsPanel = new ExtensionsPanel(model);
+
+        addTab("Object", objectPanel);
+        addTab("Actions", new JScrollPane(actionsPanel));
+        addTab("Properties", new JScrollPane(propertyTable));
+        addTab("Relationships", new JScrollPane(relationshipTable));
+        addTab("Renditions", new JScrollPane(renditionTable));
+        addTab("ACL", new JScrollPane(aclTable));
+        addTab("Policies", new JScrollPane(policyTable));
+        addTab("Versions", new JScrollPane(versionTable));
+        addTab("Extensions", new JScrollPane(extensionsPanel));
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/DetailsTabs.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/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/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ExtensionsPanel.java?rev=1005006&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ExtensionsPanel.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ExtensionsPanel.java Wed Oct  6 12:32:23 2010
@@ -0,0 +1,159 @@
+/*
+ * 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.details;
+
+import java.awt.Color;
+import java.util.List;
+
+import javax.swing.BorderFactory;
+import javax.swing.BoxLayout;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTree;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreeSelectionModel;
+
+import org.apache.chemistry.opencmis.client.api.CmisObject;
+import org.apache.chemistry.opencmis.commons.data.CmisExtensionElement;
+import org.apache.chemistry.opencmis.commons.enums.ExtensionLevel;
+import org.apache.chemistry.opencmis.workbench.model.ClientModel;
+import org.apache.chemistry.opencmis.workbench.model.ClientModelEvent;
+import org.apache.chemistry.opencmis.workbench.model.ObjectListener;
+
+public class ExtensionsPanel extends JPanel implements ObjectListener {
+
+    private static final long serialVersionUID = 1L;
+
+    private ClientModel model;
+
+    private JTree extensionsTree;
+
+    public ExtensionsPanel(ClientModel model) {
+        super();
+
+        this.model = model;
+        model.addObjectListener(this);
+
+        createGUI();
+    }
+
+    @Override
+    public void objectLoaded(ClientModelEvent event) {
+        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);
+            }
+        }
+
+        DefaultTreeModel treeModel = new DefaultTreeModel(rootNode);
+
+        extensionsTree.setModel(treeModel);
+    }
+
+    private void addExtension(DefaultMutableTreeNode parent, List<CmisExtensionElement> extensions) {
+        if ((extensions == null) || (extensions.isEmpty())) {
+            return;
+        }
+
+        for (CmisExtensionElement ext : extensions) {
+            DefaultMutableTreeNode node = new DefaultMutableTreeNode(new ExtensionNode(ext));
+            parent.add(node);
+
+            if (ext.getChildren().size() > 0) {
+                addExtension(node, ext.getChildren());
+            }
+        }
+    }
+
+    private void createGUI() {
+        setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
+        setBorder(BorderFactory.createEmptyBorder());
+        setBackground(Color.WHITE);
+
+        extensionsTree = new JTree();
+        extensionsTree.setRootVisible(false);
+        extensionsTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
+        extensionsTree.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
+
+        extensionsTree.setModel(new DefaultTreeModel(null));
+
+        JScrollPane pane = new JScrollPane(extensionsTree);
+        pane.setBorder(BorderFactory.createEmptyBorder());
+
+        add(pane);
+    }
+
+    static class ExtensionNode {
+        private CmisExtensionElement extension;
+
+        public ExtensionNode(CmisExtensionElement extension) {
+            this.extension = extension;
+        }
+
+        @Override
+        public String toString() {
+            return (extension.getNamespace() == null ? "" : "{" + extension.getNamespace() + "}") + extension.getName()
+                    + (!extension.getAttributes().isEmpty() ? " " + extension.getAttributes() : "")
+                    + (extension.getChildren().isEmpty() ? ": " + extension.getValue() : "");
+        }
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ExtensionsPanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/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/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ObjectPanel.java?rev=1005006&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ObjectPanel.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ObjectPanel.java Wed Oct  6 12:32:23 2010
@@ -0,0 +1,141 @@
+/*
+ * 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.details;
+
+import java.awt.Cursor;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.lang.reflect.Method;
+
+import javax.swing.JButton;
+import javax.swing.JList;
+import javax.swing.JTextField;
+
+import org.apache.chemistry.opencmis.client.api.CmisObject;
+import org.apache.chemistry.opencmis.client.api.Session;
+import org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService;
+import org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser;
+import org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl;
+import org.apache.chemistry.opencmis.workbench.ClientHelper;
+import org.apache.chemistry.opencmis.workbench.model.ClientModel;
+import org.apache.chemistry.opencmis.workbench.model.ClientModelEvent;
+import org.apache.chemistry.opencmis.workbench.model.ObjectListener;
+import org.apache.chemistry.opencmis.workbench.swing.InfoPanel;
+
+public class ObjectPanel extends InfoPanel implements ObjectListener {
+
+    private static final long serialVersionUID = 1L;
+
+    private ClientModel model;
+
+    private JTextField nameField;
+    private JTextField idField;
+    private JTextField typeField;
+    private JTextField basetypeField;
+    // private JTextField contentUrlField;
+    private JList allowableActionsList;
+    private JButton refreshButton;
+
+    public ObjectPanel(ClientModel model) {
+        super();
+
+        this.model = model;
+        model.addObjectListener(this);
+
+        createGUI();
+    }
+
+    public void objectLoaded(ClientModelEvent event) {
+        CmisObject object = model.getCurrentObject();
+
+        if (object == null) {
+            nameField.setText("");
+            idField.setText("");
+            typeField.setText("");
+            basetypeField.setText("");
+            // contentUrlField.setText("");
+            allowableActionsList.removeAll();
+            refreshButton.setEnabled(false);
+        } else {
+            try {
+                nameField.setText(object.getName());
+                idField.setText(object.getId());
+                typeField.setText(object.getType().getId());
+                basetypeField.setText(object.getBaseTypeId().toString());
+                // String docUrl = getDocumentURL(object,
+                // model.getClientSession().getSession());
+                // contentUrlField.setText(docUrl == null ? "" : docUrl);
+                if (object.getAllowableActions() != null) {
+                    allowableActionsList.setListData(object.getAllowableActions().getAllowableActions().toArray());
+                } else {
+                    allowableActionsList.setListData(new String[] { "(missing)" });
+                }
+                refreshButton.setEnabled(true);
+            } catch (Exception e) {
+                ClientHelper.showError(this, e);
+            }
+        }
+    }
+
+    private void createGUI() {
+        setupGUI();
+
+        nameField = addLine("Name:", true);
+        idField = addLine("Id:");
+        typeField = addLine("Type:");
+        basetypeField = addLine("Base Type:");
+        // contentUrlField = addLine("Content URL:");
+        allowableActionsList = addComponent("Allowable Actions:", new JList());
+        refreshButton = addComponent("", new JButton("Refresh"));
+        refreshButton.setEnabled(false);
+
+        refreshButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                try {
+                    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+                    model.reloadObject();
+                } catch (Exception ex) {
+                    ClientHelper.showError(null, ex);
+                } finally {
+                    setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+                }
+            }
+        });
+    }
+
+    public String getDocumentURL(final CmisObject document, final Session session) {
+        String link = null;
+
+        if (!(session.getBinding().getObjectService() instanceof ObjectServiceImpl)) {
+            return null;
+        }
+
+        try {
+            Method loadLink = AbstractAtomPubService.class.getDeclaredMethod("loadLink", new Class[] { String.class,
+                    String.class, String.class, String.class });
+            loadLink.setAccessible(true);
+            link = (String) loadLink.invoke(session.getBinding().getObjectService(), session.getRepositoryInfo()
+                    .getId(), document.getId(), AtomPubParser.LINK_REL_CONTENT, null);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return link;
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/ObjectPanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/PolicyTable.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/PolicyTable.java?rev=1005006&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/PolicyTable.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/PolicyTable.java Wed Oct  6 12:32:23 2010
@@ -0,0 +1,56 @@
+/*
+ * 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.details;
+
+import org.apache.chemistry.opencmis.client.api.Policy;
+import org.apache.chemistry.opencmis.workbench.model.ClientModel;
+
+public class PolicyTable extends AbstractDetailsTable {
+
+	private static final long serialVersionUID = 1L;
+
+	private static final String[] COLUMN_NAMES = { "Name", "Id" };
+	private static final int[] COLUMN_WIDTHS = { 200, 400 };
+
+	public PolicyTable(ClientModel model) {
+		super();
+		init(model, COLUMN_NAMES, COLUMN_WIDTHS);
+	}
+
+	public int getDetailRowCount() {
+		if (getObject().getPolicies() == null) {
+			return 0;
+		}
+
+		return getObject().getPolicies().size();
+	}
+
+	public Object getDetailValueAt(int rowIndex, int columnIndex) {
+		Policy policy = getObject().getPolicies().get(rowIndex);
+
+		switch (columnIndex) {
+		case 0:
+			return policy.getName();
+		case 1:
+			return policy.getId();
+		}
+
+		return null;
+	}
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/PolicyTable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/PropertyTable.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/PropertyTable.java?rev=1005006&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/PropertyTable.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/PropertyTable.java Wed Oct  6 12:32:23 2010
@@ -0,0 +1,67 @@
+/*
+ * 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.details;
+
+import java.util.Collection;
+
+import org.apache.chemistry.opencmis.client.api.Property;
+import org.apache.chemistry.opencmis.workbench.model.ClientModel;
+
+public class PropertyTable extends AbstractDetailsTable {
+
+    private static final long serialVersionUID = 1L;
+
+    private static final String[] COLUMN_NAMES = { "Name", "Id", "Type", "Value" };
+    private static final int[] COLUMN_WIDTHS = { 200, 200, 80, 300 };
+
+    public PropertyTable(ClientModel model) {
+        super();
+        init(model, COLUMN_NAMES, COLUMN_WIDTHS);
+    }
+
+    public int getDetailRowCount() {
+        return getObject().getProperties().size();
+    }
+
+    public Object getDetailValueAt(int rowIndex, int columnIndex) {
+        Property<?> property = getObject().getProperties().get(rowIndex);
+
+        switch (columnIndex) {
+        case 0:
+            return property.getDefinition().getDisplayName();
+        case 1:
+            return property.getId();
+        case 2:
+            return property.getDefinition().getPropertyType().value();
+        case 3:
+            return property.getValues();
+        }
+
+        return null;
+    }
+
+    @Override
+    public Class<?> getDetailColumClass(int columnIndex) {
+        if (columnIndex == 3) {
+            return Collection.class;
+        }
+
+        return super.getDetailColumClass(columnIndex);
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/PropertyTable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/RelationshipTable.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/RelationshipTable.java?rev=1005006&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/RelationshipTable.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/RelationshipTable.java Wed Oct  6 12:32:23 2010
@@ -0,0 +1,64 @@
+/*
+ * 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.details;
+
+import org.apache.chemistry.opencmis.client.api.Relationship;
+import org.apache.chemistry.opencmis.workbench.model.ClientModel;
+
+public class RelationshipTable extends AbstractDetailsTable {
+
+	private static final long serialVersionUID = 1L;
+
+	private static final String[] COLUMN_NAMES = { "Name", "Type", "Source",
+			"Target" };
+	private static final int[] COLUMN_WIDTHS = { 200, 200, 200, 200 };
+
+	public RelationshipTable(ClientModel model) {
+		super();
+		init(model, COLUMN_NAMES, COLUMN_WIDTHS);
+	}
+
+	@Override
+	public int getDetailRowCount() {
+		if (getObject().getRelationships() == null) {
+			return 0;
+		}
+
+		return getObject().getRelationships().size();
+	}
+
+	@Override
+	public Object getDetailValueAt(int rowIndex, int columnIndex) {
+		Relationship relationship = getObject().getRelationships()
+				.get(rowIndex);
+
+		switch (columnIndex) {
+		case 0:
+			return relationship.getName();
+		case 1:
+			return relationship.getType().getId();
+		case 2:
+			return relationship.getSourceId();
+		case 3:
+			return relationship.getTargetId();
+		}
+
+		return null;
+	}
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/RelationshipTable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/RenditionTable.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/RenditionTable.java?rev=1005006&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/RenditionTable.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/RenditionTable.java Wed Oct  6 12:32:23 2010
@@ -0,0 +1,74 @@
+/*
+ * 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.details;
+
+import java.awt.event.MouseEvent;
+
+import org.apache.chemistry.opencmis.client.api.Document;
+import org.apache.chemistry.opencmis.client.api.Rendition;
+import org.apache.chemistry.opencmis.workbench.ClientHelper;
+import org.apache.chemistry.opencmis.workbench.model.ClientModel;
+
+public class RenditionTable extends AbstractDetailsTable {
+
+    private static final long serialVersionUID = 1L;
+
+    private static final String[] COLUMN_NAMES = { "Title", "Kind", "MIME Type", "Size", "Stream Id" };
+    private static final int[] COLUMN_WIDTHS = { 200, 200, 80, 80, 200 };
+
+    public RenditionTable(ClientModel model) {
+        super();
+        init(model, COLUMN_NAMES, COLUMN_WIDTHS);
+    }
+
+    @Override
+    public void doubleClickAction(MouseEvent e, int rowIndex) {
+        String streamId = getObject().getRenditions().get(rowIndex).getStreamId();
+        ClientHelper.download(this, (Document) getObject(), streamId);
+    }
+
+    @Override
+    public int getDetailRowCount() {
+        if (getObject().getRenditions() == null) {
+            return 0;
+        }
+
+        return getObject().getRenditions().size();
+    }
+
+    @Override
+    public Object getDetailValueAt(int rowIndex, int columnIndex) {
+        Rendition rendition = getObject().getRenditions().get(rowIndex);
+
+        switch (columnIndex) {
+        case 0:
+            return rendition.getTitle();
+        case 1:
+            return rendition.getKind();
+        case 2:
+            return rendition.getMimeType();
+        case 3:
+            return rendition.getLength();
+        case 4:
+            return rendition.getStreamId();
+        }
+
+        return null;
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/RenditionTable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/VersionTable.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/VersionTable.java?rev=1005006&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/VersionTable.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/VersionTable.java Wed Oct  6 12:32:23 2010
@@ -0,0 +1,126 @@
+/*
+ * 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.details;
+
+import java.awt.Cursor;
+import java.awt.event.MouseEvent;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.chemistry.opencmis.client.api.Document;
+import org.apache.chemistry.opencmis.commons.exceptions.CmisNotSupportedException;
+import org.apache.chemistry.opencmis.workbench.ClientHelper;
+import org.apache.chemistry.opencmis.workbench.model.ClientModel;
+
+public class VersionTable extends AbstractDetailsTable {
+
+    private static final long serialVersionUID = 1L;
+
+    private static final String[] COLUMN_NAMES = { "Name", "Label", "Major", "Id" };
+    private static final int[] COLUMN_WIDTHS = { 200, 200, 80, 400 };
+
+    private static final int OLD = 60 * 1000;
+
+    private List<Document> versions;
+    private String lastId;
+    private long lastTimestamp;
+
+    public VersionTable(ClientModel model) {
+        super();
+
+        versions = Collections.emptyList();
+        lastId = null;
+        lastTimestamp = System.currentTimeMillis();
+        init(model, COLUMN_NAMES, COLUMN_WIDTHS);
+    }
+
+    @Override
+    public void doubleClickAction(MouseEvent e, int rowIndex) {
+        if (e.isShiftDown()) {
+            ClientHelper.download(this.getParent(), getVersions().get(rowIndex), null);
+        } else {
+            ClientHelper.open(this.getParent(), getVersions().get(rowIndex), null);
+        }
+
+    }
+
+    @Override
+    public int getDetailRowCount() {
+        if (!(getObject() instanceof Document)) {
+            return 0;
+        }
+
+        return getVersions().size();
+    }
+
+    @Override
+    public Object getDetailValueAt(int rowIndex, int columnIndex) {
+        Document version = getVersions().get(rowIndex);
+
+        switch (columnIndex) {
+        case 0:
+            return version.getName();
+        case 1:
+            return version.getVersionLabel();
+        case 2:
+            return version.isMajorVersion();
+        case 3:
+            return version.getId();
+        }
+
+        return null;
+    }
+
+    private List<Document> getVersions() {
+        // not a document -> no versions
+        if (!(getObject() instanceof Document)) {
+            versions = Collections.emptyList();
+            lastId = null;
+
+            return versions;
+        }
+
+        // if the versions have been fetched recently, don't reload
+        Document doc = (Document) getObject();
+        if (doc.getId().equals(lastId)) {
+            if (lastTimestamp + OLD > System.currentTimeMillis()) {
+                return versions;
+            }
+        }
+
+        // reset everything
+        lastId = doc.getId();
+        lastTimestamp = System.currentTimeMillis();
+        versions = Collections.emptyList();
+
+        // get versions
+        try {
+            setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+            versions = doc.getAllVersions();
+        } catch (Exception ex) {
+            if (!(ex instanceof CmisNotSupportedException)) {
+                ClientHelper.showError(null, ex);
+            }
+        } finally {
+            setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+        }
+
+        return versions;
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/VersionTable.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientModel.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientModel.java?rev=1005006&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientModel.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientModel.java Wed Oct  6 12:32:23 2010
@@ -0,0 +1,314 @@
+/*
+ * 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.model;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.swing.event.EventListenerList;
+
+import org.apache.chemistry.opencmis.client.api.CmisObject;
+import org.apache.chemistry.opencmis.client.api.Folder;
+import org.apache.chemistry.opencmis.client.api.ItemIterable;
+import org.apache.chemistry.opencmis.client.api.ObjectType;
+import org.apache.chemistry.opencmis.client.api.OperationContext;
+import org.apache.chemistry.opencmis.client.api.QueryResult;
+import org.apache.chemistry.opencmis.client.api.Session;
+import org.apache.chemistry.opencmis.client.api.Tree;
+import org.apache.chemistry.opencmis.client.runtime.OperationContextImpl;
+import org.apache.chemistry.opencmis.commons.PropertyIds;
+import org.apache.chemistry.opencmis.commons.data.ContentStream;
+import org.apache.chemistry.opencmis.commons.data.RepositoryCapabilities;
+import org.apache.chemistry.opencmis.commons.data.RepositoryInfo;
+import org.apache.chemistry.opencmis.commons.enums.CapabilityQuery;
+import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
+import org.apache.chemistry.opencmis.commons.enums.VersioningState;
+
+public class ClientModel {
+
+    // object details must not be older than 60 seconds
+    private static final long OLD = 60 * 1000;
+
+    private ClientSession clientSession;
+
+    private Folder currentFolder = null;
+    private List<CmisObject> currentChildren = Collections.emptyList();
+    private CmisObject currentObject = null;
+
+    private EventListenerList listenerList = new EventListenerList();
+
+    public ClientModel() {
+    }
+
+    public void addFolderListener(FolderListener listener) {
+        listenerList.add(FolderListener.class, listener);
+    }
+
+    public void removeFolderListener(FolderListener listener) {
+        listenerList.remove(FolderListener.class, listener);
+    }
+
+    public void addObjectListener(ObjectListener listener) {
+        listenerList.add(ObjectListener.class, listener);
+    }
+
+    public void removeObjectListener(ObjectListener listener) {
+        listenerList.remove(ObjectListener.class, listener);
+    }
+
+    public synchronized void setClientSession(ClientSession clientSession) {
+        this.clientSession = clientSession;
+    }
+
+    public synchronized ClientSession getClientSession() {
+        return clientSession;
+    }
+
+    public synchronized RepositoryInfo getRepositoryInfo() throws Exception {
+        Session session = clientSession.getSession();
+        return session.getRepositoryInfo();
+    }
+
+    public synchronized String getRepositoryName() {
+        try {
+            return getRepositoryInfo().getName();
+        } catch (Exception e) {
+            return "?";
+        }
+    }
+
+    public synchronized boolean supportsQuery() {
+        try {
+            RepositoryCapabilities cap = getRepositoryInfo().getCapabilities();
+            if (cap == null) {
+                return true;
+            }
+
+            return (cap.getQueryCapability() != null) && (cap.getQueryCapability() != CapabilityQuery.NONE);
+        } catch (Exception e) {
+            return false;
+        }
+    }
+
+    public synchronized boolean supportsChangeLog() {
+        try {
+            return (getRepositoryInfo().getChangesOnType() != null)
+                    && (!getRepositoryInfo().getChangesOnType().isEmpty());
+        } catch (Exception e) {
+            return false;
+        }
+
+    }
+
+    public synchronized void loadFolder(String folderId, boolean byPath) throws Exception {
+        try {
+            Session session = clientSession.getSession();
+            CmisObject folderObject = null;
+
+            if (byPath) {
+                folderObject = session.getObjectByPath(folderId);
+            } else {
+                folderObject = session.getObject(session.createObjectId(folderId));
+            }
+
+            if (!(folderObject instanceof Folder)) {
+                throw new Exception("Not a folder!");
+            }
+
+            List<CmisObject> children = new ArrayList<CmisObject>();
+            ItemIterable<CmisObject> iter = ((Folder) folderObject).getChildren(clientSession
+                    .getFolderOperationContext());
+            for (CmisObject child : iter) {
+                children.add(child);
+            }
+
+            setCurrentFolder((Folder) folderObject, children);
+        } catch (Exception ex) {
+            setCurrentFolder(null, new ArrayList<CmisObject>(0));
+            throw ex;
+        }
+    }
+
+    public synchronized void reloadFolder() throws Exception {
+        loadFolder(currentFolder.getId(), false);
+    }
+
+    public synchronized void loadObject(String objectId) throws Exception {
+        try {
+            Session session = clientSession.getSession();
+            CmisObject object = session.getObject(session.createObjectId(objectId),
+                    clientSession.getObjectOperationContext());
+            object.refreshIfOld(OLD);
+
+            setCurrentObject(object);
+        } catch (Exception ex) {
+            setCurrentObject(null);
+            throw ex;
+        }
+    }
+
+    public synchronized void reloadObject() throws Exception {
+        if (currentObject == null) {
+            return;
+        }
+
+        try {
+            Session session = clientSession.getSession();
+            CmisObject object = session.getObject(currentObject, clientSession.getObjectOperationContext());
+            object.refresh();
+
+            setCurrentObject(object);
+        } catch (Exception ex) {
+            setCurrentObject(null);
+            throw ex;
+        }
+    }
+
+    public synchronized ItemIterable<QueryResult> query(String q, boolean searchAllVersions, int maxHits)
+            throws Exception {
+        OperationContext queryContext = new OperationContextImpl(null, false, false, false, IncludeRelationships.NONE,
+                null, false, null, false, maxHits);
+
+        Session session = clientSession.getSession();
+        return session.query(q, searchAllVersions, queryContext);
+    }
+
+    public synchronized List<Tree<ObjectType>> getTypeDescendants() throws Exception {
+        Session session = clientSession.getSession();
+        return session.getTypeDescendants(null, -1, true);
+    }
+
+    public ContentStream createContentStream(String filename) throws Exception {
+        ContentStream content = null;
+        if ((filename != null) && (filename.length() > 0)) {
+            File file = new File(filename);
+            InputStream stream = new FileInputStream(file);
+
+            content = clientSession.getSession().getObjectFactory()
+                    .createContentStream(file.getName(), file.length(), MIMETypes.getMIMEType(file), stream);
+        }
+
+        return content;
+    }
+
+    public synchronized void createDocument(String name, String type, String filename, VersioningState versioningState)
+            throws Exception {
+        Map<String, Object> properties = new HashMap<String, Object>();
+        properties.put(PropertyIds.NAME, name);
+        properties.put(PropertyIds.OBJECT_TYPE_ID, type);
+
+        ContentStream content = createContentStream(filename);
+        clientSession.getSession()
+                .createDocument(properties, currentFolder, content, versioningState, null, null, null);
+    }
+
+    public synchronized void createFolder(String name, String type) throws Exception {
+        Map<String, Object> properties = new HashMap<String, Object>();
+        properties.put(PropertyIds.NAME, name);
+        properties.put(PropertyIds.OBJECT_TYPE_ID, type);
+
+        clientSession.getSession().createFolder(properties, currentFolder, null, null, null);
+    }
+
+    public synchronized List<ObjectType> getCreateableTypes(String rootTypeId) {
+        List<ObjectType> result = new ArrayList<ObjectType>();
+
+        List<Tree<ObjectType>> types = clientSession.getSession().getTypeDescendants(rootTypeId, -1, false);
+        addType(types, result);
+
+        ObjectType rootType = clientSession.getSession().getTypeDefinition(rootTypeId);
+        boolean isCreatable = (rootType.isCreatable() == null ? true : rootType.isCreatable().booleanValue());
+        if (isCreatable) {
+            result.add(rootType);
+        }
+
+        Collections.sort(result, new Comparator<ObjectType>() {
+            public int compare(ObjectType ot1, ObjectType ot2) {
+                return ot1.getDisplayName().compareTo(ot2.getDisplayName());
+            }
+        });
+
+        return result;
+    }
+
+    private void addType(List<Tree<ObjectType>> types, List<ObjectType> resultList) {
+        for (Tree<ObjectType> tt : types) {
+            if (tt.getItem() != null) {
+                boolean isCreatable = (tt.getItem().isCreatable() == null ? true : tt.getItem().isCreatable()
+                        .booleanValue());
+
+                if (isCreatable) {
+                    resultList.add(tt.getItem());
+                }
+
+                addType(tt.getChildren(), resultList);
+            }
+        }
+    }
+
+    public synchronized Folder getCurrentFolder() {
+        return currentFolder;
+    }
+
+    public synchronized List<CmisObject> getCurrentChildren() {
+        return currentChildren;
+    }
+
+    public synchronized CmisObject getFromCurrentChildren(String id) {
+        if ((currentChildren == null) || (currentChildren.isEmpty())) {
+            return null;
+        }
+
+        for (CmisObject o : currentChildren) {
+            if (o.getId().equals(id)) {
+                return o;
+            }
+        }
+
+        return null;
+    }
+
+    private synchronized void setCurrentFolder(Folder folder, List<CmisObject> children) {
+        currentFolder = folder;
+        currentChildren = children;
+
+        for (FolderListener fl : listenerList.getListeners(FolderListener.class)) {
+            fl.folderLoaded(new ClientModelEvent(this));
+        }
+    }
+
+    public synchronized CmisObject getCurrentObject() {
+        return currentObject;
+    }
+
+    private synchronized void setCurrentObject(CmisObject object) {
+        currentObject = object;
+
+        for (ObjectListener ol : listenerList.getListeners(ObjectListener.class)) {
+            ol.objectLoaded(new ClientModelEvent(this));
+        }
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientModel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientModelEvent.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientModelEvent.java?rev=1005006&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientModelEvent.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientModelEvent.java Wed Oct  6 12:32:23 2010
@@ -0,0 +1,38 @@
+/*
+ * 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.model;
+
+import java.util.EventObject;
+
+public class ClientModelEvent extends EventObject {
+
+	private static final long serialVersionUID = 1L;
+
+	public ClientModelEvent(Object source) {
+		super(source);
+	}
+
+	public ClientModel getClientModel() {
+		if (getSource() instanceof ClientModel) {
+			return (ClientModel) getSource();
+		}
+
+		return null;
+	}
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientModelEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientOperationContext.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientOperationContext.java?rev=1005006&view=auto
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientOperationContext.java (added)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientOperationContext.java Wed Oct  6 12:32:23 2010
@@ -0,0 +1,84 @@
+/*
+ * 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.model;
+
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.client.runtime.OperationContextImpl;
+import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
+
+public class ClientOperationContext extends OperationContextImpl {
+
+    private static final long serialVersionUID = 1L;
+
+    public static final String FILTER = "filter";
+    public static final String INCLUDE_ACLS = "includeAcls";
+    public static final String INCLUDE_ALLOWABLE_ACTIONS = "includeAllowableActions";
+    public static final String INCLUDE_POLICIES = "includePolicies";
+    public static final String INCLUDE_RELATIONSHIPS = "includeRelationships";
+    public static final String RENDITION_FILTER = "renditionFilter";
+    public static final String ORDER_BY = "orderBy";
+    public static final String MAX_ITEMS_PER_PAGE = "maxItemsPerPage";
+
+    public ClientOperationContext(String prefix, Map<String, String> map) {
+        loadContext(prefix, map);
+        setIncludePathSegments(false);
+        setCacheEnabled(true);
+    }
+
+    public void loadContext(String prefix, Map<String, String> map) {
+        setFilterString(map.get(prefix + FILTER));
+        setIncludeAcls(parseBoolean(map.get(prefix + INCLUDE_ACLS), false));
+        setIncludeAllowableActions(parseBoolean(map.get(prefix + INCLUDE_ALLOWABLE_ACTIONS), false));
+        setIncludePolicies(parseBoolean(map.get(prefix + INCLUDE_POLICIES), false));
+        setIncludeRelationships(parseIncludeRelationships(map.get(prefix + INCLUDE_RELATIONSHIPS),
+                IncludeRelationships.NONE));
+        setRenditionFilterString(map.get(prefix + RENDITION_FILTER));
+        setOrderBy(map.get(prefix + ORDER_BY));
+        setMaxItemsPerPage(parseInteger(map.get(prefix + MAX_ITEMS_PER_PAGE), 1000));
+    }
+
+    private boolean parseBoolean(String s, boolean defaultValue) {
+        return (s == null ? defaultValue : Boolean.parseBoolean(s));
+    }
+
+    private IncludeRelationships parseIncludeRelationships(String s, IncludeRelationships defaultValue) {
+        if (s == null) {
+            return defaultValue;
+        }
+
+        try {
+            return IncludeRelationships.fromValue(s);
+        } catch (Exception e) {
+            return defaultValue;
+        }
+    }
+
+    private int parseInteger(String s, int defaultValue) {
+        if (s == null) {
+            return defaultValue;
+        }
+
+        try {
+            return Integer.parseInt(s);
+        } catch (NumberFormatException e) {
+            return defaultValue;
+        }
+    }
+}

Propchange: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientOperationContext.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message