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>
16 public class DatabaseIndexingAction extends Action {
21 private static final long serialVersionUID = 4194268823457749655L;
24 * New studies which are not yet indexed by lucene.
26 private transient List<ImportedStudyDTO> _newstudies;
28 * Id's of studies to reindex.
30 private String _indices;
32 * Injected search service.
34 private SearchService _searchService;
36 // ==============================================================================================================================
38 // ==============================================================================================================================
41 * Initialize the action.
44 public String doInitialize() {
45 _newstudies = getSearchService().selectStudies();
48 initializationFullScreenContext("sysadmin", "none", "open");
57 public String doIndexing() {
58 String[] ridlist = _indices.split(",");
59 @SuppressWarnings("unchecked")
60 Map<String, Object> filter = (Map<String, Object>) getSession().get(
62 getSearchService().reindexStudies(ridlist);
63 filter.put("owner", "all"); // Just in case of 1st study search
68 // ==============================================================================================================================
69 // Getters and setters
70 // ==============================================================================================================================
73 * Get the new studies.
75 * @return the new studies
77 public List<ImportedStudyDTO> getNewStudies() {
85 public String getIndices() {
91 * @param indices the indices to set
93 public void setIndices(final String indices) {
94 this._indices = indices;
98 * Get the searchService.
100 * @return the searchService
102 public SearchService getSearchService() {
103 return _searchService;
107 * Set the searchService.
109 * @param searchService
110 * the searchService to set
112 public void setSearchService(final SearchService searchService) {
113 _searchService = searchService;