source: main/trunk/gli/src/org/greenstone/gatherer/cdm/SortFieldManager.java@ 36161

Last change on this file since 36161 was 36161, checked in by kjdon, 2 years ago

added default element name, plus key for default indicator in list

File size: 2.6 KB
Line 
1/**
2 *#########################################################################
3 *
4 * A component of the Gatherer application, part of the Greenstone digital
5 * library suite from the New Zealand Digital Library Project at the
6 * University of Waikato, New Zealand.
7 *
8 * Copyright (C) 2022 New Zealand Digital Library Project
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 *########################################################################
24 */
25package org.greenstone.gatherer.cdm;
26
27import org.greenstone.gatherer.util.StaticStrings;
28import org.w3c.dom.*;
29
30/** handles sortfields for lucene and solr collections */
31public class SortFieldManager extends BaseIndexManager {
32
33 public SortFieldManager(Element sortfields, String current_build_type) {
34 super(sortfields, current_build_type, StaticStrings.SORT_ELEMENT, StaticStrings.SORT_DEFAULT_ELEMENT, new SortField());
35 this.controls_title_key = "CDM.SortFieldManager.Title";
36 this.new_button_tooltip_key = "CDM.SortFieldManager.New_Button_Tooltip";
37 this.edit_button_tooltip_key = "CDM.SortFieldManager.Edit_Button_Tooltip";
38 this.remove_button_tooltip_key = "CDM.SortFieldManager.Remove_Button_Tooltip";
39 this.default_indicator_key = "CDM.SortFieldManager.Default_Sort_Indicator";
40 this.nip_new_index_key = "CDM.SortFieldManager.New";
41 this.nip_edit_index_key = "CDM.SortFieldManager.Edit";
42 this.nip_source_label_key = "CDM.SortFieldManager.Source";
43
44 this.nip_add_index_button_key = "CDM.SortFieldManager.Add";
45 this.nip_add_index_tooltip_key = "CDM.SortFieldManager.Add_Tooltip";
46 this.nip_replace_index_button_key = "CDM.SortFieldManager.Replace";
47 this.nip_replace_index_tooltip_key = "CDM.SortFieldManager.Replace_Tooltip";
48 }
49
50 public void buildTypeChanged(String new_build_type) {
51 if (new_build_type.equals(BuildTypeManager.BUILD_TYPE_SOLR)|| new_build_type.equals(BuildTypeManager.BUILD_TYPE_LUCENE)) {
52 // activate
53 setAssigned(true);
54 } else {
55 // deactivate
56 setAssigned(false);
57 }
58 }
59
60}
Note: See TracBrowser for help on using the repository browser.