source: main/trunk/gli/src/org/greenstone/gatherer/cdm/SortField.java@ 36171

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

sortFields can have a default

File size: 2.1 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 java.util.ArrayList;
28import org.greenstone.gatherer.util.StaticStrings;
29import org.w3c.dom.Element;
30
31/** This class encapsulates a sort field - used by Lucene and SOLR
32 It basically is an index, with a different field name */
33
34public class SortField extends Index {
35
36 static final String sortfield_element = StaticStrings.SORT_ELEMENT;
37 protected String default_sortfield_element = StaticStrings.SORT_DEFAULT_ELEMENT;
38
39 public SortField() {
40 }
41
42 public SortField(Element element) {
43 super(element);
44 }
45 public SortField(ArrayList sources) {
46 super(sources);
47 }
48
49 protected String getElementName() {
50 return sortfield_element;
51 }
52
53 protected String getDefaultElementName() {
54 return default_sortfield_element;
55 }
56
57 public DOMProxyListEntry create(Element element) {
58 return new SortField(element);
59 }
60
61 public DOMProxyListEntry create(ArrayList sources) {
62 return new SortField(sources);
63 }
64}
Note: See TracBrowser for help on using the repository browser.