Package org.alfresco.repo.virtual.store
Class TemplateVirtualizationMethod
- java.lang.Object
-
- org.alfresco.repo.virtual.store.TemplateVirtualizationMethod
-
- All Implemented Interfaces:
VirtualizationMethod
- Direct Known Subclasses:
AspectVirtualizationMethod,TypeVirtualizationMethod
public abstract class TemplateVirtualizationMethod extends java.lang.Object implements VirtualizationMethod
Base implementation for virtualization rules defined using template located in the content repository or in a system path.
System paths are custom string references of a resource that can be located either in the repository or in the java classpath - system paths are deprecated and they will be replaced byEncodings.PLAINencodedReferencestrings.
Templates are programmatic or declarative definitions of the rules implemented by this virtualization method.
Supported template formats include JavaScript defined templates and JSON defined templates (JSON templates are also referred as vanilla templates). The extension present in the name of the template is used to determine the nature of the template (*.js for JavaScript and *.json for JSON).
JSON templates processing is done using a configurable JavaScriot processor script (actually a JavaScript template that gets an extra parameter containing the JSON template) that resides in the Java class path.
Templates are processed in order to virtualizeNodeRefs usingNewVirtualReferenceMethodprotocol reference constructor visitor.- Author:
- Bogdan Horje
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringPATH_SEPARATOR
-
Constructor Summary
Constructors Constructor Description TemplateVirtualizationMethod()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected ReferencenewVirtualReference(ActualEnvironment env, org.alfresco.service.cmr.repository.NodeRef actualNodeRef, java.lang.String templateSystemPath)Deprecated.all template system path functionality should be replaced by plain encoded referencesprotected ReferencenewVirtualReference(ActualEnvironment env, org.alfresco.service.cmr.repository.NodeRef actualNodeRef, org.alfresco.service.cmr.repository.NodeRef templateRef)protected ReferencenewVirtualReference(Protocol protocol, org.alfresco.service.cmr.repository.NodeRef templateRef, org.alfresco.service.cmr.repository.NodeRef actualNodeRef)voidsetVanillaProcessor(java.lang.String vanillaProcessorClasspath)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.alfresco.repo.virtual.store.VirtualizationMethod
canVirtualize, virtualize
-
-
-
-
Field Detail
-
PATH_SEPARATOR
protected static final java.lang.String PATH_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
setVanillaProcessor
public void setVanillaProcessor(java.lang.String vanillaProcessorClasspath)
-
newVirtualReference
protected Reference newVirtualReference(ActualEnvironment env, org.alfresco.service.cmr.repository.NodeRef actualNodeRef, java.lang.String templateSystemPath) throws VirtualizationException
Deprecated.all template system path functionality should be replaced by plain encoded references- Parameters:
env- the environment in which the virtualization takes placeactualNodeRef- the node that is virtualized using the given templatetemplateSystemPath- system path string of the template used in virtualizing the given NodeRef- Returns:
- a
Referencecorrespondent of the givenNodeRefaccording to the rules defined by the given template - Throws:
VirtualizationException
-
newVirtualReference
protected Reference newVirtualReference(ActualEnvironment env, org.alfresco.service.cmr.repository.NodeRef actualNodeRef, org.alfresco.service.cmr.repository.NodeRef templateRef) throws VirtualizationException
- Parameters:
env- the environment in which the virtualization takes placeactualNodeRef- the node that is virtualized using the given templatetemplateRef-NodeRefof the template used in virtualizing the given NodeRef- Returns:
- a
Referencecorrespondent of the givenNodeRefaccording to the rules defined by the given template - Throws:
VirtualizationException
-
newVirtualReference
protected Reference newVirtualReference(Protocol protocol, org.alfresco.service.cmr.repository.NodeRef templateRef, org.alfresco.service.cmr.repository.NodeRef actualNodeRef) throws ProtocolMethodException
- Parameters:
protocol-Protocolto be used in virtualizing the givenactulalNodeReftemplateRef-NodeRefof the template used in virtualizing the given NodeRefactualNodeRef- the node that is virtualized using the given template- Returns:
- a
Referencecorrespondent of the givenNodeRefaccording to the rules defined by the given template - Throws:
ProtocolMethodException
-
-