mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Client Side Transfer Report now validates against its XSD + unit test.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19870 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1740,8 +1740,7 @@ public class TransferServiceImplTest extends BaseAlfrescoSpringTest
|
|||||||
Validator validator = schema.newValidator();
|
Validator validator = schema.newValidator();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//TODO Test does not work
|
validator.validate(transferReportSource);
|
||||||
//validator.validate(transferReportSource);
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@@ -1,64 +1,103 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
<schema
|
<xs:schema targetNamespace="http://www.alfresco.org/model/transferReport/1.0"
|
||||||
targetNamespace="http://www.alfresco.org/model/transferReport/1.0"
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||||
xmlns:report="http://www.alfresco.org/model/transferReport/1.0"
|
xmlns:report="http://www.alfresco.org/model/transferReport/1.0"
|
||||||
xmlns="http://www.w3.org/2001/XMLSchema"
|
xmlns="http://www.w3.org/2001/XMLSchema"
|
||||||
elementFormDefault="qualified">
|
elementFormDefault="qualified">
|
||||||
|
|
||||||
<!-- XML Schema for the client side transferReport -->
|
<!-- XML Schema for the client side transferReport owned by the
|
||||||
|
alfresco transferService -->
|
||||||
|
|
||||||
<element name="transferReport" type="report:transferReport" >
|
<xs:element name="transferReport" type="report:transferReport">
|
||||||
<annotation>
|
<xs:annotation>
|
||||||
<documentation>This is an Alfresco client side transfer report</documentation>
|
<xs:documentation>This is an Alfresco client side transfer report</xs:documentation>
|
||||||
</annotation>
|
</xs:annotation>
|
||||||
</element>
|
</xs:element>
|
||||||
|
|
||||||
<complexType name="transferReport">
|
<xs:complexType name="transferReport">
|
||||||
<annotation>
|
<xs:annotation>
|
||||||
<documentation>
|
<xs:documentation>
|
||||||
The Alfresco client side transfer report
|
The Alfresco client side transfer report
|
||||||
</documentation>
|
</xs:documentation>
|
||||||
</annotation>
|
</xs:annotation>
|
||||||
<sequence>
|
<xs:sequence>
|
||||||
<element name="target" type="report:target" maxOccurs="1"
|
<xs:element name="target" type="report:target" maxOccurs="1"
|
||||||
minOccurs="1">
|
minOccurs="1">
|
||||||
</element>
|
</xs:element>
|
||||||
<element name="definition" type="report:definition"
|
<xs:element name="definition" type="report:definition"
|
||||||
maxOccurs="1" minOccurs="1">
|
maxOccurs="1" minOccurs="1">
|
||||||
</element>
|
</xs:element>
|
||||||
<element name="exception" type="report:exception" maxOccurs="1"
|
<xs:sequence maxOccurs="unbounded" minOccurs="0">
|
||||||
minOccurs="0">
|
<xs:element name="node" type="report:node">
|
||||||
</element>
|
</xs:element>
|
||||||
<element name="events" type="report:events"></element>
|
</xs:sequence>
|
||||||
</sequence>
|
<xs:element name="exception" type="report:exception" maxOccurs="1"
|
||||||
</complexType>
|
minOccurs="0">
|
||||||
|
</xs:element>
|
||||||
|
<xs:element name="events" type="report:events">
|
||||||
|
</xs:element>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
|
||||||
<complexType name="target">
|
<xs:complexType name="target">
|
||||||
<annotation>
|
<xs:annotation>
|
||||||
<documentation>
|
<xs:documentation>
|
||||||
The destination of the transfer
|
The destination of the transfer
|
||||||
</documentation>
|
</xs:documentation>
|
||||||
</annotation>
|
</xs:annotation>
|
||||||
<attribute name="name" type="string"></attribute>
|
<xs:attribute name="name" type="string"></xs:attribute>
|
||||||
<attribute name="endpointPort" type="int"></attribute>
|
<xs:attribute name="endpointPort" type="int"></xs:attribute>
|
||||||
<attribute name="endpointHost" type="string"></attribute>
|
<xs:attribute name="endpointHost" type="string"></xs:attribute>
|
||||||
</complexType>
|
</xs:complexType>
|
||||||
|
|
||||||
<complexType name="definition"></complexType>
|
<xs:complexType name="definition">
|
||||||
|
</xs:complexType>
|
||||||
|
|
||||||
<complexType name="events">
|
<xs:complexType name="node">
|
||||||
<sequence maxOccurs="unbounded" minOccurs="0">
|
<xs:annotation>
|
||||||
<element name="event" type="report:event"></element>
|
<xs:documentation>
|
||||||
</sequence>
|
The nodes being transferred
|
||||||
</complexType>
|
</xs:documentation>
|
||||||
|
</xs:annotation>
|
||||||
|
|
||||||
<complexType name="event">
|
<xs:sequence>
|
||||||
</complexType>
|
<xs:element name="primaryParent" maxOccurs="1"
|
||||||
|
minOccurs="0" type="report:primaryParent">
|
||||||
|
</xs:element>
|
||||||
|
</xs:sequence>
|
||||||
|
|
||||||
|
<xs:attribute name="nodeRef" type="string"></xs:attribute>
|
||||||
|
|
||||||
|
</xs:complexType>
|
||||||
|
|
||||||
|
<xs:complexType name="events">
|
||||||
|
<xs:sequence maxOccurs="unbounded" minOccurs="0">
|
||||||
|
<xs:element name="event" type="report:event"></xs:element>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
|
||||||
|
<xs:complexType name="event" mixed="true">
|
||||||
|
<xs:attribute name="date" type="dateTime"></xs:attribute>
|
||||||
|
</xs:complexType>
|
||||||
|
|
||||||
<complexType name="exception">
|
<xs:complexType name="exception">
|
||||||
|
|
||||||
</complexType>
|
</xs:complexType>
|
||||||
|
|
||||||
<element name="report" type="string"></element>
|
<xs:complexType name="primaryParent">
|
||||||
</schema>
|
<xs:sequence>
|
||||||
|
<xs:element name="parentAssoc" type="report:parentAssoc"/>
|
||||||
|
<xs:element name="primaryPath" type="xs:string" />
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
|
||||||
|
|
||||||
|
<xs:complexType name="parentAssoc" mixed="true">
|
||||||
|
<xs:attribute name="from" use="required" type="xs:string"/>
|
||||||
|
<xs:attribute name="isPrimary" use="required" type="xs:boolean"/>
|
||||||
|
<xs:attribute name="type" use="required"/>
|
||||||
|
</xs:complexType>
|
||||||
|
|
||||||
|
|
||||||
|
</xs:schema>
|
@@ -69,7 +69,7 @@ public class XMLTransferReportWriter
|
|||||||
this.writer.startPrefixMapping(PREFIX, TransferReportModel.TRANSFER_REPORT_MODEL_1_0_URI);
|
this.writer.startPrefixMapping(PREFIX, TransferReportModel.TRANSFER_REPORT_MODEL_1_0_URI);
|
||||||
|
|
||||||
// Start Transfer Manifest // uri, name, prefix
|
// Start Transfer Manifest // uri, name, prefix
|
||||||
this.writer.startElement(TransferReportModel.TRANSFER_REPORT_MODEL_1_0_URI, TransferReportModel.LOCALNAME_TRANSFER_REPORT, TransferReportModel.LOCALNAME_TRANSFER_REPORT, EMPTY_ATTRIBUTES);
|
this.writer.startElement(TransferReportModel.TRANSFER_REPORT_MODEL_1_0_URI, TransferReportModel.LOCALNAME_TRANSFER_REPORT, PREFIX + ":" + TransferReportModel.LOCALNAME_TRANSFER_REPORT, EMPTY_ATTRIBUTES);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -78,7 +78,7 @@ public class XMLTransferReportWriter
|
|||||||
public void endTransferReport() throws SAXException
|
public void endTransferReport() throws SAXException
|
||||||
{
|
{
|
||||||
// End Transfer Manifest
|
// End Transfer Manifest
|
||||||
writer.endElement(TransferReportModel.TRANSFER_REPORT_MODEL_1_0_URI, TransferReportModel.LOCALNAME_TRANSFER_REPORT, TransferReportModel.LOCALNAME_TRANSFER_REPORT);
|
writer.endElement(TransferReportModel.TRANSFER_REPORT_MODEL_1_0_URI, TransferReportModel.LOCALNAME_TRANSFER_REPORT, PREFIX + ":" + TransferReportModel.LOCALNAME_TRANSFER_REPORT);
|
||||||
writer.endPrefixMapping(PREFIX);
|
writer.endPrefixMapping(PREFIX);
|
||||||
writer.endDocument();
|
writer.endDocument();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user