SaanEndagaHästiLäbi

From EIK wiki

Tiimi liikmed

  • Taivo Türnpu

Idee

Idee on luua veebiteenus isikuandmete otsimise jaoks.

XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<ns1:person xmlns:ns1="http://www.europa.eu/schengen/sis/xsd/v1/types/alert">
	<id>38911180241</id>
	<firstname>Taivo</firstname>
	<lastname haschanged="true">Türnpu</lastname>
	<dateofbirth>19891118</dateofbirth>
	<sex>M</sex>
	<nationality>Estonia</nationality>
	<contacts>
		<contact>
			<data type="PHONE">53037381</data>
		</contact>
	</contacts>
    <employments>
        <employment>
		    <employer>Icefire OÜ</employer>
		    <employedsince>20110101</employedsince>
		    <employedto>20131212</employedto>
	    </employment>
    </employments>
    <addresses>
        <address>
            <country>Estonia</country>
            <city>Tallinn</city>
            <street>Siili</street>
            <house>30</house>
            <apartment>21</apartment>
        </address>
    </addresses>
	<remarks>
		<remark priority="1">Brown hair</remark>
	</remarks>
	<relations>
		<relation>
			<relationid>35802028975</relationid>
			<type>FATHER</type>
        </relation>
	</relations>
</ns1:person>

XSD

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://www.europa.eu/schengen/sis/xsd/v1/types/alert"
            xmlns:tns="http://www.europa.eu/schengen/sis/xsd/v1/types/alert"
            version="3.0 Candidate">


    <!-- MAIN ELEMENT -->

    <xsd:element name="person">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="id" type="tns:isikukoodType"/>
                <xsd:element name="firstname" type="xsd:string"/>
                <xsd:element name="lastname" type="tns:lastnameType"/>
                <xsd:element name="dateofbirth" type="tns:dateType"/>
                <xsd:element name="sex" type="tns:sexType"/>
                <xsd:element name="nationality" type="xsd:string"/>
                <xsd:element name="contacts" type="tns:contactsType" minOccurs="0"/>
                <xsd:element name="employments" type="tns:employmentsType" minOccurs="0"/>
                <xsd:element name="addresses" type="tns:addressType" minOccurs="0"/>
                <xsd:element name="remarks" type="tns:remarksType" minOccurs="0"/>
                <xsd:element name="relations" type="tns:relationsType" minOccurs="0"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>

    <!-- DATA TYPES -->

    <xsd:complexType name="lastnameType">
		<xsd:annotation>
			<xsd:documentation>Description: This table defines the last name</xsd:documentation>
		</xsd:annotation>
		<xsd:simpleContent>
			<xsd:extension base="xsd:string">
				<xsd:attribute name="haschanged" type="xsd:boolean" use="optional"/>
			</xsd:extension>
		</xsd:simpleContent>
	</xsd:complexType>

    <xsd:simpleType name="isikukoodType">
        <xsd:annotation>
            <xsd:documentation>Description: This type restricts input to 11 characters, as is Estonian id code.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:length value="11"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="dateType">
        <xsd:annotation>
            <xsd:documentation>Description: This type indicates a date.</xsd:documentation>
            <xsd:documentation>Rule: format YYYYMMDD</xsd:documentation>
            <xsd:documentation>Rule: DD between [00...31]</xsd:documentation>
            <xsd:documentation>Rule: MM between [01...12]</xsd:documentation>
            <xsd:documentation>Rule: YYYY between [1800...2050]</xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="8"/>
            <xsd:maxLength value="8"/>
            <xsd:pattern value="(18\d\d|19\d\d|20[0-4]\d|2050)((0[1-9]|1[0-2])((0[1-9]|[1-2]\d|3[0-1])))"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:simpleType name="sexType">
        <xsd:annotation>
            <xsd:documentation>Description: This type restricts input to M or F.</xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:minLength value="1"/>
            <xsd:maxLength value="1"/>
            <xsd:pattern value="(M|N)"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="contactsType">
        <xsd:annotation>
            <xsd:documentation>Description: Type which contains information about person's contacts.</xsd:documentation>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="contact" maxOccurs="unbounded">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="data" type="tns:contactDataType"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="contactDataType">
		<xsd:simpleContent>
			<xsd:extension base="xsd:string">
				<xsd:attribute name="type" type="tns:contactAttributeType" use="required"/>
			</xsd:extension>
		</xsd:simpleContent>
	</xsd:complexType>

    <xsd:simpleType name="contactAttributeType">
        <xsd:annotation>
            <xsd:documentation>Description: Limits input to contact type classifier values.</xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="PHONE"/>
            <xsd:enumeration value="EMAIL"/>
            <xsd:enumeration value="ADDRESS"/>
        </xsd:restriction>
    </xsd:simpleType>

    <xsd:complexType name="employmentsType">
        <xsd:annotation>
            <xsd:documentation>Description: Type which contains information about person's employments.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="employment" maxOccurs="unbounded">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="employer" type="xsd:string"/>
                        <xsd:element name="employedsince" type="tns:dateType"/>
                        <xsd:element name="employedto" type="tns:dateType" minOccurs="0"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="addressType">
        <xsd:annotation>
            <xsd:documentation>Description: Type which contains information about person's addresses.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="address" maxOccurs="unbounded">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="country" type="xsd:string"/>
                        <xsd:element name="city" type="xsd:string"/>
                        <xsd:element name="street" type="xsd:string"/>
                        <xsd:element name="house" type="xsd:string"/>
                        <xsd:element name="apartment" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="remarksType">
        <xsd:annotation>
            <xsd:documentation>Description: Type which contains information about person's remarks.</xsd:documentation>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="remark" type="tns:indexedRemarkType" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:complexType name="indexedRemarkType">
		<xsd:annotation>
			<xsd:documentation>Description: This type defines the remark with priority attribute.</xsd:documentation>
		</xsd:annotation>
		<xsd:simpleContent>
			<xsd:extension base="xsd:string">
				<xsd:attribute name="priority" type="xsd:string" use="required"/>
			</xsd:extension>
		</xsd:simpleContent>
	</xsd:complexType>

    <xsd:complexType name="relationsType">
        <xsd:annotation>
            <xsd:documentation>Description: Type which contains information about person's relations.
            </xsd:documentation>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="relation" maxOccurs="unbounded">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="relationid" type="xsd:string"/>
                        <xsd:element name="type" type="tns:relationTypeType"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:sequence>
    </xsd:complexType>

    <xsd:simpleType name="relationTypeType">
        <xsd:annotation>
            <xsd:documentation>Description: Limits input to relation type classifier values.</xsd:documentation>
        </xsd:annotation>
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="MOTHER"/>
            <xsd:enumeration value="FATHER"/>
            <xsd:enumeration value="SON"/>
            <xsd:enumeration value="DAUGHTER"/>
        </xsd:restriction>
    </xsd:simpleType>



