Uploaded image for project: 'HiveMind'
  1. HiveMind
  2. HIVEMIND-137

Explicit default values for attribute elements within a schema

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.1
    • 1.2
    • framework
    • None

    Description

      If you want to specify default values for <attribute>s within a schema like:

      <attribute name="count" translator="int,min=5,max=10,default=5"/>

      and you use the <conversion> to convert the contribution´s data into a mapping class,
      an non-existend "count" within a contribution will not be defaulted, although it has been
      specified that it should. To get the desired behaviour you have to use <rule>s with
      "skip-if-null=false" which is often "breaking a butterfly on a wheel".

      How about adding a "default" attribute to the <attribute> element, which will be used
      when the attribute is not specified?
      This would ease the implementations of translators, because the do not have to
      worry about the specification of default values.
      And much more important the default handling would be configurable and readable
      by "contributors". It would not be necessary to hard code the defaults.

      Attachments

        Activity

          People

            Unassigned Unassigned
            stefan liebig Stefan Liebig
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: