Package org.ametys.cms.contenttype
Class ContentAttributeDefinition
- java.lang.Object
-
- org.ametys.runtime.model.AbstractModelItem
-
- org.ametys.runtime.model.ElementDefinition<T>
-
- org.ametys.cms.contenttype.AttributeDefinition<Content>
-
- org.ametys.cms.contenttype.ContentAttributeDefinition
-
- All Implemented Interfaces:
Comparable<ModelItem>
,RestrictedModelItem<Content>
,ModelItem
,ModelItemContainer
,Labelable
,ModifiableLabelable
public class ContentAttributeDefinition extends AttributeDefinition<Content> implements ModelItemContainer
Definition of content types attributes of type Content
-
-
Field Summary
Fields Modifier and Type Field Description private ContentTypeExtensionPoint
_contentTypeExtensionPoint
private String
_contentTypeId
private ContentTypesHelper
_contentTypesHelper
private boolean
_forceInvert
private String
_invertRelationPath
-
Fields inherited from class org.ametys.runtime.model.AbstractModelItem
__serviceManager
-
Fields inherited from interface org.ametys.runtime.model.ModelItem
ITEM_PATH_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description ContentAttributeDefinition(ContentTypeExtensionPoint contentTypeExtensionPoint, ContentTypesHelper contentAttributeTypeExtensionPoint)
Defintion's constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getContentTypeId()
Get the attribute's content type identifier.boolean
getForceInvert()
Returns true if mutual relationship should be set regardless of user's rightsString
getInvertRelationPath()
Get the attribute's mutual relationship path.Collection<? extends ModelItem>
getModelItems()
Retrieves all the model items of this containervoid
setContentTypeId(String contentTypeId)
Set the attribute's content type identifier.void
setForceInvert(boolean force)
Force mutual relationship regardless of user's rights (only applicable for an attribute with invert relation path).void
setInvertRelationPath(String invertRelationPath)
Set the attribute's mutual relationship path.-
Methods inherited from class org.ametys.cms.contenttype.AttributeDefinition
canRead, canWrite, setRestrictions
-
Methods inherited from class org.ametys.runtime.model.ElementDefinition
getCustomEnumerator, getCustomValidator, getDefaultValue, getDisableConditions, getEnumerator, getEnumeratorConfiguration, getPluginName, getType, getValidator, getValidatorConfiguration, getWidget, getWidgetParameters, isMultiple, of, setCustomEnumerator, setCustomValidator, setDefaultValue, setDisableConditions, setEnumerator, setEnumeratorConfiguration, setMultiple, setPluginName, setType, setValidator, setValidatorConfiguration, setWidget, setWidgetParameters, toJSON
-
Methods inherited from class org.ametys.runtime.model.AbstractModelItem
addItemChecker, compareTo, equals, getDescription, getItemCheckers, getLabel, getModel, getName, getParent, getPath, hashCode, setDescription, setLabel, setModel, setName, setParent, setServiceManager, 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, getItemCheckers, getModel, getParent, getPath, getType, setModel, setParent, setType, toJSON
-
Methods inherited from interface org.ametys.runtime.model.ModelItemContainer
getChild, getModelItem, hasModelItem
-
Methods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabel, setName
-
-
-
-
Field Detail
-
_contentTypesHelper
private ContentTypesHelper _contentTypesHelper
-
_contentTypeExtensionPoint
private ContentTypeExtensionPoint _contentTypeExtensionPoint
-
_contentTypeId
private String _contentTypeId
-
_invertRelationPath
private String _invertRelationPath
-
_forceInvert
private boolean _forceInvert
-
-
Constructor Detail
-
ContentAttributeDefinition
public ContentAttributeDefinition(ContentTypeExtensionPoint contentTypeExtensionPoint, ContentTypesHelper contentAttributeTypeExtensionPoint)
Defintion's constructor- Parameters:
contentTypeExtensionPoint
- the content type extension pointcontentAttributeTypeExtensionPoint
- the content attribute type extension point
-
-
Method Detail
-
getContentTypeId
public String getContentTypeId()
Get the attribute's content type identifier.- Returns:
- the attribute's content type identifier.
-
setContentTypeId
public void setContentTypeId(String contentTypeId)
Set the attribute's content type identifier.- Parameters:
contentTypeId
- the content type identifier to set.
-
getInvertRelationPath
public String getInvertRelationPath()
Get the attribute's mutual relationship path.- Returns:
- the attribute's mutual relationship path.
-
setInvertRelationPath
public void setInvertRelationPath(String invertRelationPath)
Set the attribute's mutual relationship path.- Parameters:
invertRelationPath
- the attribute's mutual relationship path, separated by slashes.
-
setForceInvert
public void setForceInvert(boolean force)
Force mutual relationship regardless of user's rights (only applicable for an attribute with invert relation path).- Parameters:
force
- true to force mutual relationship regardless of user's rights
-
getForceInvert
public boolean getForceInvert()
Returns true if mutual relationship should be set regardless of user's rights- Returns:
- true if mutual relationship should be set regardless of user's rights
-
getModelItems
public Collection<? extends ModelItem> getModelItems()
Description copied from interface:ModelItemContainer
Retrieves all the model items of this container- Specified by:
getModelItems
in interfaceModelItemContainer
- Returns:
- the model items
-
-