Class LayoutDefinitionImpl
java.lang.Object
org.nuxeo.ecm.platform.forms.layout.api.impl.LayoutDefinitionImpl
- All Implemented Interfaces:
Serializable
,LayoutDefinition
Default implementation for a layout definition.
Useful to compute layouts independently from the layout service.
- Since:
- 5.4
- Author:
- Anahide Tchertchian
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected Integer
protected boolean
protected String
protected Map<String,
Map<String, Serializable>> protected Map<String,
List<RenderingInfo>> protected LayoutRowDefinition[]
protected String
protected String
protected Map<String,
WidgetDefinition> -
Constructor Summary
ModifierConstructorDescriptionprotected
LayoutDefinitionImpl
(String name, String template, WidgetDefinition widgetDefinition) LayoutDefinitionImpl
(String name, Map<String, Map<String, Serializable>> properties, Map<String, String> templates, List<LayoutRowDefinition> rows, List<WidgetDefinition> widgetDefinitions) LayoutDefinitionImpl
(String name, Map<String, Map<String, Serializable>> properties, Map<String, String> templates, LayoutRowDefinition[] rows, Map<String, WidgetDefinition> widgets) -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a clone instance of this layout definition.boolean
Return alias names for this layout definition (useful for compatibility on old layout names).int
Returns the maximum number of columns.getName()
Returns the layout name used to identify it within the layout service.Returns a map of properties by mode.getProperties
(String layoutMode) Returns a map of properties to use in a given mode.Returns the map of rendering information per mode.getRenderingInfos
(String mode) Returns the list of rendering information for given mode.getRows()
Returns the list of widget names to use at a given row.getTemplate
(String mode) Returns template to use in a given mode.static String
getTemplate
(Map<String, String> templates, String mode) Returns templates by modegetType()
Return the layout type, or null if not defined.getWidgetDefinition
(String name) Returns the widget definition with given name.Returns the map of widgets defined inside this layout.boolean
boolean
isEmpty()
Returns true if all widget references in this layout are emptyvoid
setAliases
(List<String> aliases) void
setDynamic
(boolean dynamic) void
void
setProperties
(Map<String, Map<String, Serializable>> properties) void
setRenderingInfos
(Map<String, List<RenderingInfo>> renderingInfos) void
setRows
(LayoutRowDefinition[] rows) void
setTemplates
(Map<String, String> templates) void
void
setTypeCategory
(String typeCategory)
-
Field Details
-
name
-
type
-
typeCategory
-
properties
-
templates
-
rows
-
widgets
-
renderingInfos
-
columns
-
aliases
-
dynamic
protected boolean dynamic
-
-
Constructor Details
-
LayoutDefinitionImpl
protected LayoutDefinitionImpl() -
LayoutDefinitionImpl
-
LayoutDefinitionImpl
public LayoutDefinitionImpl(String name, Map<String, Map<String, Serializable>> properties, Map<String, String> templates, List<LayoutRowDefinition> rows, List<WidgetDefinition> widgetDefinitions) -
LayoutDefinitionImpl
public LayoutDefinitionImpl(String name, Map<String, Map<String, Serializable>> properties, Map<String, String> templates, LayoutRowDefinition[] rows, Map<String, WidgetDefinition> widgets)
-
-
Method Details
-
getColumns
public int getColumns()Description copied from interface:LayoutDefinition
Returns the maximum number of columns.- Specified by:
getColumns
in interfaceLayoutDefinition
-
getName
Description copied from interface:LayoutDefinition
Returns the layout name used to identify it within the layout service.- Specified by:
getName
in interfaceLayoutDefinition
-
setName
- Specified by:
setName
in interfaceLayoutDefinition
-
getType
Description copied from interface:LayoutDefinition
Return the layout type, or null if not defined.Since 6.0, the layout type can hold templates and properties configuration, so that layout does not need to define them again.
- Specified by:
getType
in interfaceLayoutDefinition
- Since:
- 6.0
-
setType
- Since:
- 6.0
-
getTypeCategory
- Specified by:
getTypeCategory
in interfaceLayoutDefinition
- Since:
- 6.0
-
setTypeCategory
- Since:
- 6.0
-
getProperties
Description copied from interface:LayoutDefinition
Returns a map of properties to use in a given mode.- Specified by:
getProperties
in interfaceLayoutDefinition
-
getProperties
Description copied from interface:LayoutDefinition
Returns a map of properties by mode.- Specified by:
getProperties
in interfaceLayoutDefinition
-
setProperties
- Specified by:
setProperties
in interfaceLayoutDefinition
-
getRows
Description copied from interface:LayoutDefinition
Returns the list of widget names to use at a given row.For instance, this could describe a layout like: [['title'], ['description'], ['creationDate', '', 'modificationDate'], ['subject']].
- Specified by:
getRows
in interfaceLayoutDefinition
-
setRows
- Specified by:
setRows
in interfaceLayoutDefinition
-
getTemplate
- Since:
- 6.0
-
getTemplate
Description copied from interface:LayoutDefinition
Returns template to use in a given mode.- Specified by:
getTemplate
in interfaceLayoutDefinition
-
getTemplates
Description copied from interface:LayoutDefinition
Returns templates by mode- Specified by:
getTemplates
in interfaceLayoutDefinition
-
setTemplates
- Specified by:
setTemplates
in interfaceLayoutDefinition
-
getWidgetDefinition
Description copied from interface:LayoutDefinition
Returns the widget definition with given name.Returns null if a widget with this name is not found within the layout.
- Specified by:
getWidgetDefinition
in interfaceLayoutDefinition
-
getWidgetDefinitions
Description copied from interface:LayoutDefinition
Returns the map of widgets defined inside this layout.- Specified by:
getWidgetDefinitions
in interfaceLayoutDefinition
-
getRenderingInfos
Description copied from interface:LayoutDefinition
Returns the map of rendering information per mode.Useful for preview management where some configuration needs to be changed: what's changed can be set as rendering information here to be displayed.
- Specified by:
getRenderingInfos
in interfaceLayoutDefinition
-
setRenderingInfos
- Specified by:
setRenderingInfos
in interfaceLayoutDefinition
-
getRenderingInfos
Description copied from interface:LayoutDefinition
Returns the list of rendering information for given mode.- Specified by:
getRenderingInfos
in interfaceLayoutDefinition
-
isEmpty
public boolean isEmpty()Description copied from interface:LayoutDefinition
Returns true if all widget references in this layout are empty- Specified by:
isEmpty
in interfaceLayoutDefinition
-
getAliases
Description copied from interface:LayoutDefinition
Return alias names for this layout definition (useful for compatibility on old layout names).- Specified by:
getAliases
in interfaceLayoutDefinition
-
setAliases
-
isDynamic
public boolean isDynamic()- Specified by:
isDynamic
in interfaceLayoutDefinition
-
setDynamic
public void setDynamic(boolean dynamic) -
clone
Description copied from interface:LayoutDefinition
Returns a clone instance of this layout definition.Useful for conversion of layout definition during export.
- Specified by:
clone
in interfaceLayoutDefinition
- Overrides:
clone
in classObject
-
equals
-