1 package org.splat.simer.admin;
6 import org.splat.service.SearchService;
7 import org.splat.service.dto.ImportedStudyDTO;
8 import org.splat.simer.Action;
11 * Action for updating lucene index.
13 * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
15 public class DatabaseIndexingAction extends Action {
20 private static final long serialVersionUID = 4194268823457749655L;
23 * New studies which are not yet indexed by lucene.
25 private transient List<ImportedStudyDTO> _newstudies;
27 * Id's of studies to reindex.
29 private String _indices;
31 * Injected search service.
33 private SearchService _searchService;
35 // ==============================================================================================================================
37 // ==============================================================================================================================
40 * Initialize the action.
43 public String doInitialize() {
44 _newstudies = getSearchService().selectStudies();
47 initializationFullScreenContext("sysadmin", "none", "open");
56 public String doIndexing() {
57 String[] ridlist = _indices.split(",");
58 @SuppressWarnings("unchecked")
59 Map<String, Object> filter = (Map<String, Object>) getSession().get(
61 getSearchService().reindexStudies(ridlist);
62 filter.put("owner", "all"); // Just in case of 1st study search
67 // ==============================================================================================================================
68 // Getters and setters
69 // ==============================================================================================================================
72 * Get the new studies.
74 * @return the new studies
76 public List<ImportedStudyDTO> getNewStudies() {
84 public String getIndices() {
90 * @param indices the indices to set
92 public void setIndices(final String indices) {
93 this._indices = indices;
97 * Get the searchService.
99 * @return the searchService
101 public SearchService getSearchService() {
102 return _searchService;
106 * Set the searchService.
108 * @param searchService
109 * the searchService to set
111 public void setSearchService(final SearchService searchService) {
112 _searchService = searchService;