Package io.wcm.wcm.ui.granite.util
Class RootPathResolver
- java.lang.Object
-
- io.wcm.wcm.ui.granite.util.RootPathResolver
-
@ProviderType public final class RootPathResolver extends java.lang.Object
Helper class for path-based GraniteUI components to resolve the root path.Resolution order for root path detection:
- Reads configured root path from
rootPath
property - Calls the provided root path detector implementation to detect root path from context
- Reads fallback root path from
fallbackRootPath
property - Uses fallback root path provided for this instance
- Fallback to "/"
Additionally the root path is modified:
- If an
appendPath
property is configured it is appended to the detected root path - Than it is checked if the root path is valid - if not the next-valid parent path is returned
- Reads configured root path from
-
-
Constructor Summary
Constructors Constructor Description RootPathResolver(@NotNull com.adobe.granite.ui.components.ComponentHelper cmp, @NotNull org.apache.sling.api.SlingHttpServletRequest request)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull java.lang.String
get()
Get the resolved and validated root path.java.util.Map<java.lang.String,java.lang.Object>
getOverrideProperties()
Get map of override properties for super component based on the wcm.io Granite UI Extensions PathField.void
setFallbackRootPath(@NotNull java.lang.String fallbackRootPath)
void
setRootPathDetector(@NotNull RootPathDetector rootPathDetector)
-
-
-
Method Detail
-
setRootPathDetector
public void setRootPathDetector(@NotNull @NotNull RootPathDetector rootPathDetector)
- Parameters:
rootPathDetector
- For detecting root path from context
-
setFallbackRootPath
public void setFallbackRootPath(@NotNull @NotNull java.lang.String fallbackRootPath)
- Parameters:
fallbackRootPath
- Fallback root path that is used if none is configured
-
get
@NotNull public @NotNull java.lang.String get()
Get the resolved and validated root path.- Returns:
- Root path.
-
getOverrideProperties
public java.util.Map<java.lang.String,java.lang.Object> getOverrideProperties()
Get map of override properties for super component based on the wcm.io Granite UI Extensions PathField.- Returns:
- Path properties
-
-