1 package org.splat.simer.admin;
6 import org.splat.service.SearchService;
7 import org.splat.simer.Action;
10 * Action for updating lucene index.
12 * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
14 public class DatabaseIndexingAction extends Action {
19 private static final long serialVersionUID = 4194268823457749655L;
21 private List<ImportedStudy> newstudies;
22 private String indices;
23 private ImportedStudy _importedStudy;
25 * Injected search service.
27 private SearchService _searchService;
29 // ==============================================================================================================================
31 // ==============================================================================================================================
34 * Initialize the action.
37 public String doInitialize() {
38 newstudies = getImportedStudy().selectAll();
47 public String doIndexing() {
48 String[] ridlist = indices.split(",");
49 @SuppressWarnings("unchecked")
50 Map<String, Object> filter = (Map<String, Object>) getSession().get(
52 getSearchService().reindexStudies(ridlist);
53 filter.put("owner", "all"); // Just in case of 1st study search
58 // ==============================================================================================================================
59 // Getters and setters
60 // ==============================================================================================================================
63 * Get the new studies.
65 * @return the new studies
67 public List<ImportedStudy> getNewStudies() {
68 // -------------------------------------------
73 * Get the importedStudy.
75 * @return the importedStudy
77 public ImportedStudy getImportedStudy() {
78 return _importedStudy;
82 * Set the importedStudy.
84 * @param importedStudy
85 * the importedStudy to set
87 public void setImportedStudy(ImportedStudy importedStudy) {
88 _importedStudy = importedStudy;
95 public String getIndices() {
101 * @param indices the indices to set
103 public void setIndices(String indices) {
104 this.indices = indices;
108 * Get the searchService.
110 * @return the searchService
112 public SearchService getSearchService() {
113 return _searchService;
117 * Set the searchService.
119 * @param searchService
120 * the searchService to set
122 public void setSearchService(SearchService searchService) {
123 _searchService = searchService;