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.cms.contenttype.ContentType;
019import org.ametys.plugins.repository.AmetysObject;
020
021/**
022 * Constants for Solr field names related to indexation.
023 */
024public interface SolrFieldNames
025{
026    //// CMS
027    
028    /** Separator before language suffix */
029    public static final String LANGUAGE_SEPARATOR = "_";
030    /** Stemmed operator */
031    public static final String STEMMED_OPERATOR = "_stemmed";
032    /** Exact word search operator */
033    public static final String EXACT_WS_OPERATOR = "_s_ws";
034    
035    
036    /** Document type. */
037    public static final String DOCUMENT_TYPE = "_documentType";
038    
039    /** Repeater entry position. */
040    public static final String REPEATER_ENTRY_POSITION = "_position";
041    
042    /** Document type for a content */
043    public static final String TYPE_CONTENT = "content";
044    /** Document type for a content repeater */
045    public static final String TYPE_REPEATER = "repeater";
046    /** Document type for a resource */
047    public static final String TYPE_RESOURCE = "resource";
048    /** Document type for a resource of a content (as a content attachment) */
049    public static final String TYPE_CONTENT_ATTACHMENT_RESOURCE = "contentAttachmentResource";
050    /** Document type for a resource of a content (as an attribute of content) */
051    public static final String TYPE_CONTENT_ATTRIBUTE_RESOURCE = "contentAttributeResource";
052    /** The id of the content for an attachment */
053    public static final String ATTACHMENT_CONTENT_ID = "attachedContentId";
054    /** Document type for a workflow entry. */
055    public static final String TYPE_WF_ENTRY = "workflowEntry";
056    /** Document type for a workflow step. */
057    public static final String TYPE_WF_STEP = "workflowStep";
058    
059    /** Id field name. */
060    public static final String ID = "id";
061    /** Title field name. */
062    public static final String TITLE = "title";
063    /** Page title for sorting field name. */
064    public static final String TITLE_SORT = "title_sort";
065    
066    /** Full-text field name with general text indexation. */
067    public static final String SYSTEM_FULL = "systemFull";
068    /** Full-text field name with general text indexation. */
069    public static final String FULL = "full";
070    /** Last modified date field name. */
071    public static final String LAST_MODIFIED = "lastModified";
072    /** Creation date field name. */
073    public static final String CREATION_DATE = "creationDate";
074    
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    /** Pseudo content types field name. */
093    public static final String PSEUDO_CONTENT_TYPES = "pseudoContentTypes";
094    /** Pseudo content type value for a resource */
095    public static final String PSEUDO_CONTENT_TYPE_VALUE_RESOURCE = "resource";
096    /** Content language field name. */
097    public static final String CONTENT_LANGUAGE = "contentLanguage";
098    /** Content creator field name. */
099    public static final String CONTENT_CREATOR = "creator";
100    /** Content last contributor field name. */
101    public static final String CONTENT_LAST_CONTRIBUTOR = "contributor";
102    /** Content first validator field name */
103    public static final String CONTENT_FIRST_VALIDATOR = "firstValidator";
104    /** Content last validator field name. */
105    public static final String CONTENT_LAST_VALIDATOR = "lastValidator";
106    /** Content last major validator field name */
107    public static final String CONTENT_LAST_MAJOR_VALIDATOR = "lastMajorValidator";
108    /** Tags field name. */
109    public static final String TAGS = "tags";
110    /** All tags (including parent ones). */
111    public static final String ALL_TAGS = "allTags";
112    /** The ids of the outgoing references to resources or folders of resources (as metadata, in docbooks, attachments of this content...) */
113    public static final String CONTENT_OUTGOING_REFEERENCES_RESOURCE_IDS = "content-outgoingResourceRefIds";
114    /** The ids of visible content attachments */
115    public static final String CONTENT_VISIBLE_ATTACHMENT_RESOURCE_IDS = "content-visibleAttachmentIds";
116    
117    /** Content: embedded mode. */
118    /** Content titles field name. */
119    public static final String CONTENT_TITLES = "content-titles";
120    /** Content languages field. */
121    public static final String CONTENT_LANGUAGES = "content-languages";
122    /** Sub-content field name. */
123    public static final String SUB_CONTENT = "subContent";
124    
125    /** Resource excerpt field name. */
126    public static final String EXCERPT = "excerpt";
127    /** The file name for resources. */
128    public static final String FILENAME = "filename";
129    /** The resource path */
130    public static final String PATH = "path";
131    /** The mime type for resources. */
132    public static final String MIME_TYPES = "mimeTypes";
133    /** The length of a resource. */
134    public static final String LENGTH = "length";
135    /** The dummy "content type" of a resource. */
136    public static final String CONTENT_TYPE_RESOURCE = "resource";
137    /** The resource root ID */
138    public static final String RESOURCE_ROOT_ID = "resourceRootId";
139    /** The ids of the ancestors of the resource (i.e. ids of the parent resource collections) */
140    public static final String RESOURCE_ANCESTOR_IDS = "resource-ancestorIds";
141    /** The ids of the ancestors of the resource and the resource itself */
142    public static final String RESOURCE_ANCESTOR_AND_SELF_IDS = "resource-ancestorAndSelfIds";
143    /** The resource author */
144    public static final String RESOURCE_CREATOR = "resourceCreator";
145    /** The resource date */
146    public static final String RESOURCE_DATE = "resourceDate";
147    /** Last modified date field name. */
148    public static final String RESOURCE_LAST_MODIFIED = "last-modified";
149    
150    //// Date facet
151    // TODO Use docValues ?
152    /** Date facet field. */
153    public static final String DATES_FACET = "dates-facet";
154    /** Date sorting */
155    public static final String DATE_FOR_SORTING = "date-for-sorting";
156    
157    //// Dublin Core metadatas
158    /** Dublin Core title. */
159    public static final String DC_TITLE = "DCTitle";
160    /** Dublin Core creator. */
161    public static final String DC_CREATOR = "DCCreator";
162    /** Dublin Core subject. */
163    public static final String DC_SUBJECT = "DCSubject";
164    /** Dublin Core description. */
165    public static final String DC_DESCRIPTION = "DCDescription";
166    /** Dublin Core publisher. */
167    public static final String DC_PUBLISHER = "DCPublisher";
168    /** Dublin Core contributor. */
169    public static final String DC_CONTRIBUTOR = "DCContributor";
170    /** Dublin Core date. */
171    public static final String DC_DATE = "DCDate";
172    /** Dublin Core type. */
173    public static final String DC_TYPE = "DCType";
174    /** Dublin Core format. */
175    public static final String DC_FORMAT = "DCFormat";
176    /** Dublin Core identifier. */
177    public static final String DC_IDENTIFIER = "DCIdentifier";
178    /** Dublin Core source. */
179    public static final String DC_SOURCE = "DCSource";
180    /** Dublin Core language. */
181    public static final String DC_LANGUAGE = "DCLanguage";
182    /** Dublin Core relation. */
183    public static final String DC_RELATION = "DCRelation";
184    /** Dublin Core coverage. */
185    public static final String DC_COVERAGE = "DCCoverage";
186    /** Dublin Core rights. */
187    public static final String DC_RIGHTS = "DCRights";
188    
189    /** Group of MIME-Type of the resource */
190    public static final String RESOURCE_MIME_TYPE_GROUP = "resource-mimeTypeGroup";
191    
192    //// Workflow fields.
193    /** Constant for workflow reference field (on the AmetysObject itself). */
194    public static final String WORKFLOW_REF = "workflowRef";
195    /** Constant for workflow reference field with suffix (on the AmetysObject itself). */
196    public static final String WORKFLOW_REF_DV = "workflowRef_s_dv";
197    /** Constant for workflow name field. */
198    public static final String WORKFLOW_NAME = "wfName";
199    /** Constant for workflow entry state field. */
200    public static final String WORKFLOW_ENTRY_STATE = "wfEntryState";
201    /** Constant for workflow history steps field. */
202    public static final String WORKFLOW_HISTORY_STEPS = "wfHistorySteps";
203    /** Constant for workflow history steps field (with suffix). */
204    public static final String WORKFLOW_HISTORY_STEPS_DV = WORKFLOW_HISTORY_STEPS + "_s_dv";
205    /** Constant for workflow current steps field. */
206    public static final String WORKFLOW_CURRENT_STEPS = "wfCurrentSteps";
207    /** Constant for workflow current steps field (with suffix). */
208    public static final String WORKFLOW_CURRENT_STEPS_DV = WORKFLOW_CURRENT_STEPS + "_s_dv";
209    /** Constant for workflow step ID field. */
210    public static final String WORKFLOW_STEP_ID = "wfStepId";
211    /** Constant for workflow step action ID field. */
212    public static final String WORKFLOW_STEP_ACTIONID = "wfStepActionId";
213    /** Constant for workflow step owner field. */
214    public static final String WORKFLOW_STEP_OWNER = "wfStepOwner";
215    /** Constant for workflow step caller field. */
216    public static final String WORKFLOW_STEP_CALLER = "wfStepCaller";
217    /** Constant for workflow step start date field. */
218    public static final String WORKFLOW_STEP_STARTDATE = "wfStepStartDate";
219    /** Constant for workflow step due date field. */
220    public static final String WORKFLOW_STEP_DUEDATE = "wfStepDueDate";
221    /** Constant for workflow step finish date field. */
222    public static final String WORKFLOW_STEP_FINISHDATE = "wfStepFinishDate";
223    /** Constant for workflow step status field. */
224    public static final String WORKFLOW_STEP_STATUS = "wfStepStatus";
225    
226    //// ACL fields.
227    /** Constant for indicating if it is an {@link AmetysObject}. */
228    public static final String IS_AMETYS_OBJECT = "ametysObject";
229    /** Constant for initial value of read-access for anonymous user */
230    public static final String ACL_INIT_VALUE_ANONYMOUS = "__initValueAclAnonymous";
231    /** Constant for initial value of read-access for any connected user */
232    public static final String ACL_INIT_VALUE_ANYCONNECTED = "__initValueAclAnyConnectedUser";
233    /** Constant for initial value of read-access for allowed users */
234    public static final String ACL_INIT_VALUE_ALLOWED_USERS = "__initValueAclAllowedUsers";
235    /** Constant for initial value of read-access for denied users */
236    public static final String ACL_INIT_VALUE_DENIED_USERS = "__initValueAclDeniedUsers";
237    /** Constant for initial value of read-access for allowed groups */
238    public static final String ACL_INIT_VALUE_ALLOWED_GROUPS = "__initValueAclAllowedGroups";
239    /** Constant for initial value of read-access for denied groups */
240    public static final String ACL_INIT_VALUE_DENIED_GROUPS = "__initValueAclDeniedGroups";
241    
242    /** Constant for parents of the content, i.e. all the ascending hierarchy (parent, grandparent, etc.). See {@link ContentType#getParentAttributeDefinition()}  */
243    public static final String SIMPLE_CONTENT_PARENTS = "parents";
244
245}