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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hippoecm.frontend.service.IEditor
IEditor.Mode
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAbstractCmsEditor
(IEditorContext editorContext, IPluginContext context, IPluginConfig parameters, org.apache.wicket.model.IModel<T> model, IEditor.Mode mode) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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>
protected IClusterConfig
protected org.apache.wicket.model.IModel<T>
org.apache.wicket.markup.html.form.Form
getForm()
TheForm
that wraps the editor.getMode()
org.apache.wicket.model.IModel<T>
getModel()
Model of the Editor.protected IPluginContext
protected String
boolean
protected boolean
isParentOfFrozenNode
(Node node) boolean
If a document has been saved as draft the document is marked as "transferable".boolean
isValid()
protected void
Hook called when an editor is activated, i.e.protected void
onClose()
protected void
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
void
setMode
(IEditor.Mode mode) void
start()
void
stop()
-
Constructor Details
-
AbstractCmsEditor
public AbstractCmsEditor(IEditorContext editorContext, IPluginContext context, IPluginConfig parameters, org.apache.wicket.model.IModel<T> model, IEditor.Mode mode) throws EditorException - Throws:
EditorException
-
-
Method Details
-
getMode
-
setMode
- Specified by:
setMode
in interfaceIEditor<T>
- Throws:
EditorException
-
getModel
Description copied from interface:IEditor
Model of the Editor. -
isModified
- Specified by:
isModified
in interfaceIEditor<T>
- Throws:
EditorException
-
isValid
- Specified by:
isValid
in interfaceIEditor<T>
- Throws:
EditorException
-
save
Default implementation that does nothing. Subclasses are expected to override this behaviour.- Specified by:
save
in interfaceIEditor<T>
- Throws:
EditorException
-
saveDraft
- Specified by:
saveDraft
in interfaceIEditor<T>
- Throws:
EditorException
-
done
Default implementation that does nothing. Subclasses are expected to override this behaviour.- Specified by:
done
in interfaceIEditor<T>
- Throws:
EditorException
-
revert
Default implementation that does nothing. Subclasses are expected to override this behaviour.- Specified by:
revert
in interfaceIEditor<T>
- Throws:
EditorException
-
discard
Default implementation that does nothing. Subclasses are expected to override this behaviour.- Specified by:
discard
in interfaceIEditor<T>
- Throws:
EditorException
-
close
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
-
createUsageEvent
-
createUsageEvent
-
preClose
- Throws:
EditorException
-
postClose
-
getPluginContext
-
getEditorModel
- Throws:
EditorException
-
getBaseModel
- Throws:
EditorException
-
getClusterConfig
-
start
- Throws:
EditorException
-
stop
public void stop() -
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
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
- Throws:
RepositoryException
-