public class ContentTypeExtensionPoint extends AbstractThreadSafeComponentExtensionPoint<ContentType>
Modifier and Type | Field and Description |
---|---|
protected Map<String,Map<String,Map<String,List<String>>>> |
_indexingReferences
The indexing references, as a Map of Referenced ContentType -> referencing ContentType
-> local IndexingField name -> path to impacted content.
|
protected HashMultimap<String,String> |
_subTypes
A registry of all the content type's sub types.
|
static String |
ROLE
Avalon Role
|
_cocoonManager, _context, _manager
Constructor and Description |
---|
ContentTypeExtensionPoint() |
Modifier and Type | Method and Description |
---|---|
ContentTypeOrMixinTypeExpression |
createHierarchicalContentTypeOrMixinExpression(String... contentIds)
Create a hierarchical
ContentTypeExpression which returns
all contents of the specified type or mixin and all its descendant types. |
ContentTypeExpression |
createHierarchicalCTExpression(String... contentTypeIds)
Create a hierarchical
ContentTypeExpression which returns
all contents of the specified type and all its descendant types. |
MixinTypeExpression |
createHierarchicalMixinExpression(String... mixinIds)
Create a hierarchical
ContentTypeExpression which returns
all contents of the specified mixin and all its descendant types. |
Set<String> |
getDirectSubTypes(String contentTypeId)
Get the immediate children types of a given
ContentType . |
Map<String,Map<String,List<String>>> |
getIndexingReferences(String referencedContentType)
Get the content types referencing this content type as an indexing field.
|
Set<String> |
getSubTypes(String contentTypeId)
Get all the descendant types of a given
ContentType . |
boolean |
hasIndexingReferences(String contentTypeId)
Test if the given content type has indexing references, i.e.
|
protected void |
initializeContentTypeHierarchy()
Initialize the content type hierarchy.
|
protected void |
initializeContentTypeIndexingReferences()
Initialize the indexing references on all content types.
|
void |
initializeExtensions()
Finalize the initialization of the extensions.
This method is called after all addExtension() calls.This is the last step before the actual startup of the application. |
boolean |
isDescendant(String contentTypeId,
String parentTypeId)
Get all the descendant types of a given
ContentType . |
boolean |
isSameOrDescendant(String contentTypeId,
String parentTypeId)
Get all the descendant types of a given
ContentType . |
protected void |
postInitialize()
The content type hierarchy has been computed: call postInitialize on each ContentType.
|
addComponent, addExtension, contextualize, dispose, getExtension, getExtensionsIds, hasExtension, initialize, service
getLogger, setLogger
protected HashMultimap<String,String> _subTypes
public ContentTypeExtensionPoint()
public void initializeExtensions() throws Exception
ExtensionPoint
addExtension()
calls.initializeExtensions
in interface ExtensionPoint<ContentType>
initializeExtensions
in class AbstractThreadSafeComponentExtensionPoint<ContentType>
Exception
- if something wrong occurspublic ContentTypeExpression createHierarchicalCTExpression(String... contentTypeIds)
ContentTypeExpression
which returns
all contents of the specified type and all its descendant types.contentTypeIds
- the content type id.public MixinTypeExpression createHierarchicalMixinExpression(String... mixinIds)
ContentTypeExpression
which returns
all contents of the specified mixin and all its descendant types.mixinIds
- the mixin idspublic ContentTypeOrMixinTypeExpression createHierarchicalContentTypeOrMixinExpression(String... contentIds)
ContentTypeExpression
which returns
all contents of the specified type or mixin and all its descendant types.contentIds
- the mixin idspublic Set<String> getSubTypes(String contentTypeId)
ContentType
.contentTypeId
- the content type id.public boolean isDescendant(String contentTypeId, String parentTypeId)
ContentType
.contentTypeId
- the content type id to testparentTypeId
- the content type that should be the parent content typepublic boolean isSameOrDescendant(String contentTypeId, String parentTypeId)
ContentType
.contentTypeId
- the content type id to testparentTypeId
- the content type that should be the parent content typepublic Set<String> getDirectSubTypes(String contentTypeId)
ContentType
.contentTypeId
- the content type id.public Map<String,Map<String,List<String>>> getIndexingReferences(String referencedContentType)
referencedContentType
- the referenced content type.ContentType
s referencing the given ContentType
as an indexing field,
as a Map of referencing ContentType -> local IndexingField name -> path to impacted content.null
is returned if the ContentType isn't referenced in any indexing field.public boolean hasIndexingReferences(String contentTypeId)
contentTypeId
- the referenced content type ID.true
if the given content type has indexing references, false
otherwise.protected void initializeContentTypeHierarchy()
protected void postInitialize() throws Exception
Exception
- if an error occurs.protected void initializeContentTypeIndexingReferences()