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
public class TypeVirtualizationMethod extends TemplateVirtualizationMethod
Content type and aspect based virtualization strategy.
Virtualizes nodes by associating their types or aspects with a template.
A type or an aspectQNameprefixed 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.jsonpostfixed. The template is located at predefined templates repository path.
Example:
If the templates repository path isData Dictionary/Virtual Foldersthecm:authoraspect will be associated with a vanilla template found by theData Dictionary/Virtual Folders/cm_author.jsonpath.
Considering all aspects for vitualization can degrade performance so the set of aspects considered for virtualization can be limited to a predefined acceptedQNameprefix 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 Constructor Description TypeVirtualizationMethod()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanVirtualize(ActualEnvironment env, org.alfresco.service.cmr.repository.NodeRef nodeRef)Determines if a givenNodeRefcan be virtualized by this virtualization method.voidinit()voidsetNamespacePrefixResolver(org.alfresco.service.namespace.NamespacePrefixResolver resolver)voidsetQnameFilters(java.lang.String filters)voidsetTemplatesPath(NodeRefExpression templatesPath)Referencevirtualize(ActualEnvironment env, org.alfresco.service.cmr.repository.NodeRef nodeRef)Applies this virtualizatio rule on a givenNodeRef.-
Methods inherited from class org.alfresco.repo.virtual.store.TemplateVirtualizationMethod
newVirtualReference, newVirtualReference, newVirtualReference, setVanillaProcessor
-
-
-
-
Method Detail
-
init
public void init()
-
setQnameFilters
public void setQnameFilters(java.lang.String filters)
-
setTemplatesPath
public void setTemplatesPath(NodeRefExpression templatesPath)
-
setNamespacePrefixResolver
public void setNamespacePrefixResolver(org.alfresco.service.namespace.NamespacePrefixResolver resolver)
-
canVirtualize
public boolean canVirtualize(ActualEnvironment env, org.alfresco.service.cmr.repository.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
public Reference virtualize(ActualEnvironment env, org.alfresco.service.cmr.repository.NodeRef nodeRef) throws VirtualizationException
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
-
-