Uploaded image for project: 'Nuxeo Studio'
  1. Nuxeo Studio
  2. NXS-4595

Handle constraints in schema initialization

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 73.6.2
    • Fix Version/s: 73.12
    • Component/s: Schemas
    • Tags:
    • Backlog priority:
      500
    • Sprint:
      NOS 10.2.3
    • Story Points:
      5

      Description

      1. in studio create 1 or 2 files of type directory
      2. click Edit and add a directory reference like continent or nature
      3. save the schema
      4. download the project
      5. check the xsd file of the schema inside the project archive, the directory reference is there but the type is String:
          <xs:element name="test1">
            <xs:simpleType>
              <xs:restriction base="xs:string" ref:resolver="directoryResolver" ref:directory="continent"/>
            </xs:simpleType>
          </xs:element>
          <xs:element name="test2">
            <xs:simpleType>
              <xs:restriction base="xs:string" ref:resolver="directoryResolver" ref:directory="nature"/>
            </xs:simpleType>
          </xs:element>
        
      6. Open the file in an editor
      7. modify the element names to test3 and test4 instead of test1 and test2.
      8. save the file with a different name
      9. in Studio, import the file with New / Initialize and select the file
      10. Observe the fields are now of type String and the directory references are lost

      This can actually be reproduced with any kind of constraint: Studio does not handle them during init at this stage.

      TODO

      • Handle constraints in schema creation with initialize option

      AC

      • When importing a schema that contains valid constraints, these constraints are added to the schema and the field type matches the declaration (e.g. it becomes a directory if a directory is referenced)
      • When importing a schema that contains INVALID constraints (e.g. try to set a min / max amount on a string field)
        • These constraints are ignored (if possible, otherwise import can also show an empty schema like it is the case currently).
        • A message is shown to the user:

          Your schema could not be imported [entirely - if partial import can be done] due to errors in its content.
          [If possible show errors]

        • Values are not checked, but only constraints validity: for instance we should not check if a directory exists because it can be created/deployed outside of studio.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 days, 2 hours
                  3d 2h