Miisiiks: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Caruste (talk | contribs)
Caruste (talk | contribs)
Line 265: Line 265:
<source lang="xml">
<source lang="xml">


<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
<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"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
Line 307: Line 308:
                 </xsl:element>
                 </xsl:element>
                 <xsl:for-each select="$ApplicationUser/Advertisements/AdvertisementDTO/AdvertisementPictureDTO">
                 <xsl:for-each select="$ApplicationUser/Advertisements/AdvertisementDTO/AdvertisementPictureDTO">
 
                  <xsl:variable name="Advertisement" select="."/>
                   <xsl:element name="Pictures">
                   <xsl:element name="Picture">
                     <xsl:attribute name="PictureId">
                     <xsl:attribute name="PictureId">
                       <xsl:value-of select="@PictureId"/>
                       <xsl:value-of select="@PictureId"/>
Line 350: Line 351:
   </xsl:template>
   </xsl:template>
</xsl:stylesheet>
</xsl:stylesheet>


</source>
</source>

Revision as of 09:09, 2 June 2018

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

<ApplicationUsers>
  <ApplicationUserDTO UserId="296a7683-be8d-45e1-9b9d-6b7e1aa4657d">
    <UserName><![CDATA[workers@hotmail.com]]></UserName>
    <Advertisements>
      <AdvertisementDTO AdId="1">
        <AdName><![CDATA[Looking for a truck driver]]></AdName>
        <AdDescription><![CDATA[I am looking for a truck driver to help me move to another town. For more information send a message.]]></AdDescription>
        <UserName><![CDATA[workers@hotmail.com]]></UserName>
        <Location><![CDATA[Tallinn, Mustamäe]]></Location>
        <JobCategory> Driving </JobCategory>
        <CreationDate> 01.06.2018 </CreationDate>
        <AdvertisementPictureDTO PictureId="1">
          <Location><![CDATA[https://i1.wp.com/movingtips.wpengine.com/wp-content/uploads/2017/10/large-moving-truck.jpg?fit=1024%2C683&ssl=1]]></Location>
          <AdvertisementId> 1 </AdvertisementId>
        </AdvertisementPictureDTO>

        <AdvertisementPictureDTO PictureId="2">
          <Location><![CDATA[https://www.southernoak.com/v2/wp-content/uploads/2016/05/Moving-Day.jpg]]></Location>
          <AdvertisementId> 1 </AdvertisementId>
        </AdvertisementPictureDTO>
      </AdvertisementDTO>
    </Advertisements>
    <Contacts>
      <ContactDTO Id="1">
        <ContactValue><![CDATA[Miisiks]]></ContactValue>
        <UserName><![CDATA[workers@hotmail.com]]></UserName>
        <ContactTypeName> Skype </ContactTypeName>
      </ContactDTO>
    </Contacts>
  </ApplicationUserDTO>

  <ApplicationUserDTO UserId="2460d33a-3505-4844-b8c8-2b7e0ece6a70">
    <UserName><![CDATA[homeforyou@gmail.com]]></UserName>
    <Advertisements>
      <AdvertisementDTO AdId="3">
        <AdName><![CDATA[Need a home assistant]]></AdName>
        <AdDescription><![CDATA[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><![CDATA[homeforyou@gmail.com]]></UserName>
        <Location><![CDATA[Pärnumaa, Sauga]]></Location>
        <JobCategory> Cleaning</JobCategory>
        <CreationDate> 12.02.2018 </CreationDate>
        <AdvertisementPictureDTO PictureId="3">
          <Location><![CDATA[https://s3-media4.fl.yelpcdn.com/bphoto/fWxU8tYpD3ddC7UtSKXA7A/o.jpg]]></Location>
          <AdvertisementId> 3 </AdvertisementId>
        </AdvertisementPictureDTO>

        <AdvertisementPictureDTO PictureId="4">
          <Location><![CDATA[http://whatdoimakenow.com/wp-content/uploads/2017/05/Messy-House-Project-Kitchen-Before-Stove-e1495030958246.jpg]]></Location>
          <AdvertisementId> 3 </AdvertisementId>
        </AdvertisementPictureDTO>

        <AdvertisementPictureDTO PictureId="5">
          <Location><![CDATA[http://www.gardenplansireland.com/forum/files/garden_123.jpg]]></Location>
          <AdvertisementId> 3 </AdvertisementId>
        </AdvertisementPictureDTO>

        <AdvertisementPictureDTO PictureId="6">
          <Location><![CDATA[https://wshg.net/wp-content/uploads/2014/05/GardenDilemmas_B_WHG13A.jpg]]></Location>
          <AdvertisementId> 3 </AdvertisementId>
        </AdvertisementPictureDTO>
      </AdvertisementDTO>
      <AdvertisementDTO AdId="4">
        <AdName><![CDATA[Fixing a roof]]></AdName>
        <AdDescription><![CDATA[Need help with fixing a roof. Please message for more information]]></AdDescription>
        <UserName><![CDATA[homeforyou@gmail.com]]></UserName>
        <Location><![CDATA[Pärnumaa, Sauga]]></Location>
        <JobCategory>Construction</JobCategory>
        <CreationDate> 01.06.2018 </CreationDate>
      </AdvertisementDTO>

    </Advertisements>
    <Contacts>
      <ContactDTO Id="2">
        <ContactValue><![CDATA[homeforyou]]></ContactValue>>
        <UserName><![CDATA[homeforyou@gmail.com]]></UserName>
        <ContactTypeName> Skype </ContactTypeName>
      </ContactDTO>
    </Contacts>
  </ApplicationUserDTO>
</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:variable name="Advertisement" select="."/>
                  <xsl:element name="Picture">
                    <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>