Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-2969

few improvements of generation xsd for dynamic types with compound properties

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Java-SDO-1.1
    • None
    • None
    • Patch Available

    Description

      1. There is class cast exception in
      org.apache.tuscany.sdo.helper.SchemaBuilder.handleBaseExtn(XSDSchema, Type, XSDComplexTypeDefinition).

      2. Some time generated XSD schema is incomplete.
      use case:
      1. Define dynamic type with more than one compound properties defined as dynamic types as well.
      2. call XSDHelper.generate(type).
      3. Resulting XSD include xs:complexType defs for compound properties. But some of them may be empty, i.e.:
      <xs:complexType abstract="false" name="compound_property_type_name" />
      instead of
      <xs:complexType abstract="false" name="compound_property_type_name" >
      <xs:sequence>
      ...
      </xs:complexType>
      It seems that problem is incorrect API usage in
      org.apache.tuscany.sdo.helper.SchemaBuilder.buildComplexSchemaType(Type):

      Patch to resolve both problems:

      Index: SchemaBuilder.java
      ===================================================================
      — SchemaBuilder.java (revision 149)
      +++ SchemaBuilder.java (revision 150)
      @@ -338,7 +338,7 @@
      complexType.setTargetNamespace(targetNamespace);
      complexType.setAbstract(dataType.isAbstract());

      • xmlSchema.getTypeDefinitions().add(complexType);
        + //xmlSchema.getTypeDefinitions().add(complexType);
        xmlSchema.getContents().add(complexType);

      complexType.updateElement();
      @@ -730,7 +730,7 @@
      }
      else

      { - complexType.setBaseTypeDefinition((XSDSimpleTypeDefinition)typeTable. + complexType.setBaseTypeDefinition((XSDComplexTypeDefinition)typeTable. getXSDTypeDef(baseSchemaType.getNamespaceURI(),baseSchemaType.getLocalPart())); }

      Attachments

        Activity

          People

            Unassigned Unassigned
            ciand7 Andrey Utkin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: