Package org.apache.sling.hapi.sightly
Class HApiUse
java.lang.Object
org.apache.sling.hapi.sightly.HApiUse
- All Implemented Interfaces:
Use
Sightly use class helper to provide the hypermedia API microdata attributes for the type configured throught the 'type' binding.
The type can be a JCR path or a fully qualified domain name like in
HApiUtil.getTypeNode(org.apache.sling.api.resource.ResourceResolver, String)
The convenience get methods are meant to be used in the 'data-sly-attribute' in the sightly script.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Initializes the helper and the attribute maps for the given type though the bindingsGet the itemprop attributes map for the type, for each property.Get the itemtype html attributes map for the typeGet a map of the type for each property name of the type The key is the property name and the value is the type path in JCRvoidCalled to initialize the Java object with the current Java Scripting API bindings.
-
Constructor Details
-
HApiUse
public HApiUse()
-
-
Method Details
-
init
Called to initialize the Java object with the current Java Scripting API bindings.
This method is called only if the object has been instantiated by HTL as part of processing the
data-sly-useattribute. The Java Scripting API bindings provide all the global variables known to a script being executed. -
activate
Initializes the helper and the attribute maps for the given type though the bindings- Throws:
Exception
-
getItemtype
Get the itemtype html attributes map for the type- Returns:
-
getItemprop
Get the itemprop attributes map for the type, for each property. The key is the property name and the value is a map of html attributes for the property- Returns:
-
getProptype
Get a map of the type for each property name of the type The key is the property name and the value is the type path in JCR- Returns:
-