mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-15 15:02:20 +00:00
Merged HEAD-BUG-FIX (Cloud33/4.3) to HEAD (Cloud33/4.3)
62917: Merged PLATFORM1 (Cloud33) to HEAD-BUG-FIX (Cloud33/4.3) 62451: ACE-33 - CMIS item support. CRUD of cmis items, cmis item shown as children of folders. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@62971 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -30,8 +30,10 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
@@ -462,11 +464,19 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
|
|||||||
|
|
||||||
PagingRequest pageRequest = new PagingRequest(skip, max, null);
|
PagingRequest pageRequest = new PagingRequest(skip, max, null);
|
||||||
pageRequest.setRequestTotalCountMax(skip + 10000); // TODO make this optional/configurable
|
pageRequest.setRequestTotalCountMax(skip + 10000); // TODO make this optional/configurable
|
||||||
// - affects whether numItems may be returned
|
// - affects whether numItems may be returned
|
||||||
|
Set<QName> typeqnames = new HashSet<QName>();
|
||||||
|
List<TypeDefinitionWrapper> allTypes = connector.getOpenCMISDictionaryService().getAllTypes();
|
||||||
|
for (TypeDefinitionWrapper type : allTypes)
|
||||||
|
{
|
||||||
|
typeqnames.add(type.getAlfrescoClass());
|
||||||
|
}
|
||||||
PagingResults<FileInfo> pageOfNodeInfos = connector.getFileFolderService().list(
|
PagingResults<FileInfo> pageOfNodeInfos = connector.getFileFolderService().list(
|
||||||
folderNodeRef, true, true,
|
folderNodeRef,
|
||||||
null, sortProps, pageRequest);
|
typeqnames,
|
||||||
|
null, //ignoreAspectQNames,
|
||||||
|
sortProps,
|
||||||
|
pageRequest);
|
||||||
|
|
||||||
if (max > 0)
|
if (max > 0)
|
||||||
{
|
{
|
||||||
@@ -733,7 +743,7 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
|
|||||||
throw new CmisConstraintException("Relationships are not fileable!");
|
throw new CmisConstraintException("Relationships are not fileable!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.isFolder() && !info.isRootFolder())
|
if (info.isItem() || (info.isFolder() && !info.isRootFolder()))
|
||||||
{
|
{
|
||||||
List<CMISNodeInfo> parentInfos = info.getParents();
|
List<CMISNodeInfo> parentInfos = info.getParents();
|
||||||
if (!parentInfos.isEmpty())
|
if (!parentInfos.isEmpty())
|
||||||
@@ -1072,11 +1082,21 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
|
|||||||
NamespaceService.CONTENT_MODEL_1_0_URI,
|
NamespaceService.CONTENT_MODEL_1_0_URI,
|
||||||
QName.createValidLocalName(name));
|
QName.createValidLocalName(name));
|
||||||
|
|
||||||
ChildAssociationRef newRef = connector.getNodeService().createNode(parentInfo.getNodeRef(), ContentModel.ASSOC_CONTAINS, assocQName, type.getAlfrescoClass());
|
Map<QName, Serializable> props = new HashMap<QName, Serializable>(11);
|
||||||
|
props.put(ContentModel.PROP_NAME, (Serializable) assocQName.getLocalName());
|
||||||
|
|
||||||
|
ChildAssociationRef newRef = connector.getNodeService().createNode(
|
||||||
|
parentInfo.getNodeRef(),
|
||||||
|
ContentModel.ASSOC_CONTAINS,
|
||||||
|
assocQName,
|
||||||
|
type.getAlfrescoClass(),
|
||||||
|
props);
|
||||||
|
|
||||||
NodeRef nodeRef = newRef.getChildRef();
|
NodeRef nodeRef = newRef.getChildRef();
|
||||||
|
|
||||||
connector.setProperties(nodeRef, type, properties, new String[] { PropertyIds.NAME, PropertyIds.OBJECT_TYPE_ID });
|
connector.setProperties(nodeRef, type, properties, new String[] { PropertyIds.NAME, PropertyIds.OBJECT_TYPE_ID });
|
||||||
|
connector.getNodeService().setProperty(nodeRef, ContentModel.PROP_NAME, assocQName.getLocalName());
|
||||||
|
|
||||||
connector.applyPolicies(nodeRef, type, policies);
|
connector.applyPolicies(nodeRef, type, policies);
|
||||||
connector.applyACL(nodeRef, type, addAces, removeAces);
|
connector.applyACL(nodeRef, type, addAces, removeAces);
|
||||||
|
|
||||||
@@ -2780,6 +2800,11 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr
|
|||||||
info.setSupportsDescendants(true);
|
info.setSupportsDescendants(true);
|
||||||
info.setSupportsFolderTree(true);
|
info.setSupportsFolderTree(true);
|
||||||
}
|
}
|
||||||
|
else if (ni.isItem())
|
||||||
|
{
|
||||||
|
info.setHasAcl(true);
|
||||||
|
info.setHasContent(false);
|
||||||
|
}
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
@@ -58,6 +58,8 @@ import org.alfresco.opencmis.dictionary.CMISNodeInfo;
|
|||||||
import org.alfresco.opencmis.dictionary.CMISObjectVariant;
|
import org.alfresco.opencmis.dictionary.CMISObjectVariant;
|
||||||
import org.alfresco.opencmis.dictionary.CMISPropertyAccessor;
|
import org.alfresco.opencmis.dictionary.CMISPropertyAccessor;
|
||||||
import org.alfresco.opencmis.dictionary.DocumentTypeDefinitionWrapper;
|
import org.alfresco.opencmis.dictionary.DocumentTypeDefinitionWrapper;
|
||||||
|
import org.alfresco.opencmis.dictionary.FolderTypeDefintionWrapper;
|
||||||
|
import org.alfresco.opencmis.dictionary.ItemTypeDefinitionWrapper;
|
||||||
import org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper;
|
import org.alfresco.opencmis.dictionary.PropertyDefinitionWrapper;
|
||||||
import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper;
|
import org.alfresco.opencmis.dictionary.TypeDefinitionWrapper;
|
||||||
import org.alfresco.opencmis.mapping.DirectProperty;
|
import org.alfresco.opencmis.mapping.DirectProperty;
|
||||||
@@ -1262,15 +1264,15 @@ public class CMISConnector implements ApplicationContextAware, ApplicationListen
|
|||||||
*/
|
*/
|
||||||
public String createObjectId(NodeRef currentVersionNodeRef)
|
public String createObjectId(NodeRef currentVersionNodeRef)
|
||||||
{
|
{
|
||||||
FileInfo fileInfo = getFileFolderService().getFileInfo(currentVersionNodeRef);
|
QName typeQName = nodeService.getType(currentVersionNodeRef);
|
||||||
|
TypeDefinitionWrapper type = getOpenCMISDictionaryService().findNodeType(typeQName);
|
||||||
if(fileInfo == null)
|
|
||||||
|
if(type instanceof ItemTypeDefinitionWrapper)
|
||||||
{
|
{
|
||||||
// not a file or a folder
|
|
||||||
return constructObjectId(currentVersionNodeRef, null);
|
return constructObjectId(currentVersionNodeRef, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fileInfo.isFolder())
|
if(type instanceof FolderTypeDefintionWrapper)
|
||||||
{
|
{
|
||||||
return constructObjectId(currentVersionNodeRef, null);
|
return constructObjectId(currentVersionNodeRef, null);
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -429,4 +429,18 @@ public interface FileFolderService
|
|||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void setHidden(NodeRef nodeRef, boolean isHidden);
|
public void setHidden(NodeRef nodeRef, boolean isHidden);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lists page of immediate child objects of the given context node
|
||||||
|
* with specification of which types to list and optional filtering (exclusion of certain child file/folder subtypes) and sorting
|
||||||
|
* @param rootNodeRef
|
||||||
|
* @param searchTypeQNames QNames of types to list
|
||||||
|
* @param ignoreAspectQNames
|
||||||
|
* @param sortProps
|
||||||
|
* @param pagingRequest
|
||||||
|
* @return list of node refs, never null
|
||||||
|
*/
|
||||||
|
@Auditable(parameters = {"rootNodeRef"})
|
||||||
|
public PagingResults<FileInfo> list(NodeRef rootNodeRef, Set<QName> searchTypeQNames, Set<QName> ignoreAspectQNames, List<Pair<QName, Boolean>> sortProps, PagingRequest pagingRequest);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user