Package org.ametys.cms.model
Class ContentRestrictedCompositeDefinition
java.lang.Object
org.ametys.runtime.model.AbstractModelItem
org.ametys.runtime.model.ModelItemGroup
org.ametys.plugins.repository.model.CompositeDefinition
org.ametys.cms.model.ContentRestrictedCompositeDefinition
- All Implemented Interfaces:
Comparable<ModelItem>
,RestrictedModelItem<Content>
,ModelItem
,ModelItemAccessor
,ModelItemContainer
,Labelable
,ModifiableLabelable
public class ContentRestrictedCompositeDefinition
extends CompositeDefinition
implements RestrictedModelItem<Content>
Definition of a composite for content types attributes
-
Field Summary
Fields inherited from class org.ametys.runtime.model.ModelItemGroup
DEFAULT_TYPE_ID
Fields inherited from class org.ametys.runtime.model.AbstractModelItem
__serviceManager
Fields inherited from interface org.ametys.runtime.model.ModelItem
ITEM_PATH_SEPARATOR
-
Constructor Summary
-
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 mapboolean
Determines if the object can be read by the definitionboolean
Determines if the object can be written by the definitionvoid
setRestrictions
(Restrictions restrictions) Set the restrictions for the compositevoid
toSAX
(ContentHandler contentHandler, DefinitionContext context) Generates SAX events for the model itemMethods inherited from class org.ametys.plugins.repository.model.CompositeDefinition
of
Methods inherited from class org.ametys.runtime.model.ModelItemGroup
_toJSON, addChild, addChild, getChildren, getChildren, getModelItems, getSwitcher, getType, of, setModel, setType, toJSON
Methods 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, 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.util.Labelable
getDescription, getLabel, getName
Methods 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, toJSON
Methods inherited from interface org.ametys.runtime.model.ModelItemAccessor
getChild, getModelItem, hasModelItem
Methods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabel, setName
-
Constructor Details
-
ContentRestrictedCompositeDefinition
public ContentRestrictedCompositeDefinition()
-
-
Method Details
-
setRestrictions
Set the restrictions for the composite- Parameters:
restrictions
- the restrictions to set
-
canRead
Description copied from interface:RestrictedModelItem
Determines if the object can be read by the definition- Specified by:
canRead
in interfaceRestrictedModelItem<Content>
- Parameters:
content
- the object- Returns:
- true if the object can be read by the definition, false otherwise
-
canWrite
Description copied from interface:RestrictedModelItem
Determines if the object can be written by the definition- Specified by:
canWrite
in 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:ModelItemGroup
Converts the model item group in a JSON map- Overrides:
_toJSON
in classModelItemGroup
- 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:ModelItemGroup
Generates 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:
toSAX
in interfaceModelItem
- Overrides:
toSAX
in classModelItemGroup
- Parameters:
contentHandler
- theContentHandler
that 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:AbstractModelItem
Checks if the current definition JSON conversion should return an empty map- Overrides:
_shouldJSONBeEmpty
in classAbstractModelItem
- Parameters:
context
- the context of the definition- Returns:
true
if the JSON conversion should return an empty map,false
otherwise
-