Package org.ametys.cms.contenttype
Class ContentTypeDefinition
- java.lang.Object
-
- org.ametys.cms.contenttype.ContentTypeDefinition
-
- All Implemented Interfaces:
ContentTypeDescriptor
public class ContentTypeDefinition extends Object implements ContentTypeDescriptor
This class represents a type of content
-
-
Field Summary
Fields Modifier and Type Field Description private I18nizableText
_category
private List<ClientSideElement.ScriptFile>
_cssFiles
private I18nizableText
_defaultTitle
private I18nizableText
_description
private String
_iconDecorator
private String
_iconGlyph
private String
_id
private boolean
_isAbstract
private I18nizableText
_label
private String
_largeIcon
private String
_mediumIcon
private List<ModelItem>
_modelItems
private String
_parentRef
private String
_pluginName
private String
_right
private String[]
_supertypeIds
private Set<String>
_tags
private List<View>
_views
-
Constructor Summary
Constructors Constructor Description ContentTypeDefinition(String id)
Constructs a new representative of a content type
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description I18nizableText
getCategory()
Retrieves the category of the content type.List<ClientSideElement.ScriptFile>
getCSSFiles()
Returns the list of CSS files needed to correctly display the content's in BO, such as the content's iconI18nizableText
getDefaultTitle()
Retrieves the default title of the content type.I18nizableText
getDescription()
Retrieves the description of the content type.Set<String>
getEditionMetadataSetNames(boolean includeInternal)
Returns all names of "edition" metadataSets.String
getIconDecorator()
Retrieves the CSS class to use for decorator above the main iconString
getIconGlyph()
Retrieves the CSS class to use for glyph iconString
getId()
Retrieves the id of the content type.I18nizableText
getLabel()
Retrieves the label of the content type.String
getLargeIcon()
Retrieves the URL of the icon without the context path.String
getMediumIcon()
Retrieves the URL of the icon without the context path.MetadataSet
getMetadataSetForEdition(String metadataSetName)
Retrieves the metadata set name for edition.MetadataSet
getMetadataSetForView(String metadataSetName)
Retrieves the metadata set name for view.List<ModelItem>
getModelItems()
Get metadata of content typeString
getParentRef()
Get the parent reference of content typeString
getPluginName()
Retrieves the name of the plugin declaring this content type.String
getRight()
Get the right of the content typeString
getSmallIcon()
Retrieves the URL of the icon without the context path.String[]
getSupertypeIds()
Retrieves the super type's ids.Set<String>
getTags()
Get tags of content typeSet<String>
getViewMetadataSetNames(boolean includeInternal)
Returns all names of "view" metadataSets.List<View>
getViews()
Get metadataSet of content typeboolean
isAbstract()
Indicates if the content type is abstractvoid
setCategory(I18nizableText category)
Set the category of content typevoid
setCSSFiles(List<ClientSideElement.ScriptFile> cSSFiles)
Set CSS files of content typevoid
setDefaultTitle(I18nizableText defaultTitle)
Set the default title of content typevoid
setDescription(I18nizableText description)
Set the description of content typevoid
setIconDecorator(String iconDecorator)
Set icon decorator of content typevoid
setIconGlyph(String iconGlyph)
Set icon glyph of content typevoid
setId(String id)
Set id of content typevoid
setIsAbstract(boolean isAbstract)
Set if content type is abstractvoid
setLabel(I18nizableText label)
Set the label of content typevoid
setLargeIcon(String largeIcon)
Set large icon of content typevoid
setMediumIcon(String mediumIcon)
Set medium icon of content typevoid
setModelItems(List<ModelItem> modelItems)
Set model items of content typevoid
setParentRef(String parentRef)
Set the parent reference of content typevoid
setPluginName(String pluginName)
Set the plugin name of content typevoid
setRight(String right)
Set the right of content typevoid
setSupertypeIds(String[] supertypeIds)
Set supertypes of content typevoid
setTags(Set<String> tags)
Set tags of content typevoid
setViews(List<View> views)
Set views of content type-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.cms.contenttype.ContentTypeDescriptor
getDefaultCatalog, getIconPath
-
-
-
-
Field Detail
-
_pluginName
private String _pluginName
-
_label
private I18nizableText _label
-
_description
private I18nizableText _description
-
_defaultTitle
private I18nizableText _defaultTitle
-
_category
private I18nizableText _category
-
_supertypeIds
private String[] _supertypeIds
-
_isAbstract
private boolean _isAbstract
-
_iconGlyph
private String _iconGlyph
-
_iconDecorator
private String _iconDecorator
-
_largeIcon
private String _largeIcon
-
_mediumIcon
private String _mediumIcon
-
_cssFiles
private List<ClientSideElement.ScriptFile> _cssFiles
-
_modelItems
private List<ModelItem> _modelItems
-
_parentRef
private String _parentRef
-
-
Constructor Detail
-
ContentTypeDefinition
public ContentTypeDefinition(String id)
Constructs a new representative of a content type- Parameters:
id
- id of content type
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:ContentTypeDescriptor
Retrieves the id of the content type.- Specified by:
getId
in interfaceContentTypeDescriptor
- Returns:
- the id.
-
getPluginName
public String getPluginName()
Description copied from interface:ContentTypeDescriptor
Retrieves the name of the plugin declaring this content type.- Specified by:
getPluginName
in interfaceContentTypeDescriptor
- Returns:
- the name of the plugin.
-
getLabel
public I18nizableText getLabel()
Description copied from interface:ContentTypeDescriptor
Retrieves the label of the content type.- Specified by:
getLabel
in interfaceContentTypeDescriptor
- Returns:
- the label.
-
getDescription
public I18nizableText getDescription()
Description copied from interface:ContentTypeDescriptor
Retrieves the description of the content type.- Specified by:
getDescription
in interfaceContentTypeDescriptor
- Returns:
- the description.
-
getDefaultTitle
public I18nizableText getDefaultTitle()
Description copied from interface:ContentTypeDescriptor
Retrieves the default title of the content type.- Specified by:
getDefaultTitle
in interfaceContentTypeDescriptor
- Returns:
- the default title.
-
getCategory
public I18nizableText getCategory()
Description copied from interface:ContentTypeDescriptor
Retrieves the category of the content type.- Specified by:
getCategory
in interfaceContentTypeDescriptor
- Returns:
- the category.
-
getSupertypeIds
public String[] getSupertypeIds()
Description copied from interface:ContentTypeDescriptor
Retrieves the super type's ids.- Specified by:
getSupertypeIds
in interfaceContentTypeDescriptor
- Returns:
- the super type's ids, or empty if this content type doesn't extend a specific content type.
-
isAbstract
public boolean isAbstract()
Indicates if the content type is abstract- Returns:
- True if the content type is abstract, false otherwise.
-
getIconGlyph
public String getIconGlyph()
Description copied from interface:ContentTypeDescriptor
Retrieves the CSS class to use for glyph icon- Specified by:
getIconGlyph
in interfaceContentTypeDescriptor
- Returns:
- the glyph name.
-
getIconDecorator
public String getIconDecorator()
Description copied from interface:ContentTypeDescriptor
Retrieves the CSS class to use for decorator above the main icon- Specified by:
getIconDecorator
in interfaceContentTypeDescriptor
- Returns:
- the glyph name.
-
getSmallIcon
public String getSmallIcon()
Description copied from interface:ContentTypeDescriptor
Retrieves the URL of the icon without the context path.- Specified by:
getSmallIcon
in interfaceContentTypeDescriptor
- Returns:
- the icon URL for the small image 16x16.
-
getMediumIcon
public String getMediumIcon()
Description copied from interface:ContentTypeDescriptor
Retrieves the URL of the icon without the context path.- Specified by:
getMediumIcon
in interfaceContentTypeDescriptor
- Returns:
- the icon URL for the medium sized image 32x32.
-
getLargeIcon
public String getLargeIcon()
Description copied from interface:ContentTypeDescriptor
Retrieves the URL of the icon without the context path.- Specified by:
getLargeIcon
in interfaceContentTypeDescriptor
- Returns:
- the icon URL for the large image 48x48.
-
getViewMetadataSetNames
public Set<String> getViewMetadataSetNames(boolean includeInternal)
Description copied from interface:ContentTypeDescriptor
Returns all names of "view" metadataSets.- Specified by:
getViewMetadataSetNames
in interfaceContentTypeDescriptor
- Parameters:
includeInternal
- if the result should include internal metadataSets.- Returns:
- all names of "view" metadataSets.
-
getEditionMetadataSetNames
public Set<String> getEditionMetadataSetNames(boolean includeInternal)
Description copied from interface:ContentTypeDescriptor
Returns all names of "edition" metadataSets.- Specified by:
getEditionMetadataSetNames
in interfaceContentTypeDescriptor
- Parameters:
includeInternal
- if the result should include internal metadataSets.- Returns:
- all names of "edition" metadataSets.
-
getMetadataSetForView
public MetadataSet getMetadataSetForView(String metadataSetName)
Description copied from interface:ContentTypeDescriptor
Retrieves the metadata set name for view.- Specified by:
getMetadataSetForView
in interfaceContentTypeDescriptor
- Parameters:
metadataSetName
- the metadata set name.- Returns:
- the metadata definition.
-
getMetadataSetForEdition
public MetadataSet getMetadataSetForEdition(String metadataSetName)
Description copied from interface:ContentTypeDescriptor
Retrieves the metadata set name for edition.- Specified by:
getMetadataSetForEdition
in interfaceContentTypeDescriptor
- Parameters:
metadataSetName
- the metadata set name.- Returns:
- the metadata set.
-
getCSSFiles
public List<ClientSideElement.ScriptFile> getCSSFiles()
Description copied from interface:ContentTypeDescriptor
Returns the list of CSS files needed to correctly display the content's in BO, such as the content's icon- Specified by:
getCSSFiles
in interfaceContentTypeDescriptor
- Returns:
- The list of CSS files needed. Must not be null.
-
getRight
public String getRight()
Get the right of the content type- Returns:
- the right of the content type
-
getViews
public List<View> getViews()
Get metadataSet of content type- Returns:
- metadataset of content type
-
getModelItems
public List<ModelItem> getModelItems()
Get metadata of content type- Returns:
- metadata of content type
-
getParentRef
public String getParentRef()
Get the parent reference of content type- Returns:
- the parent reference of content type
-
setRight
public void setRight(String right)
Set the right of content type- Parameters:
right
- the right to set
-
setTags
public void setTags(Set<String> tags)
Set tags of content type- Parameters:
tags
- tags to set
-
setModelItems
public void setModelItems(List<ModelItem> modelItems)
Set model items of content type- Parameters:
modelItems
- model items to set
-
setViews
public void setViews(List<View> views)
Set views of content type- Parameters:
views
- views to set
-
setPluginName
public void setPluginName(String pluginName)
Set the plugin name of content type- Parameters:
pluginName
- the plugin name to set
-
setLabel
public void setLabel(I18nizableText label)
Set the label of content type- Parameters:
label
- the label to set
-
setDescription
public void setDescription(I18nizableText description)
Set the description of content type- Parameters:
description
- the description to set
-
setDefaultTitle
public void setDefaultTitle(I18nizableText defaultTitle)
Set the default title of content type- Parameters:
defaultTitle
- the default title to set
-
setCategory
public void setCategory(I18nizableText category)
Set the category of content type- Parameters:
category
- the category of content type
-
setSupertypeIds
public void setSupertypeIds(String[] supertypeIds)
Set supertypes of content type- Parameters:
supertypeIds
- supertypes to set
-
setIconGlyph
public void setIconGlyph(String iconGlyph)
Set icon glyph of content type- Parameters:
iconGlyph
- icon glyph to set
-
setIconDecorator
public void setIconDecorator(String iconDecorator)
Set icon decorator of content type- Parameters:
iconDecorator
- icon decorator to set
-
setLargeIcon
public void setLargeIcon(String largeIcon)
Set large icon of content type- Parameters:
largeIcon
- large icon to set
-
setMediumIcon
public void setMediumIcon(String mediumIcon)
Set medium icon of content type- Parameters:
mediumIcon
- medium icon to set
-
setCSSFiles
public void setCSSFiles(List<ClientSideElement.ScriptFile> cSSFiles)
Set CSS files of content type- Parameters:
cSSFiles
- css files to set
-
setIsAbstract
public void setIsAbstract(boolean isAbstract)
Set if content type is abstract- Parameters:
isAbstract
- the boolean to set
-
setParentRef
public void setParentRef(String parentRef)
Set the parent reference of content type- Parameters:
parentRef
- the parent reference to set
-
-