Merged HEAD (5.2) to 5.2.N (5.2.1)

126402 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2)
      121221 jvonka: FileFolder API - minor update for get/list node info (aspectNames & properties)
      - now hides all "sys" aspects & properties (not just "referenceable" & "localizable")
      - pre-work (eg. before implementing "move") 
      - in the future, we could add advanced query option to also return these 
      RA-634, RA-638


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126747 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ancuta Morarasu
2016-05-11 11:02:54 +00:00
parent d559c54151
commit a4b84d0d05

View File

@@ -204,10 +204,13 @@ public class NodesImpl implements Nodes
this.defaultIgnoreTypes = ignoreTypes; this.defaultIgnoreTypes = ignoreTypes;
} }
private static final List<QName> EXCLUDED_ASPECTS = Arrays.asList( // excluded namespaces (aspects and properties)
ContentModel.ASPECT_REFERENCEABLE, private static final List<String> EXCLUDED_NS = Arrays.asList(NamespaceService.SYSTEM_MODEL_1_0_URI);
ContentModel.ASPECT_LOCALIZED);
// excluded aspects
private static final List<QName> EXCLUDED_ASPECTS = Arrays.asList();
// excluded properties
private static final List<QName> EXCLUDED_PROPS = Arrays.asList( private static final List<QName> EXCLUDED_PROPS = Arrays.asList(
// top-level minimal info // top-level minimal info
ContentModel.PROP_NAME, ContentModel.PROP_NAME,
@@ -216,13 +219,6 @@ public class NodesImpl implements Nodes
ContentModel.PROP_CREATOR, ContentModel.PROP_CREATOR,
ContentModel.PROP_CREATED, ContentModel.PROP_CREATED,
ContentModel.PROP_CONTENT, ContentModel.PROP_CONTENT,
// sys:localized
ContentModel.PROP_LOCALE,
// sys:referenceable
ContentModel.PROP_NODE_UUID,
ContentModel.PROP_STORE_IDENTIFIER,
ContentModel.PROP_STORE_PROTOCOL,
ContentModel.PROP_NODE_DBID,
// other - TBC // other - TBC
ContentModel.PROP_INITIAL_VERSION, ContentModel.PROP_INITIAL_VERSION,
ContentModel.PROP_AUTO_VERSION_PROPS, ContentModel.PROP_AUTO_VERSION_PROPS,
@@ -477,7 +473,7 @@ public class NodesImpl implements Nodes
} }
} }
private NodeRef getParentNodeRef(final NodeRef nodeRef) private NodeRef getParentNodeRef(NodeRef nodeRef)
{ {
if (repositoryHelper.getCompanyHome().equals(nodeRef)) if (repositoryHelper.getCompanyHome().equals(nodeRef))
{ {
@@ -788,11 +784,11 @@ public class NodesImpl implements Nodes
{ {
// return all properties // return all properties
selectedProperties = new ArrayList<>(nodeProps.size()); selectedProperties = new ArrayList<>(nodeProps.size());
for (QName name : nodeProps.keySet()) for (QName propQName : nodeProps.keySet())
{ {
if (!EXCLUDED_PROPS.contains(name)) if ((! EXCLUDED_NS.contains(propQName.getNamespaceURI())) && (! EXCLUDED_PROPS.contains(propQName)))
{ {
selectedProperties.add(name); selectedProperties.add(propQName);
} }
} }
} }
@@ -832,11 +828,11 @@ public class NodesImpl implements Nodes
{ {
List<String> aspectNames = new ArrayList<>(nodeAspects.size()); List<String> aspectNames = new ArrayList<>(nodeAspects.size());
for (QName aspectName : nodeAspects) for (QName aspectQName : nodeAspects)
{ {
if (! EXCLUDED_ASPECTS.contains(aspectName)) if ((! EXCLUDED_NS.contains(aspectQName.getNamespaceURI())) && (! EXCLUDED_ASPECTS.contains(aspectQName)))
{ {
aspectNames.add(aspectName.toPrefixString(namespaceService)); aspectNames.add(aspectQName.toPrefixString(namespaceService));
} }
} }
@@ -1101,7 +1097,7 @@ public class NodesImpl implements Nodes
for (QName aspectQName : aspectQNames) for (QName aspectQName : aspectQNames)
{ {
if (EXCLUDED_ASPECTS.contains(aspectQName) || aspectQName.equals(ContentModel.ASPECT_AUDITABLE)) if (EXCLUDED_NS.contains(aspectQName.getNamespaceURI()) || EXCLUDED_ASPECTS.contains(aspectQName) || aspectQName.equals(ContentModel.ASPECT_AUDITABLE))
{ {
continue; // ignore continue; // ignore
} }
@@ -1114,7 +1110,7 @@ public class NodesImpl implements Nodes
for (QName existingAspect : existingAspects) for (QName existingAspect : existingAspects)
{ {
if (EXCLUDED_ASPECTS.contains(existingAspect) || existingAspect.equals(ContentModel.ASPECT_AUDITABLE)) if (EXCLUDED_NS.contains(existingAspect.getNamespaceURI()) || EXCLUDED_ASPECTS.contains(existingAspect) || existingAspect.equals(ContentModel.ASPECT_AUDITABLE))
{ {
continue; // ignore continue; // ignore
} }
@@ -1592,7 +1588,7 @@ public class NodesImpl implements Nodes
List<QName> result = new ArrayList<>(qnameStrList.size()); List<QName> result = new ArrayList<>(qnameStrList.size());
for (String str : qnameStrList) for (String str : qnameStrList)
{ {
if (str.startsWith(PREFIX)) if (str.startsWith(PREFIX))
{ {
str = str.substring(PREFIX.length()); str = str.substring(PREFIX.length());
} }