com.citytechinc.aem.bedrock.api
Interface Inheritable

All Known Subinterfaces:
ComponentNode, PageDecorator

public interface Inheritable

An accessible instance (such as a Node or Page) that supports hierarchy-based content inheritance.


Method Summary
 Optional<String> getAsHrefInherited(String propertyName)
          Given a property on this node containing the path of another resource, get the href to the resource, using inheritance if the value does not exist on this component.
 Optional<String> getAsHrefInherited(String propertyName, boolean strict)
          Given a property on this node containing the path of another resource, get the href to the resource, using inheritance if the value does not exist on this component.
 Optional<String> getAsHrefInherited(String propertyName, boolean strict, boolean mapped)
          Given a property on this node containing the path of another resource, get the href to the resource, using inheritance if the value does not exist on this component.
 Optional<Link> getAsLinkInherited(String propertyName)
          Given a property on this node containing the path of another resource, get a link to the resource, using inheritance if the value does not exist on this component.
 Optional<Link> getAsLinkInherited(String propertyName, boolean strict)
          Given a property on this node containing the path of another resource, get a link to the resource, using inheritance if the value does not exist on this component.
 Optional<Link> getAsLinkInherited(String propertyName, boolean strict, boolean mapped)
          Given a property on this node containing the path of another resource, get a link to the resource, using inheritance if the value does not exist on this component.
<T> List<T>
getAsListInherited(String propertyName, Class<T> type)
          Get a multi-valued property from the current node as a list of the given type, using inheritance if the value does not exist on this component.
 Optional<PageDecorator> getAsPageInherited(String propertyName)
          Get a page from the value of the given property, using inheritance if the value does not exist on this component.
<AdapterType>
Optional<AdapterType>
getAsTypeInherited(String propertyName, Class<AdapterType> type)
          Get an Optional type instance for a property on this resource containing the path of another Resource in the repository, using inheritance if the value does not exist on this component..
 Optional<String> getImageReferenceInherited()
           
 Optional<String> getImageReferenceInherited(String name)
           
 Optional<String> getImageSourceInherited()
          Get the image source for the default image (named "image") for this node.
 Optional<String> getImageSourceInherited(int width)
          Get the image source for the default image (named "image") for this node for the given width.
 Optional<String> getImageSourceInherited(String name)
          Get the image source for this node for the named image.
 Optional<String> getImageSourceInherited(String name, int width)
          Get the image source for this node for the named image and given width.
<T> Optional<T>
getInherited(String propertyName, Class<T> type)
          Get a property value from the current node.
<T> T
getInherited(String propertyName, T defaultValue)
          Get a property value from the current node.
 

Method Detail

getAsHrefInherited

Optional<String> getAsHrefInherited(String propertyName)
Given a property on this node containing the path of another resource, get the href to the resource, using inheritance if the value does not exist on this component.

Parameters:
propertyName - name of property containing a valid content path
Returns:
Optional href

getAsHrefInherited

Optional<String> getAsHrefInherited(String propertyName,
                                    boolean strict)
Given a property on this node containing the path of another resource, get the href to the resource, using inheritance if the value does not exist on this component. Use this method with a true argument when appending ".html" to the resource path is desired only for valid CQ pages and not external paths.

Parameters:
propertyName - name of property containing a valid content path
strict - if true, strict resource resolution will be applied and only valid CQ content paths will have ".html" appended
Returns:
Optional href

getAsHrefInherited

Optional<String> getAsHrefInherited(String propertyName,
                                    boolean strict,
                                    boolean mapped)
Given a property on this node containing the path of another resource, get the href to the resource, using inheritance if the value does not exist on this component. Use this method with a true argument when appending ".html" to the resource path is desired only for valid CQ pages and not external paths. Setting mapped to true will map the path value, if it exists, through the Sling Resource Resolver.

Parameters:
propertyName - name of property containing a valid content path
strict - if true, strict resource resolution will be applied and only valid CQ content paths will have ".html" appended
mapped - if true, the property value will be routed through the Resource Resolver to determine the mapped path for the value. For example, if a mapping from "/content/" to "/" exists in the Apache Sling Resource Resolver Factory OSGi configuration, getting the mapped href for the path "/content/citytechinc" will return "/citytechinc.html".
Returns:
Optional href

getAsLinkInherited

Optional<Link> getAsLinkInherited(String propertyName)
Given a property on this node containing the path of another resource, get a link to the resource, using inheritance if the value does not exist on this component.

Parameters:
propertyName - name of property containing a valid content path
Returns:
Optional link object, or null if the property does not contain a valid content path

