Callback Schema

The following is the XML schema for responses to callback from widgets out to the developer site.

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.photoshow.com/xml/namespace/widgets.xsd" xmlns="http://www.photoshow.com/xml/namespace/widgets.xsd">

    <xs:element name="cbPostResponse">
        <xs:complexType>
            <xs:choice>
                <xs:element ref="cbResponseSuccess"/>
                <xs:element ref="cbResponseFailure"/>
            </xs:choice>
        </xs:complexType>
    </xs:element>

    <xs:element name="getAlbumListResponse">
        <xs:complexType>
            <xs:choice>
                <xs:element ref="cbResponseFailure"/>
                <xs:element name="albums" type="albumList"/>
            </xs:choice>
        </xs:complexType>
    </xs:element>

    <xs:element name="getAlbumResponse">
        <xs:complexType>
            <xs:choice>
                <xs:element ref="cbResponseFailure"/>
                <xs:element name="photos" type="photoList"/>
            </xs:choice>
        </xs:complexType>
    </xs:element>

    <xs:element name="cbResponseSuccess">
        <xs:complexType>
            <xs:all>
                <xs:element name="status" type="successStatus" minOccurs="1"/>
                <xs:element name="permalink" type="xs:anyURI" minOccurs="1"/>
            </xs:all>
        </xs:complexType>
    </xs:element>

    <xs:element name="cbResponseFailure">
        <xs:complexType>
            <xs:all>
                <xs:element name="status" type="failedStatus" minOccurs="1"/>
                <xs:element name="reason" type="xs:string" minOccurs="0"/>
            </xs:all>
        </xs:complexType>
    </xs:element>

    <xs:simpleType name="successStatus">
        <xs:restriction base="xs:string">
            <xs:pattern value="success"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="failedStatus">
        <xs:restriction base="xs:string">
            <xs:pattern value="failed"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="albumList">
        <xs:sequence>
           <xs:element minOccurs="0" maxOccurs="unbounded" type="album" name="item"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="album">
        <xs:all>
            <xs:element name="id" type="xs:string" minOccurs="1"/>
            <xs:element name="name" type="xs:string" minOccurs="1"/>
            <xs:element name="photoCount" type="xs:int" minOccurs="1"/>
            <xs:element name="thumbnailUrl" type="xs:anyURI" minOccurs="0"/>
        </xs:all>
    </xs:complexType>

    <xs:complexType name="photoList">
        <xs:sequence>
            <xs:element minOccurs="0" maxOccurs="unbounded" type="photo" name="item"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="photo">
        <xs:all>
            <xs:element name="id" type="xs:string" minOccurs="0"/>
            <xs:element name="url" type="xs:anyURI" minOccurs="1"/>
            <xs:element name="thumbnailUrl" type="xs:anyURI" minOccurs="0"/>
            <xs:element name="caption" type="xs:string" minOccurs="0"/>
        </xs:all>
    </xs:complexType>

</xs:schema>