Class LayoutStylesAssembler
java.lang.Object
io.meeds.layout.service.LayoutStylesAssembler
Writes the styling of a set_layout_styles call, or the device visibility of
a set_layout_visibility call, onto a stored page or site tree, for one
call, leaving its structure and every element the call does not address as
stored. The elements addressed are the ones the read gives
an id to and offers styling for: on a page built with the editor's
sections, a section and an application of a dynamic column or of a grid
cell; on a site, a topbar, a bottom bar, a sidebar by the id of the cell
the read answers, and an application of one of them. Each one takes the
call's blocks merged over its stored styling, written for its place in the
editor's matrix, as the two layout assemblers write them; every other
application the caller can see is saved with its generated margin and
radius tokens stripped, as the two assemblers save theirs. A grid cell,
which the editor styles through its section and its application, is
refused, and so is a device visibility given to set_layout_styles or a
styling given to set_layout_visibility; an id the read does not answer, an
element the caller cannot see included, does not exist. A device visibility
is written as the editor writes it, on the element's own class: a section
hidden on a device hides what it holds there through the page's styles,
whatever its applications are set to. A grid section, which the editor
offers no visibility, refuses a hiding and takes both as it already is.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLayoutStylesAssembler(LayoutModel root, Set<String> hiddenIds, LayoutStylingService stylingService, BiFunction<LayoutModel, StylingDestination, StylingDescription> storedStyling) LayoutStylesAssembler(LayoutModel root, Set<String> hiddenIds, LayoutStylingService stylingService, BiFunction<LayoutModel, StylingDestination, StylingDescription> storedStyling, ImageConsumption images) -
Method Summary
Modifier and TypeMethodDescriptiondisplayPage(List<ElementDisplay> elements) displaySite(List<ElementDisplay> elements) stylePage(List<ElementStyling> elements) styleSite(List<ElementStyling> elements)
-
Field Details
-
ELEMENTS_NOT_ACCEPTED
- See Also:
-
ELEMENT_ID_NOT_ACCEPTED
- See Also:
-
ELEMENT_NOT_FOUND
- See Also:
-
DISPLAY_NOT_ACCEPTED
- See Also:
-
STYLING_NOT_ACCEPTED
- See Also:
-
MAX_ELEMENTS
public static final int MAX_ELEMENTS- See Also:
-
-
Constructor Details
-
LayoutStylesAssembler
public LayoutStylesAssembler(LayoutModel root, Set<String> hiddenIds, LayoutStylingService stylingService, BiFunction<LayoutModel, StylingDestination, StylingDescription> storedStyling) - Parameters:
root- the stored page or site layout, wrappedhiddenIds- the storage id of every element the caller cannot see, an element under a container they cannot see includedstylingService- the styling writerstoredStyling- reads an element's stored styling as the read answers it, the base a call's blocks are merged over
-
LayoutStylesAssembler
public LayoutStylesAssembler(LayoutModel root, Set<String> hiddenIds, LayoutStylingService stylingService, BiFunction<LayoutModel, StylingDestination, StylingDescription> storedStyling, ImageConsumption images) - Parameters:
images- the call's image consumption, on which a block carrying an image_upload_id claims its id
-
-
Method Details
-
stylePage
public LayoutModel stylePage(List<ElementStyling> elements) throws org.exoplatform.commons.exception.ObjectNotFoundException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundException
-
styleSite
public LayoutModel styleSite(List<ElementStyling> elements) throws org.exoplatform.commons.exception.ObjectNotFoundException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundException
-
displayPage
public LayoutModel displayPage(List<ElementDisplay> elements) throws org.exoplatform.commons.exception.ObjectNotFoundException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundException
-
displaySite
public LayoutModel displaySite(List<ElementDisplay> elements) throws org.exoplatform.commons.exception.ObjectNotFoundException - Throws:
org.exoplatform.commons.exception.ObjectNotFoundException
-