Package org.opencms.jsp.util
Class CmsJspLinkMacroResolver
- java.lang.Object
-
- org.opencms.jsp.util.CmsJspLinkMacroResolver
-
- All Implemented Interfaces:
I_CmsMacroResolver
public class CmsJspLinkMacroResolver extends java.lang.Object implements I_CmsMacroResolver
Resolves link macros for jsp pages.The only supported macro is the 'link' macro.
- Since:
- 6.5.4
-
-
Field Summary
Fields Modifier and Type Field Description static char
KEY_SEPARATOR
Identifier for the link macro separator.static java.lang.String
MACRO_LINK
Identifier for the link macro name.static java.lang.String
MACRO_LINK_STRONG
Identifier for the link macro name.static java.lang.String
MACRO_LINK_WEAK
Identifier for the link macro name.static java.lang.String[]
VALUE_NAME_ARRAY
Identifier for link commands.static java.util.List<java.lang.String>
VALUE_NAMES
The link commands wrapped in a List.-
Fields inherited from interface org.opencms.util.I_CmsMacroResolver
MACRO_DELIMITER, MACRO_DELIMITER_OLD, MACRO_END, MACRO_END_OLD, MACRO_START, MACRO_START_OLD
-
-
Constructor Summary
Constructors Constructor Description CmsJspLinkMacroResolver(CmsObject cms, java.lang.String jspRootPath, boolean forRfs)
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<CmsLink>
getLinks()
Returns the links.java.lang.String
getMacroValue(java.lang.String macro)
Resolves a single macro to the macro value, returnsnull
if the macro could not be resolved.boolean
isKeepEmptyMacros()
Returnstrue
if macros that could not be resolved are kept "as is" in the input String,false
if they are replaced by an empty String.java.lang.String
resolveMacros(java.lang.String input)
Resolves the JSP link management macros in the given input.
-
-
-
Field Detail
-
KEY_SEPARATOR
public static final char KEY_SEPARATOR
Identifier for the link macro separator.- See Also:
- Constant Field Values
-
MACRO_LINK
public static final java.lang.String MACRO_LINK
Identifier for the link macro name.- See Also:
- Constant Field Values
-
MACRO_LINK_STRONG
public static final java.lang.String MACRO_LINK_STRONG
Identifier for the link macro name.- See Also:
- Constant Field Values
-
MACRO_LINK_WEAK
public static final java.lang.String MACRO_LINK_WEAK
Identifier for the link macro name.- See Also:
- Constant Field Values
-
VALUE_NAME_ARRAY
public static final java.lang.String[] VALUE_NAME_ARRAY
Identifier for link commands.
-
VALUE_NAMES
public static final java.util.List<java.lang.String> VALUE_NAMES
The link commands wrapped in a List.
-
-
Constructor Detail
-
CmsJspLinkMacroResolver
public CmsJspLinkMacroResolver(CmsObject cms, java.lang.String jspRootPath, boolean forRfs)
Default constructor.- Parameters:
cms
- the cms contextjspRootPath
- the (optional) jsp root path, needed for saving from the editor to resolve relative linksforRfs
- Only iftrue
the macros get really resolved to valid vfs paths
-
-
Method Detail
-
getMacroValue
public java.lang.String getMacroValue(java.lang.String macro)
Description copied from interface:I_CmsMacroResolver
Resolves a single macro to the macro value, returnsnull
if the macro could not be resolved.- Specified by:
getMacroValue
in interfaceI_CmsMacroResolver
- Parameters:
macro
- the macro to resolve- Returns:
- the resolved macro or
null
if the macro could not be resolved - See Also:
I_CmsMacroResolver.getMacroValue(java.lang.String)
-
isKeepEmptyMacros
public boolean isKeepEmptyMacros()
Description copied from interface:I_CmsMacroResolver
Returnstrue
if macros that could not be resolved are kept "as is" in the input String,false
if they are replaced by an empty String.- Specified by:
isKeepEmptyMacros
in interfaceI_CmsMacroResolver
- Returns:
true
if macros that could not be resolved are kept "as is" in the input String,false
if they are replaced by an empty String- See Also:
I_CmsMacroResolver.isKeepEmptyMacros()
-
resolveMacros
public java.lang.String resolveMacros(java.lang.String input)
Resolves the JSP link management macros in the given input.Calls
once for each macro in the input. This means "nested" macros are not supported in this implementation, which is fine since it can't happen in JSP link management anyway.resolveMacros(String)
- Specified by:
resolveMacros
in interfaceI_CmsMacroResolver
- Parameters:
input
- the input to resolve the macros in- Returns:
- the input with all macros resolved
- See Also:
I_CmsMacroResolver.resolveMacros(java.lang.String)
-
-