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

129170 mmuller: Merged RETURN-OF-THE-API (5.2.0) to 5.2.N (5.2.1)
      128526 amorarasu: REPO-853: Improve REST fwk: Where parameter with invalid operator like where=(inval=true)
          - Added proper error message.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@129344 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alexandru Epure
2016-08-09 14:13:02 +00:00
parent 8076a3abb3
commit b3eda064b3
2 changed files with 12 additions and 8 deletions

View File

@@ -177,7 +177,7 @@ public class MapBasedQueryWalker extends WalkerCallbackAdapter
@Override
public void comparison(int type, String propertyName, String propertyValue)
{
boolean throwError = false;
boolean throwError = false;
if (variablesEnabled && propertyName.startsWith("variables/"))
{
@@ -193,7 +193,7 @@ public class MapBasedQueryWalker extends WalkerCallbackAdapter
}
else
{
throwError = !handleUnmatchedComparison(type, propertyName, propertyValue);
throwError = !handleUnmatchedComparison(type, propertyName, propertyValue);
}
}
else if (type == WhereClauseParser.MATCHES)
@@ -204,7 +204,7 @@ public class MapBasedQueryWalker extends WalkerCallbackAdapter
}
else
{
throwError = !handleUnmatchedComparison(type, propertyName, propertyValue);
throwError = !handleUnmatchedComparison(type, propertyName, propertyValue);
}
}
else if (type == WhereClauseParser.GREATERTHAN)
@@ -215,7 +215,7 @@ public class MapBasedQueryWalker extends WalkerCallbackAdapter
}
else
{
throwError = !handleUnmatchedComparison(type, propertyName, propertyValue);
throwError = !handleUnmatchedComparison(type, propertyName, propertyValue);
}
}
else if (type == WhereClauseParser.GREATERTHANOREQUALS)
@@ -226,7 +226,7 @@ public class MapBasedQueryWalker extends WalkerCallbackAdapter
}
else
{
throwError = !handleUnmatchedComparison(type, propertyName, propertyValue);
throwError = !handleUnmatchedComparison(type, propertyName, propertyValue);
}
}
else if (type == WhereClauseParser.LESSTHAN)
@@ -237,7 +237,7 @@ public class MapBasedQueryWalker extends WalkerCallbackAdapter
}
else
{
throwError = !handleUnmatchedComparison(type, propertyName, propertyValue);
throwError = !handleUnmatchedComparison(type, propertyName, propertyValue);
}
}
else if (type == WhereClauseParser.LESSTHANOREQUALS)
@@ -248,7 +248,7 @@ public class MapBasedQueryWalker extends WalkerCallbackAdapter
}
else
{
throwError = !handleUnmatchedComparison(type, propertyName, propertyValue);
throwError = !handleUnmatchedComparison(type, propertyName, propertyValue);
}
}
else
@@ -257,7 +257,10 @@ public class MapBasedQueryWalker extends WalkerCallbackAdapter
}
}
if (throwError) { throw new InvalidArgumentException(type + " is not allowed for 'scope' comparison."); }
if (throwError)
{
throw new InvalidArgumentException("framework.exception.InvalidProperty", new Object[] {propertyName, propertyValue, WhereClauseParser.tokenNames[type]});
}
}
public String getProperty(String propertyName, int type)