Package org.ametys.cms.model
Class ContentRestrictedRepeaterDefinition
java.lang.Object
org.ametys.runtime.model.AbstractModelItem
org.ametys.runtime.model.ModelItemGroup
org.ametys.plugins.repository.model.RepeaterDefinition
org.ametys.cms.model.ContentRestrictedRepeaterDefinition
- All Implemented Interfaces:
Comparable<ModelItem>,RestrictedModelItem<Content>,ModelItem,ModelItemAccessor,ModelItemContainer,Labelable,ModifiableLabelable
public class ContentRestrictedRepeaterDefinition
extends RepeaterDefinition
implements RestrictedModelItem<Content>
Definition of a repeater for content types attributes.
-
Field Summary
Fields inherited from class org.ametys.runtime.model.ModelItemGroup
DEFAULT_TYPE_IDFields inherited from class org.ametys.runtime.model.AbstractModelItem
__serviceManagerFields inherited from interface org.ametys.runtime.model.ModelItem
ITEM_PATH_SEPARATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean_shouldJSONBeEmpty(DefinitionContext context) Checks if the current definition JSON conversion should return an empty map_toJSON(DefinitionContext context, boolean includeChildren) Converts the model item group in a JSON mapbooleanDetermines if the object can be read by the definitionbooleanDetermines if the object can be written by the definitionvoidsetRestrictions(Restrictions restrictions) Set the restrictions for the repeatervoidtoSAX(ContentHandler contentHandler, DefinitionContext context) Generates SAX events for the model itemMethods inherited from class org.ametys.plugins.repository.model.RepeaterDefinition
getAddLabel, getDeleteLabel, getHeaderLabel, getInitialSize, getMaxSize, getMinSize, of, setAddLabel, setDeleteLabel, setHeaderLabel, setInitialSize, setMaxSize, setMinSizeMethods inherited from class org.ametys.runtime.model.ModelItemGroup
_toJSON, addChild, addChild, getChildren, getChildren, getModelItems, getSwitcher, getType, of, setModel, setType, toJSONMethods inherited from class org.ametys.runtime.model.AbstractModelItem
_widgetParameterToSAX, _widgetToSAX, addItemChecker, compareTo, equals, getDescription, getDisableConditions, getItemCheckers, getLabel, getModel, getName, getParent, getPath, getPluginName, getWidget, getWidgetParameters, hashCode, setDescription, setDisableConditions, setLabel, setName, setParent, setPluginName, setServiceManager, setWidget, setWidgetParameters, 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.util.Labelable
getDescription, getLabel, getNameMethods inherited from interface org.ametys.runtime.model.ModelItem
addItemChecker, getCriterionWidget, getCriterionWidgetParameters, getDisableConditions, getItemCheckers, getModel, getParent, getPath, getPluginName, getType, getWidget, getWidgetParameters, setDisableConditions, setModel, setParent, setPluginName, setType, setWidget, setWidgetParameters, toJSONMethods inherited from interface org.ametys.runtime.model.ModelItemAccessor
getChild, getModelItem, hasModelItemMethods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabel, setName
-
Constructor Details
-
ContentRestrictedRepeaterDefinition
public ContentRestrictedRepeaterDefinition()
-
-
Method Details
-
setRestrictions
Set the restrictions for the repeater- Parameters:
restrictions- the restrictions to set
-
canRead
Description copied from interface:RestrictedModelItemDetermines if the object can be read by the definition- Specified by:
canReadin interfaceRestrictedModelItem<Content>- Parameters:
content- the object- Returns:
- true if the object can be read by the definition, false otherwise
-
canWrite
Description copied from interface:RestrictedModelItemDetermines if the object can be written by the definition- Specified by:
canWritein interfaceRestrictedModelItem<Content>- Parameters:
content- the object- Returns:
- true if the object can be written by the definition, false otherwise
-
_toJSON
protected Map<String,Object> _toJSON(DefinitionContext context, boolean includeChildren) throws ProcessingException Description copied from class:ModelItemGroupConverts the model item group in a JSON map- Overrides:
_toJSONin classRepeaterDefinition- Parameters:
context- the context of the definitionincludeChildren- true to iterate and add children as elements in the returned JSON map, false otherwise- Returns:
- The model item as a JSON map
- Throws:
ProcessingException- If an error occurs when converting the model item group
-
toSAX
Description copied from class:ModelItemGroupGenerates SAX events for the model item Do not generate SAX events for children. This method has been created to generate SAX events for views, the children are taken into account via view items children- Specified by:
toSAXin interfaceModelItem- Overrides:
toSAXin classRepeaterDefinition- Parameters:
contentHandler- theContentHandlerthat will receive the SAX eventscontext- the context of the definition- Throws:
SAXException- if an error occurs during the SAX events generation
-
_shouldJSONBeEmpty
Description copied from class:AbstractModelItemChecks if the current definition JSON conversion should return an empty map- Overrides:
_shouldJSONBeEmptyin classAbstractModelItem- Parameters:
context- the context of the definition- Returns:
trueif the JSON conversion should return an empty map,falseotherwise
-