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