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
FieldsModifier and TypeFieldDescriptionprotected Integerprotected booleanprotected Stringprotected Map<String,Map<String, Serializable>> protected Map<String,List<RenderingInfo>> protected LayoutRowDefinition[]protected Stringprotected Stringprotected Map<String,WidgetDefinition> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLayoutDefinitionImpl(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.booleanReturn alias names for this layout definition (useful for compatibility on old layout names).intReturns 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 StringgetTemplate(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.booleanbooleanisEmpty()Returns true if all widget references in this layout are emptyvoidsetAliases(List<String> aliases) voidsetDynamic(boolean dynamic) voidvoidsetProperties(Map<String, Map<String, Serializable>> properties) voidsetRenderingInfos(Map<String, List<RenderingInfo>> renderingInfos) voidsetRows(LayoutRowDefinition[] rows) voidsetTemplates(Map<String, String> templates) voidvoidsetTypeCategory(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:LayoutDefinitionReturns the maximum number of columns.- Specified by:
getColumnsin interfaceLayoutDefinition
-
getName
Description copied from interface:LayoutDefinitionReturns the layout name used to identify it within the layout service.- Specified by:
getNamein interfaceLayoutDefinition
-
setName
- Specified by:
setNamein interfaceLayoutDefinition
-
getType
Description copied from interface:LayoutDefinitionReturn 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:
getTypein interfaceLayoutDefinition- Since:
- 6.0
-
setType
- Since:
- 6.0
-
getTypeCategory
- Specified by:
getTypeCategoryin interfaceLayoutDefinition- Since:
- 6.0
-
setTypeCategory
- Since:
- 6.0
-
getProperties
Description copied from interface:LayoutDefinitionReturns a map of properties to use in a given mode.- Specified by:
getPropertiesin interfaceLayoutDefinition
-
getProperties
Description copied from interface:LayoutDefinitionReturns a map of properties by mode.- Specified by:
getPropertiesin interfaceLayoutDefinition
-
setProperties
- Specified by:
setPropertiesin interfaceLayoutDefinition
-
getRows
Description copied from interface:LayoutDefinitionReturns 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:
getRowsin interfaceLayoutDefinition
-
setRows
- Specified by:
setRowsin interfaceLayoutDefinition
-
getTemplate
- Since:
- 6.0
-
getTemplate
Description copied from interface:LayoutDefinitionReturns template to use in a given mode.- Specified by:
getTemplatein interfaceLayoutDefinition
-
getTemplates
Description copied from interface:LayoutDefinitionReturns templates by mode- Specified by:
getTemplatesin interfaceLayoutDefinition
-
setTemplates
- Specified by:
setTemplatesin interfaceLayoutDefinition
-
getWidgetDefinition
Description copied from interface:LayoutDefinitionReturns the widget definition with given name.Returns null if a widget with this name is not found within the layout.
- Specified by:
getWidgetDefinitionin interfaceLayoutDefinition
-
getWidgetDefinitions
Description copied from interface:LayoutDefinitionReturns the map of widgets defined inside this layout.- Specified by:
getWidgetDefinitionsin interfaceLayoutDefinition
-
getRenderingInfos
Description copied from interface:LayoutDefinitionReturns 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:
getRenderingInfosin interfaceLayoutDefinition
-
setRenderingInfos
- Specified by:
setRenderingInfosin interfaceLayoutDefinition
-
getRenderingInfos
Description copied from interface:LayoutDefinitionReturns the list of rendering information for given mode.- Specified by:
getRenderingInfosin interfaceLayoutDefinition
-
isEmpty
public boolean isEmpty()Description copied from interface:LayoutDefinitionReturns true if all widget references in this layout are empty- Specified by:
isEmptyin interfaceLayoutDefinition
-
getAliases
Description copied from interface:LayoutDefinitionReturn alias names for this layout definition (useful for compatibility on old layout names).- Specified by:
getAliasesin interfaceLayoutDefinition
-
setAliases
-
isDynamic
public boolean isDynamic()- Specified by:
isDynamicin interfaceLayoutDefinition
-
setDynamic
public void setDynamic(boolean dynamic) -
clone
Description copied from interface:LayoutDefinitionReturns a clone instance of this layout definition.Useful for conversion of layout definition during export.
- Specified by:
clonein interfaceLayoutDefinition- Overrides:
clonein classObject
-
equals
-