Class LayoutDefinitionImpl
- java.lang.Object
-
- org.nuxeo.ecm.platform.forms.layout.api.impl.LayoutDefinitionImpl
-
- All Implemented Interfaces:
Serializable,LayoutDefinition
public class LayoutDefinitionImpl extends Object implements LayoutDefinition
Default implementation for a layout definition.Useful to compute layouts independently from the layout service.
- Since:
- 5.4
- Author:
- Anahide Tchertchian
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List<String>aliasesprotected Integercolumnsprotected booleandynamicprotected Stringnameprotected Map<String,Map<String,Serializable>>propertiesprotected Map<String,List<RenderingInfo>>renderingInfosprotected LayoutRowDefinition[]rowsprotected Map<String,String>templatesprotected Stringtypeprotected StringtypeCategoryprotected Map<String,WidgetDefinition>widgets
-
Constructor Summary
Constructors Modifier Constructor Description protectedLayoutDefinitionImpl()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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LayoutDefinitionclone()Returns a clone instance of this layout definition.booleanequals(Object obj)List<String>getAliases()Return alias names for this layout definition (useful for compatibility on old layout names).intgetColumns()Returns the maximum number of columns.StringgetName()Returns the layout name used to identify it within the layout service.Map<String,Map<String,Serializable>>getProperties()Returns a map of properties by mode.Map<String,Serializable>getProperties(String layoutMode)Returns a map of properties to use in a given mode.Map<String,List<RenderingInfo>>getRenderingInfos()Returns the map of rendering information per mode.List<RenderingInfo>getRenderingInfos(String mode)Returns the list of rendering information for given mode.LayoutRowDefinition[]getRows()Returns the list of widget names to use at a given row.StringgetTemplate(String mode)Returns template to use in a given mode.static StringgetTemplate(Map<String,String> templates, String mode)Map<String,String>getTemplates()Returns templates by modeStringgetType()Return the layout type, or null if not defined.StringgetTypeCategory()WidgetDefinitiongetWidgetDefinition(String name)Returns the widget definition with given name.Map<String,WidgetDefinition>getWidgetDefinitions()Returns the map of widgets defined inside this layout.booleanisDynamic()booleanisEmpty()Returns true if all widget references in this layout are emptyvoidsetAliases(List<String> aliases)voidsetDynamic(boolean dynamic)voidsetName(String name)voidsetProperties(Map<String,Map<String,Serializable>> properties)voidsetRenderingInfos(Map<String,List<RenderingInfo>> renderingInfos)voidsetRows(LayoutRowDefinition[] rows)voidsetTemplates(Map<String,String> templates)voidsetType(String type)voidsetTypeCategory(String typeCategory)
-
-
-
Field Detail
-
name
protected String name
-
type
protected String type
-
typeCategory
protected String typeCategory
-
properties
protected Map<String,Map<String,Serializable>> properties
-
rows
protected LayoutRowDefinition[] rows
-
widgets
protected Map<String,WidgetDefinition> widgets
-
renderingInfos
protected Map<String,List<RenderingInfo>> renderingInfos
-
columns
protected Integer columns
-
dynamic
protected boolean dynamic
-
-
Constructor Detail
-
LayoutDefinitionImpl
protected LayoutDefinitionImpl()
-
LayoutDefinitionImpl
public LayoutDefinitionImpl(String name, String template, WidgetDefinition widgetDefinition)
-
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 Detail
-
getColumns
public int getColumns()
Description copied from interface:LayoutDefinitionReturns the maximum number of columns.- Specified by:
getColumnsin interfaceLayoutDefinition
-
getName
public String getName()
Description copied from interface:LayoutDefinitionReturns the layout name used to identify it within the layout service.- Specified by:
getNamein interfaceLayoutDefinition
-
setName
public void setName(String name)
- Specified by:
setNamein interfaceLayoutDefinition
-
getType
public String 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
public void setType(String type)
- Since:
- 6.0
-
getTypeCategory
public String getTypeCategory()
- Specified by:
getTypeCategoryin interfaceLayoutDefinition- Since:
- 6.0
-
setTypeCategory
public void setTypeCategory(String typeCategory)
- Since:
- 6.0
-
getProperties
public Map<String,Serializable> getProperties(String layoutMode)
Description copied from interface:LayoutDefinitionReturns a map of properties to use in a given mode.- Specified by:
getPropertiesin interfaceLayoutDefinition
-
getProperties
public Map<String,Map<String,Serializable>> getProperties()
Description copied from interface:LayoutDefinitionReturns a map of properties by mode.- Specified by:
getPropertiesin interfaceLayoutDefinition
-
setProperties
public void setProperties(Map<String,Map<String,Serializable>> properties)
- Specified by:
setPropertiesin interfaceLayoutDefinition
-
getRows
public LayoutRowDefinition[] 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
public void setRows(LayoutRowDefinition[] rows)
- Specified by:
setRowsin interfaceLayoutDefinition
-
getTemplate
public static String getTemplate(Map<String,String> templates, String mode)
- Since:
- 6.0
-
getTemplate
public String getTemplate(String mode)
Description copied from interface:LayoutDefinitionReturns template to use in a given mode.- Specified by:
getTemplatein interfaceLayoutDefinition
-
getTemplates
public Map<String,String> getTemplates()
Description copied from interface:LayoutDefinitionReturns templates by mode- Specified by:
getTemplatesin interfaceLayoutDefinition
-
setTemplates
public void setTemplates(Map<String,String> templates)
- Specified by:
setTemplatesin interfaceLayoutDefinition
-
getWidgetDefinition
public WidgetDefinition getWidgetDefinition(String name)
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
public Map<String,WidgetDefinition> getWidgetDefinitions()
Description copied from interface:LayoutDefinitionReturns the map of widgets defined inside this layout.- Specified by:
getWidgetDefinitionsin interfaceLayoutDefinition
-
getRenderingInfos
public Map<String,List<RenderingInfo>> 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
public void setRenderingInfos(Map<String,List<RenderingInfo>> renderingInfos)
- Specified by:
setRenderingInfosin interfaceLayoutDefinition
-
getRenderingInfos
public List<RenderingInfo> getRenderingInfos(String mode)
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
public List<String> getAliases()
Description copied from interface:LayoutDefinitionReturn alias names for this layout definition (useful for compatibility on old layout names).- Specified by:
getAliasesin interfaceLayoutDefinition
-
isDynamic
public boolean isDynamic()
- Specified by:
isDynamicin interfaceLayoutDefinition
-
setDynamic
public void setDynamic(boolean dynamic)
-
clone
public LayoutDefinition 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
-
-