Package org.hippoecm.frontend.editor
Class AbstractCmsEditor<T>
- java.lang.Object
-
- org.hippoecm.frontend.editor.AbstractCmsEditor<T>
-
- All Implemented Interfaces:
Serializable
,org.apache.wicket.model.IDetachable
,org.apache.wicket.util.io.IClusterable
,IRefreshable
,IEditor<T>
public abstract class AbstractCmsEditor<T> extends Object implements IEditor<T>, org.apache.wicket.model.IDetachable, IRefreshable
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hippoecm.frontend.service.IEditor
IEditor.Mode
-
-
Constructor Summary
Constructors Constructor Description AbstractCmsEditor(IEditorContext editorContext, IPluginContext context, IPluginConfig parameters, org.apache.wicket.model.IModel<T> model, IEditor.Mode mode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Requests that the editor be closed.protected UsageEvent
createUsageEvent(String name)
protected UsageEvent
createUsageEvent(String name, org.apache.wicket.model.IModel<T> model)
void
detach()
void
discard()
Default implementation that does nothing.void
done()
Default implementation that does nothing.void
focus()
Requests focus on the editor.protected org.apache.wicket.model.IModel<T>
getBaseModel()
protected IClusterConfig
getClusterConfig()
protected org.apache.wicket.model.IModel<T>
getEditorModel()
org.apache.wicket.markup.html.form.Form
getForm()
TheForm
that wraps the editor.IEditor.Mode
getMode()
org.apache.wicket.model.IModel<T>
getModel()
Model of the Editor.protected IPluginContext
getPluginContext()
protected String
getRendererServiceId()
boolean
isModified()
protected boolean
isParentOfFrozenNode(Node node)
boolean
isTransferable()
If a document has been saved as draft the document is marked as "transferable".boolean
isValid()
protected void
onActivated()
Hook called when an editor is activated, i.e.protected void
onClose()
protected void
onDeactivated()
Hook called when an editor is deactivate, i.e.protected void
postClose(Map<IEditorFilter,Object> contexts)
protected Map<IEditorFilter,Object>
preClose()
protected void
publishEvent(String name)
void
refresh()
void
revert()
Default implementation that does nothing.void
save()
Default implementation that does nothing.void
saveDraft()
void
setMode(IEditor.Mode mode)
void
start()
void
stop()
-
-
-
Constructor Detail
-
AbstractCmsEditor
public AbstractCmsEditor(IEditorContext editorContext, IPluginContext context, IPluginConfig parameters, org.apache.wicket.model.IModel<T> model, IEditor.Mode mode) throws EditorException
- Throws:
EditorException
-
-
Method Detail
-
getMode
public IEditor.Mode getMode()
-
setMode
public void setMode(IEditor.Mode mode) throws EditorException
- Specified by:
setMode
in interfaceIEditor<T>
- Throws:
EditorException
-
getModel
public org.apache.wicket.model.IModel<T> getModel()
Description copied from interface:IEditor
Model of the Editor.
-
isModified
public boolean isModified() throws EditorException
- Specified by:
isModified
in interfaceIEditor<T>
- Throws:
EditorException
-
isValid
public boolean isValid() throws EditorException
- Specified by:
isValid
in interfaceIEditor<T>
- Throws:
EditorException
-
save
public void save() throws EditorException
Default implementation that does nothing. Subclasses are expected to override this behaviour.- Specified by:
save
in interfaceIEditor<T>
- Throws:
EditorException
-
saveDraft
public void saveDraft() throws EditorException
- Specified by:
saveDraft
in interfaceIEditor<T>
- Throws:
EditorException
-
done
public void done() throws EditorException
Default implementation that does nothing. Subclasses are expected to override this behaviour.- Specified by:
done
in interfaceIEditor<T>
- Throws:
EditorException
-
revert
public void revert() throws EditorException
Default implementation that does nothing. Subclasses are expected to override this behaviour.- Specified by:
revert
in interfaceIEditor<T>
- Throws:
EditorException
-
discard
public void discard() throws EditorException
Default implementation that does nothing. Subclasses are expected to override this behaviour.- Specified by:
discard
in interfaceIEditor<T>
- Throws:
EditorException
-
close
public void close() throws EditorException
Description copied from interface:IEditor
Requests that the editor be closed. In case the editor contains modified document, the implementation should ask the user what to be done with the changes to the document.- Specified by:
close
in interfaceIEditor<T>
- Throws:
EditorException
- when the editor is in a state where it cannot be closed.
-
onActivated
protected void onActivated()
Hook called when an editor is activated, i.e. transitions from inactive to active state. When overiding, make sure to call super.onActivated() in order to keep the usage statistics working.
-
onDeactivated
protected void onDeactivated()
Hook called when an editor is deactivate, i.e. transitions from active to inactive state. When overriding, make sure to call super.onDeactivated().
-
publishEvent
protected void publishEvent(String name)
-
createUsageEvent
protected UsageEvent createUsageEvent(String name)
-
createUsageEvent
protected UsageEvent createUsageEvent(String name, org.apache.wicket.model.IModel<T> model)
-
preClose
protected Map<IEditorFilter,Object> preClose() throws EditorException
- Throws:
EditorException
-
postClose
protected void postClose(Map<IEditorFilter,Object> contexts)
-
getPluginContext
protected IPluginContext getPluginContext()
-
getEditorModel
protected org.apache.wicket.model.IModel<T> getEditorModel() throws EditorException
- Throws:
EditorException
-
getBaseModel
protected org.apache.wicket.model.IModel<T> getBaseModel() throws EditorException
- Throws:
EditorException
-
getClusterConfig
protected IClusterConfig getClusterConfig()
-
start
public void start() throws EditorException
- Throws:
EditorException
-
stop
public void stop()
-
getRendererServiceId
protected String getRendererServiceId()
-
getForm
public org.apache.wicket.markup.html.form.Form getForm()
Description copied from interface:IEditor
TheForm
that wraps the editor.
-
onClose
protected void onClose()
-
refresh
public void refresh()
- Specified by:
refresh
in interfaceIRefreshable
-
focus
public void focus()
Description copied from interface:IEditor
Requests focus on the editor.
-
detach
public void detach()
- Specified by:
detach
in interfaceorg.apache.wicket.model.IDetachable
-
isTransferable
public boolean isTransferable() throws EditorException
Description copied from interface:IEditor
If a document has been saved as draft the document is marked as "transferable".- Specified by:
isTransferable
in interfaceIEditor<T>
- Returns:
- true if the document has been saved as draft, otherwise false
- Throws:
EditorException
-
isParentOfFrozenNode
protected boolean isParentOfFrozenNode(Node node) throws RepositoryException
- Throws:
RepositoryException
-
-