Miisiiks

From ICO wiki
Revision as of 09:03, 2 June 2018 by Caruste (talk | contribs) (→‎XML)
Jump to navigationJump to search

Meeskond

  • Christo Aruste
  • Heleriin Malkov
  • Tõnis Prants

Analüüs

Idee

Juhutööde pakkumise ja otsimise veebiteenus ja veebikeskkond

Kirjeldus

Loome veebiteenuse ning veebikeskkonna, mille kaudu inimesed saavad vaadata ja lisada juhutöö otsimise ning pakkumise kuulutusi. Kuulutustel on võimalik ära märkida piirkond, kus otsitakse tööd/töötajat. Veebilehel on võimalik hinnata kasutajakontosid ja lisada kommentaare. Kuulutuse vastuvõtmisel saadetakse kuulutuse loojale teade kontaktandmetega. Kuulutuse lisamisel on võimalik märkida ära, kas antud töö eest pakutakse tasu või mitte.

Funktsionaalsus

Must have:

  • Kuulutuste vaatamine
  • Kuulutuste lisamine
  • Kuulutuste kustutamine
  • Kuulutuste otsimine
  • Kasutajate haldamine
  • Kasutajatele teadete saatmine
  • Teadete vaatamine

Nice to have:

  • Kasutajakontode hindamine
  • Kuulutuse aegumine
  • Kuulutuse sulgemine
  • Kasutajate kommenteerimine
  • Kuulutuse aadress
  • Kuulutuse asukoha kaugus sinu asukohast
  • Anonüümselt kuulutustele vastamine
  • Mitme kontaktandme valikuline sidumine kuulutusega

Veebiteenus

https://www.dropbox.com/s/e2vu3ukgckyc2x5/MiisiiksWS.zip?dl=0

Klientrakendus

https://www.dropbox.com/s/iwtheohp5mn0lek/MiisiiksC.zip?dl=0

XML

