Documente Academic
Documente Profesional
Documente Cultură
xmlns="http://worldcat.org/xmlschemas/MyNamespaceId-${pom.version}"
targetNamespace="http://worldcat.org/xmlschemas/MyNamespaceId-$
{pom.version}"
>
The pom.version placeholder will be replaced by Maven during the build process.
Also it is important that the schemas file name and the namespace are
consistent, meaning they should be the same.
Schema versioning:
The basic schema version numbering should be in the form of:
A.B[-SNAPSHOT]
Where A is the major version number, and it only changes when a significant
change to the service is made. B is the minor version number, it changes when a
minor enhancement to the service requires a minor change to the schema.
SNAPSHOT is used during the development phase and marks a schema as a work
in progress.
Common Types
Common types can be reused and extended in multiple schemas, and have the
same meaning all over OCLC. Types as Currency, Language and Countries are a
good example.
Schema guidelines
Some guidelines for writing good schema definitions:
To have only one root element in your schema avoid using rel="" to
reference other elements.
Work with types where you can. (Avoid inlining a type definition
anonymously within an element definition.)
Document your elements with annotation/documentation.
Do NOT control copies of XML schemas in other projects!!! (This allows
them to drift out of sync without people realizing it.) Include them as
proper dependencies and use their URLs.
4. In the branch change all the import statements from using the Archiva
location to use worldcat.org (if there are any)
5. Tag the branch
<execution>
<id>process</id>
<phase>generate-sources</phase>
<goals>
<goal>process</goal>
</goals>
<configuration>
<resourceBundles>
<!-- Add all resources that are referenced from the schema
definition -->
<resourceBundle>org.oclc.schemas.MySchema:MySchema:$
{version}</resourceBundle>
</resourceBundles>
</configuration>
</execution>
</executions>
</plugin>
2. Create an execution step for every schema and pipe the created episode
file to the next execution step.
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<executions>
<execution>
<id>Common</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<specVersion>2.2</specVersion>
<extension>true</extension>
<schemaDirectory>${project.build.directory}/maven-shared-archiveresources/schemas</schemaDirectory>
<schemaIncludes>
<include>MySchema.xsd</include>
</schemaIncludes>
<bindingDirectory>$
{project.basedir}/src/main/xsd</bindingDirectory>
<bindingIncludes>
<include>MyBindingFile.xjb</include>
</bindingIncludes>
<episode>true</episode>
<verbose>true</verbose>
<args>
<arg>-Xannotate</arg>
<arg>-XhashCode</arg>
<arg>-Xequals</arg>
<arg>-XtoString</arg>
</args>
<episodeFile>$
{project.build.directory}/xjc/my.episode</episodeFile>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics-annotate</artifactId>
<version>${jaxb2BasicsVersion}</version>
</plugin>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>${jaxb2BasicsVersion}</version>
</plugin>
</plugins>
</configuration>
</execution>
<execution>
<args>
<arg>-Xannotate</arg>
<arg>-XhashCode</arg>
<arg>-Xequals</arg>
<arg>-XtoString</arg>
<arg>-b</arg>
<arg>$
{project.build.directory}/xjc/my.episode</arg>
</args>
.