Merged 5.0.N (5.0.4) to 5.1.N (5.1.1)

120071 rmunteanu: Merged 5.0.3 (5.0.3) to 5.0.N (5.0.4)
      119848 adragoi: Merged DEV to 5.0.3 (5.0.3)
         119808 adragoi: MNT-15338 : CMIS get object by path only shows the working copy file and not the original file
            - reverted commits related to "Ghost versions when Document is created with CheckinType CHECKOUT" stask :  
            100772 : Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.2)
               100260: MNT-13722 : CLONE - Ghost versions when Document is created with CheckinType CHECKOUT
                  - Fix for tests failures
            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
            100837 : Fix another merge issue as a result of a re factor that has taken place in 5.0
               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
            101404 : Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.2)
               101273: Merged DEV to V4.2-GUB-FIX (4.2.5)
                  100792 : MNT-13722 : CLONE - Ghost versions when Document is created with CheckinType CHECKOUT
                     - Added init-method for CMISConnector. Test is added
            101597 : Merged DEV to 5.0.N (5.0.2)
               101560 : MNT-13813 : CLONE - Ghost versions when Document is created with CheckinType CHECKOUT
                  - Fix to test failure


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.1.N/root@120106 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Natalia Smintanca
2015-12-14 12:15:04 +00:00
parent e2d50154b5
commit 4dbb27041f
4 changed files with 23 additions and 90 deletions

View File

@@ -149,11 +149,7 @@
</entry> </entry>
</map> </map>
</property> </property>
<property name="ignoreChildren">
<set>
<value>cm:checkedOut</value>
</set>
</property>
<property name="openHttpSession" value="${opencmis.connector.default.openHttpSession}" /> <property name="openHttpSession" value="${opencmis.connector.default.openHttpSession}" />
<property name="OpenCMISDictionaryService" ref="OpenCMISDictionaryService" /> <property name="OpenCMISDictionaryService" ref="OpenCMISDictionaryService" />
@@ -189,7 +185,6 @@
<property name="dictionaryService" ref="DictionaryService" /> <property name="dictionaryService" ref="DictionaryService" />
<property name="behaviourFilter" ref="policyBehaviourFilter" /> <property name="behaviourFilter" ref="policyBehaviourFilter" />
<property name="eventPublisher" ref="eventPublisher" /> <property name="eventPublisher" ref="eventPublisher" />
<property name="dictionaryDAO" ref="dictionaryDAO" />
<property name="bulkMaxItems" value="${opencmis.bulkUpdateProperties.maxItemsSize}" /> <property name="bulkMaxItems" value="${opencmis.bulkUpdateProperties.maxItemsSize}" />
<property name="bulkBatchSize" value="${opencmis.bulkUpdateProperties.batchSize}" /> <property name="bulkBatchSize" value="${opencmis.bulkUpdateProperties.batchSize}" />

View File

