Platform Explorer / Nuxeo Platform 5.6

Contribution org.nuxeo.ecm.platform.forms.layouts.webapp.widgts--widgettypes

This contribution is part of XML component org.nuxeo.ecm.platform.forms.layouts.webapp.widgts inside nuxeo-platform-webapp-base-5.6.jar

Extension point

Extension point widgettypes of component WebLayoutManager.

Contributed items

  • <widgetType name="life_cycle_transitions">
          <configuration>
            <title>Life cycle transitions</title>
            <description>
              This widget type displays a selection of available life cycle
              transitions
              given a life cycle state and a life cycle policy.
              <br/>
              It requires the configuration of the first field to map to a String
              value storing the chosen life cycle transition.
              <br/>
              It needs the following properties configuration:
              <ul>
                <li>
                  currentLifeCycleState: the current state from where to start
                  finding
                  the available transitions.
                </li>
                <li>
                  lifeCycleName: represents the life cycle from which to retrieve
                  the
                  transitions.
                </li>
              </ul>
              <br/>
              A standard definition could be:
              <pre>
                <widget name="life_cycle_transitions" type="life_cycle_transitions">
                  <labels>
                    <label mode="any"/>
                  </labels>
                  <fields>
                    <field>contextData['request/lifeCycleTransition']</field>
                  </fields>
                  <properties widgetMode="edit">
                    <property name="currentLifeCycleState">#{layoutValue.currentLifeCycleState}</property>
                    <property name="lifeCycleName">#{layoutValue.lifeCyclePolicy}</property>
                  </properties>
                </widget>
              </pre>
            </description>
            <categories>
              <category>document</category>
            </categories>
          </configuration>
          <handler-class>
            org.nuxeo.ecm.platform.forms.layout.facelets.plugins.TemplateWidgetTypeHandler
          </handler-class>
          <property name="template">
            /widgets/life_cycle_transitions_widget_template.xhtml
          </property>
    
        </widgetType>

    This widget type displays a selection of available life cycle transitions given a life cycle state and a life cycle policy.

    It requires the configuration of the first field to map to a String value storing the chosen life cycle transition.

    It needs the following properties configuration:

    • currentLifeCycleState: the current state from where to start finding the available transitions.
    • lifeCycleName: represents the life cycle from which to retrieve the transitions.

    A standard definition could be:

    
    
    
    
    contextData['request/lifeCycleTransition']
    
    
    #{layoutValue.currentLifeCycleState}
    #{layoutValue.lifeCyclePolicy}
    
    
    
  • <widgetType name="image">
          <configuration>
            <sinceVersion>5.5</sinceVersion>
            <title>Image</title>
            <description>
              <p>
                The image widget displays a file uploader/editor in create or edit
                mode, with additional message tag for errors, and an &lt;img&gt; tag
                displaying the image in other modes.
              </p>
              <li>
                width: the width of the img tag in view mode.
              </li>
              <li>
                height: the height of the img tag in view mode.
              </li>
            </description>
            <properties>
              <layouts mode="view">
                <layout name="image_widget_type_properties_view">
                  <rows>
                    <row>
                      <widget>width</widget>
                    </row>
                    <row>
                      <widget>height</widget>
                    </row>
                  </rows>
                  <widget name="width" type="int">
                    <labels>
                      <label mode="any">Width</label>
                    </labels>
                    <fields>
                      <field>width</field>
                    </fields>
                  </widget>
                  <widget name="height" type="text">
                    <labels>
                      <label mode="any">Height</label>
                    </labels>
                    <fields>
                      <field>height</field>
                    </fields>
                  </widget>
                </layout>
              </layouts>
              <layouts mode="edit">
                <layout name="image_widget_type_properties_edit">
                  <rows>
                    <row>
                      <widget category="widgetTypeConf">required</widget>
                    </row>
                    <row>
                      <widget>acceptedExtensions</widget>
                    </row>
                  </rows>
                  <widget name="acceptedExtensions" type="text">
                    <labels>
                      <label mode="any">Accepted extensions</label>
                    </labels>
                    <helpLabels>
                      <label mode="any">
                        A comma separated list of supported file
                        extensions. Default value: '.jpg, .jpeg, .png, .gif'.
                      </label>
                    </helpLabels>
                    <fields>
                      <field>acceptedExtensions</field>
                    </fields>
                  </widget>
                </layout>
              </layouts>
            </properties>
            <categories>
              <category>document</category>
            </categories>
            <supportedModes>
              <mode>edit</mode>
              <mode>view</mode>
            </supportedModes>
            <fields>
              <list>false</list>
              <complex>false</complex>
              <supportedTypes>
                <type>blob</type>
              </supportedTypes>
              <defaultTypes>
                <type>blob</type>
              </defaultTypes>
            </fields>
          </configuration>
          <handler-class>
            org.nuxeo.ecm.platform.forms.layout.facelets.plugins.TemplateWidgetTypeHandler
          </handler-class>
          <property name="template">/widgets/image_widget_template.xhtml</property>
        </widgetType>

    The image widget displays a file uploader/editor in create or edit mode, with additional message tag for errors, and an <img> tag displaying the image in other modes.

    • width: the width of the img tag in view mode.
    • height: the height of the img tag in view mode.

