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 List<ImportedStudyDTO> newstudies;
27 * Id's of studies to reindex.
29 private String indices;
31 * Injected search service.
33 private SearchService _searchService;
36 * Value of the menu property.
37 * It can be: none, create, open, study, knowledge, sysadmin, help.
39 private String _menuProperty;
41 // ==============================================================================================================================
43 // ==============================================================================================================================
46 * Initialize the action.
49 public String doInitialize() {
50 newstudies = getSearchService().selectStudies();
53 setMenuProperty("sysadmin");
54 initializationScreenContext(_menuProperty);
63 public String doIndexing() {
64 String[] ridlist = indices.split(",");
65 @SuppressWarnings("unchecked")
66 Map<String, Object> filter = (Map<String, Object>) getSession().get(
68 getSearchService().reindexStudies(ridlist);
69 filter.put("owner", "all"); // Just in case of 1st study search
74 // ==============================================================================================================================
75 // Getters and setters
76 // ==============================================================================================================================
79 * Get the new studies.
81 * @return the new studies
83 public List<ImportedStudyDTO> getNewStudies() {
91 public String getIndices() {
97 * @param indices the indices to set
99 public void setIndices(String indices) {
100 this.indices = indices;
104 * Get the searchService.
106 * @return the searchService
108 public SearchService getSearchService() {
109 return _searchService;
113 * Set the searchService.
115 * @param searchService
116 * the searchService to set
118 public void setSearchService(SearchService searchService) {
119 _searchService = searchService;
123 * Get the menuProperty.
124 * @return the menuProperty
126 public String getMenuProperty() {
127 return _menuProperty;
131 * Set the menuProperty.
132 * @param menuProperty the menuProperty to set
134 public void setMenuProperty(String menuProperty) {
135 this._menuProperty = menuProperty;