public interface HApiUtil
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COLLECTION_RESOURCE_TYPE |
static java.lang.String |
COLLECTION_RESOURCE_TYPE_DESC |
static java.lang.String |
DEFAULT_COLLECTION_RESOURCE_TYPE |
static boolean |
DEFAULT_ENABLED |
static java.lang.String |
DEFAULT_RESOURCE_TYPE |
static java.lang.String |
DEFAULT_SEARCH_PATH |
static java.lang.String |
DEFAULT_SERVER_URL |
static java.lang.String |
ENABLED |
static java.lang.String |
ENABLED_DESC |
static java.lang.String |
EXTERNAL_URL |
static java.lang.String |
EXTERNAL_URL_DESC |
static java.lang.String |
RESOURCE_TYPE |
static java.lang.String |
RESOURCE_TYPE_DESC |
static java.lang.String |
SEARCH_PATHS |
static java.lang.String |
SEARCH_PATHS_DESC |
Modifier and Type | Method and Description |
---|---|
HApiTypesCollection |
collectionFromPath(ResourceResolver resolver,
java.lang.String collectionPath)
Get a
HApiTypesCollection object from a path String. |
HApiTypesCollection |
collectionFromResource(ResourceResolver resolver,
Resource collectionResource)
Get a
HApiTypesCollection object from a Resource . |
HApiType |
fromNode(ResourceResolver resolver,
Node typeNode)
Deprecated.
|
HApiType |
fromPath(ResourceResolver resolver,
java.lang.String type)
Get a HApi type object from a type identifier.
|
HApiType |
fromResource(ResourceResolver resolver,
Resource typeResource)
Get a HApi type object from the
Resource . |
MicrodataAttributeHelper |
getHelper(ResourceResolver resolver,
java.lang.String type)
Get a new instance of AttributeHelper for the type identified by 'type'
|
Resource |
getTypeCollectionResource(ResourceResolver resolver,
java.lang.String collection)
Get a HApi type collection Resource from a collection identifier.
|
Node |
getTypeNode(ResourceResolver resolver,
java.lang.String type)
Deprecated.
|
Resource |
getTypeResource(ResourceResolver resolver,
java.lang.String type)
Get a HApi type Resource from a type identifier.
|
static final java.lang.String DEFAULT_RESOURCE_TYPE
static final java.lang.String RESOURCE_TYPE
static final java.lang.String RESOURCE_TYPE_DESC
static final java.lang.String DEFAULT_COLLECTION_RESOURCE_TYPE
static final java.lang.String COLLECTION_RESOURCE_TYPE
static final java.lang.String COLLECTION_RESOURCE_TYPE_DESC
static final java.lang.String DEFAULT_SEARCH_PATH
static final java.lang.String SEARCH_PATHS
static final java.lang.String SEARCH_PATHS_DESC
static final java.lang.String DEFAULT_SERVER_URL
static final java.lang.String EXTERNAL_URL
static final java.lang.String EXTERNAL_URL_DESC
static final boolean DEFAULT_ENABLED
static final java.lang.String ENABLED
static final java.lang.String ENABLED_DESC
@Deprecated Node getTypeNode(ResourceResolver resolver, java.lang.String type) throws RepositoryException
Get a HApi type jcr node from a type identifier.
The JCR node must be [nt:unstructured], a descendant of any of the HAPi search path defined by the
HAPI_PATHS
config and the sling:resourceType should be set to the value defined by the HAPI_RESOURCE_TYPE
config
The first result is returned
resolver
- The sling resource resolver objecttype
- The type identifier, which is either in the form of a jcr path,
same as the path for . If the path cannot be resolved, type is treated like
a fully qualified domain name, which has to match the "fqdn" property on the JCR node which represents the type.RepositoryException
Resource getTypeResource(ResourceResolver resolver, java.lang.String type) throws RepositoryException
Get a HApi type Resource from a type identifier.
The Resource must be [nt:unstructured], a descendant of any of the HAPi search path defined by the
HAPI_PATHS
config and the sling:resourceType should be set to the value defined by the HapiUtil#RESOURCE_TYPE
config
The first result is returned
resolver
- The sling resource resolver objecttype
- The type identifier, which is either in the form of a jcr path,
same as the path for . If the path cannot be resolved, type is treated like
a fully qualified domain name, which has to match the "fqdn" property on the Resource which represents the type.RepositoryException
Resource getTypeCollectionResource(ResourceResolver resolver, java.lang.String collection) throws RepositoryException
Get a HApi type collection Resource from a collection identifier.
The Resource must be [nt:unstructured], a descendant of any of the HAPi search path defined by the
HAPI_PATHS
config and the sling:resourceType should be set to the value defined by the
HapiUtil#COLLECTION_RESOURCE_TYPE
config
The first result is returned
resolver
- The sling resource resolver objectcollection
- The collection identifier, which is either in the form of a jcr path,
same as the path for . If the path cannot be resolved, collection is
treated like a fully qualified domain name, which has to match the "fqdn" property on the Resource which
represents the type.RepositoryException
HApiType fromPath(ResourceResolver resolver, java.lang.String type) throws RepositoryException
Get a HApi type object from a type identifier.
The type identifier is resolved to a javax.jcr.Node
and then
#fromNode(org.apache.sling.api.resource.ResourceResolver, javax.jcr.Node)
is called.
For restrictions on the javax.jcr.Node
see getTypeNode(org.apache.sling.api.resource.ResourceResolver, String)
resolver
- The sling resource resolver objecttype
- The type identifier, which is either in the form of a jcr path,
same as the path for. If the path cannot be resolved, type is treated like
a fully qualified domain name, which has to match the "fqdn" property on the JCR node which represents the type.javax.jcr.RepositoryException
RepositoryException
@Deprecated HApiType fromNode(ResourceResolver resolver, Node typeNode) throws RepositoryException
Get a HApi type object from the javax.jcr.Node
.
The properties of this type are defined as children nodes.
The name of property node defines the name of the property for this type.
The children property nodes have the following properties:getTypeNode(org.apache.sling.api.resource.ResourceResolver, String)
for the format of this valueresolver
- The resource resolvertypeNode
- The jcr node of the HApi typeRepositoryException
HApiType fromResource(ResourceResolver resolver, Resource typeResource) throws RepositoryException
Get a HApi type object from the Resource
.
The properties of this type are defined as children resources.
The name of property resource defines the name of the property for this type.
The children property nodes have the following properties:getTypeNode(org.apache.sling.api.resource.ResourceResolver, String)
for the format of this valueresolver
- The resource resolvertypeResource
- The sling Resource of the HApi typeRepositoryException
HApiTypesCollection collectionFromResource(ResourceResolver resolver, Resource collectionResource) throws RepositoryException
Get a HApiTypesCollection
object from a Resource
.
The types collection will be populated with direct child Resources of the {{collectionResource}},
which have the resourceType equal to the value of the RESOURCE_TYPE
property
resolver
- The resource resolvercollectionResource
- The sling Resource of the HApi type collectionRepositoryException
HApiTypesCollection collectionFromPath(ResourceResolver resolver, java.lang.String collectionPath) throws RepositoryException
Get a HApiTypesCollection
object from a path String.
resolver
- The resource resolvercollectionPath
- The sling resource path of the HApi type collectionRepositoryException
MicrodataAttributeHelper getHelper(ResourceResolver resolver, java.lang.String type) throws RepositoryException
resolver
- type
- See getTypeNode(org.apache.sling.api.resource.ResourceResolver, String)
for the format of the type identifierRepositoryException
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"