public class LayoutDefinitionImpl extends Object implements LayoutDefinition
Useful to compute layouts independently from the layout service.
Modifier and Type | Field and Description |
---|---|
protected List<String> |
aliases |
protected Integer |
columns |
protected boolean |
dynamic |
protected String |
name |
protected Map<String,Map<String,Serializable>> |
properties |
protected Map<String,List<RenderingInfo>> |
renderingInfos |
protected LayoutRowDefinition[] |
rows |
protected Map<String,String> |
templates |
protected String |
type |
protected String |
typeCategory |
protected Map<String,WidgetDefinition> |
widgets |
Modifier | Constructor and Description |
---|---|
protected |
LayoutDefinitionImpl() |
|
LayoutDefinitionImpl(String name,
Map<String,Map<String,Serializable>> properties,
Map<String,String> templates,
LayoutRowDefinition[] rows,
Map<String,WidgetDefinition> widgets) |
|
LayoutDefinitionImpl(String name,
Map<String,Map<String,Serializable>> properties,
Map<String,String> templates,
List<LayoutRowDefinition> rows,
List<WidgetDefinition> widgetDefinitions) |
|
LayoutDefinitionImpl(String name,
String template,
WidgetDefinition widgetDefinition) |
Modifier and Type | Method and Description |
---|---|
LayoutDefinition |
clone()
Returns a clone instance of this layout definition.
|
boolean |
equals(Object obj) |
List<String> |
getAliases()
Return alias names for this layout definition (useful for compatibility on old layout names).
|
int |
getColumns()
Returns the maximum number of columns.
|
String |
getName()
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.
|
static String |
getTemplate(Map<String,String> templates,
String mode) |
String |
getTemplate(String mode)
Returns template to use in a given mode.
|
Map<String,String> |
getTemplates()
Returns templates by mode
|
String |
getType()
Return the layout type, or null if not defined.
|
String |
getTypeCategory() |
WidgetDefinition |
getWidgetDefinition(String name)
Returns the widget definition with given name.
|
Map<String,WidgetDefinition> |
getWidgetDefinitions()
Returns the map of widgets defined inside this layout.
|
boolean |
isDynamic() |
boolean |
isEmpty()
Returns true if all widget references in this layout are empty
|
void |
setAliases(List<String> aliases) |
void |
setDynamic(boolean dynamic) |
void |
setName(String name) |
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 |
setType(String type) |
void |
setTypeCategory(String typeCategory) |
protected String typeCategory
protected Map<String,Map<String,Serializable>> properties
protected LayoutRowDefinition[] rows
protected Map<String,WidgetDefinition> widgets
protected Map<String,List<RenderingInfo>> renderingInfos
protected boolean dynamic
protected LayoutDefinitionImpl()
public LayoutDefinitionImpl(String name, String template, WidgetDefinition widgetDefinition)
public LayoutDefinitionImpl(String name, Map<String,Map<String,Serializable>> properties, Map<String,String> templates, List<LayoutRowDefinition> rows, List<WidgetDefinition> widgetDefinitions)
public LayoutDefinitionImpl(String name, Map<String,Map<String,Serializable>> properties, Map<String,String> templates, LayoutRowDefinition[] rows, Map<String,WidgetDefinition> widgets)
public int getColumns()
LayoutDefinition
getColumns
in interface LayoutDefinition
public String getName()
LayoutDefinition
getName
in interface LayoutDefinition
public void setName(String name)
setName
in interface LayoutDefinition
public String getType()
LayoutDefinition
Since 6.0, the layout type can hold templates and properties configuration, so that layout does not need to define them again.
getType
in interface LayoutDefinition
public String getTypeCategory()
getTypeCategory
in interface LayoutDefinition
public void setTypeCategory(String typeCategory)
public Map<String,Serializable> getProperties(String layoutMode)
LayoutDefinition
getProperties
in interface LayoutDefinition
public Map<String,Map<String,Serializable>> getProperties()
LayoutDefinition
getProperties
in interface LayoutDefinition
public void setProperties(Map<String,Map<String,Serializable>> properties)
setProperties
in interface LayoutDefinition
public LayoutRowDefinition[] getRows()
LayoutDefinition
For instance, this could describe a layout like: [['title'], ['description'], ['creationDate', '', 'modificationDate'], ['subject']].
getRows
in interface LayoutDefinition
public void setRows(LayoutRowDefinition[] rows)
setRows
in interface LayoutDefinition
public String getTemplate(String mode)
LayoutDefinition
getTemplate
in interface LayoutDefinition
public Map<String,String> getTemplates()
LayoutDefinition
getTemplates
in interface LayoutDefinition
public void setTemplates(Map<String,String> templates)
setTemplates
in interface LayoutDefinition
public WidgetDefinition getWidgetDefinition(String name)
LayoutDefinition
Returns null if a widget with this name is not found within the layout.
getWidgetDefinition
in interface LayoutDefinition
public Map<String,WidgetDefinition> getWidgetDefinitions()
LayoutDefinition
getWidgetDefinitions
in interface LayoutDefinition
public Map<String,List<RenderingInfo>> getRenderingInfos()
LayoutDefinition
Useful for preview management where some configuration needs to be changed: what's changed can be set as rendering information here to be displayed.
getRenderingInfos
in interface LayoutDefinition
public void setRenderingInfos(Map<String,List<RenderingInfo>> renderingInfos)
setRenderingInfos
in interface LayoutDefinition
public List<RenderingInfo> getRenderingInfos(String mode)
LayoutDefinition
getRenderingInfos
in interface LayoutDefinition
public boolean isEmpty()
LayoutDefinition
isEmpty
in interface LayoutDefinition
public List<String> getAliases()
LayoutDefinition
getAliases
in interface LayoutDefinition
public void setAliases(List<String> aliases)
public boolean isDynamic()
isDynamic
in interface LayoutDefinition
public void setDynamic(boolean dynamic)
public LayoutDefinition clone()
LayoutDefinition
Useful for conversion of layout definition during export.
clone
in interface LayoutDefinition
clone
in class Object
Copyright © 2018 Nuxeo. All rights reserved.