Merged CMIS063 to HEAD

Resolve merge issues.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@17272 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2009-10-30 22:34:54 +00:00
parent bf4991eac0
commit 34b62b98dc
10 changed files with 20 additions and 922 deletions

View File

@@ -197,6 +197,7 @@ public class DMNavigationServicePort extends DMAbstractServicePort implements Na
*/
public CmisObjectType getFolderParent(String repositoryId, String folderId, String filter, CmisExtensionType extension) throws CmisException
{
// FIXME: [BUG] It is necessary to check with specification for behaviour of this method with folderId equal to rootFolderId!!!
checkRepositoryId(repositoryId);
if ((filter != null) && !filter.equals("") && !filter.equals("*"))

View File

@@ -97,7 +97,6 @@ public class DMRepositoryServicePort extends DMAbstractServicePort implements Re
propertyTypeEnumMapping.put(CMISDataTypeEnum.INTEGER, EnumPropertyType.INTEGER);
propertyTypeEnumMapping.put(CMISDataTypeEnum.STRING, EnumPropertyType.STRING);
propertyTypeEnumMapping.put(CMISDataTypeEnum.URI, EnumPropertyType.URI);
propertyTypeEnumMapping.put(CMISDataTypeEnum.XML, EnumPropertyType.XML);
queryTypeEnumMapping = new HashMap<CMISQueryEnum, EnumCapabilityQuery>();
queryTypeEnumMapping.put(CMISQueryEnum.BOTH_COMBINED, EnumCapabilityQuery.BOTHCOMBINED);
@@ -223,8 +222,6 @@ public class DMRepositoryServicePort extends DMAbstractServicePort implements Re
break;
case URI:
break;
case XML:
break;
}
return result;
}
@@ -286,10 +283,6 @@ public class DMRepositoryServicePort extends DMAbstractServicePort implements Re
{
return new CmisPropertyUriDefinitionType();
}
case XML:
{
return new CmisPropertyXmlDefinitionType();
}
default:
{
throw cmisObjectsUtils.createCmisException(type.getLabel(), EnumServiceException.OBJECT_NOT_FOUND);

View File

@@ -25,7 +25,9 @@
package org.alfresco.repo.cmis.ws.utils;
import java.math.BigInteger;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -387,33 +389,25 @@ public class CmisObjectsUtils
*/
public NodeRef getLatestNode(NodeRef documentNodeRef, boolean major)
{
Version specifiedVersion = versionService.getCurrentVersion(documentNodeRef);
NodeRef latestVersionNodeRef = documentNodeRef;
if ((null != specifiedVersion) && (null != specifiedVersion.getVersionedNodeRef()))
VersionHistory versionHistory = versionService.getVersionHistory(documentNodeRef);
if (null != versionHistory)
{
latestVersionNodeRef = specifiedVersion.getVersionedNodeRef();
if (major)
Collection<Version> allVersions = versionHistory.getAllVersions();
Iterator<Version> versionsIterator = ((null != allVersions) && !allVersions.isEmpty()) ? (allVersions.iterator()) : (null);
Version latestVersion = (null == versionsIterator) ? (null) : (versionsIterator.next());
String currentVersionLabel = (null != latestVersion) ? (latestVersion.getVersionLabel()) : (null);
if (major && (null != latestVersion))
{
Version latestVersion = versionService.getCurrentVersion(latestVersionNodeRef);
if ((null != latestVersion) && (VersionType.MAJOR != latestVersion.getVersionType()))
for (; (VersionType.MAJOR != latestVersion.getVersionType()) && versionsIterator.hasNext(); latestVersion = versionsIterator.next())
{
VersionHistory versionHistory = versionService.getVersionHistory(latestVersion.getFrozenStateNodeRef());
if (null != versionHistory)
{
for (latestVersion = versionHistory.getPredecessor(latestVersion); (null != latestVersion) && (VersionType.MAJOR != latestVersion.getVersionType()); latestVersion = versionHistory
.getPredecessor(latestVersion))
{
}
}
if ((null != latestVersion) && (null != latestVersion.getFrozenStateNodeRef()))
{
latestVersionNodeRef = latestVersion.getFrozenStateNodeRef();
}
}
latestVersion = (VersionType.MAJOR != latestVersion.getVersionType()) ? (null) : (latestVersion);
}
if ((null != latestVersion) && (null != latestVersion.getVersionLabel()))
{
latestVersionNodeRef = (!latestVersion.getVersionLabel().equals(currentVersionLabel) || (null == latestVersion.getVersionedNodeRef()) || !nodeService
.exists(latestVersion.getVersionedNodeRef())) ? (latestVersion.getFrozenStateNodeRef()) : (latestVersion.getVersionedNodeRef());
}
}

View File

@@ -476,7 +476,7 @@ public class PropertyUtil
return PropertyCheckingStateEnum.PROPERTY_NOT_UPDATABLE;
}
if (propertyDefinition.isRequired() && (value == null))
if (propertyDefinition.isRequired() && (null == value))
{
throw cmisObjectsUtils.createCmisException((propertyName + " property required"), EnumServiceException.CONSTRAINT);
}
@@ -499,7 +499,7 @@ public class PropertyUtil
return PropertyCheckingStateEnum.PROPERTY_CHECKED;
}
private enum PropertyCheckingStateEnum
public enum PropertyCheckingStateEnum
{
PROPERTY_CHECKED, PROPERTY_NATIVE, PROPERTY_NOT_UPDATABLE;
}
@@ -733,25 +733,6 @@ public class PropertyUtil
return property;
}
case XML:
{
CmisPropertyXml property = new CmisPropertyXml();
property.setPdid(pdid);
if (value instanceof Collection)
{
for (CmisPropertyXml.Value propertyValue : (Collection<CmisPropertyXml.Value>) value)
{
property.getValue().add(propertyValue);
}
}
else
{
property.getValue().add((CmisPropertyXml.Value) value);
}
return property;
}
case HTML:
{
CmisPropertyHtml property = new CmisPropertyHtml();