<?xml version="1.0" encoding="utf-8" ?>
<ApplicationUsers>
  <ApplicationUser UserId="296a7683-be8d-45e1-9b9d-6b7e1aa4657d">
    <UserName>workers@hotmail.com</UserName>
    <Advertisements>
      <Advertisement AdId="1">
        <AdName>Looking for a truck driver</AdName>
        <AdDescription>I am looking for a truck driver to help me move to another town. For more information send a message.</AdDescription>
        <UserName>workers@hotmail.com</UserName>
        <Location>Tallinn, Mustamäe</Location>
        <JobCategory> Driving </JobCategory>
        <CreationDate> 01.06.2018 </CreationDate>
        <Pictures PictureId="1">
          <Location>https://i1.wp.com/movingtips.wpengine.com/wp-content/uploads/2017/10/large-moving-truck.jpg?fit=1024%2C683&amp;ssl=1</Location>
          <AdvertisementId/>
        </Pictures>
        <Pictures PictureId="2">
          <Location>https://www.southernoak.com/v2/wp-content/uploads/2016/05/Moving-Day.jpg</Location>
          <AdvertisementId/>
        </Pictures>
      </Advertisement>
    </Advertisements>
    <Contacts>
      <Contact Id="1">
        <ContactValue>Miisiks</ContactValue>
        <UserName>workers@hotmail.com</UserName>
        <ContactTypeName> Skype </ContactTypeName>
      </Contact>
    </Contacts>
  </ApplicationUser>
  <ApplicationUser UserId="2460d33a-3505-4844-b8c8-2b7e0ece6a70">
    <UserName>homeforyou@gmail.com</UserName>
    <Advertisements>
      <Advertisement AdId="3">
        <AdName>Need a home assistant</AdName>
        <AdDescription>Need help with a big spring cleaning at countryside house. There’s a lot to clean from inside the house to the garden. Please message for more information</AdDescription>
        <UserName>homeforyou@gmail.com</UserName>
        <Location>Pärnumaa, Sauga</Location>
        <JobCategory> Cleaning</JobCategory>
        <CreationDate> 12.02.2018 </CreationDate>
        <Pictures PictureId="3">
          <Location>https://s3-media4.fl.yelpcdn.com/bphoto/fWxU8tYpD3ddC7UtSKXA7A/o.jpg</Location>
          <AdvertisementId> 3 </AdvertisementId>
        </Pictures>
        <Pictures PictureId="4">
          <Location>http://whatdoimakenow.com/wp-content/uploads/2017/05/Messy-House-Project-Kitchen-Before-Stove-e1495030958246.jpg</Location>
          <AdvertisementId/>
        </Pictures>
        <Pictures PictureId="5">
          <Location>http://www.gardenplansireland.com/forum/files/garden_123.jpg</Location>
          <AdvertisementId/>
        </Pictures>
        <Pictures PictureId="6">
          <Location>https://wshg.net/wp-content/uploads/2014/05/GardenDilemmas_B_WHG13A.jpg</Location>
          <AdvertisementId/>
        </Pictures>
      </Advertisement>
      <Advertisement AdId="4">
        <AdName>Fixing a roof</AdName>
        <AdDescription>Need help with fixing a roof. Please message for more information</AdDescription>
        <UserName>homeforyou@gmail.com</UserName>
        <Location>Pärnumaa, Sauga</Location>
        <JobCategory>Construction</JobCategory>
        <CreationDate> 01.06.2018 </CreationDate>
        <Pictures PictureId="3">
          <Location>https://s3-media4.fl.yelpcdn.com/bphoto/fWxU8tYpD3ddC7UtSKXA7A/o.jpg</Location>
          <AdvertisementId> 3 </AdvertisementId>
        </Pictures>
        <Pictures PictureId="4">
          <Location>http://whatdoimakenow.com/wp-content/uploads/2017/05/Messy-House-Project-Kitchen-Before-Stove-e1495030958246.jpg</Location>
          <AdvertisementId/>
        </Pictures>
        <Pictures PictureId="5">
          <Location>http://www.gardenplansireland.com/forum/files/garden_123.jpg</Location>
          <AdvertisementId/>
        </Pictures>
        <Pictures PictureId="6">
          <Location>https://wshg.net/wp-content/uploads/2014/05/GardenDilemmas_B_WHG13A.jpg</Location>
          <AdvertisementId/>
        </Pictures>
      </Advertisement>
    </Advertisements>
    <Contacts>
      <Contact Id="2">
        <ContactValue>homeforyou</ContactValue>
        <UserName>homeforyou@gmail.com</UserName>
        <ContactTypeName> Skype </ContactTypeName>
      </Contact>
    </Contacts>
  </ApplicationUser>
</ApplicationUsers>

XML skeem

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="ApplicationUsers">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" name="ApplicationUserDTO">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="UserName" type="xs:string" />
              <xs:element name="Advertisements">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element maxOccurs="unbounded" name="AdvertisementDTO">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="AdName" type="xs:string" />
                          <xs:element name="AdDescription" type="xs:string" />
                          <xs:element name="UserName" type="xs:string" />
                          <xs:element name="Location" type="xs:string" />
                          <xs:element name="JobCategory" type="xs:string" />
                          <xs:element name="CreationDate" type="xs:string" />
                          <xs:element maxOccurs="unbounded" minOccurs="0" name="AdvertisementPictureDTO">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="Location" type="xs:string" />
                                <xs:element name="AdvertisentId" type="xs:int" />
                              </xs:sequence>
                              <xs:attribute name="PictureId" type="xs:int" />
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                        <xs:attribute name="AdId" type="xs:int" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="Contacts">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element maxOccurs="unbounded" name="ContactDTO">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="ContactValue" type="xs:string" />
                          <xs:element name="UserName" type="xs:string" />
                          <xs:element name="ContactTypeName" type="xs:string" />
                        </xs:sequence>
                        <xs:attribute name="Id" type="xs:int" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="UserId" type="xs:string" />
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

