Package org.opencms.ade.contenteditor
Class CmsDelayedDefaultChangeHandler
- java.lang.Object
-
- org.opencms.ade.contenteditor.A_CmsXmlContentEditorChangeHandler
-
- org.opencms.ade.contenteditor.CmsDelayedDefaultChangeHandler
-
- All Implemented Interfaces:
I_CmsXmlContentEditorChangeHandler
public class CmsDelayedDefaultChangeHandler extends A_CmsXmlContentEditorChangeHandler
A change handler that reacts to changes in a field by setting another empty field to a default value.This is useful because the default value used may contain macros, which are expanded every time the change handler is called, rather than only during the initial editor load.
The change handler's configuration consists of two strings separated by a pipe symbol:
path|default
path is the path of the field relative to the changed field which should be filled, while default is the default value to write to the field (possibly containing macros).
-
-
Field Summary
-
Fields inherited from class org.opencms.ade.contenteditor.A_CmsXmlContentEditorChangeHandler
m_configuration, m_scope
-
-
Constructor Summary
Constructors Constructor Description CmsDelayedDefaultChangeHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CmsXmlContent
handleChange(CmsObject cms, CmsXmlContent content, java.util.Locale locale, java.util.Collection<java.lang.String> changedPaths)
Handles the content change.void
setConfiguration(java.lang.String configuration)
Sets the configuration.-
Methods inherited from class org.opencms.ade.contenteditor.A_CmsXmlContentEditorChangeHandler
getConfiguration, getScope, resolveRelativePath, setScope
-
-
-
-
Constructor Detail
-
CmsDelayedDefaultChangeHandler
public CmsDelayedDefaultChangeHandler()
-
-
Method Detail
-
handleChange
public CmsXmlContent handleChange(CmsObject cms, CmsXmlContent content, java.util.Locale locale, java.util.Collection<java.lang.String> changedPaths)
Description copied from interface:I_CmsXmlContentEditorChangeHandler
Handles the content change.- Parameters:
cms
- the cms contextcontent
- the changed contentlocale
- the edited localechangedPaths
- the changed content value paths- Returns:
- the changed content
- See Also:
I_CmsXmlContentEditorChangeHandler.handleChange(org.opencms.file.CmsObject, org.opencms.xml.content.CmsXmlContent, java.util.Locale, java.util.Collection)
-
setConfiguration
public void setConfiguration(java.lang.String configuration)
Description copied from interface:I_CmsXmlContentEditorChangeHandler
Sets the configuration.- Specified by:
setConfiguration
in interfaceI_CmsXmlContentEditorChangeHandler
- Overrides:
setConfiguration
in classA_CmsXmlContentEditorChangeHandler
- Parameters:
configuration
- the configuration- See Also:
A_CmsXmlContentEditorChangeHandler.setConfiguration(java.lang.String)
-
-