From 038b264fa6a643fe50271472685b80e7afb89333 Mon Sep 17 00:00:00 2001 From: Mateusz Kopeć <m.kopec@ipipan.waw.pl> Date: Sat, 26 Sep 2015 19:52:13 +0200 Subject: [PATCH] Added section type --- pom.xml | 4 ++-- src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Adapter1.java | 2 +- src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Adapter2.java | 2 +- src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/ObjectFactory.java | 14 +++++++++++--- src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/SectionString.java | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Span.java | 2 +- src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Spans.java | 2 +- src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Summaries.java | 2 +- src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Summary.java | 2 +- src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Text.java | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------- src/main/resources/schema/schema.xsd | 34 +++++++++++++++++++++------------- 11 files changed, 206 insertions(+), 41 deletions(-) create mode 100644 src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/SectionString.java diff --git a/pom.xml b/pom.xml index 5842e02..908bcfd 100644 --- a/pom.xml +++ b/pom.xml @@ -47,11 +47,11 @@ <distributionManagement> <repository> - <id>deployment</id> + <id>zil-releases</id> <url>http://maven.nlp.ipipan.waw.pl/content/repositories/releases/</url> </repository> <snapshotRepository> - <id>deployment</id> + <id>zil-snapshots</id> <url>http://maven.nlp.ipipan.waw.pl/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement> diff --git a/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Adapter1.java b/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Adapter1.java index 6baec88..3ad48ca 100644 --- a/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Adapter1.java +++ b/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Adapter1.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.07.22 at 12:56:02 PM CEST +// Generated on: 2015.09.26 at 07:48:06 PM CEST // diff --git a/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Adapter2.java b/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Adapter2.java index c8a5abb..67d9b13 100644 --- a/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Adapter2.java +++ b/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Adapter2.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.07.22 at 12:56:02 PM CEST +// Generated on: 2015.09.26 at 07:48:06 PM CEST // diff --git a/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/ObjectFactory.java b/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/ObjectFactory.java index 5cada92..8927b89 100644 --- a/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/ObjectFactory.java +++ b/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/ObjectFactory.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.07.22 at 12:56:02 PM CEST +// Generated on: 2015.09.26 at 07:48:06 PM CEST // @@ -14,7 +14,7 @@ import javax.xml.bind.annotation.XmlRegistry; /** * This object contains factory methods for each * Java content interface and Java element interface - * generated in the mkopec.summ.pscapi.xml package. + * generated in the pl.waw.ipipan.zil.summ.pscapi.xml package. * <p>An ObjectFactory allows you to programatically * construct new instances of the Java representation * for XML content. The Java representation of XML @@ -30,7 +30,7 @@ public class ObjectFactory { /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: mkopec.summ.pscapi.xml + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: pl.waw.ipipan.zil.summ.pscapi.xml * */ public ObjectFactory() { @@ -45,6 +45,14 @@ public class ObjectFactory { } /** + * Create an instance of {@link Text.Section } + * + */ + public Text.Section createTextSection() { + return new Text.Section(); + } + + /** * Create an instance of {@link Summaries } * */ diff --git a/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/SectionString.java b/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/SectionString.java new file mode 100644 index 0000000..6bc84ce --- /dev/null +++ b/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/SectionString.java @@ -0,0 +1,73 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2015.09.26 at 07:48:06 PM CEST +// + + +package pl.waw.ipipan.zil.summ.pscapi.xml; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + + +/** + * <p>Java class for SectionString. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * <p> + * <pre> + * <simpleType name="SectionString"> + * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> + * <enumeration value="Ekonomia"/> + * <enumeration value="Kraj"/> + * <enumeration value="Kultura"/> + * <enumeration value="Nauka i Technika"/> + * <enumeration value="Prawo"/> + * <enumeration value="Publicystyka, Opinie"/> + * <enumeration value="Sport"/> + * </restriction> + * </simpleType> + * </pre> + * + */ +@XmlType(name = "SectionString") +@XmlEnum +public enum SectionString { + + @XmlEnumValue("Ekonomia") + EKONOMIA("Ekonomia"), + @XmlEnumValue("Kraj") + KRAJ("Kraj"), + @XmlEnumValue("Kultura") + KULTURA("Kultura"), + @XmlEnumValue("Nauka i Technika") + NAUKA_I_TECHNIKA("Nauka i Technika"), + @XmlEnumValue("Prawo") + PRAWO("Prawo"), + @XmlEnumValue("Publicystyka, Opinie") + PUBLICYSTYKA_OPINIE("Publicystyka, Opinie"), + @XmlEnumValue("Sport") + SPORT("Sport"); + private final String value; + + SectionString(String v) { + value = v; + } + + public String value() { + return value; + } + + public static SectionString fromValue(String v) { + for (SectionString c: SectionString.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Span.java b/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Span.java index 60861b3..a62dde7 100644 --- a/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Span.java +++ b/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Span.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.07.22 at 12:56:02 PM CEST +// Generated on: 2015.09.26 at 07:48:06 PM CEST // diff --git a/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Spans.java b/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Spans.java index fbe83c3..e0c22d4 100644 --- a/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Spans.java +++ b/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Spans.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.07.22 at 12:56:02 PM CEST +// Generated on: 2015.09.26 at 07:48:06 PM CEST // diff --git a/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Summaries.java b/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Summaries.java index a2b192d..b9613ff 100644 --- a/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Summaries.java +++ b/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Summaries.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.07.22 at 12:56:02 PM CEST +// Generated on: 2015.09.26 at 07:48:06 PM CEST // diff --git a/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Summary.java b/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Summary.java index b7c45e4..898bbcc 100644 --- a/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Summary.java +++ b/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Summary.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.07.22 at 12:56:02 PM CEST +// Generated on: 2015.09.26 at 07:48:06 PM CEST // diff --git a/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Text.java b/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Text.java index 6a28f23..d9a804a 100644 --- a/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Text.java +++ b/src/main/java/pl/waw/ipipan/zil/summ/pscapi/xml/Text.java @@ -2,7 +2,7 @@ // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2015.07.22 at 12:56:02 PM CEST +// Generated on: 2015.09.26 at 07:48:06 PM CEST // @@ -15,6 +15,7 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; import javax.xml.datatype.XMLGregorianCalendar; @@ -31,17 +32,13 @@ import javax.xml.datatype.XMLGregorianCalendar; * <element name="date" type="{http://www.w3.org/2001/XMLSchema}date"/> * <element name="title" type="{http://www.w3.org/2001/XMLSchema}string"/> * <element name="section"> - * <simpleType> - * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> - * <enumeration value="Ekonomia"/> - * <enumeration value="Kraj"/> - * <enumeration value="Kultura"/> - * <enumeration value="Nauka i Technika"/> - * <enumeration value="Prawo"/> - * <enumeration value="Publicystyka, Opinie"/> - * <enumeration value="Sport"/> - * </restriction> - * </simpleType> + * <complexType> + * <simpleContent> + * <extension base="<>SectionString"> + * <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" /> + * </extension> + * </simpleContent> + * </complexType> * </element> * <element name="authors" type="{http://www.w3.org/2001/XMLSchema}string"/> * <element name="body" type="{http://www.w3.org/2001/XMLSchema}string"/> @@ -73,7 +70,7 @@ public class Text { @XmlElement(required = true) protected String title; @XmlElement(required = true) - protected String section; + protected Text.Section section; @XmlElement(required = true) protected String authors; @XmlElement(required = true) @@ -135,10 +132,10 @@ public class Text { * * @return * possible object is - * {@link String } + * {@link Text.Section } * */ - public String getSection() { + public Text.Section getSection() { return section; } @@ -147,10 +144,10 @@ public class Text { * * @param value * allowed object is - * {@link String } + * {@link Text.Section } * */ - public void setSection(String value) { + public void setSection(Text.Section value) { this.section = value; } @@ -250,4 +247,83 @@ public class Text { this.id = value; } + + /** + * <p>Java class for anonymous complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * <complexType> + * <simpleContent> + * <extension base="<>SectionString"> + * <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" /> + * </extension> + * </simpleContent> + * </complexType> + * </pre> + * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "value" + }) + public static class Section { + + @XmlValue + protected SectionString value; + @XmlAttribute(name = "type") + protected String type; + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link SectionString } + * + */ + public SectionString getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link SectionString } + * + */ + public void setValue(SectionString value) { + this.value = value; + } + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + + } + } diff --git a/src/main/resources/schema/schema.xsd b/src/main/resources/schema/schema.xsd index 5fd85e5..86098b5 100644 --- a/src/main/resources/schema/schema.xsd +++ b/src/main/resources/schema/schema.xsd @@ -1,5 +1,17 @@ <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> + <xs:simpleType name="SectionString"> + <xs:restriction base="xs:string"> + <xs:enumeration value="Ekonomia" /> + <xs:enumeration value="Kraj" /> + <xs:enumeration value="Kultura" /> + <xs:enumeration value="Nauka i Technika" /> + <xs:enumeration value="Prawo" /> + <xs:enumeration value="Publicystyka, Opinie" /> + <xs:enumeration value="Sport" /> + </xs:restriction> + </xs:simpleType> + <xs:element name='text'> <xs:complexType> <xs:sequence> @@ -8,24 +20,20 @@ <xs:element name='title' type='xs:string' minOccurs='1' maxOccurs='1' /> <xs:element name='section' minOccurs='1' maxOccurs='1'> - <xs:simpleType> - <xs:restriction base="xs:string"> - <xs:enumeration value="Ekonomia" /> - <xs:enumeration value="Kraj" /> - <xs:enumeration value="Kultura" /> - <xs:enumeration value="Nauka i Technika" /> - <xs:enumeration value="Prawo" /> - <xs:enumeration value="Publicystyka, Opinie" /> - <xs:enumeration value="Sport" /> - </xs:restriction> - </xs:simpleType> + <xs:complexType> + <xs:simpleContent> + <xs:extension base="SectionString"> + <xs:attribute name='type' type='xs:string' /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> </xs:element> <xs:element name='authors' type='xs:string' minOccurs='1' maxOccurs='1' /> <xs:element name='body' type='xs:string' minOccurs='1' maxOccurs='1' /> - <xs:element name='summaries' type='Summaries' - minOccurs='0' maxOccurs='1' /> + <xs:element name='summaries' type='Summaries' minOccurs='0' + maxOccurs='1' /> </xs:sequence> <xs:attribute name='id' type='xs:string' /> </xs:complexType> -- libgit2 0.22.2