</xsd:schema>

XSLT

<?xml version="1.0" encoding="UTF-8" ?>

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:t="http://www.europa.eu/schengen/sis/xsd/v1/types/alert">

    <xsl:template match="/">
        <html>
            <body style="background-color:#E0E0E0">
                <h2>Isik - <xsl:value-of select="t:person/lastname"/>, <xsl:value-of select="t:person/firstname"/></h2>
                <table>
                    <tr><td>Isikukood</td><td><b><xsl:value-of select="t:person/id"/></b></td></tr>
                    <tr><td>Eesnimi</td><td><b><xsl:value-of select="t:person/firstname"/></b></td></tr>
                    <tr><td>Perekonnanimi</td><td><b><xsl:value-of select="t:person/lastname"/></b></td></tr>
                    <tr><td>Sünniaeg</td><td><b><xsl:value-of select="t:person/dateofbirth"/></b></td></tr>
                    <tr><td>Sugu</td><b><td><b><xsl:value-of select="t:person/sex"/></b></td></b></tr>
                    <tr><td>Rahvus</td><td><b><xsl:value-of select="t:person/nationality"/></b></td></tr>
                    <tr><td>Kontaktid</td><td></td></tr>
                    <xsl:for-each select="t:person/contacts/contact">
                        <tr><td></td><td><xsl:value-of select="data/@type"/></td>
                            <td><b><xsl:value-of select="data"/></b></td></tr>
                    </xsl:for-each>
                    <tr><td>Tööandjad</td><td></td></tr>
                    <xsl:for-each select="t:person/employments/employment">
                        <tr>
                            <td></td>
                            <td>
                                <b><xsl:value-of select="employer"/></b>
                            </td>
                            <td>
                                alates <xsl:value-of select="employedsince"/>
                            </td>
                            <td>
                                kuni <xsl:value-of select="employedto"/>
                            </td>
                        </tr>
                    </xsl:for-each>
                    </table>
                    <table>
                    <tr>
                        <td>Aadressid</td>
                        <td></td>
                    </tr>
                    <xsl:for-each select="t:person/addresses/address">
                        <tr>
                            <td></td>
                            <td>
                                <xsl:value-of select="country"/>
                            </td>
                            <td>
                                <xsl:value-of select="city"/>
                            </td>
                            <td>
                                <xsl:value-of select="street"/>
                            </td>
                            <td>
                                <xsl:value-of select="house"/>
                            </td>
                            <td>
                                <xsl:value-of select="apartment"/>
                            </td>
                        </tr>
                    </xsl:for-each>
                </table>
                <table>
                    <tr>
                        <td>Märkused</td>
                        <td></td>
                    </tr>
                    <xsl:for-each select="t:person/remarks">
                        <tr>
                        <td></td>
                            <td>
                                <xsl:if test="remark/@priority=1"><font size="3" color="red"><xsl:value-of select="remark"/></font></xsl:if>
                                <xsl:if test="remark/@priority!=1"><xsl:value-of select="remark"/></xsl:if>
                            </td>
                        </tr>
                    </xsl:for-each>
                </table>
                <table>
                    <tr>
                        <td>Lingid</td>
                        <td></td>
                    </tr>
                    <xsl:for-each select="t:person/relations/relation">
                        <tr>
                        <td></td>
                            <td>
                                <a href="#"><xsl:value-of select="relationid"/></a>
                            </td>
                            <td>
                                <xsl:value-of select="type"/>
                            </td>
                        </tr>
                    </xsl:for-each>
                </table>
            </body>
        </html>
    </xsl:template>

</xsl:stylesheet>

Rakendused

Klientrakendus ja veebiteenus: http://matkapesa.ee/taivo/

Veebirakendus peaks olema ideeliselt inimeste andmete pärimiseks ja loomiseks(CUD+query). Klientrakendus on ebay veebiteenuse peale, lihtne itemite salvestamine, hinna vaatamine ja ka lingile liikumine.

Teenuse meetodid:

  • personRequest - pärib andmebaasist isiku isikukoodile
  • createPerson - loob andmebaasi isiku kirje vastavalt sisendanmetele
  • updatePerson - uuendab andmebaasi isiku kirjet vastavalt sisendandmetele
  • deletePerson - kustutab isiku andmebaasist

Retsensioonid

xml https://wiki.itcollege.ee/index.php/Talk:RM

xml https://wiki.itcollege.ee/index.php/Talk:Ulgurmutid

Rakendus https://wiki.itcollege.ee/index.php/Talk:Laenutajad

Teenus https://wiki.itcollege.ee/index.php/Talk:X-Ladu