Author: fmui
Date: Fri Jul 18 07:50:20 2014
New Revision: 1611550
URL: http://svn.apache.org/r1611550
Log:
CMIS-362: added workarounds for SharePoint 2010 and SharePoint 2013
Added:
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2013-atompub.properties
(with props)
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2013-webservices.properties
(with props)
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/SessionImpl.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/BindingSession.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/StandardAuthenticationProvider.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/VersioningServiceImpl.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/ObjectServiceImpl.java
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/ObjectServiceImpl.java
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/SessionParameter.java
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/config-library.properties
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2010-atompub.properties
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2010-webservices.properties
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/SessionImpl.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/SessionImpl.java?rev=1611550&r1=1611549&r2=1611550&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/SessionImpl.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/impl/SessionImpl.java
Fri Jul 18 07:50:20 2014
@@ -47,14 +47,17 @@ public class SessionImpl implements Bind
data = new HashMap<String, Object>();
}
+ @Override
public String getSessionId() {
return id;
}
+ @Override
public Collection<String> getKeys() {
return data.keySet();
}
+ @Override
public Object get(String key) {
Object value = null;
@@ -72,11 +75,13 @@ public class SessionImpl implements Bind
return value;
}
+ @Override
public Object get(String key, Object defValue) {
Object value = get(key);
return (value == null ? defValue : value);
}
+ @Override
public int get(String key, int defValue) {
Object value = get(key);
int intValue = defValue;
@@ -94,6 +99,22 @@ public class SessionImpl implements Bind
return intValue;
}
+ @Override
+ public boolean get(String key, boolean defValue) {
+ Object value = get(key);
+
+ if (value instanceof Boolean) {
+ return ((Boolean) value).booleanValue();
+ }
+
+ if (value instanceof String) {
+ return Boolean.parseBoolean((String) value);
+ }
+
+ return defValue;
+ }
+
+ @Override
public void put(String key, Serializable obj) {
lock.writeLock().lock();
try {
@@ -103,6 +124,7 @@ public class SessionImpl implements Bind
}
}
+ @Override
public void put(String key, Object obj, boolean isTransient) {
Object value = (isTransient ? new TransientWrapper(obj) : obj);
if (!(value instanceof Serializable)) {
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/BindingSession.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/BindingSession.java?rev=1611550&r1=1611549&r2=1611550&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/BindingSession.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/BindingSession.java
Fri Jul 18 07:50:20 2014
@@ -52,6 +52,11 @@ public interface BindingSession extends
int get(String key, int defValue);
/**
+ * Returns a session value or the default value if the key doesn't exist.
+ */
+ boolean get(String key, boolean defValue);
+
+ /**
* Adds a non-transient session value.
*/
void put(String key, Serializable object);
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/StandardAuthenticationProvider.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/StandardAuthenticationProvider.java?rev=1611550&r1=1611549&r2=1611550&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/StandardAuthenticationProvider.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/StandardAuthenticationProvider.java
Fri Jul 18 07:50:20 2014
@@ -253,45 +253,27 @@ public class StandardAuthenticationProvi
* bindings.)
*/
protected boolean getSendBasicAuth() {
- return isTrue(SessionParameter.AUTH_HTTP_BASIC);
+ return getSession().get(SessionParameter.AUTH_HTTP_BASIC, false);
}
/**
* Returns if an OAuth Bearer token header should be sent. (All bindings.)
*/
protected boolean getSendBearerToken() {
- return isTrue(SessionParameter.AUTH_OAUTH_BEARER);
+ return getSession().get(SessionParameter.AUTH_OAUTH_BEARER, false);
}
/**
* Returns if a UsernameToken should be sent. (Web Services binding only.)
*/
protected boolean getSendUsernameToken() {
- return isTrue(SessionParameter.AUTH_SOAP_USERNAMETOKEN);
+ return getSession().get(SessionParameter.AUTH_SOAP_USERNAMETOKEN,
false);
}
/**
* Returns if the authentication provider should handle cookies.
*/
protected boolean getHandleCookies() {
- return isTrue(SessionParameter.COOKIES);
- }
-
- /**
- * Returns <code>true</code> if the given parameter exists in the session
- * and is set to true, <code>false</code> otherwise.
- */
- protected boolean isTrue(String parameterName) {
- Object value = getSession().get(parameterName);
-
- if (value instanceof Boolean) {
- return ((Boolean) value).booleanValue();
- }
-
- if (value instanceof String) {
- return Boolean.parseBoolean((String) value);
- }
-
- return false;
+ return getSession().get(SessionParameter.COOKIES, false);
}
}
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java?rev=1611550&r1=1611549&r2=1611550&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AbstractAtomPubService.java
Fri Jul 18 07:50:20 2014
@@ -181,11 +181,11 @@ public abstract class AbstractAtomPubSer
*/
protected String getLink(String repositoryId, String id, String rel,
String type) {
if (repositoryId == null) {
- throw new CmisInvalidArgumentException("Repository id must be
set!");
+ throw new CmisInvalidArgumentException("Repository ID must be
set!");
}
if (id == null) {
- throw new CmisInvalidArgumentException("Object id must be set!");
+ throw new CmisInvalidArgumentException("Object ID must be set!");
}
return getLinkCache().getLink(repositoryId, id, rel, type);
@@ -283,11 +283,11 @@ public abstract class AbstractAtomPubSer
*/
protected String getTypeLink(String repositoryId, String typeId, String
rel, String type) {
if (repositoryId == null) {
- throw new CmisInvalidArgumentException("Repository id must be
set!");
+ throw new CmisInvalidArgumentException("Repository ID must be
set!");
}
if (typeId == null) {
- throw new CmisInvalidArgumentException("Type id must be set!");
+ throw new CmisInvalidArgumentException("Type ID must be set!");
}
return getLinkCache().getTypeLink(repositoryId, typeId, rel, type);
@@ -545,21 +545,34 @@ public abstract class AbstractAtomPubSer
}
/**
- * Creates a CMIS object with properties and policy ids.
+ * Creates a CMIS object with properties and policy IDs.
*/
protected ObjectDataImpl createObject(Properties properties, String
changeToken, List<String> policies) {
ObjectDataImpl object = new ObjectDataImpl();
+ boolean omitChangeToken =
getSession().get(SessionParameter.OMIT_CHANGE_TOKENS, false);
+
if (properties == null) {
properties = new PropertiesImpl();
- if (changeToken != null) {
+ if (changeToken != null && !omitChangeToken) {
((PropertiesImpl) properties)
.addProperty(new
PropertyStringImpl(PropertyIds.CHANGE_TOKEN, changeToken));
}
- } else if (changeToken != null &&
!properties.getProperties().containsKey(PropertyIds.CHANGE_TOKEN)) {
- properties = new PropertiesImpl(properties);
- ((PropertiesImpl) properties).addProperty(new
PropertyStringImpl(PropertyIds.CHANGE_TOKEN, changeToken));
+ } else {
+ if (omitChangeToken) {
+ if
(properties.getProperties().containsKey(PropertyIds.CHANGE_TOKEN)) {
+ properties = new PropertiesImpl(properties);
+ ((PropertiesImpl)
properties).removeProperty(PropertyIds.CHANGE_TOKEN);
+ }
+ } else {
+ if (changeToken != null &&
!properties.getProperties().containsKey(PropertyIds.CHANGE_TOKEN)) {
+ properties = new PropertiesImpl(properties);
+ ((PropertiesImpl) properties).addProperty(new
PropertyStringImpl(PropertyIds.CHANGE_TOKEN,
+ changeToken));
+ }
+ }
}
+
object.setProperties(properties);
if (isNotEmpty(policies)) {
@@ -572,7 +585,7 @@ public abstract class AbstractAtomPubSer
}
/**
- * Creates a CMIS object that only contains an id in the property list.
+ * Creates a CMIS object that only contains an ID in the property list.
*/
protected ObjectData createIdObject(String objectId) {
ObjectDataImpl object = new ObjectDataImpl();
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java?rev=1611550&r1=1611549&r2=1611550&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java
Fri Jul 18 07:50:20 2014
@@ -38,6 +38,7 @@ import org.apache.chemistry.opencmis.cli
import org.apache.chemistry.opencmis.client.bindings.spi.http.Output;
import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
import org.apache.chemistry.opencmis.commons.PropertyIds;
+import org.apache.chemistry.opencmis.commons.SessionParameter;
import org.apache.chemistry.opencmis.commons.data.Acl;
import org.apache.chemistry.opencmis.commons.data.AllowableActions;
import
org.apache.chemistry.opencmis.commons.data.BulkUpdateObjectIdAndChangeToken;
@@ -321,9 +322,14 @@ public class ObjectServiceImpl extends A
UrlBuilder url = new UrlBuilder(link);
if (changeToken != null) {
- // not required by the CMIS specification
- // -> keep for backwards compatibility with older OpenCMIS servers
- url.addParameter(Constants.PARAM_CHANGE_TOKEN,
changeToken.getValue());
+ if (getSession().get(SessionParameter.OMIT_CHANGE_TOKENS, false)) {
+ changeToken.setValue(null);
+ } else {
+ // not required by the CMIS specification
+ // -> keep for backwards compatibility with older OpenCMIS
+ // servers
+ url.addParameter(Constants.PARAM_CHANGE_TOKEN,
changeToken.getValue());
+ }
}
// set up writer
@@ -708,7 +714,7 @@ public class ObjectServiceImpl extends A
}
UrlBuilder url = new UrlBuilder(link);
- if (changeToken != null) {
+ if (changeToken != null &&
!getSession().get(SessionParameter.OMIT_CHANGE_TOKENS, false)) {
url.addParameter(Constants.PARAM_CHANGE_TOKEN,
changeToken.getValue());
}
@@ -784,7 +790,7 @@ public class ObjectServiceImpl extends A
}
UrlBuilder url = new UrlBuilder(link);
- if (changeToken != null) {
+ if (changeToken != null &&
!getSession().get(SessionParameter.OMIT_CHANGE_TOKENS, false)) {
url.addParameter(Constants.PARAM_CHANGE_TOKEN,
changeToken.getValue());
}
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/VersioningServiceImpl.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/VersioningServiceImpl.java?rev=1611550&r1=1611549&r2=1611550&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/VersioningServiceImpl.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/VersioningServiceImpl.java
Fri Jul 18 07:50:20 2014
@@ -32,6 +32,7 @@ import org.apache.chemistry.opencmis.cli
import
org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomLink;
import org.apache.chemistry.opencmis.client.bindings.spi.http.Output;
import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
+import org.apache.chemistry.opencmis.commons.SessionParameter;
import org.apache.chemistry.opencmis.commons.data.Acl;
import org.apache.chemistry.opencmis.commons.data.ContentStream;
import org.apache.chemistry.opencmis.commons.data.ExtensionsData;
@@ -75,6 +76,11 @@ public class VersioningServiceImpl exten
UrlBuilder url = new UrlBuilder(link);
+ // workaround for SharePoint 2010 - see CMIS-362
+ if
(getSession().get(SessionParameter.INCLUDE_OBJECTID_URL_PARAM_ON_CHECKOUT,
false)) {
+ url.addParameter("objectId", objectId.getValue());
+ }
+
// set up object and writer
final AtomEntryWriter entryWriter = new
AtomEntryWriter(createIdObject(objectId.getValue()),
getCmisVersion(repositoryId));
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/ObjectServiceImpl.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/ObjectServiceImpl.java?rev=1611550&r1=1611549&r2=1611550&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/ObjectServiceImpl.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/ObjectServiceImpl.java
Fri Jul 18 07:50:20 2014
@@ -31,6 +31,7 @@ import org.apache.chemistry.opencmis.cli
import org.apache.chemistry.opencmis.client.bindings.spi.http.Output;
import org.apache.chemistry.opencmis.client.bindings.spi.http.Response;
import org.apache.chemistry.opencmis.commons.PropertyIds;
+import org.apache.chemistry.opencmis.commons.SessionParameter;
import org.apache.chemistry.opencmis.commons.data.Acl;
import org.apache.chemistry.opencmis.commons.data.AllowableActions;
import
org.apache.chemistry.opencmis.commons.data.BulkUpdateObjectIdAndChangeToken;
@@ -379,7 +380,7 @@ public class ObjectServiceImpl extends A
public void updateProperties(String repositoryId, Holder<String> objectId,
Holder<String> changeToken,
Properties properties, ExtensionsData extension) {
- // we need an object id
+ // we need an object ID
if ((objectId == null) || (objectId.getValue() == null) ||
(objectId.getValue().length() == 0)) {
throw new CmisInvalidArgumentException("Object id must be set!");
}
@@ -390,7 +391,9 @@ public class ObjectServiceImpl extends A
// prepare form data
final FormDataWriter formData = new
FormDataWriter(Constants.CMISACTION_UPDATE_PROPERTIES);
formData.addPropertiesParameters(properties, getDateTimeFormat());
- formData.addParameter(Constants.PARAM_CHANGE_TOKEN, (changeToken ==
null ? null : changeToken.getValue()));
+ formData.addParameter(Constants.PARAM_CHANGE_TOKEN,
+ (changeToken == null ||
getSession().get(SessionParameter.OMIT_CHANGE_TOKENS, false) ? null
+ : changeToken.getValue()));
formData.addSuccinctFlag(getSuccinct());
// send and parse
@@ -538,7 +541,9 @@ public class ObjectServiceImpl extends A
// prepare form data
final FormDataWriter formData = new
FormDataWriter(Constants.CMISACTION_SET_CONTENT, contentStream);
formData.addParameter(Constants.PARAM_OVERWRITE_FLAG, overwriteFlag);
- formData.addParameter(Constants.PARAM_CHANGE_TOKEN, (changeToken ==
null ? null : changeToken.getValue()));
+ formData.addParameter(Constants.PARAM_CHANGE_TOKEN,
+ (changeToken == null ||
getSession().get(SessionParameter.OMIT_CHANGE_TOKENS, false) ? null
+ : changeToken.getValue()));
formData.addSuccinctFlag(getSuccinct());
// send and parse
@@ -575,7 +580,9 @@ public class ObjectServiceImpl extends A
// prepare form data
final FormDataWriter formData = new
FormDataWriter(Constants.CMISACTION_APPEND_CONTENT, contentStream);
formData.addParameter(Constants.CONTROL_IS_LAST_CHUNK, isLastChunk);
- formData.addParameter(Constants.PARAM_CHANGE_TOKEN, (changeToken ==
null ? null : changeToken.getValue()));
+ formData.addParameter(Constants.PARAM_CHANGE_TOKEN,
+ (changeToken == null ||
getSession().get(SessionParameter.OMIT_CHANGE_TOKENS, false) ? null
+ : changeToken.getValue()));
formData.addSuccinctFlag(getSuccinct());
// send and parse
@@ -611,7 +618,9 @@ public class ObjectServiceImpl extends A
// prepare form data
final FormDataWriter formData = new
FormDataWriter(Constants.CMISACTION_DELETE_CONTENT);
- formData.addParameter(Constants.PARAM_CHANGE_TOKEN, (changeToken ==
null ? null : changeToken.getValue()));
+ formData.addParameter(Constants.PARAM_CHANGE_TOKEN,
+ (changeToken == null ||
getSession().get(SessionParameter.OMIT_CHANGE_TOKENS, false) ? null
+ : changeToken.getValue()));
formData.addSuccinctFlag(getSuccinct());
// send and parse
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/ObjectServiceImpl.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/ObjectServiceImpl.java?rev=1611550&r1=1611549&r2=1611550&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/ObjectServiceImpl.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/webservices/ObjectServiceImpl.java
Fri Jul 18 07:50:20 2014
@@ -29,6 +29,7 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.chemistry.opencmis.client.bindings.spi.BindingSession;
+import org.apache.chemistry.opencmis.commons.SessionParameter;
import org.apache.chemistry.opencmis.commons.data.Acl;
import org.apache.chemistry.opencmis.commons.data.AllowableActions;
import
org.apache.chemistry.opencmis.commons.data.BulkUpdateObjectIdAndChangeToken;
@@ -223,7 +224,8 @@ public class ObjectServiceImpl extends A
try {
javax.xml.ws.Holder<String> portObjectId = convertHolder(objectId);
- javax.xml.ws.Holder<String> portChangeToken =
convertHolder(changeToken);
+ javax.xml.ws.Holder<String> portChangeToken =
(getSession().get(SessionParameter.OMIT_CHANGE_TOKENS, false) ? null
+ : convertHolder(changeToken));
javax.xml.ws.Holder<CmisExtensionType> portExtension =
convertExtensionHolder(extension);
port.updateProperties(repositoryId, portObjectId, portChangeToken,
convert(properties), portExtension);
@@ -449,7 +451,8 @@ public class ObjectServiceImpl extends A
try {
javax.xml.ws.Holder<String> portObjectId = convertHolder(objectId);
- javax.xml.ws.Holder<String> portChangeToken =
convertHolder(changeToken);
+ javax.xml.ws.Holder<String> portChangeToken =
(getSession().get(SessionParameter.OMIT_CHANGE_TOKENS, false) ? null
+ : convertHolder(changeToken));
javax.xml.ws.Holder<CmisExtensionType> portExtension =
convertExtensionHolder(extension);
port.setContentStream(repositoryId, portObjectId, overwriteFlag,
portChangeToken,
@@ -473,7 +476,8 @@ public class ObjectServiceImpl extends A
try {
javax.xml.ws.Holder<String> portObjectId = convertHolder(objectId);
- javax.xml.ws.Holder<String> portChangeToken =
convertHolder(changeToken);
+ javax.xml.ws.Holder<String> portChangeToken =
(getSession().get(SessionParameter.OMIT_CHANGE_TOKENS, false) ? null
+ : convertHolder(changeToken));
javax.xml.ws.Holder<CmisExtensionType> portExtension =
convertExtensionHolder(extension);
port.deleteContentStream(repositoryId, portObjectId,
portChangeToken, portExtension);
@@ -500,7 +504,8 @@ public class ObjectServiceImpl extends A
try {
javax.xml.ws.Holder<String> portObjectId = convertHolder(objectId);
- javax.xml.ws.Holder<String> portChangeToken =
convertHolder(changeToken);
+ javax.xml.ws.Holder<String> portChangeToken =
(getSession().get(SessionParameter.OMIT_CHANGE_TOKENS, false) ? null
+ : convertHolder(changeToken));
javax.xml.ws.Holder<CmisExtensionType> portExtension =
convertExtensionHolder(extension);
port.appendContentStream(repositoryId, portObjectId, isLastChunk,
portChangeToken,
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/SessionParameter.java
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/SessionParameter.java?rev=1611550&r1=1611549&r2=1611550&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/SessionParameter.java
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-commons/chemistry-opencmis-commons-api/src/main/java/org/apache/chemistry/opencmis/commons/SessionParameter.java
Fri Jul 18 07:50:20 2014
@@ -506,6 +506,27 @@ package org.apache.chemistry.opencmis.co
* <td>yes</td>
* <td>-</td>
* </tr>
+ * <tr>
+ * <td colspan="6"><b>Workarounds</b></td>
+ * </tr>
+ * <tr>
+ * <td>{@link #INCLUDE_OBJECTID_URL_PARAM_ON_CHECKOUT}</td>
+ * <td>Defines if the object ID should be added to the check out URL<br>
+ * (Workaround for SharePoint 2010)</td>
+ * <td>AtomPub</td>
+ * <td>"true", "false"</td>
+ * <td>no</td>
+ * <td>"false"</td>
+ * </tr>
+ * <tr>
+ * <td>{@link #OMIT_CHANGE_TOKENS}</td>
+ * <td>Defines if the change token should be omitted for updating calls<br>
+ * (Workaround for SharePoint 2010 and SharePoint 2013)</td>
+ * <td>all</td>
+ * <td>"true", "false"</td>
+ * <td>no</td>
+ * <td>"false"</td>
+ * </tr>
* </table>
*/
public final class SessionParameter {
@@ -565,7 +586,7 @@ public final class SessionParameter {
/** URL of the Browser Binding entry point. */
public static final String BROWSER_URL =
"org.apache.chemistry.opencmis.binding.browser.url";
public static final String BROWSER_SUCCINCT =
"org.apache.chemistry.opencmis.binding.browser.succinct";
- public static final String BROWSER_DATETIME_FORMAT
="org.apache.chemistry.opencmis.binding.browser.datetimeformat";
+ public static final String BROWSER_DATETIME_FORMAT =
"org.apache.chemistry.opencmis.binding.browser.datetimeformat";
/** Factory class name for the local binding. */
public static final String LOCAL_FACTORY =
"org.apache.chemistry.opencmis.binding.local.classname";
@@ -647,4 +668,9 @@ public final class SessionParameter {
public static final String TYPE_DEFINITION_CACHE_CLASS =
"org.apache.chemistry.opencmis.cache.types.classname";
public static final String REPOSITORY_ID =
"org.apache.chemistry.opencmis.session.repository.id";
+
+ // --- workarounds ---
+
+ public static final String INCLUDE_OBJECTID_URL_PARAM_ON_CHECKOUT =
"org.apache.chemistry.opencmis.workaround.includeObjectIdOnCheckout";
+ public static final String OMIT_CHANGE_TOKENS =
"org.apache.chemistry.opencmis.workaround.omitChangeTokens";
}
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/config-library.properties
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/config-library.properties?rev=1611550&r1=1611549&r2=1611550&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/config-library.properties
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/config-library.properties
Fri Jul 18 07:50:20 2014
@@ -37,6 +37,8 @@ alfresco-cloud-1.1-browser.properties=Al
sharepoint-2010-atompub.properties=SharePoint 2010 AtomPub
sharepoint-2010-webservices.properties=SharePoint 2010 Web Services
+sharepoint-2013-atompub.properties=SharePoint 2013 AtomPub
+sharepoint-2013-webservices.properties=SharePoint 2013 Web Services
opentext-els-10.2.0-atompub.properties=Open Text ELS 10.2.0 AtomPub
opentext-els-10.2.0-webservices.properties=Open Text ELS 10.2.0 Web Services
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2010-atompub.properties
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2010-atompub.properties?rev=1611550&r1=1611549&r2=1611550&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2010-atompub.properties
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2010-atompub.properties
Fri Jul 18 07:50:20 2014
@@ -23,7 +23,11 @@
org.apache.chemistry.opencmis.binding.spi.type=atompub
org.apache.chemistry.opencmis.binding.atompub.url=http://<host>/_vti_bin/cmis/rest/<SPList>?getrepositoryinfo
+org.apache.chemistry.opencmis.binding.auth.classname=org.apache.chemistry.opencmis.client.bindings.spi.NTLMAuthenticationProvider
org.apache.chemistry.opencmis.user=<domain>\<user>
org.apache.chemistry.opencmis.password=<password>
+org.apache.chemistry.opencmis.workaround.includeObjectIdOnCheckout=true
+org.apache.chemistry.opencmis.workaround.omitChangeTokens=true
+
cmis.workbench.folder.filter=*
\ No newline at end of file
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2010-webservices.properties
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2010-webservices.properties?rev=1611550&r1=1611549&r2=1611550&view=diff
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2010-webservices.properties
(original)
+++
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2010-webservices.properties
Fri Jul 18 07:50:20 2014
@@ -21,19 +21,16 @@
# SharePoint 2010 Web Services
-# In order to connect, download the WSDL
(http://<host>/_vti_bin/cmissoapwsdl.aspx?wsdl)
-# to your local disk and refer to this file in the configuration.
-
org.apache.chemistry.opencmis.binding.spi.type=webservices
-org.apache.chemistry.opencmis.binding.webservices.RepositoryService=file:///<path/to/wsdl>
-org.apache.chemistry.opencmis.binding.webservices.NavigationService=file:///<path/to/wsdl>
-org.apache.chemistry.opencmis.binding.webservices.ObjectService=file:///<path/to/wsdl>
-org.apache.chemistry.opencmis.binding.webservices.VersioningService=file:///<path/to/wsdl>
-org.apache.chemistry.opencmis.binding.webservices.DiscoveryService=file:///<path/to/wsdl>
-org.apache.chemistry.opencmis.binding.webservices.MultiFilingService=file:///<path/to/wsdl>
-org.apache.chemistry.opencmis.binding.webservices.RelationshipService=file:///<path/to/wsdl>
-org.apache.chemistry.opencmis.binding.webservices.ACLService=file:///<path/to/wsdl>
-org.apache.chemistry.opencmis.binding.webservices.PolicyService=file:///<path/to/wsdl>
+org.apache.chemistry.opencmis.binding.webservices.RepositoryService=http://<host>/_vti_bin/cmissoapwsdl.aspx
+org.apache.chemistry.opencmis.binding.webservices.NavigationService=http://<host>/_vti_bin/cmissoapwsdl.aspx
+org.apache.chemistry.opencmis.binding.webservices.ObjectService=http://<host>/_vti_bin/cmissoapwsdl.aspx
+org.apache.chemistry.opencmis.binding.webservices.VersioningService=http://<host>/_vti_bin/cmissoapwsdl.aspx
+org.apache.chemistry.opencmis.binding.webservices.DiscoveryService=http://<host>/_vti_bin/cmissoapwsdl.aspx
+org.apache.chemistry.opencmis.binding.webservices.MultiFilingService=http://<host>/_vti_bin/cmissoapwsdl.aspx
+org.apache.chemistry.opencmis.binding.webservices.RelationshipService=http://<host>/_vti_bin/cmissoapwsdl.aspx
+org.apache.chemistry.opencmis.binding.webservices.ACLService=http://<host>/_vti_bin/cmissoapwsdl.aspx
+org.apache.chemistry.opencmis.binding.webservices.PolicyService=http://<host>/_vti_bin/cmissoapwsdl.aspx
org.apache.chemistry.opencmis.binding.auth.classname=org.apache.chemistry.opencmis.client.bindings.spi.NTLMAuthenticationProvider
org.apache.chemistry.opencmis.user=<domain>\<user>
org.apache.chemistry.opencmis.password=<password>
Added:
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2013-atompub.properties
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2013-atompub.properties?rev=1611550&view=auto
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2013-atompub.properties
(added)
+++
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2013-atompub.properties
Fri Jul 18 07:50:20 2014
@@ -0,0 +1,31 @@
+#
+#
+# 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.
+#
+#
+
+# SharePoint 2013 AtomPub
+
+org.apache.chemistry.opencmis.binding.spi.type=atompub
+org.apache.chemistry.opencmis.binding.atompub.url=http://<host>/_vti_bin/cmis/rest?getRepositories
+org.apache.chemistry.opencmis.user=<domain>\<user>
+org.apache.chemistry.opencmis.password=<password>
+
+org.apache.chemistry.opencmis.workaround.omitChangeTokens=true
+
+cmis.workbench.folder.filter=*
\ No newline at end of file
Propchange:
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2013-atompub.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added:
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2013-webservices.properties
URL:
http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2013-webservices.properties?rev=1611550&view=auto
==============================================================================
---
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2013-webservices.properties
(added)
+++
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2013-webservices.properties
Fri Jul 18 07:50:20 2014
@@ -0,0 +1,37 @@
+#
+#
+# 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.
+#
+#
+
+# SharePoint 2013 Web Services
+
+org.apache.chemistry.opencmis.binding.spi.type=webservices
+org.apache.chemistry.opencmis.binding.webservices.RepositoryService=http://<host>/_vti_bin/cmissoapwsdl.aspx
+org.apache.chemistry.opencmis.binding.webservices.NavigationService=http://<host>/_vti_bin/cmissoapwsdl.aspx
+org.apache.chemistry.opencmis.binding.webservices.ObjectService=http://<host>/_vti_bin/cmissoapwsdl.aspx
+org.apache.chemistry.opencmis.binding.webservices.VersioningService=http://<host>/_vti_bin/cmissoapwsdl.aspx
+org.apache.chemistry.opencmis.binding.webservices.DiscoveryService=http://<host>/_vti_bin/cmissoapwsdl.aspx
+org.apache.chemistry.opencmis.binding.webservices.MultiFilingService=http://<host>/_vti_bin/cmissoapwsdl.aspx
+org.apache.chemistry.opencmis.binding.webservices.RelationshipService=http://<host>/_vti_bin/cmissoapwsdl.aspx
+org.apache.chemistry.opencmis.binding.webservices.ACLService=http://<host>/_vti_bin/cmissoapwsdl.aspx
+org.apache.chemistry.opencmis.binding.webservices.PolicyService=http://<host>/_vti_bin/cmissoapwsdl.aspx
+org.apache.chemistry.opencmis.user=<domain>\<user>
+org.apache.chemistry.opencmis.password=<password>
+
+cmis.workbench.folder.filter=*
Propchange:
chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/configs/sharepoint-2013-webservices.properties
------------------------------------------------------------------------------
svn:eol-style = native