XLS to HTML

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
  <xsl:output method="html" indent="yes"/>
  <xsl:template match="/ApplicationUsers">
    <html>
      <head>
        <title>Miisiiks</title>
        <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous"/>
      </head>
      <body>
        <h1>Advertisements</h1>
        <table border="1">
          <tr>
            <th>User</th>
            <th>Title</th>
            <th>Description</th>
            <th>Location</th>
            <th>Job Category</th>
            <th>Date Created</th>            
            <th>Pictures</th>
          </tr>
          <xsl:for-each select="ApplicationUserDTO/Advertisements/AdvertisementDTO">
            <tr>
              <td>
                <xsl:value-of select="UserName"/>
              </td>
              <td>
                <xsl:value-of select="AdName"/>
              </td>
              <td>
                <xsl:value-of select="AdDescription"/>
              </td>
              <td>
                <xsl:value-of select="Location"/>
              </td>
              <td>
                <xsl:value-of select="JobCategory"/>
              </td>
              <td>
                <xsl:value-of select="CreationDate"/>
              </td>
              <td>
                <xsl:choose>
                  <xsl:when test="0 = count(AdvertisementPictureDTO)">
                    No pictures
                  </xsl:when>
                  <xsl:otherwise>
                    <img alt="Advertisement picture" height="50" width="60">
                      <xsl:attribute name="src">
                        <xsl:value-of select="AdvertisementPictureDTO/Location"/>
                      </xsl:attribute>
                    </img>
                  </xsl:otherwise>
                </xsl:choose>
              </td>
            </tr>
          </xsl:for-each>
        </table>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

XLS to XML

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
<xsl:output method="xml" indent="yes"/>

<xsl:template match="/">
    <xsl:element name="ApplicationUsers">
		<xsl:for-each select="/ApplicationUsers/ApplicationUserDTO">
			<xsl:variable name="ApplicationUser" select="."/>
			<xsl:element name="ApplicationUser">
				<xsl:attribute name="UserId">
					<xsl:value-of select="@UserId"/>
				</xsl:attribute>
			<xsl:element name="UserName">
				<xsl:value-of select="UserName" />
			</xsl:element>
			<xsl:element name="Advertisements">
			<xsl:for-each select="$ApplicationUser/Advertisements/AdvertisementDTO">
				<xsl:variable name="AdvertisementDTO" select="."/>
					<xsl:element name="Advertisement">
					<xsl:attribute name="AdId">
						<xsl:value-of select="@AdId"/>
					</xsl:attribute>
					<xsl:element name="AdName">
						<xsl:value-of select="AdName"/>
					</xsl:element>
					<xsl:element name="AdDescription">
						<xsl:value-of select="AdDescription"/>
					</xsl:element>
					<xsl:element name="UserName">
						<xsl:value-of select="UserName"/>
					</xsl:element>
					<xsl:element name="Location">
						<xsl:value-of select="Location"/>
					</xsl:element>
					<xsl:element name="JobCategory">
						<xsl:value-of select="JobCategory"/>
					</xsl:element>
					<xsl:element name="CreationDate">
						<xsl:value-of select="CreationDate"/>
					</xsl:element>
						<xsl:for-each select="$ApplicationUser/Advertisements/AdvertisementDTO/AdvertisementPictureDTO">
							
							<xsl:element name="Pictures">
							<xsl:attribute name="PictureId">
								<xsl:value-of select="@PictureId"/>
							</xsl:attribute>
							<xsl:element name="Location">
								<xsl:value-of select="Location"/>
							</xsl:element>
							<xsl:element name="AdvertisementId">
								<xsl:value-of select="AdvertisementId"/>
							</xsl:element>
							</xsl:element>
						</xsl:for-each>
					</xsl:element>
			</xsl:for-each>
			</xsl:element>
			<xsl:element name="Contacts">
			<xsl:for-each select="$ApplicationUser/Contacts/ContactDTO">	
				<xsl:variable name="Contact" select="."/>
					<xsl:element name="Contact">
						<xsl:attribute name="Id">
							<xsl:value-of select="@Id"/>
						</xsl:attribute>

						<xsl:element name="ContactValue">
							<xsl:value-of select="ContactValue" />
						</xsl:element>

						<xsl:element name="UserName">
							<xsl:value-of select="UserName" />
						</xsl:element>

						<xsl:element name="ContactTypeName">
							<xsl:value-of select="ContactTypeName" />
						</xsl:element>
					</xsl:element>
			</xsl:for-each>
			</xsl:element>
			</xsl:element>
		</xsl:for-each>
    </xsl:element>
</xsl:template>
</xsl:stylesheet>