getAsLinkInherited

Optional<Link> getAsLinkInherited(String propertyName,
                                  boolean strict)
Given a property on this node containing the path of another resource, get a link to the resource, using inheritance if the value does not exist on this component. Use this method with a true argument when including an extension for the link is desired only for valid CQ pages and not external paths.

Parameters:
propertyName - name of property containing a valid content path
strict - if true, strict resource resolution will be applied and only valid CQ content paths will have an extension
Returns:
Optional link object, or null if the property does not contain a valid content path

getAsLinkInherited

Optional<Link> getAsLinkInherited(String propertyName,
                                  boolean strict,
                                  boolean mapped)
Given a property on this node containing the path of another resource, get a link to the resource, using inheritance if the value does not exist on this component. Use this method with a true argument when including an extension for the link is desired only for valid CQ pages and not external paths. Setting mapped to true will map the path value, if it exists, through the Sling Resource Resolver.

Parameters:
propertyName - name of property containing a valid content path
strict - if true, strict resource resolution will be applied and only valid CQ content paths will have an extension
mapped - if true, the property value will be routed through the Resource Resolver to determine the mapped path for the value. For example, if a mapping from "/content/" to "/" exists in the Apache Sling Resource Resolver Factory OSGi configuration, the Link path will be "/citytechinc" rather than "/content/citytechinc".
Returns:
Optional link object, or null if the property does not contain a valid content path

getAsListInherited

<T> List<T> getAsListInherited(String propertyName,
                               Class<T> type)
Get a multi-valued property from the current node as a list of the given type, using inheritance if the value does not exist on this component.

Type Parameters:
T - property type
Parameters:
propertyName - name of multi-valued property
type - property type
Returns:
list of property values or an empty list if the property does not exist

getAsPageInherited

Optional<PageDecorator> getAsPageInherited(String propertyName)
Get a page from the value of the given property, using inheritance if the value does not exist on this component. The property value will be localized to the current page context before getting the page.

Parameters:
propertyName - property name
Returns:
Optional page for property value

getAsTypeInherited

<AdapterType> Optional<AdapterType> getAsTypeInherited(String propertyName,
                                                       Class<AdapterType> type)
Get an Optional type instance for a property on this resource containing the path of another Resource in the repository, using inheritance if the value does not exist on this component..

Type Parameters:
AdapterType - adapter class that is adaptable from Resource
Parameters:
propertyName - name of property containing a resource path
type - type to adapt from resource
Returns:
Optional instance of the specified type, or absent if either the property does not exist or the resource does not adapt to the provided type

getImageReferenceInherited

Optional<String> getImageReferenceInherited()
Returns:
Optional inherited image reference

getImageReferenceInherited

Optional<String> getImageReferenceInherited(String name)
Parameters:
name - image name
Returns:
Optional inherited image reference

getImageSourceInherited

Optional<String> getImageSourceInherited()
Get the image source for the default image (named "image") for this node. Uses the image servlet rather than a direct reference to the DAM path.

Returns:
optional inherited image source

getImageSourceInherited

Optional<String> getImageSourceInherited(int width)
Get the image source for the default image (named "image") for this node for the given width.

Parameters:
width - image width
Returns:
optional inherited image source

getImageSourceInherited

Optional<String> getImageSourceInherited(String name)
Get the image source for this node for the named image.

Parameters:
name - image name (name of image as defined in dialog)
Returns:
optional inherited image source

getImageSourceInherited

Optional<String> getImageSourceInherited(String name,
                                         int width)
Get the image source for this node for the named image and given width.

Parameters:
name - image name (name of image as defined in dialog)
width - image width
Returns:
optional inherited image source

getInherited

<T> T getInherited(String propertyName,
                   T defaultValue)
Get a property value from the current node. If no value is found, recurse up the content tree respective to the page and relative node path until a value is found.

Type Parameters:
T - result type
Parameters:
propertyName - property to get
defaultValue - value if no result is found
Returns:
inherited value

getInherited

<T> Optional<T> getInherited(String propertyName,
                             Class<T> type)
Get a property value from the current node. If no value is found, recurse up the content tree respective to the page and relative node path until a value is found, returning an absent Optional if not. This returns the same value as the underlying ValueMap wrapped in an Optional instance instead of returning null.

Type Parameters:
T - type
Parameters:
propertyName - property name
type - property type
Returns:
Optional of the given type containing the property value or absent if no value is found


Copyright © 2015 CITYTECH, Inc.. All rights reserved.