Package org.alfresco.repo.virtual.store
Class TypeVirtualizationMethod
java.lang.Object
org.alfresco.repo.virtual.store.TemplateVirtualizationMethod
org.alfresco.repo.virtual.store.TypeVirtualizationMethod
- All Implemented Interfaces:
VirtualizationMethod
Content type and aspect based virtualization strategy.
Virtualizes nodes by associating their types or aspects with a template.
A type or an aspect
Example:
If the templates repository path is
Considering all aspects for vitualization can degrade performance so the set of aspects considered for virtualization can be limited to a predefined accepted
Virtualizes nodes by associating their types or aspects with a template.
A type or an aspect
QName prefixed string form is associated with a vanilla template that has the same name as the type or aspect prefixed name with ':' replaced by '_' and it is .json postfixed. The template is located at predefined templates repository path. Example:
If the templates repository path is
Data Dictionary/Virtual Folders the cm:author aspect will be associated with a vanilla template found by the Data Dictionary/Virtual Folders/cm_author.json path. Considering all aspects for vitualization can degrade performance so the set of aspects considered for virtualization can be limited to a predefined accepted
QName prefix set by setting a comma separated list of accepted prefixes through #setAspectPrefixFilter(String).- Author:
- Bogdan Horje
-
Field Summary
Fields inherited from class org.alfresco.repo.virtual.store.TemplateVirtualizationMethod
PATH_SEPARATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanVirtualize(ActualEnvironment env, NodeRef nodeRef) Determines if a givenNodeRefcan be virtualized by this virtualization method.voidinit()voidvoidsetQnameFilters(String filters) voidsetTemplatesPath(NodeRefExpression templatesPath) virtualize(ActualEnvironment env, NodeRef nodeRef) Applies this virtualizatio rule on a givenNodeRef.Methods inherited from class org.alfresco.repo.virtual.store.TemplateVirtualizationMethod
newVirtualReference, newVirtualReference, newVirtualReference, setVanillaProcessor
-
Constructor Details
-
TypeVirtualizationMethod
public TypeVirtualizationMethod()
-
-
Method Details
-
init
public void init() -
setQnameFilters
-
setTemplatesPath
-
setNamespacePrefixResolver
-
canVirtualize
public boolean canVirtualize(ActualEnvironment env, NodeRef nodeRef) throws ActualEnvironmentException Description copied from interface:VirtualizationMethodDetermines if a givenNodeRefcan be virtualized by this virtualization method.- Parameters:
env- the environment in which the virtualization should take placenodeRef- theNodeRefthat should be virtualized- Returns:
trueif the givenNodeRefcan be virtualized by this virtualization method
falseotherwise- Throws:
ActualEnvironmentException
-
virtualize
Description copied from interface:VirtualizationMethodApplies this virtualizatio rule on a givenNodeRef.- Parameters:
env- the environment in which the virtualization takes placenodeRef- nodeRef theNodeRefthat will be virtualized- Returns:
- a
Referencecorrespondent of the givenNodeRef - Throws:
VirtualizationException
-