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 trash element */ 049 public static final String TYPE_TRASH_ELEMENT = "trashElement"; 050 /** Document type for a resource of a content (as a content attachment) */ 051 public static final String TYPE_CONTENT_ATTACHMENT_RESOURCE = "contentAttachmentResource"; 052 /** Document type for a resource of a content (as an attribute of content) */ 053 public static final String TYPE_CONTENT_ATTRIBUTE_RESOURCE = "contentAttributeResource"; 054 /** The id of the content for an attachment */ 055 public static final String ATTACHMENT_CONTENT_ID = "attachedContentId"; 056 /** Document type for a workflow entry. */ 057 public static final String TYPE_WF_ENTRY = "workflowEntry"; 058 /** Document type for a workflow step. */ 059 public static final String TYPE_WF_STEP = "workflowStep"; 060 061 /** Id field name. */ 062 public static final String ID = "id"; 063 /** Id field name (with suffix). */ 064 public static final String ID_DV = ID + "_dv"; 065 /** Title field name. */ 066 public static final String TITLE = "title"; 067 /** Page title for sorting field name. */ 068 public static final String TITLE_SORT = "title_sort"; 069 070 /** Full-text field name with general text indexation. */ 071 public static final String SYSTEM_FULL = "systemFull"; 072 /** Full-text field name with general text indexation. */ 073 public static final String FULL = "full"; 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 /** Pseudo content types field name. */ 083 public static final String PSEUDO_CONTENT_TYPES = "pseudoContentTypes"; 084 /** Pseudo content type value for a resource */ 085 public static final String PSEUDO_CONTENT_TYPE_VALUE_RESOURCE = "resource"; 086 /** The ids of the outgoing references to resources or folders of resources (as metadata, in docbooks, attachments of this content...) */ 087 public static final String CONTENT_OUTGOING_REFEERENCES_RESOURCE_IDS = "content-outgoingResourceRefIds"; 088 /** The ids of visible content attachments */ 089 public static final String CONTENT_VISIBLE_ATTACHMENT_RESOURCE_IDS = "content-visibleAttachmentIds"; 090 091 /** Content: embedded mode. */ 092 /** Content titles field name. */ 093 public static final String CONTENT_TITLES = "content-titles"; 094 /** Content languages field. */ 095 public static final String CONTENT_LANGUAGES = "content-languages"; 096 097 /** Resource excerpt field name. */ 098 public static final String EXCERPT = "excerpt"; 099 /** The file name for resources. */ 100 public static final String FILENAME = "filename"; 101 /** The resource path */ 102 public static final String PATH = "path"; 103 /** The mime type for resources. */ 104 public static final String MIME_TYPES = "mimeTypes"; 105 /** The length of a resource. */ 106 public static final String LENGTH = "length"; 107 /** The dummy "content type" of a resource. */ 108 public static final String CONTENT_TYPE_RESOURCE = "resource"; 109 /** The resource root ID */ 110 public static final String RESOURCE_ROOT_ID = "resourceRootId"; 111 /** The ids of the ancestors of the resource (i.e. ids of the parent resource collections) */ 112 public static final String RESOURCE_ANCESTOR_IDS = "resource-ancestorIds"; 113 /** The ids of the ancestors of the resource and the resource itself */ 114 public static final String RESOURCE_ANCESTOR_AND_SELF_IDS = "resource-ancestorAndSelfIds"; 115 /** The resource author */ 116 public static final String RESOURCE_CREATOR = "resourceCreator"; 117 /** The resource date */ 118 public static final String RESOURCE_DATE = "resourceDate"; 119 /** Last modified date field name. */ 120 public static final String RESOURCE_LAST_MODIFIED = "last-modified"; 121 122 //// Date facet 123 // TODO Use docValues ? 124 /** Date facet field. */ 125 public static final String DATES_FACET = "dates-facet"; 126 /** Date sorting */ 127 public static final String DATE_FOR_SORTING = "date-for-sorting"; 128 129 //// Dublin Core metadatas 130 /** Dublin Core title. */ 131 public static final String DC_TITLE = "DCTitle"; 132 /** Dublin Core creator. */ 133 public static final String DC_CREATOR = "DCCreator"; 134 /** Dublin Core subject. */ 135 public static final String DC_SUBJECT = "DCSubject"; 136 /** Dublin Core description. */ 137 public static final String DC_DESCRIPTION = "DCDescription"; 138 /** Dublin Core publisher. */ 139 public static final String DC_PUBLISHER = "DCPublisher"; 140 /** Dublin Core contributor. */ 141 public static final String DC_CONTRIBUTOR = "DCContributor"; 142 /** Dublin Core date. */ 143 public static final String DC_DATE = "DCDate"; 144 /** Dublin Core type. */ 145 public static final String DC_TYPE = "DCType"; 146 /** Dublin Core format. */ 147 public static final String DC_FORMAT = "DCFormat"; 148 /** Dublin Core identifier. */ 149 public static final String DC_IDENTIFIER = "DCIdentifier"; 150 /** Dublin Core source. */ 151 public static final String DC_SOURCE = "DCSource"; 152 /** Dublin Core language. */ 153 public static final String DC_LANGUAGE = "DCLanguage"; 154 /** Dublin Core relation. */ 155 public static final String DC_RELATION = "DCRelation"; 156 /** Dublin Core coverage. */ 157 public static final String DC_COVERAGE = "DCCoverage"; 158 /** Dublin Core rights. */ 159 public static final String DC_RIGHTS = "DCRights"; 160 161 /** Group of MIME-Type of the resource */ 162 public static final String RESOURCE_MIME_TYPE_GROUP = "resource-mimeTypeGroup"; 163 164 //// Workflow fields. 165 /** Constant for workflow reference field (on the AmetysObject itself). */ 166 public static final String WORKFLOW_REF = "workflowRef"; 167 /** Constant for workflow reference field with suffix (on the AmetysObject itself). */ 168 public static final String WORKFLOW_REF_DV = "workflowRef_s_dv"; 169 /** Constant for workflow name field. */ 170 public static final String WORKFLOW_NAME = "wfName"; 171 /** Constant for workflow entry state field. */ 172 public static final String WORKFLOW_ENTRY_STATE = "wfEntryState"; 173 /** Constant for workflow history steps field. */ 174 public static final String WORKFLOW_HISTORY_STEPS = "wfHistorySteps"; 175 /** Constant for workflow history steps field (with suffix). */ 176 public static final String WORKFLOW_HISTORY_STEPS_DV = WORKFLOW_HISTORY_STEPS + "_s_dv"; 177 /** Constant for workflow current steps field. */ 178 public static final String WORKFLOW_CURRENT_STEPS = "wfCurrentSteps"; 179 /** Constant for workflow current steps field (with suffix). */ 180 public static final String WORKFLOW_CURRENT_STEPS_DV = WORKFLOW_CURRENT_STEPS + "_s_dv"; 181 /** Constant for workflow step ID field. */ 182 public static final String WORKFLOW_STEP_ID = "wfStepId"; 183 /** Constant for workflow step action ID field. */ 184 public static final String WORKFLOW_STEP_ACTIONID = "wfStepActionId"; 185 /** Constant for workflow step owner field. */ 186 public static final String WORKFLOW_STEP_OWNER = "wfStepOwner"; 187 /** Constant for workflow step caller field. */ 188 public static final String WORKFLOW_STEP_CALLER = "wfStepCaller"; 189 /** Constant for workflow step start date field. */ 190 public static final String WORKFLOW_STEP_STARTDATE = "wfStepStartDate"; 191 /** Constant for workflow step due date field. */ 192 public static final String WORKFLOW_STEP_DUEDATE = "wfStepDueDate"; 193 /** Constant for workflow step finish date field. */ 194 public static final String WORKFLOW_STEP_FINISHDATE = "wfStepFinishDate"; 195 /** Constant for workflow step status field. */ 196 public static final String WORKFLOW_STEP_STATUS = "wfStepStatus"; 197 198 //// ACL fields. 199 /** Constant for indicating if it is an {@link AmetysObject}. */ 200 public static final String IS_AMETYS_OBJECT = "ametysObject"; 201 /** Constant for initial value of read-access for anonymous user */ 202 public static final String ACL_INIT_VALUE_ANONYMOUS = "__initValueAclAnonymous"; 203 /** Constant for initial value of read-access for any connected user */ 204 public static final String ACL_INIT_VALUE_ANYCONNECTED = "__initValueAclAnyConnectedUser"; 205 /** Constant for initial value of read-access for allowed users */ 206 public static final String ACL_INIT_VALUE_ALLOWED_USERS = "__initValueAclAllowedUsers"; 207 /** Constant for initial value of read-access for denied users */ 208 public static final String ACL_INIT_VALUE_DENIED_USERS = "__initValueAclDeniedUsers"; 209 /** Constant for initial value of read-access for allowed groups */ 210 public static final String ACL_INIT_VALUE_ALLOWED_GROUPS = "__initValueAclAllowedGroups"; 211 /** Constant for initial value of read-access for denied groups */ 212 public static final String ACL_INIT_VALUE_DENIED_GROUPS = "__initValueAclDeniedGroups"; 213 214 /** Constant for parents of the content, i.e. all the ascending hierarchy (parent, grandparent, etc.). See {@link ContentType#getParentAttributeDefinition()} */ 215 public static final String SIMPLE_CONTENT_PARENTS = "parents"; 216 217}