无法使用OpenCMIS更新SharePoint 2013中的文档属性

时间:2016-08-29 05:05:54

标签: sharepoint-2013 opencmis

我正在使用SharePoint 2013,我正在尝试使用OpenCMIS 0.14.0更新文档的属性

代码很简单:

final String PROP = "MyCustomProperty";
Session session = buildSessionWithAtomPubBinding("https://domain/_vti_bin/cmis/rest/?getRepositories");

OperationContext oc = session.createOperationContext();
oc.setFilterString(PROP);
CmisObject doc = session.getObjectByPath("/docs/contracts/doc.xsl", oc);
System.out.println("Doc id before checkout: " + doc.getId());

final Map<String, String> prop = new HashMap<String, String>();
prop.put(PROP, "IronMan");
System.out.println(prop);
CmisObject newObj = doc.updateProperties(prop);

但我得到以下例外:

Doc id before checkout: 6010-512
Exception in thread "main" org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException: Redirects are not supported (HTTP status code 302): Found
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:469)
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.put(AbstractAtomPubService.java:685)
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.put(AbstractAtomPubService.java:672)
    at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.updateProperties(ObjectServiceImpl.java:340)
    at org.apache.chemistry.opencmis.client.runtime.AbstractCmisObject.updateProperties(AbstractCmisObject.java:376)
    at org.apache.chemistry.opencmis.client.runtime.AbstractCmisObject.updateProperties(AbstractCmisObject.java:340)
    at it.alessandro.CMISTest.main(CMISTest.java:30)

下面是用于创建会话的属性:

org.apache.chemistry.opencmis.user=xxxxxxxx
org.apache.chemistry.opencmis.password=xxxxxxxx
org.apache.chemistry.opencmis.binding.atompub.url=https://domain/_vti_bin/cmis/rest/?getRepositories
org.apache.chemistry.opencmis.binding.auth.http.oauth.bearer=false
org.apache.chemistry.opencmis.binding.auth.soap.usernametoken=true
org.apache.chemistry.opencmis.binding.spi.type=atompub
org.apache.chemistry.opencmis.binding.auth.http.basic=false
org.apache.chemistry.opencmis.binding.auth.classname=org.apache.chemistry.opencmis.client.bindings.spi.NTLMAuthenticationProvider
org.apache.chemistry.opencmis.workaround.omitChangeTokens=true

这是一个SharePoint的错误还是我的实现出了问题?

0 个答案:

没有答案