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
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 by
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 virtualize
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 by
Encodings.PLAIN encoded
Reference strings.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 virtualize
NodeRefs using
NewVirtualReferenceMethod protocol reference constructor visitor.
- Author:
- Bogdan Horje
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ReferencenewVirtualReference(ActualEnvironment env, NodeRef actualNodeRef, String templateSystemPath) Deprecated.all template system path functionality should be replaced by plain encoded referencesprotected ReferencenewVirtualReference(ActualEnvironment env, NodeRef actualNodeRef, NodeRef templateRef) protected ReferencenewVirtualReference(Protocol protocol, NodeRef templateRef, NodeRef actualNodeRef) voidsetVanillaProcessor(String vanillaProcessorClasspath) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.alfresco.repo.virtual.store.VirtualizationMethod
canVirtualize, virtualize
-
Field Details
-
PATH_SEPARATOR
- See Also:
-
-
Constructor Details
-
TemplateVirtualizationMethod
public TemplateVirtualizationMethod()
-
-
Method Details
-
setVanillaProcessor
-
newVirtualReference
protected Reference newVirtualReference(ActualEnvironment env, NodeRef actualNodeRef, 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, NodeRef actualNodeRef, 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, NodeRef templateRef, 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
-