예제 #1
0
 @ModelAttribute("filters")
 public static List<TrackerFilterEnum> getFilter(HttpServletRequest request) {
   Template tmpl = Template.getTemplate(request);
   if (tmpl.isSessionAuthorized()) {
     return Arrays.asList(TrackerFilterEnum.values());
   } else {
     List<TrackerFilterEnum> trackerFilters = new ArrayList<>();
     for (TrackerFilterEnum trackerFilter : TrackerFilterEnum.values()) {
       if ("mine".equals(trackerFilter.getValue())) {
         continue;
       }
       trackerFilters.add(trackerFilter);
     }
     return trackerFilters;
   }
 }
예제 #2
0
 static {
   filterValues = new HashSet<>();
   for (TrackerFilterEnum eventFilter : TrackerFilterEnum.values()) {
     filterValues.add(eventFilter.getValue());
   }
 }