Ejemplo n.º 1
0
 public void deleteByIds(Set<Long> ids) {
   for (Long id : ids) {
     Resource resource = resourceDAO.getById(id);
     resourceDAO.delete(resource);
   }
   refreshProtectedResources();
 }
Ejemplo n.º 2
0
 public List<Resource> getAvailableResources(List<Long> notInIds) {
   if (notInIds == null || notInIds.isEmpty()) {
     return resourceDAO.getAll();
   } else {
     Condition condition = new Condition("id", notInIds);
     condition.setOperator(Condition.NOT_IN);
     condition.setValueType(Long.class);
     return resourceDAO.getByCondition(condition);
   }
 }
Ejemplo n.º 3
0
 public ResponseJSON query(QueryObject queryObject) {
   List<Condition> realConditions = new ArrayList<Condition>();
   for (Condition condition : queryObject.getConditions()) {
     if (condition.getValue() == null || !StringUtils.hasText(condition.getValue().toString())) {
       continue;
     }
     if (condition.getKey().equals("name") || condition.getKey().equals("url")) {
       condition.setOperator(Condition.LIKE);
       realConditions.add(condition);
     }
   }
   queryObject.setConditions(realConditions);
   ResponseJSON json = resourceDAO.getAll(queryObject);
   return json;
 }
Ejemplo n.º 4
0
 public Resource getResourceById(Long id) {
   return resourceDAO.getById(id);
 }
Ejemplo n.º 5
0
 public List<Resource> getAllEnabledResources() {
   List<Resource> resources = resourceDAO.getByProperty("disabled", false);
   return resources;
 }
Ejemplo n.º 6
0
 public List<Resource> getAllResources() {
   List<Resource> resources = resourceDAO.getAll();
   return resources;
 }
Ejemplo n.º 7
0
 @Override
 public <T extends BaseEntity> void delete(T model) {
   resourceDAO.delete(model);
   refreshProtectedResources();
 }