Search in sources :

Example 1 with SearchReindexEvent

use of fi.otavanopisto.muikku.search.SearchReindexEvent in project muikku by otavanopisto.

the class SystemReindexBackingBean method init.

@RequestAction
public String init() {
    if (sessionController.hasPermission(MuikkuPermissions.ADMIN, null)) {
        List<Task> tasks = null;
        if (StringUtils.isNotBlank(getTask())) {
            Task task = EnumUtils.getEnum(Task.class, getTask());
            if (task == null) {
                return NavigationRules.INTERNAL_ERROR;
            } else {
                tasks = Arrays.asList(task);
            }
        } else {
            tasks = Arrays.asList(Task.values());
        }
        reindexEvent.fire(new SearchReindexEvent(tasks, resume != null ? resume : false));
    }
    return "/index.jsf?faces-redirect=true";
}
Also used : Task(fi.otavanopisto.muikku.search.SearchReindexEvent.Task) SearchReindexEvent(fi.otavanopisto.muikku.search.SearchReindexEvent) RequestAction(org.ocpsoft.rewrite.annotation.RequestAction)

Aggregations

SearchReindexEvent (fi.otavanopisto.muikku.search.SearchReindexEvent)1 Task (fi.otavanopisto.muikku.search.SearchReindexEvent.Task)1 RequestAction (org.ocpsoft.rewrite.annotation.RequestAction)1