Package org.hippoecm.hst.core.linking
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<String,String>
getMappings()
returns the mapping from nodename to url prefix.String
getNodeType()
String
getPrimaryItem()
String
resolveToPathInfo(Node resourceContainerNode, Node resourceNode, Mount mount)
Implementations should here do their logic, possibly linkrewriting.Node
resolveToResourceNode(Session session, String pathInfo)
This is the reverse ofresolveToPathInfo(Node, Node, Mount)
.
-
-
-
Method Detail
-
resolveToPathInfo
String resolveToPathInfo(Node resourceContainerNode, Node resourceNode, Mount mount)
Implementations should here do their logic, possibly linkrewriting. With the resolved path from this method, aHstLink
object is created- Parameters:
resourceContainerNode
- The parent node of the resource noderesourceNode
- The resource node itself containing the binarymount
- theMount
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 ofresolveToPathInfo(Node, Node, Mount)
. If this ResourceContainer can resolve the pathInfo to a resource node of typegetNodeType()
, 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
-
-