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
Modifier and TypeFieldDescriptionprotected I18nUtils
The i18n utils.protected ServiceManager
The service managerprotected AmetysObjectResolver
The ametys object resolverprotected UserHelper
The user helperprotected UserManager
The user managerFields inherited from class org.ametys.cms.model.properties.AbstractProperty
_availableTypesExtensionPoint
Fields inherited from class org.ametys.runtime.model.DefaultElementDefinition
_logger
Fields inherited from class org.ametys.runtime.model.AbstractModelItem
__serviceManager
Fields inherited from interface org.ametys.runtime.model.ElementDefinition
CONFIG_DEFAULT_VALUE_TYPE
Fields inherited from interface org.ametys.runtime.model.ModelItem
ITEM_PATH_SEPARATOR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
Retrieves 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.void
indexValue
(org.apache.solr.common.SolrInputDocument document, X ametysObject, IndexableDataContext context) Index the property in a solr document.protected boolean
parseBoolean
(Object value) Get the value as a boolean.protected AdaptableDate
Get the value as a date.protected double
parseDouble
(Object value) Get the value as a double.protected long
Get the value as a long.protected String
parseString
(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 ofUserIdentity
void
service
(ServiceManager manager) Methods inherited from class org.ametys.cms.model.properties.AbstractProperty
_getTypeId, _parseI18nizableText, configure, getType, isEditable, setAvailableTypeExtensionPoint, setPluginInfo
Methods 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, toSAX
Methods 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, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods 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, setValidatorConfiguration
Methods inherited from interface org.ametys.runtime.util.Labelable
getDescription, getLabel, getName
Methods 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, toSAX
Methods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabel, setName
Methods inherited from interface org.ametys.cms.model.properties.Property
getCriterionWidget, getCriterionWidgetParameters, getType, getValue, initializeAfterModelItemsInitialization, setAvailableTypeExtensionPoint, valueToJSON, valueToSAX
Methods 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:
service
in interfaceServiceable
- Throws:
ServiceException
-
_getNameConfigurationAttribute
Description copied from class:AbstractProperty
Retrieves the name of the configuration attribute that contains the name of the property- Overrides:
_getNameConfigurationAttribute
in 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:Property
Index the property in a solr document.- Specified by:
indexValue
in 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:SystemProperty
Get the sort value represented by this field in the given result ametys object.- Specified by:
getSortValue
in 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:SystemProperty
Get the schema definitions brought by this property.- Specified by:
getSchemaDefinitions
in 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
-