XML source

<extension point="widgettypes" target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager">

    <widgetType name="life_cycle_transitions">
      <configuration>
        <title>Life cycle transitions</title>
        <description>
          This widget type displays a selection of available life cycle
          transitions
          given a life cycle state and a life cycle policy.
          <br/>
          It requires the configuration of the first field to map to a String
          value storing the chosen life cycle transition.
          <br/>
          It needs the following properties configuration:
          <ul>
            <li>
              currentLifeCycleState: the current state from where to start
              finding
              the available transitions.
            </li>
            <li>
              lifeCycleName: represents the life cycle from which to retrieve
              the
              transitions.
            </li>
          </ul>
          <br/>
          A standard definition could be:
          <pre>
            <widget name="life_cycle_transitions" type="life_cycle_transitions">
              <labels>
                <label mode="any"/>
              </labels>
              <fields>
                <field>contextData['request/lifeCycleTransition']</field>
              </fields>
              <properties widgetMode="edit">
                <property name="currentLifeCycleState">#{layoutValue.currentLifeCycleState}</property>
                <property name="lifeCycleName">#{layoutValue.lifeCyclePolicy}</property>
              </properties>
            </widget>
          </pre>
        </description>
        <categories>
          <category>document</category>
        </categories>
      </configuration>
      <handler-class>
        org.nuxeo.ecm.platform.forms.layout.facelets.plugins.TemplateWidgetTypeHandler
      </handler-class>
      <property name="template">
        /widgets/life_cycle_transitions_widget_template.xhtml
      </property>

    </widgetType>

    <widgetType name="image">
      <configuration>
        <sinceVersion>5.5</sinceVersion>
        <title>Image</title>
        <description>
          <p>
            The image widget displays a file uploader/editor in create or edit
            mode, with additional message tag for errors, and an &lt;img&gt; tag
            displaying the image in other modes.
          </p>
          <li>
            width: the width of the img tag in view mode.
          </li>
          <li>
            height: the height of the img tag in view mode.
          </li>
        </description>
        <properties>
          <layouts mode="view">
            <layout name="image_widget_type_properties_view">
              <rows>
                <row>
                  <widget>width</widget>
                </row>
                <row>
                  <widget>height</widget>
                </row>
              </rows>
              <widget name="width" type="int">
                <labels>
                  <label mode="any">Width</label>
                </labels>
                <fields>
                  <field>width</field>
                </fields>
              </widget>
              <widget name="height" type="text">
                <labels>
                  <label mode="any">Height</label>
                </labels>
                <fields>
                  <field>height</field>
                </fields>
              </widget>
            </layout>
          </layouts>
          <layouts mode="edit">
            <layout name="image_widget_type_properties_edit">
              <rows>
                <row>
                  <widget category="widgetTypeConf">required</widget>
                </row>
                <row>
                  <widget>acceptedExtensions</widget>
                </row>
              </rows>
              <widget name="acceptedExtensions" type="text">
                <labels>
                  <label mode="any">Accepted extensions</label>
                </labels>
                <helpLabels>
                  <label mode="any">
                    A comma separated list of supported file
                    extensions. Default value: '.jpg, .jpeg, .png, .gif'.
                  </label>
                </helpLabels>
                <fields>
                  <field>acceptedExtensions</field>
                </fields>
              </widget>
            </layout>
          </layouts>
        </properties>
        <categories>
          <category>document</category>
        </categories>
        <supportedModes>
          <mode>edit</mode>
          <mode>view</mode>
        </supportedModes>
        <fields>
          <list>false</list>
          <complex>false</complex>
          <supportedTypes>
            <type>blob</type>
          </supportedTypes>
          <defaultTypes>
            <type>blob</type>
          </defaultTypes>
        </fields>
      </configuration>
      <handler-class>
        org.nuxeo.ecm.platform.forms.layout.facelets.plugins.TemplateWidgetTypeHandler
      </handler-class>
      <property name="template">/widgets/image_widget_template.xhtml</property>
    </widgetType>

  </extension>