diff --git a/config/alfresco/opencmis-context.xml b/config/alfresco/opencmis-context.xml index 0a5f5319c7..5e18dcc8b4 100644 --- a/config/alfresco/opencmis-context.xml +++ b/config/alfresco/opencmis-context.xml @@ -149,11 +149,7 @@ - - - cm:checkedOut - - + @@ -189,7 +185,6 @@ - diff --git a/source/java/org/alfresco/opencmis/AlfrescoCmisServiceImpl.java b/source/java/org/alfresco/opencmis/AlfrescoCmisServiceImpl.java index 88f156e1a3..2b667e41f1 100644 --- a/source/java/org/alfresco/opencmis/AlfrescoCmisServiceImpl.java +++ b/source/java/org/alfresco/opencmis/AlfrescoCmisServiceImpl.java @@ -30,7 +30,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import java.util.EnumSet; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -486,7 +485,12 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr { typeqnames.add(type.getAlfrescoClass()); } - PagingResults pageOfNodeInfos = connector.getChildren(folderNodeRef, typeqnames, sortProps, pageRequest); + PagingResults pageOfNodeInfos = connector.getFileFolderService().list( + folderNodeRef, + typeqnames, + null, //ignoreAspectQNames, + sortProps, + pageRequest); if (max > 0) { @@ -2304,7 +2308,7 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr List result = new ArrayList(); // what kind of object is it? - CMISNodeInfo info = getOrCreateNodeInfo(objectId); + CMISNodeInfo info = getOrCreateNodeInfo(versionSeriesId, "Version Series"); // when webservices binding is used, objectId points to null and versionSeriesId points to original node instead of PWC // see MNT-13839 @@ -2318,7 +2322,7 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr } } - if (!EnumSet.of(CMISObjectVariant.CURRENT_VERSION, CMISObjectVariant.PWC, CMISObjectVariant.VERSION).contains(info.getObjectVariant())) + if (!info.isVariant(CMISObjectVariant.CURRENT_VERSION)) { // the version series id is the id of current version, which is a // document @@ -2329,7 +2333,7 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr NodeRef nodeRef = info.getNodeRef(); VersionHistory versionHistory = ((CMISNodeInfoImpl) info).getVersionHistory(); - if (versionHistory == null || info.isPWC()) + if (versionHistory == null) { // add current version result.add(connector.createCMISObject(info, filter, includeAllowableActions, IncludeRelationships.NONE, @@ -2352,7 +2356,7 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr pwcInfo, filter, includeAllowableActions, IncludeRelationships.NONE, CMISConnector.RENDITION_NONE, false, false)); - boolean isObjectInfoRequired = getContext().isObjectInfoRequired(); + boolean isObjectInfoRequired = getContext().isObjectInfoRequired(); if (isObjectInfoRequired) { getObjectInfo(repositoryId, pwcInfo.getObjectId(), IncludeRelationships.NONE); @@ -2366,7 +2370,7 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr // MNT-9557 fix. Replace head version with current node info if (versionHistory.getHeadVersion().equals(version)) { - versionInfo = createNodeInfo(info.getCurrentNodeNodeRef()); + versionInfo = createNodeInfo(nodeRef); } result.add( diff --git a/source/java/org/alfresco/opencmis/CMISConnector.java b/source/java/org/alfresco/opencmis/CMISConnector.java index e8e1231139..82deac23d8 100644 --- a/source/java/org/alfresco/opencmis/CMISConnector.java +++ b/source/java/org/alfresco/opencmis/CMISConnector.java @@ -71,14 +71,10 @@ import org.alfresco.opencmis.search.CMISQueryService; import org.alfresco.opencmis.search.CMISResultSet; import org.alfresco.opencmis.search.CMISResultSetColumn; import org.alfresco.opencmis.search.CMISResultSetRow; -import org.alfresco.query.PagingRequest; -import org.alfresco.query.PagingResults; import org.alfresco.repo.Client; import org.alfresco.repo.Client.ClientType; import org.alfresco.repo.action.executer.ContentMetadataExtracter; import org.alfresco.repo.cache.SimpleCache; -import org.alfresco.repo.dictionary.DictionaryDAO; -import org.alfresco.repo.dictionary.DictionaryListener; import org.alfresco.repo.events.EventPreparator; import org.alfresco.repo.events.EventPublisher; import org.alfresco.repo.model.filefolder.GetChildrenCannedQuery; @@ -245,7 +241,7 @@ import org.springframework.util.StringUtils; * @author Derek Hulley * @author steveglover */ -public class CMISConnector implements ApplicationContextAware, ApplicationListener, TenantDeployer, DictionaryListener +public class CMISConnector implements ApplicationContextAware, ApplicationListener, TenantDeployer { private static Log logger = LogFactory.getLog(CMISConnector.class); @@ -328,15 +324,12 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen private CmisActivityPoster activityPoster; private BehaviourFilter behaviourFilter; - private DictionaryDAO dictionaryDAO; private HiddenAspect hiddenAspect; private StoreRef storeRef; private String rootPath; private Map> kindToRenditionNames; - private Set ignoreChildren = Collections.emptySet(); - private Set ignoreChildrenQNames = Collections.emptySet(); // note: cache is tenant-aware (if using TransctionalCache impl) @@ -468,11 +461,6 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen this.kindToRenditionNames = renditionKinds; } - public void setIgnoreChildren(Set ignoreChildren) - { - this.ignoreChildren = ignoreChildren; - } - public void setOpenHttpSession(boolean openHttpSession) { this.openHttpSession = openHttpSession; @@ -511,11 +499,6 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen this.behaviourFilter = behaviourFilter; } - public void setDictionaryDAO(DictionaryDAO dictionaryDAO) - { - this.dictionaryDAO = dictionaryDAO; - } - /** * Sets the node service. */ @@ -833,7 +816,6 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen { throw new AlfrescoRuntimeException("Failed to create CMIS temporary directory"); } - dictionaryDAO.registerListener(this); } public void init() @@ -3928,15 +3910,6 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen return descriptorService.getCurrentRepositoryDescriptor().getId(); } - public PagingResults getChildren(NodeRef folderNodeRef, Set typeqnames, List> sortProps, PagingRequest pageRequest) - { - return fileFolderService.list(folderNodeRef, typeqnames, ignoreChildrenQNames, sortProps, pageRequest); - } - public PagingResults getChildren(NodeRef folderNodeRef, List> sortProps, PagingRequest pageRequest) - { - return fileFolderService.list(folderNodeRef, true, true, ignoreChildrenQNames, sortProps, pageRequest); - } - /** * Creates the repository info object. */ @@ -4084,41 +4057,4 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen } return renditionMapping; } - - /* - * (non-Javadoc) - * @see org.alfresco.repo.dictionary.DictionaryListener#onDictionaryInit() - */ - @Override - public void onDictionaryInit() - { - } - /* - * (non-Javadoc) - * @see org.alfresco.repo.dictionary.DictionaryListener#afterDictionaryInit() - */ - @Override - public void afterDictionaryInit() - { - this.ignoreChildrenQNames = new HashSet(this.ignoreChildren.size(), 1); - for (String prefixString : this.ignoreChildren) - { - try - { - this.ignoreChildrenQNames.add(QName.createQName(prefixString, this.namespaceService)); - } - catch (Exception e) - { - logger.warn("Couldn't create QName from " + prefixString, e); - } - } - } - /* - * (non-Javadoc) - * @see org.alfresco.repo.dictionary.DictionaryListener#afterDictionaryDestroy() - */ - @Override - public void afterDictionaryDestroy() - { - } } diff --git a/source/java/org/alfresco/opencmis/CMISNodeInfoImpl.java b/source/java/org/alfresco/opencmis/CMISNodeInfoImpl.java index 0421773165..e377535556 100644 --- a/source/java/org/alfresco/opencmis/CMISNodeInfoImpl.java +++ b/source/java/org/alfresco/opencmis/CMISNodeInfoImpl.java @@ -640,7 +640,7 @@ public class CMISNodeInfoImpl implements CMISNodeInfo public boolean isLatestVersion() { - return (isCurrentVersion() && !hasPWC()) || isPWC(); + return isCurrentVersion(); } public boolean isLatestMajorVersion() @@ -941,18 +941,16 @@ public class CMISNodeInfoImpl implements CMISNodeInfo private NodeRef getLatestNonMajorVersionNodeRef() { - if (isPWC()) - { - return nodeRef; - } - else if (hasPWC()) - { - return connector.getCheckOutCheckInService().getWorkingCopy(getCurrentNodeNodeRef()); - } - else - { +// if (isPWC()) +// { +// return nodeRef; +// } else if (hasPWC()) +// { +// return connector.getCheckOutCheckInService().getWorkingCopy(getCurrentNodeNodeRef()); +// } else +// { return getCurrentNodeNodeRef(); - } +// } } // TODO lock here??