Interface NewSectionOperation


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.

Since:
5.2.180703
  • Field Details

  • Method Details

    • body

      Body on which a new section should be created.
      Parameters:
      body - body on which new sections should be created
      Since:
      5.2.180703
    • section

      NewSectionOperation section(@Nullable Section<?> section)
      Contextual section after which the new section should be inserted.
      Parameters:
      section - The contextual section.
      Since:
      5.2.191103
    • template

      The SectionTemplate on which the new section should be based on. If no template is provided the user will be asked to select one.
      Parameters:
      template - SectionTemplate on which the new section should be based
      Since:
      5.2.180703
    • reloadAfterCreation

      NewSectionOperation reloadAfterCreation(String elementId)
      The ID of an HTML element to be reloaded instead of the complete preview, after an automated Section creation.
      Parameters:
      elementId - the html element which should be reloaded after creation
      Since:
      5.2.180703
    • 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. 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.
      Parameters:
      dropData - the drag-and-drop object containing a Section or any other compatible data
      Since:
      5.2.180703
    • filterAvailableTemplates

      NewSectionOperation filterAvailableTemplates(Filter<SectionTemplate> filter)
      You may provide a filter to control which templates are available for the new Section. Keep in mind, that only templates allowed for the specific content area are available anyway.
      Parameters:
      filter - filter to sort out SectionTemplate
      Since:
      5.2.180703
    • delegateContext

      NewSectionOperation delegateContext(Map<String,Object> context)
      Convenient method to pass a whole context containing all needed information to the operation. This is especially useful if this operation is used inside a 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.
      Parameters:
      context - the context containing all information needed
      Since:
      5.2.180703
    • preselectedLanguage

      NewSectionOperation preselectedLanguage(@NotNull Language language)
      Sets a preselected language in new-section dialogs.
      Parameters:
      language - the language which should be preselected in the dialog
      Since:
      5.2.180901, 5.2.180804
    • perform

      Section<?> perform()
      Executes this operation based on the previously defined settings. This method will wait for the completion of the section creation process.
      Returns:
      the newly created Section or null if the operation failed
      Since:
      5.2.180703