mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
REPO-5391 : [cmis webservices] isPrivateWorkingCopy throws NullPointerException (#56)
- Alfresco supports BindingType.WEBSERVICES for CMIS 1.0 and "cmis:isPrivateWorkingCopy" was introduced with CMIS 1.1 - thus checking if the document is a pwc (private working copy) through CMIS 1.0 method https://chemistry.apache.org/java/javadoc/org/apache/chemistry/opencmis/client/api/Document.html#isVersionSeriesPrivateWorkingCopy--
This commit is contained in:
@@ -37,6 +37,7 @@ import org.apache.chemistry.opencmis.commons.data.Ace;
|
|||||||
import org.apache.chemistry.opencmis.commons.data.Acl;
|
import org.apache.chemistry.opencmis.commons.data.Acl;
|
||||||
import org.apache.chemistry.opencmis.commons.data.CmisExtensionElement;
|
import org.apache.chemistry.opencmis.commons.data.CmisExtensionElement;
|
||||||
import org.apache.chemistry.opencmis.commons.enums.Action;
|
import org.apache.chemistry.opencmis.commons.enums.Action;
|
||||||
|
import org.apache.chemistry.opencmis.commons.enums.BindingType;
|
||||||
import org.apache.chemistry.opencmis.commons.enums.ChangeType;
|
import org.apache.chemistry.opencmis.commons.enums.ChangeType;
|
||||||
import org.apache.chemistry.opencmis.commons.enums.ExtensionLevel;
|
import org.apache.chemistry.opencmis.commons.enums.ExtensionLevel;
|
||||||
import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
|
import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
|
||||||
@@ -314,7 +315,20 @@ public class CmisAssertion extends DSLAssertion<CmisWrapper>
|
|||||||
{
|
{
|
||||||
Document document = cmisAPI().withCMISUtil().getCmisDocument(cmisAPI().getLastResource());
|
Document document = cmisAPI().withCMISUtil().getCmisDocument(cmisAPI().getLastResource());
|
||||||
STEP(String.format("%s Verify if document '%s' is private working copy", CmisWrapper.STEP_PREFIX, document.getName()));
|
STEP(String.format("%s Verify if document '%s' is private working copy", CmisWrapper.STEP_PREFIX, document.getName()));
|
||||||
|
|
||||||
|
// Alfresco supports BindingType.WEBSERVICES for CMIS 1.0
|
||||||
|
// (BindingType.ATOMPUB and BindingType.BROWSER for CMIS 1.1)
|
||||||
|
// and "cmis:isPrivateWorkingCopy" was introduced with CMIS 1.1.
|
||||||
|
//
|
||||||
|
// Checking if the document is a pwc through
|
||||||
|
// https://chemistry.apache.org/java/javadoc/org/apache/chemistry/opencmis/client/api/DocumentProperties.html#isPrivateWorkingCopy--
|
||||||
|
// won't work for BindingType.WEBSERVICES
|
||||||
|
//
|
||||||
|
// Thus using
|
||||||
|
// https://chemistry.apache.org/java/javadoc/org/apache/chemistry/opencmis/client/api/Document.html#isVersionSeriesPrivateWorkingCopy--
|
||||||
|
// which is supported in all CMIS versions.
|
||||||
Assert.assertTrue(cmisAPI().withCMISUtil().isPrivateWorkingCopy());
|
Assert.assertTrue(cmisAPI().withCMISUtil().isPrivateWorkingCopy());
|
||||||
|
|
||||||
return cmisAPI();
|
return cmisAPI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -280,10 +280,10 @@ public class CmisUtil
|
|||||||
|
|
||||||
protected boolean isPrivateWorkingCopy()
|
protected boolean isPrivateWorkingCopy()
|
||||||
{
|
{
|
||||||
boolean result = false;
|
boolean result;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
result = getPWCDocument().isPrivateWorkingCopy();
|
result = getPWCDocument().isVersionSeriesPrivateWorkingCopy();
|
||||||
}
|
}
|
||||||
catch (CmisVersioningException cmisVersioningException)
|
catch (CmisVersioningException cmisVersioningException)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user