Class VirtualProtocol

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    VanillaProtocol

    public class VirtualProtocol
    extends Protocol
    A protocol for encoding virtual artefacts.
    Virtual artefacts are generated using a virtual folder templateindicated by the main Reference resource.
    The virtual folder template defines a hierarchical structure of virtual nodes.
    The template path (see getTemplatePath(Reference)) indicates a path in this structure.
    Virtual folders templates can be applied on actual repository nodes (see getActualNodeLocation(Reference)) which should be passed as parameters to the virtual folder template.
    The protocol implementation also handles virtual protocol Reference creation and template path navigation.
    See Also:
    Serialized Form
    • Field Detail

      • ACTUAL_NODE_LOCATION_PARAM_INDEX

        public static final int ACTUAL_NODE_LOCATION_PARAM_INDEX
        Actual node Parameter index.
        See Also:
        Constant Field Values
      • NODE_TEMPLATE_PATH_TOKEN

        public static final java.lang.Character NODE_TEMPLATE_PATH_TOKEN
        Repository node path system path token.
      • CLASS_TEMPLATE_PATH_TOKEN

        public static final java.lang.Character CLASS_TEMPLATE_PATH_TOKEN
        Classpath system path token.
    • Constructor Detail

      • VirtualProtocol

        public VirtualProtocol()
      • VirtualProtocol

        public VirtualProtocol​(java.lang.String name)
    • Method Detail

      • replaceTemplatePath

        public Reference replaceTemplatePath​(Reference reference,
                                             java.lang.String path)
        Parameters:
        reference -
        path -
        Returns:
        a Reference copy of the given reference parameter with the template path set to the given path parameter value
        See Also:
        TEMPLATE_PATH_PARAM_INDEX
      • newReference

        public Reference newReference​(org.alfresco.service.cmr.repository.NodeRef templateNodeRef,
                                      java.lang.String templatePath,
                                      org.alfresco.service.cmr.repository.NodeRef actualNodeRef)
        Parameters:
        templateNodeRef - NodeRef of the template content holding repository node
        templatePath -
        actualNodeRef -
        Returns:
        a new virtual protocol Reference with the given virtual protocol reference elements
      • newReference

        public Reference newReference​(Resource templateResource,
                                      java.lang.String templatePath,
                                      org.alfresco.service.cmr.repository.NodeRef actualNodeRef,
                                      java.util.List<Parameter> extraParameters)
        Parameters:
        templateResource - template content holding resource
        templatePath -
        actualNodeRef -
        Returns:
        a new virtual protocol Reference with the given virtual protocol reference elements
      • newReference

        public Reference newReference​(java.lang.String templateSysPath,
                                      java.lang.String templatePath,
                                      org.alfresco.service.cmr.repository.NodeRef actualNodeRef)
                               throws ProtocolMethodException
        Deprecated.
        In future system paths will be replaced with actual resources or string encoded references
        Creates a resource based on the given template system-path that is used in creating a new virtual protocol reference.
        Parameters:
        templateSysPath - a template-system-path for the template holding content
        Template-system-paths are classpaths paths or repository paths prefixed with CLASS_TEMPLATE_PATH_TOKEN or NODE_TEMPLATE_PATH_TOKEN respectively.
        templatePath -
        actualNodeRef -
        Returns:
        a new virtual protocol Reference with the given virtual protocol reference elements
        Throws:
        ProtocolMethodException
      • createSystemPathResource

        protected Resource createSystemPathResource​(java.lang.String templateSysPath)
        Deprecated.
        In future system paths will be replaced with actual resources or string encoded references
        System path resource factory method.
        Parameters:
        templateSysPath - a classpath or a repository path prefixed with CLASS_TEMPLATE_PATH_TOKEN or NODE_TEMPLATE_PATH_TOKEN respectively.
        Returns:
        a ClassPathResource or a RepositoryResource for the given system path