mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-22 15:12:38 +00:00
Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)
100983: Merged 5.0.N (5.0.2) to HEAD-BUG-FIX (5.1/Cloud)
100824: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.2)
100184: Merged V4.1-BUG-FIX (4.1.10) to V4.2-BUG-FIX (4.2.5)
100131 : Merged DEV to V4.1-BUG-FIX (4.1.10)
99521 : MNT-9088 : Ghost versions when Document is created with CheckinType CHECKOUT
- Don't include PWC in a version series
99824 : MNT-9088 : Ghost versions when Document is created with CheckinType CHECKOUT
- Return PWC as a part of version series. Fixes to pass TCK
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@100998 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -149,7 +149,11 @@
|
||||
</entry>
|
||||
</map>
|
||||
</property>
|
||||
|
||||
<property name="ignoreChildren">
|
||||
<set>
|
||||
<value>cm:checkedOut</value>
|
||||
</set>
|
||||
</property>
|
||||
<property name="openHttpSession" value="${opencmis.connector.default.openHttpSession}" />
|
||||
|
||||
<property name="OpenCMISDictionaryService" ref="OpenCMISDictionaryService" />
|
||||
@@ -185,6 +189,7 @@
|
||||
<property name="dictionaryService" ref="DictionaryService" />
|
||||
<property name="behaviourFilter" ref="policyBehaviourFilter" />
|
||||
<property name="eventPublisher" ref="eventPublisher" />
|
||||
<property name="dictionaryDAO" ref="dictionaryDAO" />
|
||||
|
||||
<property name="bulkMaxItems" value="${opencmis.bulkUpdateProperties.maxItemsSize}" />
|
||||
<property name="bulkBatchSize" value="${opencmis.bulkUpdateProperties.batchSize}" />
|
||||
|
||||
@@ -30,6 +30,7 @@ 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;
|
||||
@@ -2215,9 +2216,9 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
|
||||
List<ObjectData> result = new ArrayList<ObjectData>();
|
||||
|
||||
// what kind of object is it?
|
||||
CMISNodeInfo info = getOrCreateNodeInfo(versionSeriesId, "Version Series");
|
||||
CMISNodeInfo info = getOrCreateNodeInfo(objectId);
|
||||
|
||||
if (!info.isVariant(CMISObjectVariant.CURRENT_VERSION))
|
||||
if (!EnumSet.of(CMISObjectVariant.CURRENT_VERSION, CMISObjectVariant.PWC, CMISObjectVariant.VERSION).contains(info.getObjectVariant()))
|
||||
{
|
||||
// the version series id is the id of current version, which is a
|
||||
// document
|
||||
@@ -2228,7 +2229,7 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
|
||||
NodeRef nodeRef = info.getNodeRef();
|
||||
VersionHistory versionHistory = ((CMISNodeInfoImpl) info).getVersionHistory();
|
||||
|
||||
if (versionHistory == null)
|
||||
if (versionHistory == null || info.isPWC())
|
||||
{
|
||||
// add current version
|
||||
result.add(connector.createCMISObject(info, filter, includeAllowableActions, IncludeRelationships.NONE,
|
||||
|
||||
@@ -72,10 +72,14 @@ 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;
|
||||
@@ -242,7 +246,7 @@ import org.springframework.util.StringUtils;
|
||||
* @author Derek Hulley
|
||||
* @author steveglover
|
||||
*/
|
||||
public class CMISConnector implements ApplicationContextAware, ApplicationListener<ApplicationContextEvent>, TenantDeployer
|
||||
public class CMISConnector implements ApplicationContextAware, ApplicationListener<ApplicationContextEvent>, TenantDeployer, DictionaryListener
|
||||
{
|
||||
private static Log logger = LogFactory.getLog(CMISConnector.class);
|
||||
|
||||
@@ -324,12 +328,15 @@ 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<String, List<String>> kindToRenditionNames;
|
||||
private Set<String> ignoreChildren = Collections.emptySet();
|
||||
private Set<QName> ignoreChildrenQNames = Collections.emptySet();
|
||||
|
||||
// note: cache is tenant-aware (if using TransctionalCache impl)
|
||||
|
||||
@@ -461,6 +468,11 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
|
||||
this.kindToRenditionNames = renditionKinds;
|
||||
}
|
||||
|
||||
public void setIgnoreChildren(Set<String> ignoreChildren)
|
||||
{
|
||||
this.ignoreChildren = ignoreChildren;
|
||||
}
|
||||
|
||||
public void setOpenHttpSession(boolean openHttpSession)
|
||||
{
|
||||
this.openHttpSession = openHttpSession;
|
||||
@@ -499,6 +511,11 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
|
||||
this.behaviourFilter = behaviourFilter;
|
||||
}
|
||||
|
||||
public void setDictionaryDAO(DictionaryDAO dictionaryDAO)
|
||||
{
|
||||
this.dictionaryDAO = dictionaryDAO;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the node service.
|
||||
*/
|
||||
@@ -816,6 +833,7 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Failed to create CMIS temporary directory");
|
||||
}
|
||||
dictionaryDAO.register(this);
|
||||
}
|
||||
|
||||
public void init()
|
||||
@@ -3902,6 +3920,11 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
|
||||
return descriptorService.getCurrentRepositoryDescriptor().getId();
|
||||
}
|
||||
|
||||
public PagingResults<FileInfo> getChildren(NodeRef folderNodeRef, List<Pair<QName, Boolean>> sortProps, PagingRequest pageRequest)
|
||||
{
|
||||
return fileFolderService.list(folderNodeRef, true, true, ignoreChildrenQNames, sortProps, pageRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the repository info object.
|
||||
*/
|
||||
@@ -4049,4 +4072,41 @@ 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<QName>(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()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ import org.alfresco.opencmis.dictionary.RelationshipTypeDefintionWrapper;
|
||||
import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper;
|
||||
import org.alfresco.repo.security.permissions.AccessDeniedException;
|
||||
import org.alfresco.repo.version.Version2Model;
|
||||
import org.alfresco.repo.version.VersionBaseModel;
|
||||
import org.alfresco.repo.version.VersionModel;
|
||||
import org.alfresco.service.cmr.repository.AssociationRef;
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
@@ -598,7 +597,7 @@ public class CMISNodeInfoImpl implements CMISNodeInfo
|
||||
|
||||
public boolean isLatestVersion()
|
||||
{
|
||||
return isCurrentVersion();
|
||||
return (isCurrentVersion() && !hasPWC()) || isPWC();
|
||||
}
|
||||
|
||||
public boolean isLatestMajorVersion()
|
||||
@@ -899,16 +898,18 @@ 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??
|
||||
|
||||
Reference in New Issue
Block a user