Merged MNT-17845-5.2.N (5.2.2) to 5.2.N (5.2.2)

137726 jvonka: REPO-2516 - MNT-17845 : Smart Folders - node id (sys:node-uuid) that starts with 'v'
   - step 2 (experimental => sub-optimal) fix to also handle non-virtual node ids that happen to start with 'v0', 'vH', 'vP' (including simple unit test)
   - requires refactor to avoid parsing twice (ie. most usages of isReference + fromNodeRef)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@137781 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ancuta Morarasu
2017-06-23 11:32:04 +00:00
parent 069d6bcc57
commit 689c4cac70
2 changed files with 52 additions and 14 deletions

View File

@@ -80,7 +80,33 @@ public class Reference
Encoding encoding = Encodings.fromToken(token);
if (encoding != null)
{
return true;
//
// TODO experimental step 2 (sub-optimal) - remove & refactor so that we don't parse twice (for smart folder virtual ids)
//
try
{
Reference ref = fromNodeRef(nodeRef);
if (ref != null)
{
return true;
}
}
catch (ReferenceParseException rpe)
{
// ignore
if (logger.isTraceEnabled())
{
logger.trace("Ignore parse exception: "+rpe.getMessage());
}
}
catch (ReferenceEncodingException ree)
{
// ignore
if (logger.isTraceEnabled())
{
logger.trace("Ignore encoding exception: "+ree.getMessage());
}
}
}
}