Interface Conf
-
- All Superinterfaces:
ConfConstants
@Deprecated @ProviderType public interface Conf extends ConfConstants
Deprecated.Use of the open source Apache Sling Context-Aware Configuration API is recommended for new code. The ConfMgr API is backed by the Sling CA implementation and will continue to be supported for existing code.Provides access to configuration.
-
-
Field Summary
-
Fields inherited from interface com.adobe.granite.confmgr.ConfConstants
NAME, NN_SETTINGS, PN_CONF, PN_MERGE_LIST, PN_SYMLINK, VAR_END, VAR_PROPERTY_PREFIX, VAR_RESOURCE_NAME, VAR_START
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description ValueMap
getItem(java.lang.String itemName)
Deprecated.Returns configuration values for the given config item which can be a relative path.Resource
getItemResource(java.lang.String itemName)
Deprecated.Returns a configuration resource for the given item which can be a relative path.java.util.List<ValueMap>
getList(java.lang.String parentItemName)
Deprecated.Returns ValueMaps for a list of items beneath the given configuration item.java.util.List<Resource>
getListResources(java.lang.String parentItemName)
Deprecated.Returns a list of items beneath the given configuration item.
-
-
-
Method Detail
-
getItem
ValueMap getItem(java.lang.String itemName)
Deprecated.Returns configuration values for the given config item which can be a relative path. See alsogetItemResource(String)
if you need to the resource behind the value map. If the config item has a "jcr:content" child, this will be returned as the source of the value map.The itemName can be a relative path and is looked up beneath the resolved configuration tree. For example, if the original resource from which this Conf object was created, points to a configuration at "/conf/adobe/ch", and an item path like "dam/presets/pdf" is requested, this will return a value map for the resource at "/conf/adobe/ch/dam/presets/pdf". Note that itemName should be a fixed name specific to the application config.
If no configuration resource can be found, an empty map will be returned.
- Parameters:
itemName
- a relative path to an item within a specific configuration tree- Returns:
- a value map for a configuration resource; an empty map if nothing is found
-
getItemResource
Resource getItemResource(java.lang.String itemName)
Deprecated.Returns a configuration resource for the given item which can be a relative path. Use this instead ofgetItem(String)
if you need to iterate over the child structure, for example a list of resources.The itemName can be a relative path and is looked up beneath the resolved configuration tree. For example, if the original resource from which this Conf object was created, points to a configuration at "/conf/adobe/ch", and an item path like "dam/presets/pdf" is requested, this will return the resource at "/conf/adobe/ch/dam/presets/pdf". Note that itemName should be a fixed name specific to the application config.
If no configuration resource can be found,
null
will be returned.- Parameters:
itemName
- a relative path to an item within a specific configuration tree- Returns:
- a configuration resource or
null
if not found
-
getList
java.util.List<ValueMap> getList(java.lang.String parentItemName)
Deprecated.Returns ValueMaps for a list of items beneath the given configuration item. Depending on the configuration item, this list could be automatically merged between the different applicable configurations.See
getListResources(String)
for the merge logic.- Parameters:
parentItemName
- a relative path to an item within a specific configuration tree- Returns:
- a possibly merged list of items as ValueMaps; an empty list if nothing is found
-
getListResources
java.util.List<Resource> getListResources(java.lang.String parentItemName)
Deprecated.Returns a list of items beneath the given configuration item. This allows for cases where there is a choice of different configuration entries. Note that folders and nested structures are not supported as applications should map them to entirely separate sub-project configurations.If the most specific configuration parent item has
ConfConstants.PN_MERGE_LIST
set to true, the list will be merged with the lists for all applicable configurations. Starting with the lowest level configuration up to the most specific one, for each configuration, if the parent item is present, these rules will be applied:- a new item will be added to the list
- same name item with a jcr:content child will overwrite
- same name item without a jcr:content child will remove it from the list
Note that for merged lists, no order is guaranteed. For fixed lists, the order of the child resources will be kept.
- Parameters:
parentItemName
- a relative path to an item within a specific configuration tree- Returns:
- a possibly merged list of items as Resources; an empty list if nothing is found
-
-