public class ContentTypesHelper extends AbstractLogEnabled implements Component, Serviceable, ThreadSafe, Disposable
ContentType
sModifier and Type | Class and Description |
---|---|
(package private) class |
ContentTypesHelper.ContentTypeComparator |
Modifier and Type | Field and Description |
---|---|
private Map<String,Map<String,MetadataSet>> |
_cacheForEdition
Deprecated.
use
_viewCache instead |
private Map<String,Map<String,MetadataSet>> |
_cacheForView
Deprecated.
use
_viewCache instead |
protected ContentTypeExtensionPoint |
_cTypeEP
The content types extension point
|
private DynamicContentTypeDescriptorExtentionPoint |
_dynamicCTDescriptorEP |
protected RightManager |
_rightManager
The rights manager
|
protected RootContentHelper |
_rootContentHelper
Helper for root content
|
private ServiceManager |
_smanager |
protected CurrentUserProvider |
_userProvider
The current user provider
|
private Map<String,Map<String,View>> |
_viewCache
Cache containing content types' views
The key is a cache identifier that is a concatenation of the identifiers of the concerned content types and mixins
The value is a Map containing the views by their names
|
static String |
ROLE
The Avalon role
|
Constructor and Description |
---|
ContentTypesHelper() |
Modifier and Type | Method and Description |
---|---|
private void |
_addIfNotPresent(Collection<String> collection,
String value) |
private List<Set<String>> |
_buildReverseHierarchies(String contentTypeId,
Set<String> hierarchy) |
private boolean |
_containsContentType(String[] cTypesId,
String cTypeId) |
private void |
_copyMetadataSetElementsIfNotExist(AbstractMetadataSetElement src,
AbstractMetadataSetElement dest,
AbstractMetadataSetElement reference)
Deprecated.
Use
View.includeView(View) instead |
private Map<String,Object> |
_dispatchContentTypes(boolean checkRights,
boolean includePrivate,
boolean includeMixins,
boolean includeAbstract,
Collection<String> allContentTypesIds) |
private String |
_getCacheIdentifier(String[] contentTypes,
String[] mixins) |
protected ContentTypeExtensionPoint |
_getContentTypeEP()
Lazy lookup of
ContentTypeExtensionPoint |
private DynamicContentTypeDescriptorExtentionPoint |
_getDynamicContentTypeDescriptorExtentionPoint() |
protected void |
_getMetadataDefinitionsAcc(Map<String,MetadataDefinition> internalAcc,
AbstractMetadataSetElement metadataSetElement,
String prefix,
MetadataDefinitionHolder metaDefHolder)
Deprecated.
Use
AttributeDefinition API instead |
protected MetadataSet |
_getMetadataSet(ContentType contentType,
String metadataSetName,
boolean isEdition)
Deprecated.
Use
AttributeDefinition API instead |
protected boolean |
_hasRight(ContentType contentType)
Test if the current user has the right needed by the content type to create a content.
|
List<Set<String>> |
buildReverseHierarchies(String contentTypeId)
Builds the reverse hierarchies of ancestors of a content type
|
boolean |
canRead(Content content,
MetadataDefinition metadataDef)
Deprecated.
Use
AttributeDefinition API instead |
boolean |
canWrite(Content content,
MetadataDefinition metadataDef)
Deprecated.
Use
AttributeDefinition API instead |
void |
copyMetadataSetElementsIfNotExist(AbstractMetadataSetElement src,
AbstractMetadataSetElement dest)
Deprecated.
Use
View.includeView(View) instead |
void |
dispose() |
Set<String> |
getAncestors(String contentTypeId)
Get all ancestors for the given content type
|
String |
getCommonAncestor(Collection<String> contentTypes)
Get the id of the content type common ancestor
|
Map<String,MetadataDefinition> |
getCommonMetadataDefinitions(Collection<String> cTypeIds,
String metadataSetName,
boolean isEdition)
Deprecated.
Use
AttributeDefinition API instead |
I18nizableText |
getContentTypeCategory(Content content)
Retrieves the category of the content type.
|
I18nizableText |
getContentTypeDefaultTitle(Content content)
Retrieves the default title of the content type.
|
I18nizableText |
getContentTypeDescription(Content content)
Retrieves the description of the content type.
|
String |
getContentTypeIdForRendering(Content content)
Get the id of content type to use for rendering
|
I18nizableText |
getContentTypeLabel(Content content)
Retrieves the label of the content type.
|
String |
getContentTypePluginForRendering(Content content)
Get the plugin name of content type to use for rendering
|
Map<String,Object> |
getContentTypeProperties(ContentType contentType)
Get the content type properties
|
Set<Map<String,Object>> |
getContentTypesInformations()
Get information on content types.
|
Map<String,Object> |
getContentTypesList(List<String> ids,
boolean inherited,
boolean checkRights,
boolean includePrivate,
boolean includeMixins,
boolean includeAbstract)
Get information on content types.
|
String |
getDynamicContentTypeId(String[] contentTypes,
String[] mixinTypes)
Get the id of the dynamic content type matching to given ones
|
String |
getDynamicContentTypePlugin(String[] contentTypes,
String[] mixinTypes)
Get the plugin name of the dynamic content type matching to given ones
|
ContentType |
getFirstContentType(Content content)
Get the content type which determines the content icons and rendering
|
String |
getIconDecorator(Content content)
Retrieves the CSS class to use as decorator above the main icon
|
String |
getIconGlyph(Content content)
Retrieves the CSS class to use as glyph icon of the content
|
IndexingModel |
getIndexingModel(Content content)
Get the indexing model resulting of the concatenation of indexing models of given content types and mixins.
|
IndexingModel |
getIndexingModel(String[] cTypes,
String[] mixins)
Get the indexing model resulting of the concatenation of indexing models of given content types and mixins.
|
String |
getLargeIcon(Content content)
Retrieves the URL of the icon without the context path.
|
String |
getMediumIcon(Content content)
Retrieves the URL of the icon without the context path.
|
MetadataDefinition |
getMetadataDefinition(String metadataPath,
Content content)
Deprecated.
Use
Content.getDefinition(String) API instead |
MetadataDefinition |
getMetadataDefinition(String metadataPath,
ContentType initialContentType)
Deprecated.
Use
ModelItemContainer.getModelItem(String) instead |
MetadataDefinition |
getMetadataDefinition(String metadataPath,
String[] cTypes,
String[] mixins)
Deprecated.
Use
AttributeDefinition API instead |
MetadataDefinition |
getMetadataDefinitionByMetadataValuePath(String metadataValuePath,
Content content)
Deprecated.
Use
AttributeDefinition API instead |
private MetadataDefinition |
getMetadataDefinitionByMetadataValuePath(String metadataValuePath,
MetadataDefinitionHolder metadataDefHolder)
Deprecated.
Use
AttributeDefinition API instead |
MetadataDefinition |
getMetadataDefinitionByMetadataValuePath(String metadataValuePath,
String[] cTypes,
String[] mixins)
Deprecated.
Use
AttributeDefinition API instead |
List<MetadataDefinition> |
getMetadataDefinitionPath(String metadataPath,
Content content)
Deprecated.
Use
AttributeDefinition API instead |
List<MetadataDefinition> |
getMetadataDefinitionPath(String metadataPath,
ContentType initialContentType)
Deprecated.
Use
ModelItemContainer.getModelItem(String) API instead |
List<MetadataDefinition> |
getMetadataDefinitionPath(String metadataPath,
String[] cTypes,
String[] mixins)
Deprecated.
Use
AttributeDefinition API instead |
Map<String,MetadataDefinition> |
getMetadataDefinitions(MetadataDefinitionHolder metaDefHolder,
Predicate<MetadataDefinition> predicate)
Deprecated.
Use
AttributeDefinition API instead |
Map<String,MetadataDefinition> |
getMetadataDefinitions(MetadataSet metadataSet,
Content content)
Deprecated.
Use
AttributeDefinition API instead |
Map<String,MetadataDefinition> |
getMetadataDefinitions(MetadataSet metadataSet,
ContentType initialContentType)
Deprecated.
Use
AttributeDefinition API instead |
Map<String,MetadataDefinition> |
getMetadataDefinitions(MetadataSet metadataSet,
String[] cTypes,
String[] mixins)
Deprecated.
Use
AttributeDefinition API instead |
Map<String,MetadataDefinition> |
getMetadataDefinitions(Set<String> metadataPaths,
Content content)
Deprecated.
Use
AttributeDefinition API instead |
Map<String,MetadataDefinition> |
getMetadataDefinitions(Set<String> metadataPaths,
ContentType initialContentType)
Deprecated.
Use
AttributeDefinition API instead |
Map<String,MetadataDefinition> |
getMetadataDefinitions(Set<String> metadataPaths,
String[] cTypes,
String[] mixins)
Deprecated.
Use
AttributeDefinition API instead |
Map<String,MetadataDefinition> |
getMetadataDefinitions(String[] cTypes)
Deprecated.
Use
AttributeDefinition API instead |
Map<String,List<MetadataDefinition>> |
getMetadataDefinitionsPaths(MetadataSet metadataSet,
Content content)
Deprecated.
Use
AttributeDefinition API instead |
Map<String,List<MetadataDefinition>> |
getMetadataDefinitionsPaths(MetadataSet metadataSet,
ContentType initialContentType)
Deprecated.
Use
AttributeDefinition API instead |
Map<String,List<MetadataDefinition>> |
getMetadataDefinitionsPaths(MetadataSet metadataSet,
String[] cTypes,
String[] mixins)
Deprecated.
Use
AttributeDefinition API instead |
Map<String,List<MetadataDefinition>> |
getMetadataDefinitionsPaths(Set<String> metadataPaths,
Content content)
Deprecated.
Use
AttributeDefinition API instead |
Map<String,List<MetadataDefinition>> |
getMetadataDefinitionsPaths(Set<String> metadataPaths,
ContentType initialContentType)
Deprecated.
Use
AttributeDefinition API instead |
Map<String,List<MetadataDefinition>> |
getMetadataDefinitionsPaths(Set<String> metadataPaths,
String[] cTypes,
String[] mixins)
Deprecated.
Use
AttributeDefinition API instead |
Set<String> |
getMetadataNames(Content content)
Retrieves the root metadata names of a content.
|
Set<String> |
getMetadataNames(String[] cTypes,
String[] mixins)
Retrieves the metadata names resulting of the union of metadata
names of given content types and mixins
|
protected Set<String> |
getMetadataPaths(AbstractMetadataSetElement metadataSet,
String prefix)
Deprecated.
Use
ViewItem API instead |
Set<String> |
getMetadataPaths(MetadataSet metadataSet)
Deprecated.
Use
View API instead |
MetadataSet |
getMetadataSetForEdition(String metadataSetName,
String[] cTypes,
String[] mixins)
Deprecated.
Use
getView(String, String[], String[]) instead |
MetadataSet |
getMetadataSetForView(String metadataSetName,
String[] cTypes,
String[] mixins)
Deprecated.
Use
getView(String, String[], String[]) instead |
Map<String,MetadataSet> |
getMetadataSetsForEdition(String[] cTypes,
String[] mixins,
boolean includeInternal)
Deprecated.
Use
getViews(String[], String[]) instead |
Map<String,MetadataSet> |
getMetadataSetsForView(String[] cTypes,
String[] mixins,
boolean includeInternal)
Deprecated.
Use
getViews(String[], String[]) instead |
List<Map<String,Object>> |
getMetadataSetsInfo(String cTypeId,
boolean edition,
boolean includeInternal)
Deprecated.
Use
View API instead |
Map<String,ModelItem> |
getModelItems(String[] contentTypes)
Retrieves all model items of given content types.
|
String |
getPluginName(String contentTypeId)
Get plugin name for the given content type
|
String |
getSmallIcon(Content content)
Retrieves the URL of the icon without the context path.
|
Pair<String[],String[]> |
getSupertypeIds(String contentTypeId)
Get super type's ids for the given content type
The first entry contains super content types, the second one contains super mixin types
|
static MetadataDefinition |
getTitleMetadataDefinition()
Deprecated.
Use
AttributeDefinition API instead |
View |
getView(String viewName,
String[] contentTypeIds,
String[] mixinIds)
Get the view for view resulting of the concatenation of views of the given content types and mixins.
|
Map<String,View> |
getViews(String[] contentTypeIds,
String[] mixinIds)
Get all views resulting of the concatenation of views of given content types and mixins.
|
Map<String,View> |
getViews(String[] contentTypeIds,
String[] mixinIds,
Set<String> viewNamesToAvoid)
Get all views resulting of the concatenation of views of given content types and mixins.
|
boolean |
isCompatibleContentType(Content content,
String cTypeId)
Determines if the given content type can be added to content
|
boolean |
isInstanceOf(Content content,
String cTypeId)
Determines if a content is a instance of given content type id
|
protected Set<String> |
removeAncestors(Set<String> contentTypes)
Remove all content types in the set that are ancestors of other content types in the set.
|
void |
service(ServiceManager smanager) |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected ContentTypeExtensionPoint _cTypeEP
protected CurrentUserProvider _userProvider
protected RightManager _rightManager
protected RootContentHelper _rootContentHelper
private DynamicContentTypeDescriptorExtentionPoint _dynamicCTDescriptorEP
@Deprecated private Map<String,Map<String,MetadataSet>> _cacheForView
_viewCache
instead@Deprecated private Map<String,Map<String,MetadataSet>> _cacheForEdition
_viewCache
insteadprivate Map<String,Map<String,View>> _viewCache
private ServiceManager _smanager
public ContentTypesHelper()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
ServiceException
private DynamicContentTypeDescriptorExtentionPoint _getDynamicContentTypeDescriptorExtentionPoint()
public void dispose()
dispose
in interface Disposable
protected ContentTypeExtensionPoint _getContentTypeEP()
ContentTypeExtensionPoint
public boolean isInstanceOf(Content content, String cTypeId)
content
- The contentcTypeId
- The id of content type or mixintrue
if the content is an instance of content typeprivate boolean _containsContentType(String[] cTypesId, String cTypeId)
public String getCommonAncestor(Collection<String> contentTypes)
contentTypes
- The content types to comparenull
if not foundprotected Set<String> removeAncestors(Set<String> contentTypes)
contentTypes
- a Set of content type IDs.public Set<String> getAncestors(String contentTypeId)
contentTypeId
- The content type id to testIllegalArgumentException
- if the content type does not exist.public Pair<String[],String[]> getSupertypeIds(String contentTypeId)
contentTypeId
- The content type id to testIllegalArgumentException
- if the content type does not exist.public String getPluginName(String contentTypeId)
contentTypeId
- The content type id to testIllegalArgumentException
- if the content type does not exist.public List<Set<String>> buildReverseHierarchies(String contentTypeId)
contentTypeId
- The content type's idprivate List<Set<String>> _buildReverseHierarchies(String contentTypeId, Set<String> hierarchy)
public Set<String> getMetadataNames(Content content)
content
- The content.public Set<String> getMetadataNames(String[] cTypes, String[] mixins)
cTypes
- The id of content typesmixins
- The id of mixinspublic Map<String,View> getViews(String[] contentTypeIds, String[] mixinIds)
contentTypeIds
- the identifiers of the content typesmixinIds
- the identifiers of the mixinspublic Map<String,View> getViews(String[] contentTypeIds, String[] mixinIds, Set<String> viewNamesToAvoid)
contentTypeIds
- the identifiers of the content typesmixinIds
- the identifiers of the mixinsviewNamesToAvoid
- names of views that should not be managedpublic View getView(String viewName, String[] contentTypeIds, String[] mixinIds)
viewName
- the name of the view to retrievecontentTypeIds
- the identifiers of the content typesmixinIds
- the identifiers of the mixins@Deprecated public Map<String,MetadataSet> getMetadataSetsForView(String[] cTypes, String[] mixins, boolean includeInternal)
getViews(String[], String[])
insteadcTypes
- The id of content typesmixins
- The id of mixinsincludeInternal
- true
True to include internal
metadata sets@Deprecated public Map<String,MetadataSet> getMetadataSetsForEdition(String[] cTypes, String[] mixins, boolean includeInternal)
getViews(String[], String[])
insteadcTypes
- The id of content typesmixins
- The id of mixinsincludeInternal
- true
True to include internal
metadata sets@Deprecated public MetadataSet getMetadataSetForView(String metadataSetName, String[] cTypes, String[] mixins)
getView(String, String[], String[])
insteadmetadataSetName
- the name of metadata set to retrievecTypes
- The id of content typesmixins
- The id of mixins@Deprecated public MetadataSet getMetadataSetForEdition(String metadataSetName, String[] cTypes, String[] mixins)
getView(String, String[], String[])
insteadmetadataSetName
- the name of metadata set to retrievecTypes
- The id of content typesmixins
- The id of mixins@Deprecated public List<Map<String,Object>> getMetadataSetsInfo(String cTypeId, boolean edition, boolean includeInternal)
View
API insteadcTypeId
- the content type idedition
- Set to true to get edition metadata set. False otherwise.includeInternal
- Set to true to include internal metadata sets.public IndexingModel getIndexingModel(Content content)
content
- The content.public IndexingModel getIndexingModel(String[] cTypes, String[] mixins)
cTypes
- The id of content typesmixins
- The id of mixins@Deprecated public void copyMetadataSetElementsIfNotExist(AbstractMetadataSetElement src, AbstractMetadataSetElement dest)
View.includeView(View)
insteadsrc
- The metadata set to copydest
- The metadata of destination@Deprecated private void _copyMetadataSetElementsIfNotExist(AbstractMetadataSetElement src, AbstractMetadataSetElement dest, AbstractMetadataSetElement reference)
View.includeView(View)
insteadsrc
- the sourcedest
- the destinationreference
- the reference@Deprecated public MetadataDefinition getMetadataDefinitionByMetadataValuePath(String metadataValuePath, Content content)
AttributeDefinition
API insteadmetadataValuePath
- the metadata value path: it is separated by slashes and repeaters are valued: eg: "mycomposite/myrepeater[3]/mymetadata".content
- the content.null
if not found@Deprecated public MetadataDefinition getMetadataDefinitionByMetadataValuePath(String metadataValuePath, String[] cTypes, String[] mixins)
AttributeDefinition
API insteadmetadataValuePath
- the metadata value path: it is separated by slashes and repeaters are valued: eg: "mycomposite.myrepeater[3].mymetadata".cTypes
- The id of content typesmixins
- The id of mixinsnull
if not found@Deprecated private MetadataDefinition getMetadataDefinitionByMetadataValuePath(String metadataValuePath, MetadataDefinitionHolder metadataDefHolder)
AttributeDefinition
API insteadmetadataValuePath
- the metadata value path: it is separated by slashes and repeaters are valued: eg: "mycomposite/myrepeater[3]/mymetadata".metadataDefHolder
- The metadata def holder (such as the content type)null
if not found@Deprecated public Set<String> getMetadataPaths(MetadataSet metadataSet)
View
API insteadmetadataSet
- The metadataset to get@Deprecated protected Set<String> getMetadataPaths(AbstractMetadataSetElement metadataSet, String prefix)
ViewItem
API insteadmetadataSet
- The metadataset to getprefix
- The metadata path of the parent@Deprecated public MetadataDefinition getMetadataDefinition(String metadataPath, Content content)
Content.getDefinition(String)
API insteadmetadataPath
- the metadata path separated by '/'content
- The content.@Deprecated public Map<String,MetadataDefinition> getMetadataDefinitions(Set<String> metadataPaths, Content content)
AttributeDefinition
API insteadmetadataPaths
- A set of metadata path to analysecontent
- The content associated@Deprecated public Map<String,MetadataDefinition> getMetadataDefinitions(MetadataSet metadataSet, Content content)
AttributeDefinition
API insteadmetadataSet
- A metadataSet to analysecontent
- The content associated@Deprecated public List<MetadataDefinition> getMetadataDefinitionPath(String metadataPath, Content content)
AttributeDefinition
API insteadmetadataPath
- the metadata path separated by '/'content
- The content.@Deprecated public Map<String,List<MetadataDefinition>> getMetadataDefinitionsPaths(Set<String> metadataPaths, Content content)
AttributeDefinition
API insteadmetadataPaths
- A set of metadata path to analysecontent
- The content associated@Deprecated public Map<String,List<MetadataDefinition>> getMetadataDefinitionsPaths(MetadataSet metadataSet, Content content)
AttributeDefinition
API insteadmetadataSet
- A metadataset to analysecontent
- The content associated@Deprecated public MetadataDefinition getMetadataDefinition(String metadataPath, String[] cTypes, String[] mixins)
AttributeDefinition
API insteadmetadataPath
- the metadata path separated by '/'cTypes
- The content types.mixins
- The content mixins types.@Deprecated public Map<String,MetadataDefinition> getMetadataDefinitions(Set<String> metadataPaths, String[] cTypes, String[] mixins)
AttributeDefinition
API insteadmetadataPaths
- A set of metadata path to analysecTypes
- The content types.mixins
- The content mixins types.@Deprecated public Map<String,MetadataDefinition> getMetadataDefinitions(MetadataSet metadataSet, String[] cTypes, String[] mixins)
AttributeDefinition
API insteadmetadataSet
- A metadataset to analysecTypes
- The content types.mixins
- The content mixins types.@Deprecated public Map<String,MetadataDefinition> getMetadataDefinitions(MetadataDefinitionHolder metaDefHolder, Predicate<MetadataDefinition> predicate)
AttributeDefinition
API insteadmetaDefHolder
- The metadata definition holderpredicate
- The predicate (ex. m -> m.getType() == MetadataType.CONTENT)@Deprecated public List<MetadataDefinition> getMetadataDefinitionPath(String metadataPath, String[] cTypes, String[] mixins)
AttributeDefinition
API insteadmetadataPath
- the metadata path separated by '/'cTypes
- The id of content typesmixins
- The id of mixinsnull
if not found@Deprecated public Map<String,List<MetadataDefinition>> getMetadataDefinitionsPaths(Set<String> metadataPaths, String[] cTypes, String[] mixins)
AttributeDefinition
API insteadmetadataPaths
- A set of metadata path to analysecTypes
- The id of content typesmixins
- The id of mixins@Deprecated public Map<String,List<MetadataDefinition>> getMetadataDefinitionsPaths(MetadataSet metadataSet, String[] cTypes, String[] mixins)
AttributeDefinition
API insteadmetadataSet
- A metadataset to analysecTypes
- The id of content typesmixins
- The id of mixins@Deprecated public MetadataDefinition getMetadataDefinition(String metadataPath, ContentType initialContentType)
ModelItemContainer.getModelItem(String)
insteadmetadataPath
- the metadata path separated by '/'initialContentType
- The initial content type to start the searchnull
if not found@Deprecated public Map<String,MetadataDefinition> getMetadataDefinitions(Set<String> metadataPaths, ContentType initialContentType)
AttributeDefinition
API insteadmetadataPaths
- A set of metadata path to analyseinitialContentType
- The initial content type to start the search@Deprecated public Map<String,MetadataDefinition> getMetadataDefinitions(MetadataSet metadataSet, ContentType initialContentType)
AttributeDefinition
API insteadmetadataSet
- A metadataset to analyseinitialContentType
- The initial content type to start the search@Deprecated public List<MetadataDefinition> getMetadataDefinitionPath(String metadataPath, ContentType initialContentType)
ModelItemContainer.getModelItem(String)
API insteadinitialContentType
- The initial content type to start the searchmetadataPath
- the metadata path separated by '/'@Deprecated public Map<String,List<MetadataDefinition>> getMetadataDefinitionsPaths(Set<String> metadataPaths, ContentType initialContentType)
AttributeDefinition
API insteadmetadataPaths
- A set of metadata path to analyseinitialContentType
- The initial content type to start the search@Deprecated public Map<String,List<MetadataDefinition>> getMetadataDefinitionsPaths(MetadataSet metadataSet, ContentType initialContentType)
AttributeDefinition
API insteadmetadataSet
- A semetadataSet to analyseinitialContentType
- The initial content type to start the searchpublic boolean isCompatibleContentType(Content content, String cTypeId)
content
- The contentcTypeId
- The id of content typetrue
if the content type is compatible with content@Deprecated public Map<String,MetadataDefinition> getMetadataDefinitions(String[] cTypes) throws ConfigurationException
AttributeDefinition
API insteadcTypes
- The id of content typesConfigurationException
- if an error occurredpublic Map<String,ModelItem> getModelItems(String[] contentTypes) throws ConfigurationException
contentTypes
- The identifier of the content typesConfigurationException
- if an error occurred@Deprecated public Map<String,MetadataDefinition> getCommonMetadataDefinitions(Collection<String> cTypeIds, String metadataSetName, boolean isEdition)
AttributeDefinition
API insteadcTypeIds
- The list of content types to considermetadataSetName
- The metadata set name to list metadataisEdition
- Is the metadata set for edition (or for view)@Deprecated protected void _getMetadataDefinitionsAcc(Map<String,MetadataDefinition> internalAcc, AbstractMetadataSetElement metadataSetElement, String prefix, MetadataDefinitionHolder metaDefHolder)
AttributeDefinition
API insteadinternalAcc
- the accumulator of metadata definitionmetadataSetElement
- the metadata set of the contentprefix
- the path prefix preceding the names of the metadatametaDefHolder
- the holder of the metadata definitions for the content@Deprecated protected MetadataSet _getMetadataSet(ContentType contentType, String metadataSetName, boolean isEdition)
AttributeDefinition
API insteadcontentType
- The content type to considermetadataSetName
- The metadata set to get (that list the metadata to consider)isEdition
- Is the metadata set for edition (or for view)public Set<Map<String,Object>> getContentTypesInformations()
public Map<String,Object> getContentTypesList(List<String> ids, boolean inherited, boolean checkRights, boolean includePrivate, boolean includeMixins, boolean includeAbstract)
ids
- The id of content types to retrieveinherited
- If true, the sub-types will be also returned.checkRights
- If true, only content types allowed for creation will
be returnedincludePrivate
- If true, the list will include the private content types. By default the list is restricted to the public content types.includeMixins
- If true the list will include the mixins content types.includeAbstract
- If true the list will include the abstract content types.private Map<String,Object> _dispatchContentTypes(boolean checkRights, boolean includePrivate, boolean includeMixins, boolean includeAbstract, Collection<String> allContentTypesIds)
public Map<String,Object> getContentTypeProperties(ContentType contentType)
contentType
- The content typeprotected boolean _hasRight(ContentType contentType)
contentType
- The content typeprivate void _addIfNotPresent(Collection<String> collection, String value)
@Deprecated public boolean canRead(Content content, MetadataDefinition metadataDef)
AttributeDefinition
API insteadmetadataDef
- the metadata definitioncontent
- The content where metadata is to be read on.true
if the current user is allowed to read the
metadata of this content.AmetysRepositoryException
- if an error occurs while accessing the
content.@Deprecated public boolean canWrite(Content content, MetadataDefinition metadataDef)
AttributeDefinition
API insteadmetadataDef
- the metadata definitioncontent
- The content where metadata is to be read on.true
if the current user is allowed to read the
metadata of this content.AmetysRepositoryException
- if an error occurs while accessing the
content.public String getContentTypeIdForRendering(Content content)
content
- The contentpublic String getDynamicContentTypeId(String[] contentTypes, String[] mixinTypes)
contentTypes
- The content typesmixinTypes
- The mixinspublic String getContentTypePluginForRendering(Content content)
content
- The contentpublic String getDynamicContentTypePlugin(String[] contentTypes, String[] mixinTypes)
contentTypes
- The content typesmixinTypes
- The mixinspublic I18nizableText getContentTypeLabel(Content content)
content
- The contentpublic I18nizableText getContentTypeDescription(Content content)
content
- The contentpublic I18nizableText getContentTypeDefaultTitle(Content content)
content
- The contentpublic I18nizableText getContentTypeCategory(Content content)
content
- The contentpublic String getIconGlyph(Content content)
content
- The contentpublic String getIconDecorator(Content content)
content
- The contentpublic String getSmallIcon(Content content)
content
- The contentpublic String getMediumIcon(Content content)
content
- The contentpublic String getLargeIcon(Content content)
content
- The contentpublic ContentType getFirstContentType(Content content)
content
- The content@Deprecated public static MetadataDefinition getTitleMetadataDefinition()
AttributeDefinition
API insteadprivate String _getCacheIdentifier(String[] contentTypes, String[] mixins)