Package org.ametys.cms.search.systemprop
Class AbstractSystemProperty<T,X extends ModelAwareDataAwareAmetysObject>
java.lang.Object
org.ametys.runtime.model.AbstractModelItem
org.ametys.runtime.model.DefaultElementDefinition<T>
org.ametys.cms.model.properties.AbstractProperty<T,X>
org.ametys.cms.search.systemprop.AbstractSystemProperty<T,X>
- Type Parameters:
T- type of the property valuesX- type of ametys object supported by this property
- All Implemented Interfaces:
Comparable<ModelItem>,Property<T,,X> SystemProperty<T,,X> ElementDefinition<T>,ModelItem,PluginAware,Labelable,ModifiableLabelable,Configurable,Serviceable
- Direct Known Subclasses:
AbstractDateTimeSystemProperty,AbstractUserSystemProperty,CollectionsSystemProperty,CommentsSystemProperty,ContentIdSystemProperty,ContentPrivacySystemProperty,ContentTypeSystemProperty,FulltextSystemProperty,HasLiveVersionSystemProperty,LanguageSystemProperty,OrphanSystemProperty,PagesSystemProperty,ParentContentSystemProperty,SemanticAnnotationSystemProperty,SharedSystemProperty,SiteSystemProperty,SiteTypeSystemProperty,TagsSystemProperty,ViewBasedFullTextSystemProperty,WorkflowNameSystemProperty,WorkflowStepSystemProperty
public abstract class AbstractSystemProperty<T,X extends ModelAwareDataAwareAmetysObject>
extends AbstractProperty<T,X>
implements SystemProperty<T,X>, Serviceable
Abstract class providing standard behavior and helper methods for a
SystemProperty.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected I18nUtilsThe i18n utils.protected ServiceManagerThe service managerprotected AmetysObjectResolverThe ametys object resolverprotected UserHelperThe user helperprotected UserManagerThe user managerFields inherited from class org.ametys.cms.model.properties.AbstractProperty
_availableTypesExtensionPointFields inherited from class org.ametys.runtime.model.DefaultElementDefinition
_loggerFields inherited from class org.ametys.runtime.model.AbstractModelItem
__serviceManagerFields inherited from interface org.ametys.runtime.model.ElementDefinition
CONFIG_DEFAULT_VALUE_TYPEFields inherited from interface org.ametys.runtime.model.ModelItem
ITEM_PATH_SEPARATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringRetrieves the name of the configuration attribute that contains the name of the propertyGet the schema definitions brought by this property.getSortValue(X ametysObject) Get the sort value represented by this field in the given result ametys object.voidindexValue(org.apache.solr.common.SolrInputDocument document, X ametysObject, IndexableDataContext context) Index the property in a solr document.protected booleanparseBoolean(Object value) Get the value as a boolean.protected AdaptableDateGet the value as a date.protected doubleparseDouble(Object value) Get the value as a double.protected longGet the value as a long.protected StringparseString(Object value) Get the value as a long.protected String[]parseStringArray(Object value) Get the value as a array of Stringprotected UserIdentity[]parseUserArray(Object value) Get the value as array ofUserIdentityvoidservice(ServiceManager manager) Methods inherited from class org.ametys.cms.model.properties.AbstractProperty
_getTypeId, _parseI18nizableText, configure, getType, isEditable, setAvailableTypeExtensionPoint, setPluginInfoMethods inherited from class org.ametys.runtime.model.DefaultElementDefinition
_getDefaultValues, _toJSON, _widgetToJSON, _widgetToSAX, getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumerator, getEnumeratorConfiguration, getParsedDefaultValues, getValidator, getValidatorConfiguration, getWidget, getWidgetParameters, isMultiple, of, setCustomEnumerator, setCustomValidator, setDefaultValue, setEnumerator, setEnumeratorConfiguration, setMultiple, setParsedDefaultValues, setType, setValidator, setValidatorConfiguration, setWidget, setWidgetParameters, toSAXMethods inherited from class org.ametys.runtime.model.AbstractModelItem
_getModelItemHelper, _shouldJSONBeEmpty, _widgetParameterToSAX, addItemChecker, compareTo, disableConditionsToJSON, equals, getDescription, getDisableConditions, getItemCheckers, getLabel, getModel, getName, getParent, getPath, getPluginName, hashCode, setDescription, setDisableConditions, setLabel, setModel, setName, setParent, setPluginName, setServiceManager, toJSON, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.ametys.runtime.model.ElementDefinition
getCriterionEnumerator, getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumerator, getEnumeratorConfiguration, getParsedDefaultValues, getValidator, getValidatorConfiguration, isEditable, isMultiple, setCustomEnumerator, setCustomValidator, setDefaultValue, setEnumerator, setEnumeratorConfiguration, setMultiple, setParsedDefaultValues, setValidator, setValidatorConfigurationMethods inherited from interface org.ametys.runtime.util.Labelable
getDescription, getLabel, getNameMethods inherited from interface org.ametys.runtime.model.ModelItem
addItemChecker, getDisableConditions, getItemCheckers, getModel, getParent, getPath, getPluginName, getWidget, getWidgetParameters, setDisableConditions, setModel, setParent, setPluginName, setType, setWidget, setWidgetParameters, toJSON, toSAXMethods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabel, setNameMethods inherited from interface org.ametys.cms.model.properties.Property
getCriterionWidget, getCriterionWidgetParameters, getType, getValue, initializeAfterModelItemsInitialization, setAvailableTypeExtensionPoint, valueToJSON, valueToSAXMethods inherited from interface org.ametys.cms.search.model.SystemProperty
getColumnWidth, getConverter, getQuery, getRenderer, getSearchField, isDisplayable, isFacetable, isSearchable, isSortable
-
Field Details
-
_i18nUtils
The i18n utils. -
_userHelper
The user helper -
_resolver
The ametys object resolver -
_userManager
The user manager -
_manager
The service manager
-
-
Constructor Details
-
AbstractSystemProperty
public AbstractSystemProperty()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
_getNameConfigurationAttribute
Description copied from class:AbstractPropertyRetrieves the name of the configuration attribute that contains the name of the property- Overrides:
_getNameConfigurationAttributein classAbstractProperty<T,X extends ModelAwareDataAwareAmetysObject> - Returns:
- the name of the configuration attribute that contains the name of the property
-
indexValue
public void indexValue(org.apache.solr.common.SolrInputDocument document, X ametysObject, IndexableDataContext context) Description copied from interface:PropertyIndex the property in a solr document.- Specified by:
indexValuein interfaceProperty<T,X extends ModelAwareDataAwareAmetysObject> - Parameters:
document- the solr document to index into.ametysObject- the ametysObject containing the property to index.context- the context of the data to index. Can not be null.
-
getSortValue
Description copied from interface:SystemPropertyGet the sort value represented by this field in the given result ametys object.- Specified by:
getSortValuein interfaceSystemProperty<T,X extends ModelAwareDataAwareAmetysObject> - Parameters:
ametysObject- the result ametys object.- Returns:
- the content sort value, must be scalar (String, long, double, Date).
-
getSchemaDefinitions
Description copied from interface:SystemPropertyGet the schema definitions brought by this property.- Specified by:
getSchemaDefinitionsin interfaceSystemProperty<T,X extends ModelAwareDataAwareAmetysObject> - Returns:
- The schema definitions used by this property.
-
parseString
Get the value as a long.- Parameters:
value- The value as an object.- Returns:
- The value as a long.
-
parseLong
Get the value as a long.- Parameters:
value- The value as an object.- Returns:
- The value as a long.
-
parseDouble
Get the value as a double.- Parameters:
value- The value as an object.- Returns:
- The value as a double.
-
parseBoolean
Get the value as a boolean.- Parameters:
value- The value as an object, can be a Boolean or a String.- Returns:
- The value as a boolean.
-
parseDate
Get the value as a date.- Parameters:
value- The value as an object, can be a Date or a String.- Returns:
- The value as a Date object.
-
parseUserArray
Get the value as array ofUserIdentity- Parameters:
value- The value to parse- Returns:
- A array of
UserIdentity
-
parseStringArray
Get the value as a array of String- Parameters:
value- The value as an object to parse- Returns:
- The values as a String array
-