|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Objectorg.opencms.workplace.tools.CmsToolMacroResolver
public class CmsToolMacroResolver
Resolves special macros for the admin view.
Supported macros are:
| Field Summary | |
|---|---|
static java.lang.String |
KEY_GROUPNAME
Identifier for admin parameter names. |
static java.lang.String |
KEY_JOBNAME
Identifier for admin parameter names. |
static java.lang.String |
KEY_OUDESCRIPTION
Identifier for admin parameter names. |
static java.lang.String |
KEY_OUTYPE
Identifier for admin parameter names. |
static java.lang.String |
KEY_PROJECTNAME
Identifier for admin parameter names. |
static java.lang.String |
KEY_ROLENAME
Identifier for admin parameter names. |
static java.lang.String |
KEY_USERNAME
Identifier for admin parameter names. |
static java.lang.String |
PREFIX_ADMIN
Identifier for admin macros prefix. |
static java.lang.String[] |
VALUE_NAME_ARRAY
Identified for admin parameter commands. |
static java.util.List |
VALUE_NAMES
The admin 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 | |
|---|---|
CmsToolMacroResolver(CmsWorkplace wp)
Default private constructor. |
|
| Method Summary | |
|---|---|
java.lang.String |
getMacroValue(java.lang.String macro)
Resolves a single macro to the macro value, returns null if the macro could not be resolved. |
boolean |
isKeepEmptyMacros()
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. |
java.lang.String |
resolveMacros(java.lang.String input)
Resolves the macros in the given input. |
static java.lang.String |
resolveMacros(java.lang.String input,
CmsWorkplace wp)
Resolves the macros in the given input using the provided parameters. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PREFIX_ADMIN
public static final java.lang.String KEY_USERNAME
public static final java.lang.String KEY_GROUPNAME
public static final java.lang.String KEY_JOBNAME
public static final java.lang.String KEY_PROJECTNAME
public static final java.lang.String KEY_OUDESCRIPTION
public static final java.lang.String KEY_OUTYPE
public static final java.lang.String KEY_ROLENAME
public static final java.lang.String[] VALUE_NAME_ARRAY
public static final java.util.List VALUE_NAMES
| Constructor Detail |
|---|
public CmsToolMacroResolver(CmsWorkplace wp)
wp - the workplace instance| Method Detail |
|---|
public static java.lang.String resolveMacros(java.lang.String input,
CmsWorkplace wp)
A macro in the form ${key} in the content is replaced with it's assigned value
returned by the method of the given
I_CmsMacroResolver.getMacroValue(String) instance.I_CmsMacroResolver
If a macro is found that can not be mapped to a value by the given macro resolver, it is left untouched in the input.
input - the input in which to resolve the macroswp - the workplace class for falling back
public java.lang.String getMacroValue(java.lang.String macro)
I_CmsMacroResolvernull if the macro could not be resolved.
getMacroValue in interface I_CmsMacroResolvermacro - the macro to resolve
null if the macro could not be resolvedI_CmsMacroResolver.getMacroValue(java.lang.String)public java.lang.String resolveMacros(java.lang.String input)
Calls until no more macros can
be resolved in the input. This way "nested" macros in the input are resolved as well.resolveMacros(String)
resolveMacros in interface I_CmsMacroResolverinput - the input to resolve the macros in
I_CmsMacroResolver.resolveMacros(java.lang.String)public boolean isKeepEmptyMacros()
I_CmsMacroResolvertrue if macros that could not be resolved are kept "as is" in the
input String, false if they are replaced by an empty String.
isKeepEmptyMacros in interface I_CmsMacroResolvertrue if macros that could not be resolved are kept "as is" in the
input String, false if they are replaced by an empty StringI_CmsMacroResolver.isKeepEmptyMacros()
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||