Miisiiks: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Hmalkov (talk | contribs)
Caruste (talk | contribs)
Line 287: Line 287:


<xsl:template match="/">
<xsl:template match="/">
     <xsl:element name="ApplicationUserDTO">
     <xsl:element name="ApplicationUsers">
<xsl:for-each select="/ApplicationUserDTO/ApplicationUserDTO">
<xsl:for-each select="/ApplicationUsers/ApplicationUserDTO">
<xsl:variable name="ApplicationUser" select="."/>
<xsl:variable name="ApplicationUser" select="."/>
<xsl:element name="ApplicationUser">
<xsl:element name="ApplicationUser">
Line 298: Line 298:
</xsl:element>
</xsl:element>
<xsl:element name="Advertisements">
<xsl:element name="Advertisements">
<xsl:for-each select="$ApplicationUser/Advertisements">
<xsl:for-each select="$ApplicationUser/Advertisements/AdvertisementDTO">
<xsl:variable name="AdvertisementDTO" select="."/>
<xsl:variable name="AdvertisementDTO" select="."/>
<xsl:element name="Advertisement">
<xsl:element name="Advertisement">
Line 322: Line 322:
<xsl:value-of select="CreationDate"/>
<xsl:value-of select="CreationDate"/>
</xsl:element>
</xsl:element>
<xsl:for-each select="$ApplicationUser/Advertisements/AdvertisementPicture">
<xsl:for-each select="$ApplicationUser/Advertisements/AdvertisementDTO/AdvertisementPictureDTO">
<xsl:attribute name="PictureId">
<xsl:attribute name="PictureId">
<xsl:value-of select="PictureId"/>
<xsl:value-of select="PictureId"/>
Line 339: Line 339:
</xsl:for-each>
</xsl:for-each>
</xsl:element>
</xsl:element>
<xsl:for-each select="$ApplicationUser/Contact">
<xsl:for-each select="$ApplicationUser">
<xsl:variable name="Contacts" select="."/>
<xsl:variable name="ContactDTO" select="."/>
<xsl:element name="Contact">
<xsl:element name="Contact">
<xsl:attribute name="Id">
<xsl:element name="Id">
<xsl:value-of select="Id"/>
<xsl:value-of select="Id"/>
</xsl:attribute>
</xsl:element >
<xsl:element name="ContactValue">
<xsl:element name="ContactValue">
<xsl:value-of select="ContactValue"/>
<xsl:value-of select="ContactValue"/>
Line 361: Line 361:
</xsl:template>
</xsl:template>
</xsl:stylesheet>
</xsl:stylesheet>


</source>
</source>

Revision as of 08:20, 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

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

<ApplicationUsers>
	<ApplicationUserDTO>
		<UserId> 296a7683-be8d-45e1-9b9d-6b7e1aa4657d </UserId>
		<UserName><![CDATA[workers@hotmail.com]]></UserName>
		<Advertisements>
			<AdvertisementDTO>
				<AdId>1</AdId>
				<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</PictureId>
					<Location><![CDATA[https://i1.wp.com/movingtips.wpengine.com/wp-content/uploads/2017/10/large-moving-truck.jpg?fit=1024%2C683&ssl=1]]></Location>
					<AdvertisentId> 1 </AdvertisentId>
				</AdvertisementPictureDTO>
		
				<AdvertisementPictureDTO> 
					<PictureId>2</PictureId>
					<Location><![CDATA[https://www.southernoak.com/v2/wp-content/uploads/2016/05/Moving-Day.jpg]]></Location>
					<AdvertisentId> 1 </AdvertisentId>
				</AdvertisementPictureDTO>
			</AdvertisementDTO>
		</Advertisements>
		<Contacts>
			<ContactDTO>
				<Id> 1 </Id>
				<ContactValue><![CDATA[Miisiks]]></ContactValue>
				<UserName><![CDATA[workers@hotmail.com]]></UserName>
				<ContactTypeName> Skype </ContactTypeName>
			</ContactDTO>
        </Contacts>
	</ApplicationUserDTO>	
	
	<ApplicationUserDTO>
		<UserId> 2460d33a-3505-4844-b8c8-2b7e0ece6a70 </UserId>
		<UserName><![CDATA[homeforyou@gmail.com]]></UserName>
		<Advertisements>
			<AdvertisementDTO>
				<AdId>3</AdId>
				<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</PictureId>
					<Location><![CDATA[https://s3-media4.fl.yelpcdn.com/bphoto/fWxU8tYpD3ddC7UtSKXA7A/o.jpg]]></Location>
					<AdvertisentId> 3 </AdvertisentId>
				</AdvertisementPictureDTO>
		
				<AdvertisementPictureDTO> 
					<PictureId>4</PictureId>
					<Location><![CDATA[http://whatdoimakenow.com/wp-content/uploads/2017/05/Messy-House-Project-Kitchen-Before-Stove-e1495030958246.jpg]]></Location>
					<AdvertisentId> 3 </AdvertisentId>
				</AdvertisementPictureDTO>

				<AdvertisementPictureDTO> 
					<PictureId>5</PictureId>
					<Location><![CDATA[http://www.gardenplansireland.com/forum/files/garden_123.jpg]]></Location>
					<AdvertisentId> 3 </AdvertisentId>
				</AdvertisementPictureDTO>
		
				<AdvertisementPictureDTO> 
					<PictureId>6</PictureId>
					<Location><![CDATA[https://wshg.net/wp-content/uploads/2014/05/GardenDilemmas_B_WHG13A.jpg]]></Location>
					<AdvertisentId> 3 </AdvertisentId>
				</AdvertisementPictureDTO>
			</AdvertisementDTO>
			<AdvertisementDTO>
        				<AdId>4</AdId>
        				<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 </Id>
				<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="UserId" type="xs:string" />
              <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="AdId" type="xs:int" />
                          <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="PictureId" type="xs:int" />
                                <xs:element name="Location" type="xs:string" />
                                <xs:element name="AdvertisentId" type="xs:int" />
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </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="Id" type="xs:int" />
                          <xs:element name="ContactValue" type="xs:string" />
                          <xs:element name="UserName" type="xs:string" />
                          <xs:element name="ContactTypeName" type="xs:string" />
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </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="@id"/>
				</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:attribute name="PictureId">
								<xsl:value-of select="PictureId"/>
							</xsl:attribute>
							<xsl:element name="AdName">
								<xsl:value-of select="AdName"/>
							</xsl:element>
							<xsl:element name="Location">
								<xsl:value-of select="Location"/>
							</xsl:element>
							<xsl:element name="AdvertisentId">
								<xsl:value-of select="AdvertisentId"/>
							</xsl:element>
						</xsl:for-each>
					</xsl:element>
			</xsl:for-each>
			</xsl:element>
			<xsl:for-each select="$ApplicationUser">	
				<xsl:variable name="ContactDTO" select="."/>
					<xsl:element name="Contact">
						<xsl:element name="Id">
							<xsl:value-of select="Id"/>
						</xsl:element >
						<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:for-each>
    </xsl:element>
</xsl:template>
</xsl:stylesheet>