org.xwiki.rendering.internal.macro.dashboard
Class DashboardMacro

java.lang.Object
  extended by org.xwiki.rendering.macro.AbstractMacro<DashboardMacroParameters>
      extended by org.xwiki.rendering.internal.macro.dashboard.DashboardMacro
All Implemented Interfaces:
java.lang.Comparable<org.xwiki.rendering.macro.Macro<?>>, org.xwiki.component.phase.Initializable, org.xwiki.rendering.macro.Macro<DashboardMacroParameters>

@Component
@Named(value="dashboard")
@Singleton
public class DashboardMacro
extends org.xwiki.rendering.macro.AbstractMacro<DashboardMacroParameters>

The dashboard macro, to display other macros as gadgets in a dashboard, using a container to include its contents.

Since:
2.5M2
Version:
$Id$

Field Summary
static java.lang.String ADD_URL
          The identifier of the add url metadata.
static java.lang.String EDIT_URL
          The identifier of the edit url metadata.
static java.lang.String GADGET_CONTAINER
          The marker to set as class parameter for the gadget containers in this dashboard, i.e.
static java.lang.String GADGET_CONTAINER_PREFIX
          The prefix of the id of the gadget containers in this dashboard, i.e.
static java.lang.String MACRO_NAME
          The name of this macro.
static java.lang.String METADATA
          The identifier of the metadata block for this dashboard (class parameter of the generated XDOM container that holds the rest of the metadata).
static java.lang.String REMOVE_URL
          The identifier of the remove url metadata.
static java.lang.String SOURCE_PAGE
          The identifier of the source page metadata.
static java.lang.String SOURCE_SPACE
          The identifier of the source space metadata.
static java.lang.String SOURCE_URL
          The identifier of the source url metadata.
static java.lang.String SOURCE_WIKI
          The identifier of the source wiki metadata.
 
Fields inherited from class org.xwiki.rendering.macro.AbstractMacro
beanManager, DEFAULT_CATEGORY_CONTENT, DEFAULT_CATEGORY_DEVELOPMENT, DEFAULT_CATEGORY_FORMATTING, DEFAULT_CATEGORY_NAVIGATION
 
Constructor Summary
DashboardMacro()
          Instantiates the dashboard macro, setting the name, description and parameters type.
 
Method Summary
 java.util.List<Block> execute(DashboardMacroParameters parameters, java.lang.String content, org.xwiki.rendering.transformation.MacroTransformationContext context)
          
protected  DashboardRenderer getDashboardRenderer(java.lang.String layout)
           
protected  GadgetRenderer getGadgetRenderer(boolean isEditing)
           
protected  void includeResources(boolean editMode)
          Includes the js and css resources for the dashboard macro.
 boolean supportsInlineMode()
          
 
Methods inherited from class org.xwiki.rendering.macro.AbstractMacro
compareTo, getDescriptor, getPriority, initialize, setDefaultCategory, setDescriptor, setPriority
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GADGET_CONTAINER

public static final java.lang.String GADGET_CONTAINER
The marker to set as class parameter for the gadget containers in this dashboard, i.e. the elements that can contain gadgets.

See Also:
Constant Field Values

GADGET_CONTAINER_PREFIX

public static final java.lang.String GADGET_CONTAINER_PREFIX
The prefix of the id of the gadget containers in this dashboard, i.e. the elements that can contain gadgets. To be completed by the individual renderers with the container ids.

See Also:
Constant Field Values

METADATA

public static final java.lang.String METADATA
The identifier of the metadata block for this dashboard (class parameter of the generated XDOM container that holds the rest of the metadata).

See Also:
Constant Field Values

EDIT_URL

public static final java.lang.String EDIT_URL
The identifier of the edit url metadata.

See Also:
Constant Field Values

ADD_URL

public static final java.lang.String ADD_URL
The identifier of the add url metadata.

See Also:
Constant Field Values

REMOVE_URL

public static final java.lang.String REMOVE_URL
The identifier of the remove url metadata.

See Also:
Constant Field Values

SOURCE_PAGE

public static final java.lang.String SOURCE_PAGE
The identifier of the source page metadata.

See Also:
Constant Field Values

SOURCE_SPACE

public static final java.lang.String SOURCE_SPACE
The identifier of the source space metadata.

See Also:
Constant Field Values

SOURCE_WIKI

public static final java.lang.String SOURCE_WIKI
The identifier of the source wiki metadata.

See Also:
Constant Field Values

SOURCE_URL

public static final java.lang.String SOURCE_URL
The identifier of the source url metadata.

See Also:
Constant Field Values

MACRO_NAME

public static final java.lang.String MACRO_NAME
The name of this macro.

See Also:
Constant Field Values
Constructor Detail

DashboardMacro

public DashboardMacro()
Instantiates the dashboard macro, setting the name, description and parameters type.

Method Detail

execute

public java.util.List<Block> execute(DashboardMacroParameters parameters,
                                     java.lang.String content,
                                     org.xwiki.rendering.transformation.MacroTransformationContext context)
                              throws org.xwiki.rendering.macro.MacroExecutionException

Throws:
org.xwiki.rendering.macro.MacroExecutionException
See Also:
Macro.execute(java.lang.Object, java.lang.String, org.xwiki.rendering.transformation.MacroTransformationContext)

includeResources

protected void includeResources(boolean editMode)
Includes the js and css resources for the dashboard macro.

Parameters:
editMode - whether the dashboard is in edit mode or not (js resources need to be loaded only in edit mode)

getDashboardRenderer

protected DashboardRenderer getDashboardRenderer(java.lang.String layout)
Parameters:
layout - the layout style parameter of this dashboard, to find the renderer for
Returns:
the dashboard renderer, according to the style parameter of this dashboard macro

getGadgetRenderer

protected GadgetRenderer getGadgetRenderer(boolean isEditing)
Parameters:
isEditing - whether this dashboard is in edit mode or in view mode
Returns:
the gadgets renderer used by this dashboard

supportsInlineMode

public boolean supportsInlineMode()

See Also:
Macro.supportsInlineMode()


Copyright © 2004-2011 XWiki. All Rights Reserved.