Package org.ametys.cms.model.properties
Interface Property<T,X extends ModelAwareDataAwareAmetysObject>
- Type Parameters:
T
- type of the property valuesX
- type of ametys object supported by this property
- All Superinterfaces:
Comparable<ModelItem>
,ElementDefinition<T>
,Labelable
,ModelItem
,ModifiableLabelable
- All Known Subinterfaces:
SystemProperty<T,
X>
- All Known Implementing Classes:
AbstractContentProperty
,AbstractDateTimeSystemProperty
,AbstractMultiTypedValuesProperty
,AbstractMultiValuesProperty
,AbstractProperty
,AbstractSystemProperty
,AbstractUserSystemProperty
,CollectionsSystemProperty
,CommentsSystemProperty
,ContentPrivacySystemProperty
,ContentTypeSystemProperty
,ContributorSystemProperty
,CreationDateSystemProperty
,CreatorSystemProperty
,DegreeOrderProperty
,DegreeTypeProperty
,ElementRefProperty
,FirstValidationSystemProperty
,FirstValidatorSystemProperty
,FulltextSystemProperty
,HasLiveVersionSystemProperty
,LanguageSystemProperty
,LastMajorValidationSystemProperty
,LastMajorValidatorSystemProperty
,LastModifiedSystemProperty
,LastValidationSystemProperty
,LastValidatorSystemProperty
,MemberProjectProperty
,MultiContentValuesProperty
,MultiStringValuesProperty
,OrgUnitAncestorProperty
,OrphanSystemProperty
,PagesSystemProperty
,ParentContentSystemProperty
,ParentProgramsProperty
,ParentSubProgramsProperty
,PinProperty
,ProfiledGroupsTagsSystemProperty
,ProgramSkillsProperty
,SemanticAnnotationSystemProperty
,SharedSystemProperty
,SiteSystemProperty
,SiteTypeSystemProperty
,SubProgramParentProgramProperty
,TagsSystemProperty
,TagsSystemProperty
,ViewBasedFullTextSystemProperty
,WorkflowStepSystemProperty
,WorkflowStepSystemProperty
Interface for a property
-
Field Summary
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
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
Get the default widget to use when rendering this item as a criterion.default Map<String,
I18nizableText> getCriterionWidgetParameters
(Configuration configuration) Get the widget parameters to use when rendering this item as a criterion.getType()
Retrieves the type.Get the property's valuedefault void
indexValue
(org.apache.solr.common.SolrInputDocument document, X ametysObject, IndexableDataContext context) Index the property in a solr document.void
setAvailableTypeExtensionPoint
(ExtensionPoint<ModelItemType> availableTypesExtensionPoint) Set the extension point containing the types available for this propertydefault Object
valueToJSON
(X ametysObject, Optional<ViewItem> viewItem, DataContext context) Convert the property into a JSON objectdefault Object
valueToJSON
(X ametysObject, DataContext context) Convert the property into a JSON objectdefault void
valueToSAX
(ContentHandler contentHandler, X ametysObject, Optional<ViewItem> viewItem, DataContext context) Generates SAX events for the propertydefault void
valueToSAX
(ContentHandler contentHandler, X ametysObject, DataContext context) Generates SAX events for the propertyMethods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface org.ametys.runtime.model.ElementDefinition
_getParsedDefaultValues, getCriterionEnumerator, getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumerator, getEnumeratorConfiguration, 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
-
Method Details
-
getType
Description copied from interface:ModelItem
Retrieves the type.- Specified by:
getType
in interfaceElementDefinition<T>
- Specified by:
getType
in interfaceModelItem
- Returns:
- the type.
-
setAvailableTypeExtensionPoint
Set the extension point containing the types available for this property- Parameters:
availableTypesExtensionPoint
- the extension point to set
-
getValue
Get the property's value- Parameters:
ametysObject
- the ametysObject containing the property- Returns:
- the values to index.
-
valueToSAX
default void valueToSAX(ContentHandler contentHandler, X ametysObject, DataContext context) throws SAXException Generates SAX events for the property- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventsametysObject
- the ametysObject containing the property to SAX.context
- the context of the data to SAX. Can not be null.- Throws:
SAXException
- if an error occurs during the SAX events generation
-
valueToSAX
default void valueToSAX(ContentHandler contentHandler, X ametysObject, Optional<ViewItem> viewItem, DataContext context) throws SAXException Generates SAX events for the property- Parameters:
contentHandler
- theContentHandler
that will receive the SAX eventsametysObject
- the ametysObject containing the property to SAX.viewItem
- The optional view item corresponding property that is currently saxed. This view item gives context for the SAX event that will be generated here.context
- the context of the data to SAX. Can not be null.- Throws:
SAXException
- if an error occurs during the SAX events generation
-
valueToJSON
Convert the property into a JSON object- Parameters:
ametysObject
- the ametysObject containing the property to convert.context
- the context of the data to convert. Can not be null.- Returns:
- The property as JSON
-
valueToJSON
Convert the property into a JSON object- Parameters:
ametysObject
- the ametysObject containing the property to convert.viewItem
- The optional view item corresponding property that is currently saxed. This view item gives context for the SAX event that will be generated here.context
- the context of the data to convert. Can not be null.- Returns:
- The property as JSON
-
indexValue
default void indexValue(org.apache.solr.common.SolrInputDocument document, X ametysObject, IndexableDataContext context) Index the property in a solr document.- 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.
-
getCriterionWidget
Description copied from interface:ModelItem
Get the default widget to use when rendering this item as a criterion.- Specified by:
getCriterionWidget
in interfaceModelItem
- Returns:
- The default widget to use, or
null
if no specific widget is necessary.
-
getCriterionWidgetParameters
Description copied from interface:ModelItem
Get the widget parameters to use when rendering this item as a criterion.- Specified by:
getCriterionWidgetParameters
in interfaceModelItem
- Parameters:
configuration
- The widget parameters configuration- Returns:
- The default widget parameters to use, or an empty Map if no specific widget parameters are necessary.
-