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;
48 * Value of the left menu property.
49 * It can be: open, study, knowledge, scenario.
51 private String _leftMenuProperty;
53 // ==============================================================================================================================
55 // ==============================================================================================================================
58 * Initialize the action.
61 public String doInitialize() {
62 newstudies = getSearchService().selectStudies();
65 setMenuProperty("sysadmin");
66 setToolProperty("none");
67 setLeftMenuProperty("open");
68 initializationFullScreenContext(_menuProperty, _toolProperty, _leftMenuProperty);
77 public String doIndexing() {
78 String[] ridlist = indices.split(",");
79 @SuppressWarnings("unchecked")
80 Map<String, Object> filter = (Map<String, Object>) getSession().get(
82 getSearchService().reindexStudies(ridlist);
83 filter.put("owner", "all"); // Just in case of 1st study search
88 // ==============================================================================================================================
89 // Getters and setters
90 // ==============================================================================================================================
93 * Get the new studies.
95 * @return the new studies
97 public List<ImportedStudyDTO> getNewStudies() {
103 * @return the indices
105 public String getIndices() {
111 * @param indices the indices to set
113 public void setIndices(String indices) {
114 this.indices = indices;
118 * Get the searchService.
120 * @return the searchService
122 public SearchService getSearchService() {
123 return _searchService;
127 * Set the searchService.
129 * @param searchService
130 * the searchService to set
132 public void setSearchService(SearchService searchService) {
133 _searchService = searchService;
137 * Get the menuProperty.
138 * @return the menuProperty
140 public String getMenuProperty() {
141 return _menuProperty;
145 * Set the menuProperty.
146 * @param menuProperty the menuProperty to set
148 public void setMenuProperty(String menuProperty) {
149 this._menuProperty = menuProperty;
153 * Get the toolProperty.
154 * @return the toolProperty
156 public String getToolProperty() {
157 return _toolProperty;
161 * Set the toolProperty.
162 * @param toolProperty the toolProperty to set
164 public void setToolProperty(final String toolProperty) {
165 _toolProperty = toolProperty;
169 * Get the leftMenuProperty.
170 * @return the leftMenuProperty
172 public String getLeftMenuProperty() {
173 return _leftMenuProperty;
177 * Set the leftMenuProperty.
178 * @param leftMenuProperty the leftMenuProperty to set
180 public void setLeftMenuProperty(final String leftMenuProperty) {
181 _leftMenuProperty = leftMenuProperty;