Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Dali Project/FeatureDocs/Indigo/MOXy 2.1/oxm xml"

(Removing all content from page)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
= Functional Specification: Support for oxm.xml  =
 
  
[enter bug location here]
 
 
== Document History  ==
 
{|{{BMTableStyle}}
 
|-{{BMTHStyle}}
 
! Date
 
! Author
 
! Version Description & Notes
 
|-
 
!10-13-2010
 
!Paul Fullbright
 
!Draft
 
|}
 
 
== Feature overview  ==
 
 
This feature is about supporting oxm.xml files within a JAXB/MOXy project.
 
 
Goals:
 
 
*Support oxm.xml content type
 
*Associate oxm.xml files with package/namespaces
 
*Support MOXy 2.1 oxm.xml features
 
 
== Concepts  ==
 
 
EclipseLink MOXy 2.0 introduced support for oxm.xml files, which act similarly to orm.xml files.  They provide standalone support for mapping java classes to XML document data sources and they work in conjunction with JAXB (and soon MOXy) annotations to add and override metadata.
 
 
Users associate each file with a package when creating a JAXBContext as such:
 
<source lang="java">
 
InputStream employeeExternalizedMetadata =
 
    aClassLoader.getResourceAsStream("org/example/employee/metadata.xml";
 
InputStream customerExternalizedMetadata =
 
    aClassLoader.getResourceAsStream("org/example/customer/metadata.xml";
 
 
HashMap<String, Source> metadataSourceMap = new HashMap<String, Source>();
 
metadataSourceMap.put("org.example.employee", new StreamSource(employeeExternalizedMetadata));
 
metadataSourceMap.put("org.example.customer", new StreamSource(customerExternalizedMetadata));
 
 
Map<String, Map<String, Source>> properties = new HashMap<String, Map<String, Source>>();
 
properties.put("eclipselink-oxm-xml", metadataSourceMap);
 
 
JAXBContext.newInstance("org.example.customer:org.example.employee", aClassLoader, properties);
 
</source>
 
 
It therefore seems to place the requirement on Dali to associate each file with a package in order to accurately support them.
 
 
== References  ==
 
 
[http://wiki.eclipse.org/EclipseLink/DesignDocs/277920 MOXy oxm.xml support for 2.0]
 
 
[http://wiki.eclipse.org/EclipseLink/DesignDocs/293925 MOXy oxm.xml support for 2.1]
 
 
== Requirements / Functionality ==
 
 
=== oxm.xml content type ===
 
 
oxm.xml content type will need to be created similar to orm.xml content type.  A resource model will need to be created.
 
 
=== file to package association ===
 
 
In order to correctly associate the files with the packages they represent, we will likely need additional project metadata.
 
 
=== MOXy 2.1 oxm.xml features ===
 
 
Validation and code assist will need to be provided where appropriate
 

Latest revision as of 13:15, 14 October 2010

Back to the top