001/*
002 *  Copyright 2015 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.cms.content.indexing.solr;
017
018import org.ametys.plugins.repository.AmetysObject;
019import org.ametys.cms.contenttype.ContentType;
020
021/**
022 * Constants for Solr field names related to indexation.
023 */
024public interface SolrFieldNames
025{
026    //// CMS
027    
028    /** Document type. */
029    public static final String DOCUMENT_TYPE = "_documentType";
030    
031    /** Repeater entry position. */
032    public static final String REPEATER_ENTRY_POSITION = "_position";
033    
034    /** Document type for a content */
035    public static final String TYPE_CONTENT = "content";
036    /** Document type for a content repeater */
037    public static final String TYPE_REPEATER = "repeater";
038    /** Document type for a resource */
039    public static final String TYPE_RESOURCE = "resource";
040    /** Document type for a resource of a content (content attachment) */
041    public static final String TYPE_CONTENT_RESOURCE = "contentResource";
042    /** The id of the content for an attachment */
043    public static final String ATTACHMENT_CONTENT_ID = "attachedContentId";
044    /** Document type for a workflow entry. */
045    public static final String TYPE_WF_ENTRY = "workflowEntry";
046    /** Document type for a workflow step. */
047    public static final String TYPE_WF_STEP = "workflowStep";
048    
049    /** Id field name. */
050    public static final String ID = "id";
051    /** Title field name. */
052    public static final String TITLE = "title";
053    /** Page title for sorting field name. */
054    public static final String TITLE_SORT = "title_sort";
055    
056    /** Unstemmed full-text field prefix */
057    public static final String FULL_PREFIX = "full_";
058    /** Stemmed full-text field prefix. */
059    public static final String FULL_STEMMED_PREFIX = "full_stemmed_";
060    /** Full-text field name with general text indexation. */
061    public static final String FULL_GENERAL = "full";
062    /** Full-text with simple white-space tokenization. */
063    public static final String FULL_EXACT_WS = "full_s_ws";
064    /** Last modified date field name. */
065    public static final String LAST_MODIFIED = "lastModified";
066    /** Creation date field name. */
067    public static final String CREATION_DATE = "creationDate";
068    /** Last validation date field name. */
069    public static final String LAST_VALIDATION = "lastValidation";
070    /** Last major validation date field name. */
071    public static final String LAST_MAJOR_VALIDATION = "lastMajorValidation";
072    
073    /** Comments status of a content. */
074    public static final String CONTENT_COMMENTS = "comments";
075    /** Validated comments of a content. */
076    public static final String CONTENT_COMMENTS_VALIDATED = "commentsValidated";
077    /** Non-validated comments of a content. */
078    public static final String CONTENT_COMMENTS_NONVALIDATED = "commentsNonValidated";
079    
080    /** Content name field name. */
081    public static final String CONTENT_NAME = "contentName";
082    /** Content types field name. */
083    public static final String CONTENT_TYPES = "contentTypes";
084    /** All content types field name. */
085    public static final String ALL_CONTENT_TYPES = "allContentTypes";
086    /** Mixin types field name. */
087    public static final String MIXIN_TYPES = "mixinTypes";
088    /** All mixin types field name. */
089    public static final String ALL_MIXIN_TYPES = "allMixinTypes";
090//    /** The content types and mixins of a content. */
091//    public static final String CONTENT_TYPE_OR_MIXIN = "contentTypeOrMixin";
092    /** Content language field name. */
093    public static final String CONTENT_LANGUAGE = "contentLanguage";
094    /** The content current workflow step. */
095    public static final String WORKFLOW_STEP = "workflowStep";
096    /** Content creator field name. */
097    public static final String CONTENT_CREATOR = "creator";
098    /** Content last contributor field name. */
099    public static final String CONTENT_LAST_CONTRIBUTOR = "contributor";
100    /** Tags field name. */
101    public static final String TAGS = "tags";
102    /** All tags (including parent ones). */
103    public static final String ALL_TAGS = "allTags";
104    /** The ids of the outgoing references to resources or folders of resources (as metadata, in docbooks, attachments of this content...) */
105    public static final String CONTENT_OUTGOING_REFEERENCES_RESOURCE_IDS = "content-outgoingResourceRefIds";
106    
107    /** Content: embedded mode. */
108    /** Content titles field name. */
109    public static final String CONTENT_TITLES = "content-titles";
110    /** Content languages field. */
111    public static final String CONTENT_LANGUAGES = "content-languages";
112    /** Sub-content field name. */
113    public static final String SUB_CONTENT = "subContent";
114    
115    /** Resource excerpt field name. */
116    public static final String EXCERPT = "excerpt";
117    /** The file name for resources. */
118    public static final String FILENAME = "filename";
119    /** The resource path */
120    public static final String PATH = "path";
121    /** The mime type for resources. */
122    public static final String MIME_TYPES = "mimeTypes";
123    /** The length of a resource. */
124    public static final String LENGTH = "length";
125    /** The dummy "content type" of a resource. */
126    public static final String CONTENT_TYPE_RESOURCE = "resource";
127    /** The resource root ID */
128    public static final String RESOURCE_ROOT_ID = "resourceRootId";
129    /** The ids of the ancestors of the resource (i.e. ids of the parent resource collections) */
130    public static final String RESOURCE_ANCESTOR_IDS = "resource-ancestorIds";
131    /** The resource author */
132    public static final String RESOURCE_CREATOR = "resourceCreator";
133    /** The resource date */
134    public static final String RESOURCE_DATE = "resourceDate";
135    /** Last modified date field name. */
136    public static final String RESOURCE_LAST_MODIFIED = "last-modified";
137    
138    //// Date facet
139    // TODO Use docValues ?
140    /** Date facet field. */
141    public static final String DATES_FACET = "dates-facet";
142    /** Date sorting */
143    public static final String DATE_FOR_SORTING = "date-for-sorting";
144    
145    //// Dublin Core metadatas
146    /** Dublin Core title. */
147    public static final String DC_TITLE = "DCTitle";
148    /** Dublin Core creator. */
149    public static final String DC_CREATOR = "DCCreator";
150    /** Dublin Core subject. */
151    public static final String DC_SUBJECT = "DCSubject";
152    /** Dublin Core description. */
153    public static final String DC_DESCRIPTION = "DCDescription";
154    /** Dublin Core publisher. */
155    public static final String DC_PUBLISHER = "DCPublisher";
156    /** Dublin Core contributor. */
157    public static final String DC_CONTRIBUTOR = "DCContributor";
158    /** Dublin Core date. */
159    public static final String DC_DATE = "DCDate";
160    /** Dublin Core type. */
161    public static final String DC_TYPE = "DCType";
162    /** Dublin Core format. */
163    public static final String DC_FORMAT = "DCFormat";
164    /** Dublin Core identifier. */
165    public static final String DC_IDENTIFIER = "DCIdentifier";
166    /** Dublin Core source. */
167    public static final String DC_SOURCE = "DCSource";
168    /** Dublin Core language. */
169    public static final String DC_LANGUAGE = "DCLanguage";
170    /** Dublin Core relation. */
171    public static final String DC_RELATION = "DCRelation";
172    /** Dublin Core coverage. */
173    public static final String DC_COVERAGE = "DCCoverage";
174    /** Dublin Core rights. */
175    public static final String DC_RIGHTS = "DCRights";
176    
177    //// Workflow fields.
178    /** Constant for workflow reference field (on the AmetysObject itself). */
179    public static final String WORKFLOW_REF = "workflowRef";
180    /** Constant for workflow reference field with suffix (on the AmetysObject itself). */
181    public static final String WORKFLOW_REF_DV = "workflowRef_s_dv";
182    /** Constant for workflow name field. */
183    public static final String WORKFLOW_NAME = "wfName";
184    /** Constant for workflow entry state field. */
185    public static final String WORKFLOW_ENTRY_STATE = "wfEntryState";
186    /** Constant for workflow history steps field. */
187    public static final String WORKFLOW_HISTORY_STEPS = "wfHistorySteps";
188    /** Constant for workflow history steps field (with suffix). */
189    public static final String WORKFLOW_HISTORY_STEPS_DV = WORKFLOW_HISTORY_STEPS + "_s_dv";
190    /** Constant for workflow current steps field. */
191    public static final String WORKFLOW_CURRENT_STEPS = "wfCurrentSteps";
192    /** Constant for workflow current steps field (with suffix). */
193    public static final String WORKFLOW_CURRENT_STEPS_DV = WORKFLOW_CURRENT_STEPS + "_s_dv";
194    /** Constant for workflow step ID field. */
195    public static final String WORKFLOW_STEP_ID = "wfStepId";
196    /** Constant for workflow step action ID field. */
197    public static final String WORKFLOW_STEP_ACTIONID = "wfStepActionId";
198    /** Constant for workflow step owner field. */
199    public static final String WORKFLOW_STEP_OWNER = "wfStepOwner";
200    /** Constant for workflow step caller field. */
201    public static final String WORKFLOW_STEP_CALLER = "wfStepCaller";
202    /** Constant for workflow step start date field. */
203    public static final String WORKFLOW_STEP_STARTDATE = "wfStepStartDate";
204    /** Constant for workflow step due date field. */
205    public static final String WORKFLOW_STEP_DUEDATE = "wfStepDueDate";
206    /** Constant for workflow step finish date field. */
207    public static final String WORKFLOW_STEP_FINISHDATE = "wfStepFinishDate";
208    /** Constant for workflow step status field. */
209    public static final String WORKFLOW_STEP_STATUS = "wfStepStatus";
210    
211    //// ACL fields.
212    /** Constant for indicating if it is an {@link AmetysObject}. */
213    public static final String IS_AMETYS_OBJECT = "ametysObject";
214    
215    /** Constant for parents of the content, i.e. all the ascending hierarchy (parent, grandparent, etc.). See {@link ContentType#getParentMetadata()}  */
216    public static final String SIMPLE_CONTENT_PARENTS = "parents";
217}