Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.forms.layout.api.impl
Class LayoutImpl

java.lang.Object
  extended by org.nuxeo.ecm.platform.forms.layout.api.impl.LayoutImpl
All Implemented Interfaces:
Serializable, Layout

public class LayoutImpl
extends Object
implements Layout

Implementation for layouts.

Author:
Anahide Tchertchian
See Also:
Serialized Form

Constructor Summary
LayoutImpl(String name, String mode, String template, List<LayoutRow> rows, int columns)
          Deprecated. since 5.4.3: use LayoutImpl(String, String, String, List, int, Map, String)
LayoutImpl(String name, String mode, String template, List<LayoutRow> rows, int columns, Map<String,Serializable> properties)
          Deprecated. since 5.4.3: use LayoutImpl(String, String, String, List, int, Map, String)
LayoutImpl(String name, String mode, String template, List<LayoutRow> rows, int columns, Map<String,Serializable> properties, String definitionId)
           
 
Method Summary
 int getColumns()
          Returns the maximum number of columns.
 String getId()
          Returns the layout id, unique within the facelet context.
 String getMode()
          Returns the layout mode.
 String getName()
          Returns the layout name used to identify it within the layout service.
 Map<String,Serializable> getProperties()
          Get properties to use in this mode.
 Serializable getProperty(String name)
          Returns property with given name in this mode.
 LayoutRow[] getRows()
          Returns the table of widgets.
 String getTagConfigId()
          Returns the unique identifier of this widget to be used in tag configuration.
 String getTemplate()
          Returns the template used to render widgets.
 Widget getWidget(String name)
          Returns widget with given name.
 Map<String,Widget> getWidgetMap()
          Returns a widget map, with widget name as key.
 void setId(String id)
          Sets the layout id, unique within the facelet context.
 void setProperty(String name, Serializable value)
          Sets property with given name on the layout.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LayoutImpl

@Deprecated
public LayoutImpl(String name,
                             String mode,
                             String template,
                             List<LayoutRow> rows,
                             int columns)
Deprecated. since 5.4.3: use LayoutImpl(String, String, String, List, int, Map, String)


LayoutImpl

@Deprecated
public LayoutImpl(String name,
                             String mode,
                             String template,
                             List<LayoutRow> rows,
                             int columns,
                             Map<String,Serializable> properties)
Deprecated. since 5.4.3: use LayoutImpl(String, String, String, List, int, Map, String)


LayoutImpl

public LayoutImpl(String name,
                  String mode,
                  String template,
                  List<LayoutRow> rows,
                  int columns,
                  Map<String,Serializable> properties,
                  String definitionId)
Since:
5.4.3
Method Detail

getId

public String getId()
Description copied from interface: Layout
Returns the layout id, unique within the facelet context.

Specified by:
getId in interface Layout

getTagConfigId

public String getTagConfigId()
Description copied from interface: Layout
Returns the unique identifier of this widget to be used in tag configuration.

In JSF, layouts are rendered dynamically and re-use the tag configuration of the tag rendering them when adding handlers to the facelet hierarchy. Since this tag identifier is used to perform some kind of caching on the JSF layer, it needs to change when the layout definition changes, so that JSF components are not mistaken for another one.

This identifier is unique to a given layout definition and always returns the same result given the same layout definition.

Specified by:
getTagConfigId in interface Layout

setId

public void setId(String id)
Description copied from interface: Layout
Sets the layout id, unique within the facelet context.

Specified by:
setId in interface Layout

getName

public String getName()
Description copied from interface: Layout
Returns the layout name used to identify it within the layout service.

Specified by:
getName in interface Layout

getMode

public String getMode()
Description copied from interface: Layout
Returns the layout mode.

Specified by:
getMode in interface Layout

getTemplate

public String getTemplate()
Description copied from interface: Layout
Returns the template used to render widgets.

Specified by:
getTemplate in interface Layout

getRows

public LayoutRow[] getRows()
Description copied from interface: Layout
Returns the table of widgets.

This list is computed from the LayoutDefinition rows.

Widgets that are not found are ignored.

Specified by:
getRows in interface Layout

getColumns

public int getColumns()
Description copied from interface: Layout
Returns the maximum number of columns.

Specified by:
getColumns in interface Layout

getWidget

public Widget getWidget(String name)
Description copied from interface: Layout
Returns widget with given name.

Only widgets of the first level are retrieved.

Specified by:
getWidget in interface Layout

getWidgetMap

public Map<String,Widget> getWidgetMap()
Description copied from interface: Layout
Returns a widget map, with widget name as key.

Only widgets of the first level are retrieved.

Specified by:
getWidgetMap in interface Layout

getProperties

public Map<String,Serializable> getProperties()
Description copied from interface: Layout
Get properties to use in this mode.

The way that properties will be mapped to rendered components is managed by the widget type.

Specified by:
getProperties in interface Layout

getProperty

public Serializable getProperty(String name)
Description copied from interface: Layout
Returns property with given name in this mode.

Specified by:
getProperty in interface Layout
Parameters:
name - the property name.
Returns:
the property value or null if not found.

setProperty

public void setProperty(String name,
                        Serializable value)
Description copied from interface: Layout
Sets property with given name on the layout. If there is already a property with this name on the layout, it will be overridden.

Specified by:
setProperty in interface Layout
Parameters:
name - the property name.
value - the property value or null if not found.

toString

public String toString()
Overrides:
toString in class Object

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.