Author: fmui
Date: Thu May 7 17:13:19 2015
New Revision: 1678240
URL: http://svn.apache.org/r1678240
Log:
Workbench: login dialog and type window enhancements
Added:
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/checks/TypeComplianceCheck.java
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/checks/TypeComplianceTestGroup.java
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/AbstractLoginTab.java
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/AbstractSpringLoginTab.java
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/BasicLoginTab.java
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientFrame.java
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/TypeSplitPane.java
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/checks/ObjectComplianceCheck.java
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/model/ClientSession.java
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/META-INF/README-cmis-workbench.txt
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/AbstractLoginTab.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/AbstractLoginTab.java?rev=1678240&r1=1678239&r2=1678240&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/AbstractLoginTab.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/AbstractLoginTab.java
Thu May 7 17:13:19 2015
@@ -115,4 +115,14 @@ public abstract class AbstractLoginTab e
*/
public void afterLogin(Session session) {
}
+
+ /**
+ * Returns the ID of the folder that the Workbench should load after login.
+ *
+ * @return a valid folder ID or {@code null} for the repositories root
+ * folder.
+ */
+ public String getStartFolderId() {
+ return null;
+ }
}
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/AbstractSpringLoginTab.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/AbstractSpringLoginTab.java?rev=1678240&r1=1678239&r2=1678240&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/AbstractSpringLoginTab.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/AbstractSpringLoginTab.java
Thu May 7 17:13:19 2015
@@ -20,7 +20,9 @@ package org.apache.chemistry.opencmis.wo
import java.awt.Component;
import java.awt.Container;
+import java.text.NumberFormat;
+import javax.swing.JFormattedTextField;
import javax.swing.JLabel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
@@ -45,6 +47,18 @@ public abstract class AbstractSpringLogi
return textField;
}
+ protected JFormattedTextField createIntegerField(Container pane, String
label) {
+ NumberFormat format = NumberFormat.getIntegerInstance();
+ JFormattedTextField intField = new JFormattedTextField(format);
+ JLabel intLabel = new JLabel(label, JLabel.TRAILING);
+ intLabel.setLabelFor(intField);
+
+ pane.add(intLabel);
+ pane.add(intField);
+
+ return intField;
+ }
+
protected JPasswordField createPasswordField(Container pane, String label)
{
JPasswordField textField = new JPasswordField(60);
JLabel textLabel = new JLabel(label, JLabel.TRAILING);
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=1678240&r1=1678239&r2=1678240&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
Thu May 7 17:13:19 2015
@@ -26,6 +26,7 @@ import java.util.Map;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
+import javax.swing.JFormattedTextField;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
@@ -46,6 +47,8 @@ public class BasicLoginTab extends Abstr
public static final String SYSPROP_COMPRESSION =
ClientSession.WORKBENCH_PREFIX + "compression";
public static final String SYSPROP_CLIENTCOMPRESSION =
ClientSession.WORKBENCH_PREFIX + "clientcompression";
public static final String SYSPROP_COOKIES =
ClientSession.WORKBENCH_PREFIX + "cookies";
+ public static final String SYSPROP_CONN_TIMEOUT =
ClientSession.WORKBENCH_PREFIX + "connecttimeout";
+ public static final String SYSPROP_READ_TIMEOUT =
ClientSession.WORKBENCH_PREFIX + "readtimeout";
public static final String SYSPROP_USER = ClientSession.WORKBENCH_PREFIX +
"user";
public static final String SYSPROP_PASSWORD =
ClientSession.WORKBENCH_PREFIX + "password";
@@ -65,6 +68,8 @@ public class BasicLoginTab extends Abstr
private JRadioButton clientCompressionOffButton;
private JRadioButton cookiesOnButton;
private JRadioButton cookiesOffButton;
+ private JFormattedTextField connectTimeoutField;
+ private JFormattedTextField readTimeoutField;
public BasicLoginTab() {
super();
@@ -93,7 +98,21 @@ public class BasicLoginTab extends Abstr
createCookieButtons(this);
- makeCompactGrid(this, 8, 2, 5, 10, 5, 5);
+ connectTimeoutField = createIntegerField(this, "Connect timeout
(secs):");
+ try {
+
connectTimeoutField.setValue(Long.parseLong(System.getProperty(SYSPROP_CONN_TIMEOUT,
"30")));
+ } catch (NumberFormatException e) {
+ connectTimeoutField.setValue(30);
+ }
+
+ readTimeoutField = createIntegerField(this, "Read timeout (secs):");
+ try {
+
readTimeoutField.setValue(Long.parseLong(System.getProperty(SYSPROP_READ_TIMEOUT,
"600")));
+ } catch (NumberFormatException e) {
+ readTimeoutField.setValue(600);
+ }
+
+ makeCompactGrid(this, 10, 2, 5, 10, 5, 5);
}
private void createBindingButtons(Container pane) {
@@ -232,8 +251,28 @@ public class BasicLoginTab extends Abstr
} else if (authenticationOAuthButton.isSelected()) {
authentication = ClientSession.Authentication.OAUTH_BEARER;
}
+
+ long connectTimeout = 0;
+ if (connectTimeoutField.getValue() instanceof Number) {
+ connectTimeout = ((Number)
connectTimeoutField.getValue()).longValue() * 1000;
+ if (connectTimeout < 0) {
+ connectTimeoutField.setValue(0);
+ connectTimeout = 0;
+ }
+ }
+
+ long readTimeout = 0;
+ if (readTimeoutField.getValue() instanceof Number) {
+ readTimeout = ((Number) readTimeoutField.getValue()).longValue() *
1000;
+ if (readTimeout < 0) {
+ readTimeoutField.setValue(0);
+ readTimeout = 0;
+ }
+ }
+
return ClientSession.createSessionParameters(url, binding, username,
password, authentication,
- compressionOnButton.isSelected(),
clientCompressionOnButton.isSelected(), cookiesOnButton.isSelected());
+ compressionOnButton.isSelected(),
clientCompressionOnButton.isSelected(), cookiesOnButton.isSelected(),
+ connectTimeout, readTimeout);
}
@Override
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientFrame.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientFrame.java?rev=1678240&r1=1678239&r2=1678240&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientFrame.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/ClientFrame.java
Thu May 7 17:13:19 2015
@@ -359,8 +359,8 @@ public class ClientFrame extends JFrame
try {
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
-
model.loadFolder(clientSession.getSession().getRepositoryInfo().getRootFolderId(),
false);
-
model.loadObject(clientSession.getSession().getRepositoryInfo().getRootFolderId());
+ model.loadFolder(clientSession.getStartFolderId(), false);
+ model.loadObject(clientSession.getStartFolderId());
toolbarButton[BUTTON_REPOSITORY_INFO].setEnabled(true);
toolbarButton[BUTTON_TYPES].setEnabled(true);
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java?rev=1678240&r1=1678239&r2=1678240&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/LoginDialog.java
Thu May 7 17:13:19 2015
@@ -179,6 +179,8 @@ public class LoginDialog extends JDialog
currentTab.afterLogin(clientSession.getSession());
+
clientSession.setStartFolderId(currentTab.getStartFolderId());
+
canceled = false;
hideDialog();
} catch (Exception ex) {
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/TypeSplitPane.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/TypeSplitPane.java?rev=1678240&r1=1678239&r2=1678240&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/TypeSplitPane.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/TypeSplitPane.java
Thu May 7 17:13:19 2015
@@ -18,16 +18,21 @@
*/
package org.apache.chemistry.opencmis.workbench;
+import java.awt.Cursor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
+import java.io.Writer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
+import javax.swing.JButton;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
@@ -38,9 +43,13 @@ import javax.swing.table.AbstractTableMo
import javax.swing.table.TableColumn;
import org.apache.chemistry.opencmis.client.api.ObjectType;
+import org.apache.chemistry.opencmis.commons.SessionParameter;
import
org.apache.chemistry.opencmis.commons.definitions.DocumentTypeDefinition;
import org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition;
import
org.apache.chemistry.opencmis.commons.definitions.RelationshipTypeDefinition;
+import org.apache.chemistry.opencmis.tck.CmisTestGroup;
+import org.apache.chemistry.opencmis.workbench.checks.SwingReport;
+import org.apache.chemistry.opencmis.workbench.checks.TypeComplianceTestGroup;
import org.apache.chemistry.opencmis.workbench.model.ClientModel;
import org.apache.chemistry.opencmis.workbench.swing.CollectionRenderer;
import org.apache.chemistry.opencmis.workbench.swing.InfoPanel;
@@ -109,6 +118,7 @@ public class TypeSplitPane extends JSpli
private JTextField allowedSourceTypesField;
private JTextField allowedTargetTypesField;
private JTextField typeMutabilityField;
+ private JButton checkButton;
public TypeInfoPanel(ClientModel model) {
super(model);
@@ -182,6 +192,8 @@ public class TypeSplitPane extends JSpli
allowedSourceTypesField.setVisible(false);
allowedTargetTypesField.setVisible(false);
}
+
+ checkButton.setEnabled(true);
} else {
nameField.setText("");
descriptionField.setText("");
@@ -202,6 +214,7 @@ public class TypeSplitPane extends JSpli
allowedSourceTypesField.setVisible(false);
allowedTargetTypesField.setVisible(false);
typeMutabilityField.setText("");
+ checkButton.setEnabled(false);
}
revalidate();
@@ -229,6 +242,32 @@ public class TypeSplitPane extends JSpli
contentStreamAllowedField = addLine("Content stream allowed:");
allowedSourceTypesField = addLine("Allowed source types:");
allowedTargetTypesField = addLine("Allowed target types:");
+
+ checkButton = addComponent("", new JButton("Check specification
compliance"));
+
+ checkButton.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ try {
+
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+
+ Map<String, String> parameters = new HashMap<String,
String>(getClientModel()
+ .getClientSession().getSessionParameters());
+ parameters.put(SessionParameter.REPOSITORY_ID,
getClientModel().getRepositoryInfo().getId());
+
+ TypeComplianceTestGroup tctg = new
TypeComplianceTestGroup(parameters, idField.getText());
+ tctg.run();
+
+ List<CmisTestGroup> groups = new
ArrayList<CmisTestGroup>();
+ groups.add(tctg);
+ SwingReport report = new SwingReport(null, 700, 500);
+ report.createReport(parameters, groups, (Writer) null);
+ } catch (Exception ex) {
+ ClientHelper.showError(null, ex);
+ } finally {
+
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ }
+ }
+ });
}
private boolean is(Boolean b) {
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/checks/ObjectComplianceCheck.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/checks/ObjectComplianceCheck.java?rev=1678240&r1=1678239&r2=1678240&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/checks/ObjectComplianceCheck.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/checks/ObjectComplianceCheck.java
Thu May 7 17:13:19 2015
@@ -59,7 +59,7 @@ public class ObjectComplianceCheck exten
}
if (getResults().isEmpty()) {
- addResult(createResult(CmisTestResultStatus.OK, "Object seems to
be compliant! Id: " + object.getId()));
+ addResult(createResult(CmisTestResultStatus.OK, "Object seems to
be compliant! ID: " + object.getId()));
}
}
}
Added:
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/checks/TypeComplianceCheck.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/checks/TypeComplianceCheck.java?rev=1678240&view=auto
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/checks/TypeComplianceCheck.java
(added)
+++
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/checks/TypeComplianceCheck.java
Thu May 7 17:13:19 2015
@@ -0,0 +1,55 @@
+/*
+ * 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.checks;
+
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.client.api.ObjectType;
+import org.apache.chemistry.opencmis.client.api.Session;
+import org.apache.chemistry.opencmis.tck.CmisTestResultStatus;
+import org.apache.chemistry.opencmis.tck.impl.AbstractSessionTest;
+
+/**
+ * This class checks an object for CMIS specification compliance.
+ */
+public class TypeComplianceCheck extends AbstractSessionTest {
+
+ private String typeId;
+
+ public TypeComplianceCheck(String typeId) {
+ this.typeId = typeId;
+ }
+
+ @Override
+ public final void init(Map<String, String> parameters) {
+ super.init(parameters);
+ setName("Type Definition Compliance Check");
+ }
+
+ @Override
+ public final void run(Session session) {
+ ObjectType type = session.getTypeDefinition(typeId);
+
+ addResult(checkTypeDefinition(session, type, "Type check:" +
type.getId()));
+
+ if (getResults().isEmpty()) {
+ addResult(createResult(CmisTestResultStatus.OK, "Type seems to be
compliant! ID: " + type.getId()));
+ }
+ }
+}
Added:
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/checks/TypeComplianceTestGroup.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/checks/TypeComplianceTestGroup.java?rev=1678240&view=auto
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/checks/TypeComplianceTestGroup.java
(added)
+++
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/checks/TypeComplianceTestGroup.java
Thu May 7 17:13:19 2015
@@ -0,0 +1,42 @@
+/*
+ * 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.checks;
+
+import java.util.Map;
+
+import org.apache.chemistry.opencmis.tck.impl.AbstractCmisTestGroup;
+
+public class TypeComplianceTestGroup extends AbstractCmisTestGroup {
+
+ private String typeId;
+
+ public TypeComplianceTestGroup(Map<String, String> parameters, String
typeId) throws Exception {
+ this.typeId = typeId;
+ init(parameters);
+ }
+
+ @Override
+ public final void init(Map<String, String> parameters) throws Exception {
+ super.init(parameters);
+
+ setName("Type Definition Compliance Test Group");
+
+ addTest(new TypeComplianceCheck(typeId));
+ }
+}
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=1678240&r1=1678239&r2=1678240&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
Thu May 7 17:13:19 2015
@@ -108,6 +108,7 @@ public class ClientSession {
private OperationContext folderOperationContext;
private OperationContext versionOperationContext;
private int maxChildren;
+ private String startFolderId;
public ClientSession(Map<String, String> sessionParameters, ObjectFactory
objectFactory,
AuthenticationProvider authenticationProvider, Cache cache,
TypeDefinitionCache typeDefCache) {
@@ -120,7 +121,7 @@ public class ClientSession {
public static SessionParameterMap createSessionParameters(String url,
BindingType binding, String username,
String password, Authentication authentication, boolean
compression, boolean clientCompression,
- boolean cookies) {
+ boolean cookies, long connectionTimeout, long readTimeout) {
SessionParameterMap parameters = new SessionParameterMap();
switch (binding) {
@@ -156,6 +157,18 @@ public class ClientSession {
parameters.setCookies(cookies);
+ if (connectionTimeout > 0) {
+ parameters.setConnectionTimeout(connectionTimeout);
+ } else {
+ parameters.setConnectionTimeout(0);
+ }
+
+ if (readTimeout > 0) {
+ parameters.setReadTimeout(readTimeout);
+ } else {
+ parameters.setReadTimeout(0);
+ }
+
// get additional workbench properties from system properties
Properties sysProps = System.getProperties();
for (String key : sysProps.stringPropertyNames()) {
@@ -233,6 +246,18 @@ public class ClientSession {
return Collections.unmodifiableMap(sessionParameters);
}
+ public void setStartFolderId(String startFolderId) {
+ this.startFolderId = startFolderId;
+ }
+
+ public String getStartFolderId() {
+ if (startFolderId != null) {
+ return startFolderId;
+ } else {
+ return getSession().getRepositoryInfo().getRootFolderId();
+ }
+ }
+
public int getMaxChildren() {
return maxChildren;
}
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/META-INF/README-cmis-workbench.txt
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/META-INF/README-cmis-workbench.txt?rev=1678240&r1=1678239&r2=1678240&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/META-INF/README-cmis-workbench.txt
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/META-INF/README-cmis-workbench.txt
Thu May 7 17:13:19 2015
@@ -25,6 +25,8 @@ cmis.workbench.authentication - prese
cmis.workbench.compression - preset compression (on/off)
cmis.workbench.clientcompression - preset client compression (on/off)
cmis.workbench.cookies - preset cookies (on/off)
+cmis.workbench.connecttimeout - preset the connect timeout (in seconds)
+cmis.workbench.readtimeout - preset the read timeout (in seconds)
Folder operation context: