Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.forms.layout.service
Class WebLayoutManagerImpl

java.lang.Object
  extended by org.nuxeo.runtime.model.DefaultComponent
      extended by org.nuxeo.ecm.platform.forms.layout.service.WebLayoutManagerImpl
All Implemented Interfaces:
Serializable, LayoutManager, WebLayoutManager, Adaptable, Component, Extensible

public class WebLayoutManagerImpl
extends DefaultComponent
implements WebLayoutManager

Layout service implementation.

Author:
Anahide Tchertchian
See Also:
Serialized Form

Field Summary
static String LAYOUTS_EP_NAME
           
static ComponentName NAME
           
static String WIDGET_TYPES_EP_NAME
           
static String WIDGETS_EP_NAME
           
 
Constructor Summary
WebLayoutManagerImpl()
           
 
Method Summary
 Widget createWidget(com.sun.facelets.FaceletContext ctx, String type, String mode, String valueName, List<FieldDefinition> fieldDefinitions, String label, String helpLabel, Boolean translated, Map<String,Serializable> properties, Widget[] subWidgets)
          Returns a widget computed from given information.
 Widget createWidget(com.sun.facelets.FaceletContext ctx, String type, String mode, String valueName, Map<String,Serializable> properties, Widget[] subWidgets)
          Returns a widget computed from given information.
 com.sun.facelets.FaceletHandler getFaceletHandler(com.sun.facelets.FaceletContext ctx, com.sun.facelets.tag.TagConfig config, Widget widget)
          Returns the facelet handler for given widget.
 Layout getLayout(com.sun.facelets.FaceletContext ctx, LayoutDefinition layoutDef, String mode, String valueName, List<String> selectedRows, boolean selectAllRowsByDefault)
          Returns the computed layout for this definition, mode and list of selected rows in given context, or null if the layout definition is null.
 Layout getLayout(com.sun.facelets.FaceletContext ctx, String layoutName, String mode, String valueName)
          Returns the computed layout for this name and mode in given context, or null if no layout with this name is found.
 Layout getLayout(com.sun.facelets.FaceletContext ctx, String layoutName, String mode, String valueName, List<String> selectedRows, boolean selectAllRowsByDefault)
          Returns the computed layout for this name, mode and list of selected rows in given context, or null if no layout with this name is found.
 LayoutDefinition getLayoutDefinition(String layoutName)
          Returns the registered layout definition for this name.
 List<String> getLayoutDefinitionNames()
          Returns the names of all the registered layout definitions
 WidgetDefinition getWidgetDefinition(String widgetName)
          Returns the registered widget definition for this name.
 WidgetType getWidgetType(String typeName)
          Returns the registered widget type for this type name.
 WidgetTypeDefinition getWidgetTypeDefinition(String typeName)
          Returns the widget type definition with given name, or null if no widget type with this name is found.
 List<WidgetTypeDefinition> getWidgetTypeDefinitions()
          Returns the widget type definitions for all the registered widget types.
 WidgetTypeHandler getWidgetTypeHandler(String typeName)
          Returns the widget type handler for the registered widget type with this type name.
 void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
           
 void registerLayout(LayoutDefinition layoutDef)
           
 void registerWidget(WidgetDefinition widgetDef)
           
 void registerWidgetType(WidgetTypeDefinition desc)
           
 void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
           
 void unregisterLayout(LayoutDefinition layoutDef)
           
 void unregisterWidget(WidgetDefinition widgetDef)
           
 void unregisterWidgetType(WidgetTypeDefinition desc)
           
 
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, applicationStarted, deactivate, getAdapter, registerExtension, unregisterExtension
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final ComponentName NAME

WIDGET_TYPES_EP_NAME

public static final String WIDGET_TYPES_EP_NAME
See Also:
Constant Field Values

WIDGETS_EP_NAME

public static final String WIDGETS_EP_NAME
See Also:
Constant Field Values

LAYOUTS_EP_NAME

public static final String LAYOUTS_EP_NAME
See Also:
Constant Field Values
Constructor Detail

WebLayoutManagerImpl

public WebLayoutManagerImpl()
Method Detail

registerContribution

public void registerContribution(Object contribution,
                                 String extensionPoint,
                                 ComponentInstance contributor)
Overrides:
registerContribution in class DefaultComponent

unregisterContribution

public void unregisterContribution(Object contribution,
                                   String extensionPoint,
                                   ComponentInstance contributor)
Overrides:
unregisterContribution in class DefaultComponent

registerWidgetType

public void registerWidgetType(WidgetTypeDefinition desc)
Specified by:
registerWidgetType in interface LayoutManager

unregisterWidgetType

public void unregisterWidgetType(WidgetTypeDefinition desc)
Specified by:
unregisterWidgetType in interface LayoutManager

registerLayout

public void registerLayout(LayoutDefinition layoutDef)
Specified by:
registerLayout in interface LayoutManager

unregisterLayout

public void unregisterLayout(LayoutDefinition layoutDef)
Specified by:
unregisterLayout in interface LayoutManager

registerWidget

public void registerWidget(WidgetDefinition widgetDef)
Specified by:
registerWidget in interface LayoutManager

unregisterWidget

public void unregisterWidget(WidgetDefinition widgetDef)
Specified by:
unregisterWidget in interface LayoutManager

getWidgetType

public WidgetType getWidgetType(String typeName)
Description copied from interface: LayoutManager
Returns the registered widget type for this type name.

If the no widget type is found with this name, return null.

Specified by:
getWidgetType in interface LayoutManager

getWidgetTypeDefinition

public WidgetTypeDefinition getWidgetTypeDefinition(String typeName)
Description copied from interface: LayoutManager
Returns the widget type definition with given name, or null if no widget type with this name is found.

Specified by:
getWidgetTypeDefinition in interface LayoutManager

getWidgetTypeDefinitions

public List<WidgetTypeDefinition> getWidgetTypeDefinitions()
Description copied from interface: LayoutManager
Returns the widget type definitions for all the registered widget types.

Specified by:
getWidgetTypeDefinitions in interface LayoutManager

getLayoutDefinition

public LayoutDefinition getLayoutDefinition(String layoutName)
Description copied from interface: LayoutManager
Returns the registered layout definition for this name.

If the no definition is found with this name, return null.

Specified by:
getLayoutDefinition in interface LayoutManager

getLayoutDefinitionNames

public List<String> getLayoutDefinitionNames()
Description copied from interface: LayoutManager
Returns the names of all the registered layout definitions

Specified by:
getLayoutDefinitionNames in interface LayoutManager

getWidgetDefinition

public WidgetDefinition getWidgetDefinition(String widgetName)
Description copied from interface: LayoutManager
Returns the registered widget definition for this name.

If the no definition is found with this name, return null.

Specified by:
getWidgetDefinition in interface LayoutManager

getWidgetTypeHandler

public WidgetTypeHandler getWidgetTypeHandler(String typeName)
                                       throws WidgetException
Description copied from interface: WebLayoutManager
Returns the widget type handler for the registered widget type with this type name.

If the no widget type is found with this name, return null.

Specified by:
getWidgetTypeHandler in interface WebLayoutManager
Throws:
WidgetException

getLayout

public Layout getLayout(com.sun.facelets.FaceletContext ctx,
                        String layoutName,
                        String mode,
                        String valueName)
                 throws LayoutException
Description copied from interface: WebLayoutManager
Returns the computed layout for this name and mode in given context, or null if no layout with this name is found.

When a widget is configured not to be rendered in this mode, the layout will hold a null value instead. As well, when a row does not hold any non-null widget in this mode, the layout will not hold it.

Specified by:
getLayout in interface WebLayoutManager
Parameters:
ctx - the facelet context this layout will be computed in. If context is null, no expressions can be resolved during computing.
layoutName - the layout definition name.
mode - the mode.
valueName - the value name to use when computing tag attributes.
Returns:
a layout computed in this context.
Throws:
LayoutException
See Also:
WebLayoutManager.getLayout(FaceletContext, String, String, String, List, boolean)

