@Override
 public String batchDelete(
     Model model,
     @RequestParam("items") Long[] items,
     HttpServletRequest request,
     HttpServletResponse response)
     throws RebirthException {
   List<CircleTopicEntity> list =
       circleService.findByIds(CircleTopicEntity.class, Arrays.asList(items));
   circleService.delete(list);
   return "circle/circleDeatil";
 }
Пример #2
0
  // Consider return map in future.
  private static List<String> fetchPartialKey(Map<String, String> map, String key) {
    List<String> keywords = Arrays.asList(key.split("\\{INDEX\\}"));
    List<String> listStr = new ArrayList<>();

    for (Map.Entry<String, String> e : map.entrySet()) {
      String numStr = e.getKey().toUpperCase();
      for (String keyword : keywords) {
        numStr = StringUtils.remove(numStr, keyword);
      }
      if (NumberUtils.isDigits(numStr)) {
        listStr.add(e.getValue());
      }
    }
    return listStr;
  }
  @PostFilter("hasPermission(filterObject, 'read')")
  public List<PersonMatch> searchForPersonBy(final SearchCriteria searchCriteria) {

    if (StringUtils.hasText(searchCriteria.getIdentifierValue())) {
      final String identifierValue = searchCriteria.getIdentifierValue();
      final Person person =
          this.findPersonByIdentifier(
              searchCriteria.getIdentifierType().getName(), identifierValue);
      if (person != null)
        return new ArrayList<PersonMatch>(
            Arrays.asList(new PersonMatchImpl(person, 100, new ArrayList<FieldMatch>())));
      else return new ArrayList<PersonMatch>();
    }
    final List<Person> persons = this.personRepository.searchByCriteria(searchCriteria);
    return createMatches(persons);
  }