Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)

79326: Merged EOL to HEAD-BUG-FIX (5.0/Cloud)
      79090: ACE-2013 EOL JCR, JCR-RMI, etc in 5.0
         - Removed references to http://www.jcp.org/jcr (left in web-scripts-application-context.xml
           and multiple versions of opencmis-gnamefilter-context.xml)
      78990: ACE-2013 EOL JCR, JCR-RMI, etc in 5.0
         - Removing references to "jcr-xpath" - Biggest changes were to: DocumentNavigator, NodeServiceXPath and NodeSearcher
         - SearcherComponentTest has a lot of tests removed that appeared to be JCR specific
         - There are still a lot of namespace references in XML files to http://www.jcp.org/jcr/1.0 etc.
         - Left a few  references to "JSR 170" and JCR in java classes as they looked like they might be common with other bits.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@82708 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Will Abson
2014-09-03 15:21:53 +00:00
parent ef18c89175
commit c717551907
27 changed files with 51 additions and 1998 deletions

View File

@@ -75,53 +75,11 @@ public class NodeSearcher
try
{
String xpath = xpathIn;
boolean useJCRXPath = language.equalsIgnoreCase(SearchService.LANGUAGE_JCR_XPATH);
List<AttributeOrder> order = null;
// replace element
if (useJCRXPath)
{
order = new ArrayList<AttributeOrder>();
// We do not allow variable substitution with this pattern
xpath = xpath.replaceAll("element\\(\\s*(\\*|\\w*:\\w*)\\s*,\\s*(\\*|\\w*:\\w*)\\s*\\)",
"$1[subtypeOf(\"$2\")]");
String split[] = xpath.split("order\\s*by\\s*", 2);
xpath = split[0];
if (split.length > 1 && split[1].length() > 0)
{
String clauses[] = split[1].split("\\s,\\s");
for (String clause : clauses)
{
if (clause.startsWith("@"))
{
String attribute = clause.replaceFirst("@(\\p{Alpha}[\\w:]*)(?:\\s+(.*))?", "$1");
String sort = clause.replaceFirst("@(\\p{Alpha}[\\w:]*)(?:\\s+(.*))?", "$2");
if (sort.length() == 0)
{
sort = "ascending";
}
QName attributeQName = QName.createQName(attribute, namespacePrefixResolver);
order.add(new AttributeOrder(attributeQName, sort.equalsIgnoreCase("ascending")));
}
else if (clause.startsWith("jcr:score"))
{
// ignore jcr:score ordering
}
else
{
throw new IllegalArgumentException("Malformed order by expression " + split[1]);
}
}
}
}
DocumentNavigator documentNavigator = new DocumentNavigator(dictionaryService, nodeService, searchService,
namespacePrefixResolver, followAllParentLinks, useJCRXPath);
namespacePrefixResolver, followAllParentLinks);
NodeServiceXPath nsXPath = new NodeServiceXPath(xpath, documentNavigator, paramDefs);
for (String prefix : namespacePrefixResolver.getPrefixes())
{
@@ -236,10 +194,8 @@ public class NodeSearcher
{
try
{
boolean useJCRXPath = language.equalsIgnoreCase(SearchService.LANGUAGE_JCR_XPATH);
DocumentNavigator documentNavigator = new DocumentNavigator(dictionaryService, nodeService, searchService,
namespacePrefixResolver, followAllParentLinks, useJCRXPath);
namespacePrefixResolver, followAllParentLinks);
NodeServiceXPath nsXPath = new NodeServiceXPath(xpath, documentNavigator, paramDefs);
for (String prefix : namespacePrefixResolver.getPrefixes())
{