getLayout

public Layout getLayout(com.sun.facelets.FaceletContext ctx,
                        String layoutName,
                        String mode,
                        String valueName,
                        List<String> selectedRows,
                        boolean selectAllRowsByDefault)
Description copied from interface: WebLayoutManager
Returns the computed layout for this name, mode and list of selected rows in given context, or null if no layout with this name is found.

Specified by:
getLayout in interface WebLayoutManager
layoutName - the layout definition name.
Returns:
a layout computed in this context.
See Also:
LayoutManager.getLayoutDefinition(String), WebLayoutManager.getLayout(FaceletContext, LayoutDefinition, String, String, List, boolean)

getLayout

public Layout getLayout(com.sun.facelets.FaceletContext ctx,
                        LayoutDefinition layoutDef,
                        String mode,
                        String valueName,
                        List<String> selectedRows,
                        boolean selectAllRowsByDefault)
Description copied from interface: WebLayoutManager
Returns the computed layout for this definition, mode and list of selected rows in given context, or null if the layout definition is null.

When a widget is configured not to be rendered in this mode, the layout will hold a null value instead. As well, when a row does not hold any non-null widget in this mode, the layout will not hold it.

If parameter selectedRows is not null, layout rows will be filtered according to this value. If selectedRows is null and parameter selectAllRowsByDefault is true, all rows will be taken into account, even rows marked as not selected by default.

Specified by:
getLayout in interface WebLayoutManager
Parameters:
ctx - the facelet context this layout will be computed in. If context is null, no expressions can be resolved during computing.
layoutDef - the layout definition instance.
mode - the mode.
valueName - the value name to use when computing tag attributes.
selectedRows - the list of selected rows names
selectAllRowsByDefault - boolean indicating if all rows should be considered selected by default in case parameter selectedRows resolves to null.
Returns:
a layout computed in this context.

getFaceletHandler

public com.sun.facelets.FaceletHandler getFaceletHandler(com.sun.facelets.FaceletContext ctx,
                                                         com.sun.facelets.tag.TagConfig config,
                                                         Widget widget)
Description copied from interface: WebLayoutManager
Returns the facelet handler for given widget.

Specified by:
getFaceletHandler in interface WebLayoutManager
Parameters:
ctx - the facelet context.
config - the tag config, used to hook the handler in the jsf tree.
widget - the computed widget.
Returns:
a facelet handler.

createWidget

public Widget createWidget(com.sun.facelets.FaceletContext ctx,
                           String type,
                           String mode,
                           String valueName,
                           Map<String,Serializable> properties,
                           Widget[] subWidgets)
Description copied from interface: WebLayoutManager
Returns a widget computed from given information.

Specified by:
createWidget in interface WebLayoutManager
Parameters:
ctx - the facelet context this layout will be computed in. If context is null, no expressions can be resolved during computing.
type - the widget type name.
mode - the mode.
valueName - the value name to use when computing tag attributes.
properties - optional properties to use when computing the widget.
subWidgets - optional sub widgets for this widget.
Returns:
a widget computed in this context.
See Also:
WebLayoutManager.createWidget(FaceletContext, String, String, String, List, String, String, Boolean, Map, Widget[])

createWidget

public Widget createWidget(com.sun.facelets.FaceletContext ctx,
                           String type,
                           String mode,
                           String valueName,
                           List<FieldDefinition> fieldDefinitions,
                           String label,
                           String helpLabel,
                           Boolean translated,
                           Map<String,Serializable> properties,
                           Widget[] subWidgets)
Description copied from interface: WebLayoutManager
Returns a widget computed from given information.

Specified by:
createWidget in interface WebLayoutManager
Parameters:
ctx - the facelet context this layout will be computed in. If context is null, no expressions can be resolved during computing.
type - the widget type name.
mode - the mode.
valueName - the value name to use when computing tag attributes.
label - the widget label
helpLabel - the widget help label
translated - if true, the labels will be translated
properties - optional properties to use when computing the widget.
subWidgets - optional sub widgets for this widget.
Returns:
a widget computed in this context.

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.