Class LayoutPlacementAssembler

java.lang.Object
io.meeds.layout.service.LayoutPlacementAssembler

public class LayoutPlacementAssembler extends Object
Places, moves or removes one application of a stored page or site tree, for one move_layout_application or remove_layout_application call, every other element staying where it is stored. The places addressed are the ones the read describes: on a page built with the editor's sections, a column of a dynamic section and a cell of a grid section; on a site, a column of a topbar or a bottom bar by the banner's id and the column's number, and a sidebar by the id of its cell, the outer one when a side holds two. An index counts the applications the caller can see, every number from 1, and an application the caller cannot see keeps its stored place among them. A moved application keeps its window, its preferences and its styling, written for its new place in the editor's matrix: a block the new place does not offer is dropped. A grid cell and a column of a topbar or a bottom bar hold one application: a taken one is refused, never swapped. An application alone in a column of a topbar or a bottom bar moves to another column with its own column, which carries the settings the site layout editor gives it: the two columns swap places. Every value is checked before the tree changes.
  • Field Details

  • Constructor Details

    • LayoutPlacementAssembler

      public LayoutPlacementAssembler(LayoutModel root, boolean site, Set<String> hiddenIds, LayoutStylingService stylingService, LayoutDescriptionService descriptionService)
      Parameters:
      root - the stored page or site layout, wrapped
      site - whether the root is a site layout
      hiddenIds - the storage id of every element the caller cannot see, an element under a container they cannot see included
      stylingService - the styling writer
      descriptionService - the reader whose numbering and styling the placement follows
  • Method Details

    • move

      public PlacedLayout move(String applicationId, ApplicationPosition position) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • place

      public PlacedLayout place(Supplier<LayoutModel> newApplication, ApplicationPosition position) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • remove

      public LayoutModel remove(String applicationId) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException