BUG-ID: CS-27662: ListTags API is ignoring the resourceID and displaying

all the tags of all resources.
Reviewed-by: Frank
This commit is contained in:
Min Chen 2014-11-17 15:04:03 -08:00
parent d2d448c401
commit 3014fd0089

View File

@ -653,9 +653,8 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
sb.and("value", sb.entity().getValue(), SearchCriteria.Op.EQ);
if (resourceId != null) {
sb.and().op("resourceId", sb.entity().getResourceId(), SearchCriteria.Op.EQ);
sb.or("resourceUuid", sb.entity().getResourceUuid(), SearchCriteria.Op.EQ);
sb.cp();
sb.and("resourceId", sb.entity().getResourceId(), SearchCriteria.Op.EQ);
sb.and("resourceUuid", sb.entity().getResourceUuid(), SearchCriteria.Op.EQ);
}
sb.and("resourceType", sb.entity().getResourceType(), SearchCriteria.Op.EQ);
@ -675,8 +674,13 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
}
if (resourceId != null) {
sc.setParameters("resourceId", resourceId);
sc.setParameters("resourceUuid", resourceId);
try {
long rid = Long.parseLong(resourceId);
sc.setParameters("resourceId", rid);
} catch (NumberFormatException ex) {
// internal id instead of resource id is passed
sc.setParameters("resourceUuid", resourceId);
}
}
if (resourceType != null) {