org.hippoecm.hst.core.linking
Interface ResourceContainer

All Known Implementing Classes:
AbstractResourceContainer, DefaultResourceContainer, HippoGalleryAssetSet, HippoGalleryExampleImageSetContainer, HippoGalleryImageSetContainer

public interface ResourceContainer

Implementations that know how to rewrite a link for a nodetype containing resources, like hippogallery:exampleImageSet or hippogallery:exampleAssetSet


Method Summary
 Map<String,String> getMappings()
          returns the mapping from nodename to url prefix.
 String getNodeType()
           
 String getPrimaryItem()
           
 String resolveToPathInfo(javax.jcr.Node resourceContainerNode, javax.jcr.Node resourceNode, Mount mount)
          Implementations should here do their logic, possibly linkrewriting.
 javax.jcr.Node resolveToResourceNode(javax.jcr.Session session, String pathInfo)
          This is the reverse of #resolvePathInfo(Node, Node, HstSite).
 

Method Detail

resolveToPathInfo

String resolveToPathInfo(javax.jcr.Node resourceContainerNode,
                         javax.jcr.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

javax.jcr.Node resolveToResourceNode(javax.jcr.Session session,
                                     String pathInfo)
This is the reverse of #resolvePathInfo(Node, Node, HstSite). 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
object -
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


Copyright © 2008-2012 Hippo. All Rights Reserved.