@@ -30,7 +30,6 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.EnumSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
@@ -486,7 +485,12 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
{ {
typeqnames.add(type.getAlfrescoClass()); typeqnames.add(type.getAlfrescoClass());
} }
PagingResults<FileInfo> pageOfNodeInfos = connector.getChildren(folderNodeRef, typeqnames, sortProps, pageRequest); PagingResults<FileInfo> pageOfNodeInfos = connector.getFileFolderService().list(
folderNodeRef,
typeqnames,
null, //ignoreAspectQNames,
sortProps,
pageRequest);
if (max > 0) if (max > 0)
{ {
@@ -2304,7 +2308,7 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
List<ObjectData> result = new ArrayList<ObjectData>(); List<ObjectData> result = new ArrayList<ObjectData>();
// what kind of object is it? // 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 // when webservices binding is used, objectId points to null and versionSeriesId points to original node instead of PWC
// see MNT-13839 // 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 // the version series id is the id of current version, which is a
// document // document
@@ -2329,7 +2333,7 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
NodeRef nodeRef = info.getNodeRef(); NodeRef nodeRef = info.getNodeRef();
VersionHistory versionHistory = ((CMISNodeInfoImpl) info).getVersionHistory(); VersionHistory versionHistory = ((CMISNodeInfoImpl) info).getVersionHistory();
if (versionHistory == null || info.isPWC()) if (versionHistory == null)
{ {
// add current version // add current version
result.add(connector.createCMISObject(info, filter, includeAllowableActions, IncludeRelationships.NONE, result.add(connector.createCMISObject(info, filter, includeAllowableActions, IncludeRelationships.NONE,
@@ -2366,7 +2370,7 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
// MNT-9557 fix. Replace head version with current node info // MNT-9557 fix. Replace head version with current node info
if (versionHistory.getHeadVersion().equals(version)) if (versionHistory.getHeadVersion().equals(version))
{ {
versionInfo = createNodeInfo(info.getCurrentNodeNodeRef()); versionInfo = createNodeInfo(nodeRef);
} }
result.add( result.add(

View File

@@ -71,14 +71,10 @@ import org.alfresco.opencmis.search.CMISQueryService;
import org.alfresco.opencmis.search.CMISResultSet; import org.alfresco.opencmis.search.CMISResultSet;
import org.alfresco.opencmis.search.CMISResultSetColumn; import org.alfresco.opencmis.search.CMISResultSetColumn;
import org.alfresco.opencmis.search.CMISResultSetRow; 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;
import org.alfresco.repo.Client.ClientType; import org.alfresco.repo.Client.ClientType;
import org.alfresco.repo.action.executer.ContentMetadataExtracter; import org.alfresco.repo.action.executer.ContentMetadataExtracter;
import org.alfresco.repo.cache.SimpleCache; 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.EventPreparator;
import org.alfresco.repo.events.EventPublisher; import org.alfresco.repo.events.EventPublisher;
import org.alfresco.repo.model.filefolder.GetChildrenCannedQuery; import org.alfresco.repo.model.filefolder.GetChildrenCannedQuery;
@@ -245,7 +241,7 @@ import org.springframework.util.StringUtils;
* @author Derek Hulley * @author Derek Hulley
* @author steveglover * @author steveglover
*/ */
public class CMISConnector implements ApplicationContextAware, ApplicationListener<ApplicationContextEvent>, TenantDeployer, DictionaryListener public class CMISConnector implements ApplicationContextAware, ApplicationListener<ApplicationContextEvent>, TenantDeployer
{ {
private static Log logger = LogFactory.getLog(CMISConnector.class); private static Log logger = LogFactory.getLog(CMISConnector.class);
@@ -328,15 +324,12 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
private CmisActivityPoster activityPoster; private CmisActivityPoster activityPoster;
private BehaviourFilter behaviourFilter; private BehaviourFilter behaviourFilter;
private DictionaryDAO dictionaryDAO;
private HiddenAspect hiddenAspect; private HiddenAspect hiddenAspect;
private StoreRef storeRef; private StoreRef storeRef;
private String rootPath; private String rootPath;
private Map<String, List<String>> kindToRenditionNames; 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) // note: cache is tenant-aware (if using TransctionalCache impl)
@@ -468,11 +461,6 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
this.kindToRenditionNames = renditionKinds; this.kindToRenditionNames = renditionKinds;
} }
public void setIgnoreChildren(Set<String> ignoreChildren)
{
this.ignoreChildren = ignoreChildren;
}
public void setOpenHttpSession(boolean openHttpSession) public void setOpenHttpSession(boolean openHttpSession)
{ {
this.openHttpSession = openHttpSession; this.openHttpSession = openHttpSession;
@@ -511,11 +499,6 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
this.behaviourFilter = behaviourFilter; this.behaviourFilter = behaviourFilter;
} }
public void setDictionaryDAO(DictionaryDAO dictionaryDAO)
{
this.dictionaryDAO = dictionaryDAO;
}
/** /**
* Sets the node service. * Sets the node service.
*/ */
@@ -833,7 +816,6 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
{ {
throw new AlfrescoRuntimeException("Failed to create CMIS temporary directory"); throw new AlfrescoRuntimeException("Failed to create CMIS temporary directory");
} }
dictionaryDAO.registerListener(this);
} }
public void init() public void init()
@@ -3928,15 +3910,6 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
return descriptorService.getCurrentRepositoryDescriptor().getId(); return descriptorService.getCurrentRepositoryDescriptor().getId();
} }
public PagingResults<FileInfo> getChildren(NodeRef folderNodeRef, Set<QName> typeqnames, List<Pair<QName, Boolean>> sortProps, PagingRequest pageRequest)
{
return fileFolderService.list(folderNodeRef, typeqnames, ignoreChildrenQNames, sortProps, pageRequest);
}
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. * Creates the repository info object.
*/ */
@@ -4084,41 +4057,4 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
} }
return renditionMapping; 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()
{
}
} }

View File

@@ -640,7 +640,7 @@ public class CMISNodeInfoImpl implements CMISNodeInfo
public boolean isLatestVersion() public boolean isLatestVersion()
{ {
return (isCurrentVersion() && !hasPWC()) || isPWC(); return isCurrentVersion();
} }
public boolean isLatestMajorVersion() public boolean isLatestMajorVersion()
@@ -941,18 +941,16 @@ public class CMISNodeInfoImpl implements CMISNodeInfo
private NodeRef getLatestNonMajorVersionNodeRef() private NodeRef getLatestNonMajorVersionNodeRef()
{ {
if (isPWC()) // if (isPWC())
{ // {
return nodeRef; // return nodeRef;
} // } else if (hasPWC())
else if (hasPWC()) // {
{ // return connector.getCheckOutCheckInService().getWorkingCopy(getCurrentNodeNodeRef());
return connector.getCheckOutCheckInService().getWorkingCopy(getCurrentNodeNodeRef()); // } else
} // {
else
{
return getCurrentNodeNodeRef(); return getCurrentNodeNodeRef();
} // }
} }
// TODO lock here?? // TODO lock here??