source: main/trunk/gli/src/org/greenstone/gatherer/cdm/Facet.java@ 36194

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

added getType() method

File size: 2.2 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 facet field - used by SOLR
32 It basically is an index, with a different field name */
33
34public class Facet extends Index {
35
36 static final String facet_element = StaticStrings.FACET_ELEMENT;
37 //protected String default_element_name = null; // don't have default at this stage
38
39 public Facet() {
40 }
41
42 public Facet(Element element) {
43 super(element);
44 }
45
46 public Facet(ArrayList sources) {
47 super(sources);
48 }
49
50 protected String getElementName() {
51 return facet_element;
52 }
53
54 protected String getDefaultElementName() {
55 return null; //StaticSTrings.FACET_DEFAULT_ELEMENT;
56 }
57
58 public String getType() {
59 return SearchMeta.TYPE_FACET;
60 }
61 public DOMProxyListEntry create(Element element) {
62 return new Facet(element);
63 }
64
65 public DOMProxyListEntry create(ArrayList sources) {
66 return new Facet(sources);
67 }
68
69
70}
Note: See TracBrowser for help on using the repository browser.