Class 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 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
    • Constructor Detail

      • TypeVirtualizationMethod

        public TypeVirtualizationMethod()
    • 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: VirtualizationMethod
        Determines if a given NodeRef can be virtualized by this virtualization method.
        Parameters:
        env - the environment in which the virtualization should take place
        nodeRef - the NodeRef that should be virtualized
        Returns:
        true if the given NodeRef can be virtualized by this virtualization method
        false otherwise
        Throws:
        ActualEnvironmentException