Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321242 - JAXB Externalized Metadata: Need support for XML transformation mappings
Summary: JAXB Externalized Metadata: Need support for XML transformation mappings
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 317962
  Show dependency tree
 
Reported: 2010-07-29 11:46 EDT by David McCann CLA
Modified: 2022-06-09 10:30 EDT (History)
0 users

See Also:


Attachments
Contains proposed fix + supporting test cases (80.83 KB, patch)
2010-08-11 16:01 EDT, David McCann CLA
no flags Details | Diff
Contains proposed fix + supporting test cases (90.42 KB, patch)
2010-08-12 15:03 EDT, David McCann CLA
no flags Details | Diff
Contains proposed fix + supporting test cases (112.18 KB, patch)
2010-08-16 12:40 EDT, David McCann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David McCann CLA 2010-07-29 11:46:02 EDT
We need to add support for configuring XMLTransformationMappings via external metadata.

The schema component should look something like the folllowing:

<xs:element name="xml-transformation" substitutionGroup="java-attribute">
  <xs:complexType>
    <xs:complexContent>
      <xs:extension base="java-attribute">
        <xs:all>
          <xs:element name="xml-read-transformer">
            <xs:complexType>
              <xs:attribute name="transformer-class" type="xs:string" />
              <xs:attribute name="method" type="xs:string" />
            </xs:complexType>
          </xs:element>
          <xs:element name="xml-write-transformer" minOccurs="0" 
                      maxOccurs="unbounded">
            <xs:complexType>
              <xs:attribute name="xml-path" type="xs:string" />
              <xs:attribute name="transformer-class" type="xs:string" />
              <xs:attribute name="method" type="xs:string" />
            </xs:complexType>
          </xs:element>
          <xs:element name="xml-property" type="xml-property" minOccurs="0" 
                      maxOccurs="unbounded"/>
          <xs:element name="xml-access-methods" type="xml-access-methods" 
                      minOccurs="0"/>
        </xs:all>
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="optional" type="xs:boolean" default="false"/>
        <xs:attribute name="xml-accessor-type" type="xml-access-type" 
                      minOccurs="0" default="PUBLIC_MEMBER"/>
        <xs:attribute name="mutable" type="xs:boolean" default="false"/>
        <xs:attribute name="attribute-type" type="xs:string" />
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:element>

Design and expected usage can be found here:

http://wiki.eclipse.org/EclipseLink/DesignDocs/317962/Phase2.1#xml-transformation
Comment 1 David McCann CLA 2010-08-11 16:01:54 EDT
Created attachment 176393 [details]
Contains proposed fix + supporting test cases
Comment 2 David McCann CLA 2010-08-12 15:03:41 EDT
Created attachment 176492 [details]
Contains proposed fix + supporting test cases
Comment 3 David McCann CLA 2010-08-16 12:40:20 EDT
Created attachment 176696 [details]
Contains proposed fix + supporting test cases

Made changes based on review.
Comment 4 David McCann CLA 2010-08-16 12:44:41 EDT
Final XSD change:

<xs:element name="xml-transformation" substitutionGroup="java-attribute">
  <xs:complexType>
    <xs:complexContent>
      <xs:extension base="java-attribute">
        <xs:sequence>
          <xs:element name="xml-access-methods" 
                  type="xml-access-methods" minOccurs="0"/>
          <xs:element ref="xml-properties" minOccurs="0"/>
          <xs:element name="xml-read-transformer">
            <xs:complexType>
              <xs:attribute name="method" type="xs:string" />
              <xs:attribute name="transformer-class" type="xs:string" />
            </xs:complexType>
          </xs:element>
          <xs:element name="xml-write-transformer" 
                  minOccurs="0" maxOccurs="unbounded">
            <xs:complexType>
              <xs:attribute name="method" type="xs:string" />
              <xs:attribute name="xml-path" type="xs:string" />
              <xs:attribute name="transformer-class" type="xs:string" />
            </xs:complexType>
          </xs:element>
        </xs:sequence>
        <xs:attribute name="optional" type="xs:boolean" default="false"/>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:element>
Comment 5 David McCann CLA 2010-08-16 12:50:20 EDT
Reviewed by:  matt.macivor@oracle.com
Tests: all unit tests pass as expected; jaxb/externalizedmetadata/mappings/xmltransformation/XmlTransformationTestCases
Comment 6 Eclipse Webmaster CLA 2022-06-09 10:30:43 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink