if (!isFirstOfWhereClause) query.append(" and ");
query.append("v.access = 1 and user.properties['institutionalName']= :institution ");
isFirstOfWhereClause = false;
DBQuery dbQuery = DBFactory.getInstance().createQuery(query.toString());
dbQuery.setString("institution", institution);
if (var_author) {
dbQuery.setString("author", author);
}
if (var_displayname) {
dbQuery.setString("displayname", displayName);
}
if (var_desc) {
dbQuery.setString("desc", desc);
}
if (var_resourcetypes) {
dbQuery.setParameterList("resourcetypes", resourceTypes, Hibernate.STRING);
}
List result = dbQuery.list();
result.addAll(runGenericANDQueryWithRolesRestriction(displayName, author, desc, resourceTypes, roles));
return result;
} else {
return runGenericANDQueryWithRolesRestriction(displayName, author, desc, resourceTypes, roles);
}