Package org.opencms.jsp.util
Class CmsJspLinkMacroResolver
java.lang.Object
org.opencms.jsp.util.CmsJspLinkMacroResolver
- All Implemented Interfaces:
I_CmsMacroResolver
Resolves link macros for jsp pages.
The only supported macro is the 'link' macro.
- Since:
- 6.5.4
-
Field Summary
Modifier and TypeFieldDescriptionstatic final char
Identifier for the link macro separator.static final String
Identifier for the link macro name.static final String
Identifier for the link macro name.static final String
Identifier for the link macro name.static final String[]
Identifier for link commands.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
ConstructorDescriptionCmsJspLinkMacroResolver
(CmsObject cms, String jspRootPath, boolean forRfs) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetLinks()
Returns the links.getMacroValue
(String macro) Resolves a single macro to the macro value, returnsnull
if the macro could not be resolved.boolean
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.resolveMacros
(String input) Resolves the JSP link management macros in the given input.
-
Field Details
-
KEY_SEPARATOR
Identifier for the link macro separator.- See Also:
-
MACRO_LINK
Identifier for the link macro name.- See Also:
-
MACRO_LINK_STRONG
Identifier for the link macro name.- See Also:
-
MACRO_LINK_WEAK
Identifier for the link macro name.- See Also:
-
VALUE_NAME_ARRAY
Identifier for link commands. -
VALUE_NAMES
The link commands wrapped in a List.
-
-
Constructor Details
-
CmsJspLinkMacroResolver
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 Details
-
getLinks
Returns the links.- Returns:
- the links
-
getMacroValue
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:
-
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:
-
resolveMacros
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:
-