public interface NewSectionOperation
Operation for creating new sections. This operation is meant to be used in a webedit context.
It may be used in two different ways:
From an Executable in combination with FSButton
In that case you may want to delegate the whole context to this operation. Usually you don't need to make any further settings.
From anywhere (Executable, Script, ...)
Define all settings explicitly by yourself.
Modifier and Type | Field and Description |
---|---|
static String |
PARAM_BODY
Context Parameter for body's name as String
|
static String |
PARAM_DROPDATA
Context Parameter for DropData
|
static String |
PARAM_PAGE
Context Parameter for Page (id or uid as String)
|
static String |
PARAM_RELOAD
ID as String of the HTML element to reload on success
|
static String |
PARAM_SECTION
Context parameter for the numerical ID of the contextual section after which the new section should be inserted.
|
static String |
PARAM_STORE
Context Parameter for the store's name as String.
|
static OperationType<NewSectionOperation> |
TYPE
Operation for creating a new Section
|
Modifier and Type | Method and Description |
---|---|
NewSectionOperation |
body(Body body)
Body on which a new section should be created.
|
NewSectionOperation |
delegateContext(Map<String,Object> context)
Convenient method to pass a whole context containing all needed information to the operation.
|
NewSectionOperation |
dropData(CommodityContainer dropData)
A
CommodityContainer may be provided to support drag-and-drop data containing either a Section
or other data compatible with any drop editor configured in each allowed template. |
NewSectionOperation |
filterAvailableTemplates(Filter<SectionTemplate> filter)
You may provide a filter to control which templates are available for the new
Section . |
Section<?> |
perform()
Executes this operation based on the previously defined settings.
|
NewSectionOperation |
preselectedLanguage(Language language)
Sets a preselected language in new-section dialogs.
|
NewSectionOperation |
reloadAfterCreation(String elementId)
The ID of an HTML element to be reloaded instead of the complete preview, after an automated
Section creation. |
NewSectionOperation |
section(Section<?> section)
Contextual section after which the new section should be inserted.
|
NewSectionOperation |
template(SectionTemplate template)
The
SectionTemplate on which the new section should be based on. |
static final String PARAM_PAGE
static final String PARAM_BODY
static final String PARAM_SECTION
static final String PARAM_RELOAD
reloadAfterCreation(java.lang.String)
,
Constant Field Valuesstatic final String PARAM_DROPDATA
dropData(de.espirit.firstspirit.ui.gadgets.aspects.transfer.CommodityContainer)
,
Constant Field Valuesstatic final String PARAM_STORE
Store.Type
.static final OperationType<NewSectionOperation> TYPE
NewSectionOperation body(@NotNull Body body)
body
- body on which new sections should be createdNewSectionOperation section(@Nullable Section<?> section)
section
- The contextual section.NewSectionOperation template(@NotNull SectionTemplate template)
SectionTemplate
on which the new section should be based on.
If no template is provided the user will be asked to select one.template
- SectionTemplate
on which the new section should be basedNewSectionOperation reloadAfterCreation(String elementId)
Section
creation.elementId
- the html element which should be reloaded after creationNewSectionOperation dropData(CommodityContainer dropData)
CommodityContainer
may be provided to support drag-and-drop data containing either a Section
or other data compatible with any drop editor configured in each allowed template. If the data fits to multiple
section templates the user will be asked to select one when perform()
is executed.
The provided data will then be used to pre-fill the newly created Section.dropData
- the drag-and-drop object containing a Section
or any other compatible dataNewSectionOperation filterAvailableTemplates(Filter<SectionTemplate> filter)
Section
.
Keep in mind, that only templates allowed for the specific content area are available anyway.filter
- filter to sort out SectionTemplate
NewSectionOperation delegateContext(Map<String,Object> context)
Executable
called from a FS_BUTTON, because
in that case parameters (e.g. page, body) may be directly passed. That way you are able to extend the capabilities of
the NewSectionExecutable without any further Glue-Code.
Be aware that parameters may be overwritten in subsequently called configuration methods.context
- the context containing all information neededNewSectionOperation preselectedLanguage(@NotNull Language language)
language
- the language which should be preselected in the dialogCopyright © 2021 e-Spirit AG. All Rights Reserved. Build 5.2.210210