Hi all,
I did a small refactoring in the REST module which consisted in
isolating the JAXB model classes in a separate module.
This allows client to use JAXB classes for retrieving XML
representations without dragging in all the core dependencies.
The refactoring consisted in creating an xwiki-rest-model module in
core, moving some files, and update the pom.xml's to make things compile.
Maybe it's risky to commit it now, but if you are ok everything's ready.
I include a diff so that you can check what it looks like.
-Fabio
Index: pom.xml
===================================================================
--- pom.xml (revision 29995)
+++ pom.xml (working copy)
@@ -159,6 +159,7 @@
<module>xwiki-webdav</module>
<module>xwiki-officeimporter</module>
<module>xwiki-rest</module>
+ <module>xwiki-rest-model</module>
<module>xwiki-refactoring</module>
<module>xwiki-chart</module>
<module>xwiki-properties</module>
Property changes on: xwiki-rest-model
___________________________________________________________________
Added: svn:ignore
+ .classpath
.project
.settings
target
target-eclipse
Index: xwiki-rest-model/src/main/java/org/xwiki/rest/model/README.txt
===================================================================
--- xwiki-rest-model/src/main/java/org/xwiki/rest/model/README.txt (revision 0)
+++ xwiki-rest-model/src/main/java/org/xwiki/rest/model/README.txt (revision 0)
@@ -0,0 +1 @@
+Model classes are automatically generated from src/main/resource/xwiki.rest.model.xsd in the org.xwiki.rest.model.jaxb package.
\ No newline at end of file
Index: xwiki-rest-model/src/main/resources/xwiki.rest.model.xsd
===================================================================
--- xwiki-rest-model/src/main/resources/xwiki.rest.model.xsd (revision 0)
+++ xwiki-rest-model/src/main/resources/xwiki.rest.model.xsd (revision 0)
@@ -0,0 +1,485 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.xwiki.org"
+ xmlns:xwiki="http://www.xwiki.org" elementFormDefault="qualified">
+
+ <complexType name="Link">
+ <attribute name="href" type="string"></attribute>
+ <attribute name="rel" type="string"></attribute>
+ <attribute name="type" type="string"></attribute>
+ <attribute name="hrefLang" type="string"></attribute>
+ </complexType>
+
+ <complexType name="LinkCollection">
+ <sequence>
+ <element name="link" type="xwiki:Link" minOccurs="0" maxOccurs="unbounded"></element>
+ </sequence>
+ </complexType>
+
+ <complexType name="Translations">
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="translation" type="xwiki:Translation"
+ minOccurs="0" maxOccurs="unbounded"></element>
+ </sequence>
+ <attribute name="default" type="string"></attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="Translation">
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <attribute name="language" type="string"></attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="XWiki">
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="version" type="string"></element>
+ <element name="syntaxes" type="xwiki:Syntaxes"></element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="Wiki">
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="id" type="string"></element>
+ <element name="name" type="string"></element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="Space">
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="id" type="string"></element>
+ <element name="wiki" type="string"></element>
+ <element name="name" type="string"></element>
+ <element name="home" type="string"></element>
+ <element name="xwikiRelativeUrl" type="string"></element>
+ <element name="xwikiAbsoluteUrl" type="string"></element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="PageSummary">
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="id" type="string"></element>
+ <element name="fullName" type="string"></element>
+ <element name="wiki" type="string"></element>
+ <element name="space" type="string"></element>
+ <element name="name" type="string"></element>
+ <element name="title" type="string"></element>
+ <element name="parent" type="string"></element>
+ <element name="parentId" type="string"></element>
+ <element name="xwikiRelativeUrl" type="string"></element>
+ <element name="xwikiAbsoluteUrl" type="string"></element>
+ <element name="translations" type="xwiki:Translations"></element>
+ <element name="syntax" type="string"></element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="Page">
+ <complexContent>
+ <extension base="xwiki:PageSummary">
+ <sequence>
+ <element name="language" type="string"></element>
+ <element name="version" type="string"></element>
+ <element name="majorVersion" type="int"></element>
+ <element name="minorVersion" type="int"></element>
+ <element name="created" type="dateTime"></element>
+ <element name="creator" type="string"></element>
+ <element name="modified" type="dateTime"></element>
+ <element name="modifier" type="string"></element>
+ <element name="content" type="string"></element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="HistorySummary">
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="pageId" type="string"></element>
+ <element name="wiki" type="string"></element>
+ <element name="space" type="string"></element>
+ <element name="name" type="string"></element>
+ <element name="version" type="string"></element>
+ <element name="majorVersion" type="int"></element>
+ <element name="minorVersion" type="int"></element>
+ <element name="modified" type="dateTime"></element>
+ <element name="modifier" type="string"></element>
+ <element name="language" type="string"></element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="Attachment">
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="id" type="string"></element>
+ <element name="name" type="string"></element>
+ <element name="size" type="int"></element>
+ <element name="version" type="string"></element>
+ <element name="pageId" type="string"></element>
+ <element name="pageVersion" type="string"></element>
+ <element name="mimeType" type="string"></element>
+ <element name="author" type="string"></element>
+ <element name="date" type="dateTime"></element>
+ <element name="xwikiRelativeUrl" type="string"></element>
+ <element name="xwikiAbsoluteUrl" type="string"></element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="Comment">
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="id" type="int"></element>
+ <element name="pageId" type="string"></element>
+ <element name="author" type="string"></element>
+ <element name="date" type="dateTime"></element>
+ <element name="highlight" type="string"></element>
+ <element name="text" type="string"></element>
+ <element name="replyTo" type="int" nillable="true"></element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="ObjectSummary">
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="id" type="string"></element>
+ <element name="guid" type="string"></element>
+ <element name="pageId" type="string"></element>
+ <element name="wiki" type="string"></element>
+ <element name="space" type="string"></element>
+ <element name="pageName" type="string"></element>
+ <element name="className" type="string"></element>
+ <element name="number" type="int"></element>
+ <element name="headline" type="string"></element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="Object">
+ <complexContent>
+ <extension base="xwiki:ObjectSummary">
+ <sequence>
+ <element name="property" type="xwiki:Property" minOccurs="0"
+ maxOccurs="unbounded">
+ </element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="Property">
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="attribute" type="xwiki:Attribute" maxOccurs="unbounded"
+ minOccurs="0"></element>
+ <element name="value" type="string"></element>
+ </sequence>
+
+ <attribute name="name" type="string" use="required"></attribute>
+
+ <attribute name="type" type="string" use="optional"></attribute>
+
+ </extension>
+ </complexContent>
+ </complexType>
+
+
+ <complexType name="Attribute">
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <attribute name="name" type="string" use="required"></attribute>
+
+ <attribute name="value" type="string"></attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <complexType name="Class">
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="id" type="string"></element>
+ <element name="name" type="string"></element>
+ <element name="property" type="xwiki:Property" minOccurs="0"
+ maxOccurs="unbounded"></element>
+ </sequence>
+
+ </extension>
+ </complexContent>
+ </complexType>
+
+
+ <!--
+ *
+ * ELEMENTS
+ *
+ -->
+
+ <element name="xwiki" type="xwiki:XWiki"></element>
+
+ <element name="wikis">
+ <complexType>
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="wiki" type="xwiki:Wiki" minOccurs="0"
+ maxOccurs="unbounded"></element>
+ </sequence>
+
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+ <element name="spaces">
+ <complexType>
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="space" type="xwiki:Space" minOccurs="0"
+ maxOccurs="unbounded"></element>
+ </sequence>
+
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+ <element name="pages">
+ <complexType>
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="pageSummary" type="xwiki:PageSummary"
+ minOccurs="0" maxOccurs="unbounded"></element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+ <element name="wiki" type="xwiki:Wiki"></element>
+
+ <element name="space" type="xwiki:Space"></element>
+
+ <element name="page" type="xwiki:Page"></element>
+
+ <element name="history">
+ <complexType>
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="historySummary" type="xwiki:HistorySummary"
+ minOccurs="0" maxOccurs="unbounded">
+ </element>
+ </sequence>
+
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+ <element name="attachments">
+ <complexType>
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="attachment" type="xwiki:Attachment"
+ minOccurs="0" maxOccurs="unbounded"></element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+ <element name="comments">
+ <complexType>
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="comment" type="xwiki:Comment" minOccurs="0"
+ maxOccurs="unbounded"></element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+ <element name="comment" type="xwiki:Comment"></element>
+
+ <element name="attachment" type="xwiki:Attachment"></element>
+
+ <element name="property" type="xwiki:Property"></element>
+
+ <element name="class" type="xwiki:Class"></element>
+
+ <element name="classes">
+ <complexType>
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="class" type="xwiki:Class" minOccurs="0"
+ maxOccurs="unbounded"></element>
+ </sequence>
+
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+ <element name="objects">
+ <complexType>
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="objectSummary" type="xwiki:ObjectSummary"
+ minOccurs="0" maxOccurs="unbounded"></element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+ <element name="object" type="xwiki:Object"></element>
+
+
+ <element name="translations" type="xwiki:Translations"></element>
+
+
+ <element name="properties">
+ <complexType>
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="property" type="xwiki:Property" minOccurs="0"
+ maxOccurs="unbounded"></element>
+ </sequence>
+
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+ <element name="objectSummary" type="xwiki:ObjectSummary"></element>
+
+ <complexType name="Tag">
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <attribute name="name" type="string"></attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <element name="tag" type="xwiki:Tag"></element>
+
+ <element name="tags">
+ <complexType>
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="tag" type="xwiki:Tag" minOccurs="0"
+ maxOccurs="unbounded"></element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+ <complexType name="SearchResult">
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="type" type="string"></element>
+ <element name="id" type="string"></element>
+ <element name="pageFullName" type="string"></element>
+ <element name="wiki" type="string"></element>
+ <element name="space" type="string"></element>
+ <element name="pageName" type="string"></element>
+ <element name="language" type="string"></element>
+ <element name="className" type="string" minOccurs="0"></element>
+ <element name="objectNumber" type="int" minOccurs="0"></element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <element name="searchResult" type="xwiki:SearchResult"></element>
+
+ <element name="searchResults">
+ <complexType>
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="searchResult" type="xwiki:SearchResult"
+ minOccurs="0" maxOccurs="unbounded"></element>
+ </sequence>
+ <attribute name="template" type="string"></attribute>
+ </extension>
+ </complexContent>
+ </complexType>
+ </element>
+
+
+ <complexType name="Syntaxes">
+ <complexContent>
+ <extension base="xwiki:LinkCollection">
+ <sequence>
+ <element name="syntax" type="string" minOccurs="0" maxOccurs="unbounded"></element>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+
+ <element name="syntaxes" type="xwiki:Syntaxes"></element>
+</schema>
\ No newline at end of file
Index: xwiki-rest-model/src/main/resources/simple.xjb
===================================================================
--- xwiki-rest-model/src/main/resources/simple.xjb (revision 0)
+++ xwiki-rest-model/src/main/resources/simple.xjb (revision 0)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+-->
+
+<!--
+ This enables the simple binding mode in JAXB.
+ See http://weblogs.java.net/blog/kohsuke/archive/2006/03/simple_and_bett.html
+-->
+<jaxb:bindings
+ xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"
+ xmlns:xjc= "http://java.sun.com/xml/ns/jaxb/xjc" jaxb:extensionBindingPrefixes="xjc"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <jaxb:globalBindings>
+ <xjc:simple/>
+ <jaxb:javaType name="java.util.Calendar" xmlType="xs:dateTime"
+ parseMethod="javax.xml.bind.DatatypeConverter.parseDateTime"
+ printMethod="javax.xml.bind.DatatypeConverter.printDateTime"
+ />
+ </jaxb:globalBindings>
+</jaxb:bindings>
Index: xwiki-rest-model/pom.xml
===================================================================
--- xwiki-rest-model/pom.xml (revision 0)
+++ xwiki-rest-model/pom.xml (revision 0)
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ *
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.xwiki.platform</groupId>
+ <artifactId>xwiki-core-parent</artifactId>
+ <version>2.4-SNAPSHOT</version>
+ </parent>
+ <artifactId>xwiki-rest-model</artifactId>
+ <name>XWiki Platform - Core - REST - Model</name>
+ <description>The (JAXB) model for XML resource representations served by the REST module.</description>
+ <!-- Since we are introducing this module in 2.4, previous versions don't exist. REMOVE this line in next development cycles! -->
+ <properties>
+ <xwiki.clirr.skip>true</xwiki.clirr.skip>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jvnet.jaxb2.maven2</groupId>
+ <artifactId>maven-jaxb2-plugin</artifactId>
+ <version>0.6.3</version>
+ <configuration>
+ <extension>true</extension>
+ <args>
+ <arg>-Xfluent-api</arg>
+ </args>
+ <schemaDirectory>src/main/resources</schemaDirectory>
+ <generateDirectory>${basedir}/src/main/java</generateDirectory>
+ <generatePackage>org.xwiki.rest.model.jaxb</generatePackage>
+ <verbose>true</verbose>
+ <removeOldOutput>false</removeOldOutput>
+ <plugins>
+ <plugin>
+ <groupId>net.java.dev.jaxb2-commons</groupId>
+ <artifactId>jaxb-fluent-api</artifactId>
+ <version>2.1.8</version>
+ </plugin>
+ </plugins>
+ </configuration>
+ <!-- Make it work on JDK 1.6 and Maven 3.x. Otherwise we get: Failed to execute goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.6.3:generate (default) on project xwiki-rest:
+ Execution default of goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.6.3:generate failed: DTD factory class org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl does not extend from DTDDVFactory. -->
+ <dependencies>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.9.1</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>maven2-repository.dev.java.net.2</id>
+ <name>Java.net Repository for Maven</name>
+ <url>http://download.java.net/maven/2/</url>
+ </pluginRepository>
+ <!-- TODO: remove maven1 repository as soon as dependencies are available on maven2 repositories -->
+ <pluginRepository>
+ <id>maven-repository.dev.java.net.1</id>
+ <name>Java.net Maven 1 Repository (legacy)</name>
+ <url>http://download.java.net/maven/1</url>
+ <layout>legacy</layout>
+ </pluginRepository>
+ </pluginRepositories>
+</project>
\ No newline at end of file
Index: xwiki-rest/src/main/java/org/xwiki/rest/model/README.txt
===================================================================
--- xwiki-rest/src/main/java/org/xwiki/rest/model/README.txt (revision 29995)
+++ xwiki-rest/src/main/java/org/xwiki/rest/model/README.txt (working copy)
@@ -1 +0,0 @@
-Model classes are automatically generated from src/main/resource/xwiki.rest.model.xsd in the org.xwiki.rest.model.jaxb package.
\ No newline at end of file
Index: xwiki-rest/src/main/resources/xwiki.rest.model.xsd
===================================================================
--- xwiki-rest/src/main/resources/xwiki.rest.model.xsd (revision 29995)
+++ xwiki-rest/src/main/resources/xwiki.rest.model.xsd (working copy)
@@ -1,485 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- *
- * See the NOTICE file distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *
--->
-<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.xwiki.org"
- xmlns:xwiki="http://www.xwiki.org" elementFormDefault="qualified">
-
- <complexType name="Link">
- <attribute name="href" type="string"></attribute>
- <attribute name="rel" type="string"></attribute>
- <attribute name="type" type="string"></attribute>
- <attribute name="hrefLang" type="string"></attribute>
- </complexType>
-
- <complexType name="LinkCollection">
- <sequence>
- <element name="link" type="xwiki:Link" minOccurs="0" maxOccurs="unbounded"></element>
- </sequence>
- </complexType>
-
- <complexType name="Translations">
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="translation" type="xwiki:Translation"
- minOccurs="0" maxOccurs="unbounded"></element>
- </sequence>
- <attribute name="default" type="string"></attribute>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="Translation">
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <attribute name="language" type="string"></attribute>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="XWiki">
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="version" type="string"></element>
- <element name="syntaxes" type="xwiki:Syntaxes"></element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="Wiki">
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="id" type="string"></element>
- <element name="name" type="string"></element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="Space">
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="id" type="string"></element>
- <element name="wiki" type="string"></element>
- <element name="name" type="string"></element>
- <element name="home" type="string"></element>
- <element name="xwikiRelativeUrl" type="string"></element>
- <element name="xwikiAbsoluteUrl" type="string"></element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="PageSummary">
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="id" type="string"></element>
- <element name="fullName" type="string"></element>
- <element name="wiki" type="string"></element>
- <element name="space" type="string"></element>
- <element name="name" type="string"></element>
- <element name="title" type="string"></element>
- <element name="parent" type="string"></element>
- <element name="parentId" type="string"></element>
- <element name="xwikiRelativeUrl" type="string"></element>
- <element name="xwikiAbsoluteUrl" type="string"></element>
- <element name="translations" type="xwiki:Translations"></element>
- <element name="syntax" type="string"></element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="Page">
- <complexContent>
- <extension base="xwiki:PageSummary">
- <sequence>
- <element name="language" type="string"></element>
- <element name="version" type="string"></element>
- <element name="majorVersion" type="int"></element>
- <element name="minorVersion" type="int"></element>
- <element name="created" type="dateTime"></element>
- <element name="creator" type="string"></element>
- <element name="modified" type="dateTime"></element>
- <element name="modifier" type="string"></element>
- <element name="content" type="string"></element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="HistorySummary">
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="pageId" type="string"></element>
- <element name="wiki" type="string"></element>
- <element name="space" type="string"></element>
- <element name="name" type="string"></element>
- <element name="version" type="string"></element>
- <element name="majorVersion" type="int"></element>
- <element name="minorVersion" type="int"></element>
- <element name="modified" type="dateTime"></element>
- <element name="modifier" type="string"></element>
- <element name="language" type="string"></element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="Attachment">
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="id" type="string"></element>
- <element name="name" type="string"></element>
- <element name="size" type="int"></element>
- <element name="version" type="string"></element>
- <element name="pageId" type="string"></element>
- <element name="pageVersion" type="string"></element>
- <element name="mimeType" type="string"></element>
- <element name="author" type="string"></element>
- <element name="date" type="dateTime"></element>
- <element name="xwikiRelativeUrl" type="string"></element>
- <element name="xwikiAbsoluteUrl" type="string"></element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="Comment">
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="id" type="int"></element>
- <element name="pageId" type="string"></element>
- <element name="author" type="string"></element>
- <element name="date" type="dateTime"></element>
- <element name="highlight" type="string"></element>
- <element name="text" type="string"></element>
- <element name="replyTo" type="int" nillable="true"></element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="ObjectSummary">
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="id" type="string"></element>
- <element name="guid" type="string"></element>
- <element name="pageId" type="string"></element>
- <element name="wiki" type="string"></element>
- <element name="space" type="string"></element>
- <element name="pageName" type="string"></element>
- <element name="className" type="string"></element>
- <element name="number" type="int"></element>
- <element name="headline" type="string"></element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="Object">
- <complexContent>
- <extension base="xwiki:ObjectSummary">
- <sequence>
- <element name="property" type="xwiki:Property" minOccurs="0"
- maxOccurs="unbounded">
- </element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="Property">
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="attribute" type="xwiki:Attribute" maxOccurs="unbounded"
- minOccurs="0"></element>
- <element name="value" type="string"></element>
- </sequence>
-
- <attribute name="name" type="string" use="required"></attribute>
-
- <attribute name="type" type="string" use="optional"></attribute>
-
- </extension>
- </complexContent>
- </complexType>
-
-
- <complexType name="Attribute">
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <attribute name="name" type="string" use="required"></attribute>
-
- <attribute name="value" type="string"></attribute>
- </extension>
- </complexContent>
- </complexType>
-
- <complexType name="Class">
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="id" type="string"></element>
- <element name="name" type="string"></element>
- <element name="property" type="xwiki:Property" minOccurs="0"
- maxOccurs="unbounded"></element>
- </sequence>
-
- </extension>
- </complexContent>
- </complexType>
-
-
- <!--
- *
- * ELEMENTS
- *
- -->
-
- <element name="xwiki" type="xwiki:XWiki"></element>
-
- <element name="wikis">
- <complexType>
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="wiki" type="xwiki:Wiki" minOccurs="0"
- maxOccurs="unbounded"></element>
- </sequence>
-
- </extension>
- </complexContent>
- </complexType>
- </element>
-
- <element name="spaces">
- <complexType>
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="space" type="xwiki:Space" minOccurs="0"
- maxOccurs="unbounded"></element>
- </sequence>
-
- </extension>
- </complexContent>
- </complexType>
- </element>
-
- <element name="pages">
- <complexType>
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="pageSummary" type="xwiki:PageSummary"
- minOccurs="0" maxOccurs="unbounded"></element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
- </element>
-
- <element name="wiki" type="xwiki:Wiki"></element>
-
- <element name="space" type="xwiki:Space"></element>
-
- <element name="page" type="xwiki:Page"></element>
-
- <element name="history">
- <complexType>
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="historySummary" type="xwiki:HistorySummary"
- minOccurs="0" maxOccurs="unbounded">
- </element>
- </sequence>
-
- </extension>
- </complexContent>
- </complexType>
- </element>
-
- <element name="attachments">
- <complexType>
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="attachment" type="xwiki:Attachment"
- minOccurs="0" maxOccurs="unbounded"></element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
- </element>
-
- <element name="comments">
- <complexType>
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="comment" type="xwiki:Comment" minOccurs="0"
- maxOccurs="unbounded"></element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
- </element>
-
- <element name="comment" type="xwiki:Comment"></element>
-
- <element name="attachment" type="xwiki:Attachment"></element>
-
- <element name="property" type="xwiki:Property"></element>
-
- <element name="class" type="xwiki:Class"></element>
-
- <element name="classes">
- <complexType>
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="class" type="xwiki:Class" minOccurs="0"
- maxOccurs="unbounded"></element>
- </sequence>
-
- </extension>
- </complexContent>
- </complexType>
- </element>
-
- <element name="objects">
- <complexType>
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="objectSummary" type="xwiki:ObjectSummary"
- minOccurs="0" maxOccurs="unbounded"></element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
- </element>
-
- <element name="object" type="xwiki:Object"></element>
-
-
- <element name="translations" type="xwiki:Translations"></element>
-
-
- <element name="properties">
- <complexType>
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="property" type="xwiki:Property" minOccurs="0"
- maxOccurs="unbounded"></element>
- </sequence>
-
- </extension>
- </complexContent>
- </complexType>
- </element>
-
- <element name="objectSummary" type="xwiki:ObjectSummary"></element>
-
- <complexType name="Tag">
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <attribute name="name" type="string"></attribute>
- </extension>
- </complexContent>
- </complexType>
-
- <element name="tag" type="xwiki:Tag"></element>
-
- <element name="tags">
- <complexType>
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="tag" type="xwiki:Tag" minOccurs="0"
- maxOccurs="unbounded"></element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
- </element>
-
- <complexType name="SearchResult">
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="type" type="string"></element>
- <element name="id" type="string"></element>
- <element name="pageFullName" type="string"></element>
- <element name="wiki" type="string"></element>
- <element name="space" type="string"></element>
- <element name="pageName" type="string"></element>
- <element name="language" type="string"></element>
- <element name="className" type="string" minOccurs="0"></element>
- <element name="objectNumber" type="int" minOccurs="0"></element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <element name="searchResult" type="xwiki:SearchResult"></element>
-
- <element name="searchResults">
- <complexType>
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="searchResult" type="xwiki:SearchResult"
- minOccurs="0" maxOccurs="unbounded"></element>
- </sequence>
- <attribute name="template" type="string"></attribute>
- </extension>
- </complexContent>
- </complexType>
- </element>
-
-
- <complexType name="Syntaxes">
- <complexContent>
- <extension base="xwiki:LinkCollection">
- <sequence>
- <element name="syntax" type="string" minOccurs="0" maxOccurs="unbounded"></element>
- </sequence>
- </extension>
- </complexContent>
- </complexType>
-
- <element name="syntaxes" type="xwiki:Syntaxes"></element>
-</schema>
\ No newline at end of file
Index: xwiki-rest/src/main/resources/simple.xjb
===================================================================
--- xwiki-rest/src/main/resources/simple.xjb (revision 29995)
+++ xwiki-rest/src/main/resources/simple.xjb (working copy)
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- *
- * See the NOTICE file distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *
--->
-
-<!--
- This enables the simple binding mode in JAXB.
- See http://weblogs.java.net/blog/kohsuke/archive/2006/03/simple_and_bett.html
--->
-<jaxb:bindings
- xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"
- xmlns:xjc= "http://java.sun.com/xml/ns/jaxb/xjc" jaxb:extensionBindingPrefixes="xjc"
- xmlns:xs="http://www.w3.org/2001/XMLSchema">
-
- <jaxb:globalBindings>
- <xjc:simple/>
- <jaxb:javaType name="java.util.Calendar" xmlType="xs:dateTime"
- parseMethod="javax.xml.bind.DatatypeConverter.parseDateTime"
- printMethod="javax.xml.bind.DatatypeConverter.printDateTime"
- />
- </jaxb:globalBindings>
-</jaxb:bindings>
Index: xwiki-rest/pom.xml
===================================================================
--- xwiki-rest/pom.xml (revision 29995)
+++ xwiki-rest/pom.xml (working copy)
@@ -1,25 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- *
- * See the NOTICE file distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- *
+ *
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
@@ -34,6 +34,10 @@
<packaging>jar</packaging>
<name>XWiki Platform - Core - REST</name>
<description>Service for accessing XWiki through a RESTful API</description>
+ <!-- Since in 2.4 we moved all model classes in a separate module, skip clirr otherwise we will get plenty of "removed" errors. Re-enable it in next development cycles! -->
+ <properties>
+ <xwiki.clirr.skip>true</xwiki.clirr.skip>
+ </properties>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
@@ -56,6 +60,11 @@
<version>1.1.4</version>
</dependency>
<dependency>
+ <groupId>org.xwiki.platform</groupId>
+ <artifactId>xwiki-rest-model</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
<groupId>com.xpn.xwiki.platform</groupId>
<artifactId>xwiki-core</artifactId>
<version>${pom.version}</version>
@@ -64,7 +73,7 @@
<groupId>org.xwiki.platform</groupId>
<artifactId>xwiki-core-component-api</artifactId>
<version>${pom.version}</version>
- </dependency>
+ </dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
@@ -84,47 +93,6 @@
<build>
<plugins>
<plugin>
- <groupId>org.jvnet.jaxb2.maven2</groupId>
- <artifactId>maven-jaxb2-plugin</artifactId>
- <version>0.6.3</version>
- <configuration>
- <extension>true</extension>
- <args>
- <arg>-Xfluent-api</arg>
- </args>
- <schemaDirectory>src/main/resources</schemaDirectory>
- <generateDirectory>${basedir}/src/main/java</generateDirectory>
- <generatePackage>org.xwiki.rest.model.jaxb</generatePackage>
- <verbose>true</verbose>
- <removeOldOutput>false</removeOldOutput>
- <plugins>
- <plugin>
- <groupId>net.java.dev.jaxb2-commons</groupId>
- <artifactId>jaxb-fluent-api</artifactId>
- <version>2.1.8</version>
- </plugin>
- </plugins>
- </configuration>
- <!-- Make it work on JDK 1.6 and Maven 3.x. Otherwise we get:
- Failed to execute goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.6.3:generate (default) on project
- xwiki-rest: Execution default of goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.6.3:generate failed:
- DTD factory class org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl does not extend from DTDDVFactory. -->
- <dependencies>
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>2.9.1</version>
- </dependency>
- </dependencies>
- <executions>
- <execution>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
@@ -153,18 +121,4 @@
<layout>legacy</layout>
</repository>
</repositories>
- <pluginRepositories>
- <pluginRepository>
- <id>maven2-repository.dev.java.net.2</id>
- <name>Java.net Repository for Maven</name>
- <url>http://download.java.net/maven/2/</url>
- </pluginRepository>
- <!-- TODO: remove maven1 repository as soon as dependencies are available on maven2 repositories -->
- <pluginRepository>
- <id>maven-repository.dev.java.net.1</id>
- <name>Java.net Maven 1 Repository (legacy)</name>
- <url>http://download.java.net/maven/1</url>
- <layout>legacy</layout>
- </pluginRepository>
- </pluginRepositories>
</project>
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs