Package com.day.cq.wcm.contentsync
Class PathRewriterOptions
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<String,PathRewriterOptions.RewriteMode>
-
- com.day.cq.wcm.contentsync.PathRewriterOptions
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,PathRewriterOptions.RewriteMode>
public class PathRewriterOptions extends HashMap<String,PathRewriterOptions.RewriteMode>
ThePathRewriterOptions
configure in which way links and references should be rewritten. To enable path rewriting you have to set an instance ofPathRewriterOptions
as a request attribute.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PathRewriterOptions.RewriteMode
Available rewrite modes.-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTRIBUTE_PATH_REWRITING_OPTIONS
The request attribute name.static String
OPTION_REWRITE_CLIENTLIBS
static String
OPTION_REWRITE_IMAGES
static String
OPTION_REWRITE_LINKS
static String
OPTION_TEMP_DESIGNS
-
Constructor Summary
Constructors Constructor Description PathRewriterOptions(PathRewriterOptions.RewriteMode links, PathRewriterOptions.RewriteMode clientlibs, PathRewriterOptions.RewriteMode images)
PathRewriterOptions(String tempDesignPath, PathRewriterOptions.RewriteMode links, PathRewriterOptions.RewriteMode clientlibs, PathRewriterOptions.RewriteMode images)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getRelativeParentPath()
Get configured relative parent path.PathRewriterOptions.RewriteMode
getRewriteMode(String option)
Get configured rewrite mode.String
getTempDesignPath()
boolean
hasRelativeParent()
boolean
isExternal(String option)
boolean
isRelative(String option)
void
setRelativeParentPath(String path)
Set a new relative parent.void
setRewriteMode(String option, PathRewriterOptions.RewriteMode mode)
Set a new rewrite mode.-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
-
-
-
Field Detail
-
ATTRIBUTE_PATH_REWRITING_OPTIONS
public static final String ATTRIBUTE_PATH_REWRITING_OPTIONS
The request attribute name.- See Also:
- Constant Field Values
-
OPTION_REWRITE_LINKS
public static final String OPTION_REWRITE_LINKS
- See Also:
- Constant Field Values
-
OPTION_REWRITE_CLIENTLIBS
public static final String OPTION_REWRITE_CLIENTLIBS
- See Also:
- Constant Field Values
-
OPTION_REWRITE_IMAGES
public static final String OPTION_REWRITE_IMAGES
- See Also:
- Constant Field Values
-
OPTION_TEMP_DESIGNS
public static final String OPTION_TEMP_DESIGNS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PathRewriterOptions
public PathRewriterOptions(PathRewriterOptions.RewriteMode links, PathRewriterOptions.RewriteMode clientlibs, PathRewriterOptions.RewriteMode images)
-
PathRewriterOptions
public PathRewriterOptions(String tempDesignPath, PathRewriterOptions.RewriteMode links, PathRewriterOptions.RewriteMode clientlibs, PathRewriterOptions.RewriteMode images)
-
-
Method Detail
-
isExternal
public boolean isExternal(String option)
-
isRelative
public boolean isRelative(String option)
-
hasRelativeParent
public boolean hasRelativeParent()
-
getRewriteMode
public PathRewriterOptions.RewriteMode getRewriteMode(String option)
Get configured rewrite mode.- Returns:
- the rewriteLinks
-
setRewriteMode
public void setRewriteMode(String option, PathRewriterOptions.RewriteMode mode)
Set a new rewrite mode.- Parameters:
mode
- The new rewrite mode
-
getTempDesignPath
public String getTempDesignPath()
-
getRelativeParentPath
public String getRelativeParentPath()
Get configured relative parent path.- Returns:
- the relative parent path
-
setRelativeParentPath
public void setRelativeParentPath(String path)
Set a new relative parent.- Parameters:
path
- The new relative parent path
-
-