CLOUD-2157 "CMIS version is invalid. Setting it to CMIS 1.0." move original fix to Cloud override context file and ensure 1.0 endpoints explicitly set the CMIS version.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@57937 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Steven Glover
2013-11-15 17:28:00 +00:00
parent bf3647f7f2
commit 8459973ee3
2 changed files with 12 additions and 11 deletions

View File

@@ -41,6 +41,7 @@ import org.alfresco.opencmis.CMISDispatcherRegistry.Binding;
import org.alfresco.opencmis.CMISDispatcherRegistry.Endpoint;
import org.alfresco.service.descriptor.Descriptor;
import org.alfresco.service.descriptor.DescriptorService;
import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
import org.apache.chemistry.opencmis.commons.server.CmisServiceFactory;
import org.apache.chemistry.opencmis.server.impl.CmisRepositoryContextListener;
import org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet;
@@ -64,6 +65,7 @@ public abstract class CMISServletDispatcher implements CMISDispatcher
protected String serviceName;
protected BaseUrlGenerator baseUrlGenerator;
protected String version;
protected CmisVersion cmisVersion;
public void setDescriptorService(DescriptorService descriptorService)
{
@@ -100,7 +102,12 @@ public abstract class CMISServletDispatcher implements CMISDispatcher
return serviceName;
}
protected synchronized Descriptor getCurrentDescriptor()
public void setCmisVersion(String cmisVersion)
{
this.cmisVersion = CmisVersion.fromValue(cmisVersion);
}
protected synchronized Descriptor getCurrentDescriptor()
{
if(this.currentDescriptor == null)
{
@@ -205,7 +212,7 @@ public abstract class CMISServletDispatcher implements CMISDispatcher
}
else if(arg0.equals(CmisAtomPubServlet.PARAM_CMIS_VERSION))
{
return version;
return (cmisVersion != null ? cmisVersion.value() : CmisVersion.CMIS_1_0.value());
}
return null;
}