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;
42 * Value of the tool bar property.
43 * It can be: none, standard, study, back.
45 private String _toolProperty;
47 // ==============================================================================================================================
49 // ==============================================================================================================================
52 * Initialize the action.
55 public String doInitialize() {
56 newstudies = getSearchService().selectStudies();
59 setMenuProperty("sysadmin");
60 setToolProperty("none");
61 initializationScreenContext(_menuProperty, _toolProperty);
70 public String doIndexing() {
71 String[] ridlist = indices.split(",");
72 @SuppressWarnings("unchecked")
73 Map<String, Object> filter = (Map<String, Object>) getSession().get(
75 getSearchService().reindexStudies(ridlist);
76 filter.put("owner", "all"); // Just in case of 1st study search
81 // ==============================================================================================================================
82 // Getters and setters
83 // ==============================================================================================================================
86 * Get the new studies.
88 * @return the new studies
90 public List<ImportedStudyDTO> getNewStudies() {
98 public String getIndices() {
104 * @param indices the indices to set
106 public void setIndices(String indices) {
107 this.indices = indices;
111 * Get the searchService.
113 * @return the searchService
115 public SearchService getSearchService() {
116 return _searchService;
120 * Set the searchService.
122 * @param searchService
123 * the searchService to set
125 public void setSearchService(SearchService searchService) {
126 _searchService = searchService;
130 * Get the menuProperty.
131 * @return the menuProperty
133 public String getMenuProperty() {
134 return _menuProperty;
138 * Set the menuProperty.
139 * @param menuProperty the menuProperty to set
141 public void setMenuProperty(String menuProperty) {
142 this._menuProperty = menuProperty;
146 * Get the toolProperty.
147 * @return the toolProperty
149 public String getToolProperty() {
150 return _toolProperty;
154 * Set the toolProperty.
155 * @param toolProperty the toolProperty to set
157 public void setToolProperty(final String toolProperty) {
158 _toolProperty = toolProperty;