Interface ResourceContainer


public interface ResourceContainer
Implementations that know how to rewrite a link for a nodetype containing resources, like hippogallery:exampleImageSet or hippogallery:exampleAssetSet
  • Method Details

    • resolveToPathInfo

      String resolveToPathInfo(Node resourceContainerNode, Node resourceNode, Mount mount)
      Implementations should here do their logic, possibly linkrewriting. With the resolved path from this method, a HstLink object is created
      Parameters:
      resourceContainerNode - The parent node of the resource node
      resourceNode - The resource node itself containing the binary
      mount - the Mount the link is meant for
      Returns:
      the resolved pathInfo for the node, or null when not able to create one
    • resolveToResourceNode

      Node resolveToResourceNode(Session session, String pathInfo)
      This is the reverse of resolveToPathInfo(Node, Node, Mount). If this ResourceContainer can resolve the pathInfo to a resource node of type getNodeType(), it returns the resourceNode. If it cannot resolve the pathInfo, null is returned
      Parameters:
      session -
      pathInfo - : the path from the url after the context and servlet path. It starts with a slash
      Returns:
      the resourceNode or null if this resource container does not know how to resolve this pathInfo
    • getNodeType

      String getNodeType()
      Returns:
      the node type this resource container works on
    • getPrimaryItem

      String getPrimaryItem()
      Returns:
      the primary item for this resource container
    • getMappings

      Map<String,String> getMappings()
      returns the mapping from nodename to url prefix. For example, hippogallery:thumbnail <--> thumbnail
      Returns:
      the mapping from nodename to url prefix