Interface Section<T extends SectionTemplate>

All Superinterfaces:
Comparable<StoreElement>, DataProvider, HistoryProvider, IDProvider, PackagePoolItem, StoreElement, TemplateProvider<T>, Workflowable
All Known Subinterfaces:
Content2Section, GCASection, SectionReference<T>

public interface Section<T extends SectionTemplate> extends DataProvider, TemplateProvider<T>, PackagePoolItem
This interface provides methods to handle the sections of Pages in the PageStore. A Page-Body in PageStore can have zero or several sections. To get all sections for a Page-body, use Body.getChildren(Section.class).
Since:
3.0
  • Field Details

    • OPEN_ENDED

      static final long OPEN_ENDED
      Indicator for open ended lifespan
      Since:
      4.0.129
      See Also:
  • Method Details

    • getName

      @ApiDoc(comment="Get the name of the section", since="3.0") @NotNull @NotNull String getName()
      Get the name of the section
      Specified by:
      getName in interface StoreElement
      Returns:
      name of the section
      Since:
      3.0
    • setName

      @ApiDoc(comment="Set the name of a section", since="3.0") void setName(String name)
      Set the name of a section
      Parameters:
      name - new name of a section
      Since:
      3.0
    • getTemplate

      @ApiDoc(comment="Returns the template of this element.", since="3.0") @NotNull T getTemplate() throws ReferenceNotFoundException
      Returns the template of this element.
      Specified by:
      getTemplate in interface TemplateProvider<T extends SectionTemplate>
      Returns:
      the template of type <T>
      Throws:
      ReferenceNotFoundException - if template is missing
      Since:
      3.0
    • setTemplate

      @ApiDoc(comment="Set the template for this section.", since="4.1.25") void setTemplate(@NotNull T template)
      Set the template for this section.
      Parameters:
      template - new template
      Throws:
      NullPointerException - if sectionTemplate is null
      Since:
      4.1.25
    • getLifespan

      @ApiDoc(comment="Get the lifespan of the current section if there is one defined.", since="3.0") @Nullable @org.jetbrains.annotations.Nullable long[] getLifespan()
      Get the lifespan of the current section if there is one defined.
      Returns:
      null or an array with two elements: 1.) start date, 2.) end date or -1L for no restriction.
      Since:
      3.0
      See Also:
    • setLifespan

      @ApiDoc(comment="Set the lifespan of the current section.", since="3.0") void setLifespan(long from, long to)
      Set the lifespan of the current section.
      Parameters:
      from - start date for lifespan (in milliseconds since 1.1.1970 0:00 UTC)
      to - end date for lifespan (in milliseconds since 1.1.1970 0:00 UTC) or -1L for no restriction
      Since:
      3.0
      See Also:
    • removeLifespan

      @ApiDoc(comment="Remove lifespan of the current section.", since="3.0") void removeLifespan()
      Remove lifespan of the current section.
      Since:
      3.0
      See Also:
    • isInLifespan

      @ApiDoc(comment="Indicates whether the actual time is included in the lifespan of this section.", since="4.0") boolean isInLifespan()
      Indicates whether the actual time is included in the lifespan of this section. Calls isInLifepan(System.currentTimeMillis()).
      Returns:
      true if no lifespan is set or the actual time is included in the lifespan.
      Since:
      4.0
      See Also:
    • isInLifespan

      @ApiDoc(comment="Indicates whether the given timestamp is included in the lifespan of this section.", since="4.2.200") boolean isInLifespan(long time)
      Indicates whether the given timestamp is included in the lifespan of this section.
      Parameters:
      time - the timestamp to check the lifespan for
      Returns:
      true if no lifespan is set or the given time is included in the lifespan, false otherwise
      Since:
      4.2.200
      See Also:
    • includeInOutput

      @ApiDoc(comment="Includes this section in the output for the given language.", since="3.0") void includeInOutput(Language language)
      Includes this section in the output for the given language.
      Parameters:
      language - the language to include this section for
      Since:
      3.0
    • excludeFromOutput

      @ApiDoc(comment="Excludes this section from the output for the given language.", since="3.0") void excludeFromOutput(Language language)
      Excludes this section from the output for the given language.
      Parameters:
      language - the language to exclude for this section
      Since:
      3.0
    • isInOutputIncluded

      @ApiDoc(comment="Checks if this section is included in the output for the given language.", since="3.0") boolean isInOutputIncluded(Language language)
      Checks if this section is included in the output for the given language.
      Parameters:
      language - the language to check this section for
      Returns:
      true if this section is included in the output for this language
      Since:
      3.0
    • isReference

      @ApiDoc(comment="Is this a reference section?", since="3.0") boolean isReference()
      Is this a reference section?
      Returns:
      true if this section is a reference section
      Since:
      3.0