With censhare version 5.4.0 we introduce new options related to the general setup of widgets in a user’s workspace. These enhancements are based on JSON properties respectively XML attributes and allow developers and administrators to restrict the available widget as well as the standard widget configuration options. This article provides an overview of the possibilities and describes how to set up these options.

Available widgets

By default, a user is allowed to add any existing widget to a static page or to an asset page. Since version 5.4.0, it is possible to define a subset of available widgets per page.

Administrators

A system administrator can define a specific subset of widget types that can be added to specific pages via the Add widget dialog.

Reference

  • allowed-widgets
  • Description: Defines the widget subset available to a user. Specific widgets are defined via widget child elements. Their type is set using the kind attribute, values contain the widget name.
    The container element has to be defined following the typepatterns element of a page.
  • Syntax: allowed-widgets
  • Example: Workspace XML

<page id="image">
  <configuration/>
  <typepatterns> … </typepatterns>
  <allowed-widgets>
    <widget kind="csActionsWidget"/>
    <widget kind="csMyLastEditedWidget"/>
    <widget kind="csAssetStatusWidget"/>
  </allowed-widgets>
</page>

Widget options

By default, a user is allowed to add, configure and remove widgets and to change its position and size. Since version 5.4.0, some of these options can be restricted for specific widgets in context of an asset page.

Developers

A widget developer can set default options for a widget directly in the pkg.json file, inside the widgetInfo object. Corresponding parameter names are listed in the Syntax JSON column in the following reference.

Administrators

A system administrator can set and overwrite user options for a widget in the Workspace XML of the workspace template. Corresponding attributes are set on the widget element, attribute names are listed in the Syntax XML column in the following reference. Definitions in the Workspace XML take precedence over settings in the widget module.

Reference

  • min-size-width
  • Description: Defines the minimum width of a widget in grid units
  • Syntax JSON: minSizeWidth
  • Syntax XML: min-size-width
  • Example: JSON

"widgetInfo": {
  
  "minSizeWidth": 2
}

  • Example: Workspace XML

<widget id="imageMetadata" min-size-width="2">

  • max-size-width
  • Description: Defines the maxmimum width of a widget in grid units
  • Syntax JSON: mmaxSizeWidth
  • Syntax XML: max-size-width
  • Example: JSON

"widgetInfo": {
  
  "maxSizeWidth": 4
}

  • Example: Workspace XML

<widget id="imageMetadata" max-size-width="4">

  • min-size-height
  • Description: Defines the minimum height of a widget in grid units
  • Syntax JSON: minSizeHeight
  • Syntax XML: min-size-height
  • Example: JSON

"widgetInfo": {
  
  "minSizeHeight": 2
}

  • Example: Workspace XML

<widget id="imageMetadata" min-size-height="2">

  • max-size-height
  • Description: Defines the maximum height of a widget in grid units
  • Syntax JSON: maxSizeHeight
  • Syntax XML: max-size-height
  • Example: JSON

"widgetInfo": {
  
  "maxSizeHeight": 4
}

  • Example: Workspace XML

<widget id="imageMetadata" max-size-height="4">

  • resizable
  • Description: Disables the resize option of a widget if set to “false”
  • Syntax JSON: resizable
  • Syntax XML: resizable
  • Example: JSON

"widgetInfo": {
  
  "resizable": false
}

  • Example: Workspace XML

<widget id="imageMetadata" resizable="0">

  • removable
  • Description: Disables the “Remove widget” option if set to “false”
  • Syntax JSON: removable
  • Syntax XML: removable
  • Example: JSON

"widgetInfo": {
  
  "removable": false
}

  • Example: Workspace XML

<widget id="imageMetadata" removable="0">

  • configurable
  • Description: Disables the “Configure widget…” option if set to “false”
  • Syntax JSON: configurable
  • Syntax XML: configurable
  • Example: JSON

"widgetInfo": {
  
  "configurable": false
}

  • Example: Workspace XML

<widget id="imageMetadata" configurable="0">

  • dragable
  • Description: Locks the position of a widget if set to “false”
  • Syntax JSON: dragable
  • Syntax XML: dragable
  • Example: JSON

"widgetInfo": {
  
  "dragable": false
}

  • Example: Workspace XML

<widget id="imageMetadata" dragable="0">