Laenutajad: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Ktonisma (talk | contribs)
No edit summary
Vlaats (talk | contribs)
Line 485: Line 485:
'''RegisterUser()''' - Kui kasutaja on sisestanud väljadesse kasutajanime, parooli ja emaili, siis luuakse uus kasutaja. Kui väljad on kõik tühjad siis kuvatakse veateade. <br />
'''RegisterUser()''' - Kui kasutaja on sisestanud väljadesse kasutajanime, parooli ja emaili, siis luuakse uus kasutaja. Kui väljad on kõik tühjad siis kuvatakse veateade. <br />
'''LoginUser()''' - Loob andmebaasiga ühenduse, saadab päringu, kus võrdleb kasutajanime, parooli. Sisse logides on igal kasutajal kindel id. <br />
'''LoginUser()''' - Loob andmebaasiga ühenduse, saadab päringu, kus võrdleb kasutajanime, parooli. Sisse logides on igal kasutajal kindel id. <br />
'''LogoutUser()''' - Kui vajutad pealehes log out nuppu, tagastab väärtuse true ehk toiming on õnnestunud. <br />
'''LogoutUser()''' - Kui vajutad pealehes "Log out" nuppu, tagastab väärtuse true ehk toiming on õnnestunud. Kuvatakse kasutajale uus login aken. <br />
'''DeleteUser()''' - Adminn saab kasutajaid kustutada. <br />
'''DeleteUser()''' - Administraator saab kasutajaid kustutada. <br />
'''UpdateUser()''' - Adminn saab kasutajaid uuendada. <br />
'''UpdateUser()''' - Administraator saab kasutajaid uuendada. <br />
'''List<User> GetAllUsers()''' - Tagastab listi useri andmetest läbi teenuse. <br />
'''List<User> GetAllUsers()''' - Tagastab listi kasutaja andmetest läbi teenuse. <br />
'''AddMovie()''' - Adminn saab lisada uusi filme, mis salvestatakse andmebaasi. <br />
'''AddMovie()''' - Administraator saab lisada uusi filme, mis salvestatakse andmebaasi. <br />
'''UpdateMovie()''' - Adminn saab andmbebaasis olevat filmi uuendada. <br />
'''UpdateMovie()''' - Administraator saab andmebaasis olevat filmi uuendada. <br />
'''DeleteMovie()''' - Adminn saab andmebaasis olevat filmi kustutada. <br />
'''DeleteMovie()''' - Administraator saab andmebaasis olevat filmi kustutada. <br />
'''GetAllMovies()''' - Tagastab listi filmidest läbi teenuse. <br />
'''GetAllMovies()''' - Tagastab listi filmidest läbi teenuse. <br />
'''List<Genre> GetAllGenres()''' - Tagastab filmitüüpide listi ja ühendab andmebaasiga. <br />
'''List<Genre> GetAllGenres()''' - Tagastab filmitüüpide listi ja ühendab andmebaasiga. <br />
Line 500: Line 500:
'''List<Movie> SearchMOvieByYear()''' - Tagastab listi andmebaasis olevatest filmidest aasta järgi, mis on parameetrites ära kirjeldatud.<br />
'''List<Movie> SearchMOvieByYear()''' - Tagastab listi andmebaasis olevatest filmidest aasta järgi, mis on parameetrites ära kirjeldatud.<br />
'''List<Movie> SearchMovieByDirector()''' - Tagastab listi andmebaasis olevatest filmidest režissööri järgi, mis on parameetrites ära kirjeldatud. <br />
'''List<Movie> SearchMovieByDirector()''' - Tagastab listi andmebaasis olevatest filmidest režissööri järgi, mis on parameetrites ära kirjeldatud. <br />
'''AddMovieToRent()''' - Ühendatakse teenusega ja saadetakse läbi teenuse andmebaasi andmed läbi teenuse data conracti. <br />
'''AddMovieToRent()''' - Lisatakse kasutaja poolt valitud film läbi id laenutusse. <br />
'''RemoveMovieInRent()''' - Kustutatakse parameetrites RemoveMovieInRent() olev renditud film id järgi. <br />
'''RemoveMovieInRent()''' - Kustutatakse parameetrites RemoveMovieInRent() olev renditud film id järgi. <br />
'''List<Rent> GetAllRentedMovies()''' - Tagastatakse list andmebaasis olevatest kõikidest renditud filmidest. <br />
'''List<Rent> GetAllRentedMovies()''' - Tagastatakse list andmebaasis olevatest kõikidest renditud filmidest. <br />

Revision as of 18:40, 30 May 2013

Meeskond

  • Kristjan Tõnismäe
  • Veiko Lääts
  • Andreas Plado
  • Xiangwei Zuo

Kirjeldus

Eesmärk on luua kodune filmide laenutus, kuhu peaks saama filme lisada ja vähemaks võtta. Lisaks on meil sisse ja välja logimise süsteem.

Visuaalne pool

Vaade meie hetkelisele projekti tulemusele asub siin.

XML fail

  <?xml version="1.0" encoding="UTF-8" ?> 
- <movieStore>
  - <movies>
    - <žanr>
      - <action>
        - <movie id="1" year="2012" language="en">
            <title>Skyfall</title> 
            <description>Bond's loyalty to M is tested when her past comes back to haunt her. Whilst MI6 comes under attack, 007 must track down and 
             destroy the threat, no matter how personal the cost.</description> 
            <director>Sam Mendes</director> 
          - <subtitles>
              <subtitle value="ru">ru</subtitle> 
              <subtitle value="fin">fin</subtitle> 
              <subtitle value="est">est</subtitle> 
            </subtitles>
          - <prices>
              <price-day value="4,5€" /> 
              <price-week value="7€" /> 
            </prices>
          </movie>
        - <movie id="2" year="2013" language="en">
            <title>Kick-Ass 2</title> 
            <description>The costumed high-school hero Kick-Ass joins with a group of normal citizens who have been inspired to fight crime in costume.</description> 
            <director>Jeff Wadlow</director> 
          - <subtitles>
              <subtitle value="ru">ru</subtitle> 
              <subtitle value="est">est</subtitle> 
            </subtitles>
          - <prices>
              <price-day value="1,5€" /> 
              <price-week value="4,4€" /> 
            </prices>
          </movie>
        - <movie id="3" year="2013" language="en">
            <title>Iron Man 3</title> 
            <description>When Tony Stark's world is torn apart by a formidable terrorist called the Mandarin, Stark starts an odyssey of rebuilding and retribution.</description> 
            <director>Shane Black</director> 
          - <subtitles>
              <subtitle value="ru">ru</subtitle> 
              <subtitle value="est">est</subtitle> 
            </subtitles>
          - <prices>
              <price-day value="1,5€" /> 
              <price-week value="3,4€" /> 
            </prices>
          </movie>
        - <movie id="4" year="2012" language="en">
           <title>The Dark Knight Rises</title> 
           <description>Eight years on, a new evil rises from where the Batman and Commissioner Gordon tried to bury it, causing the Batman to resurface and fight to protect Gotham City...</description> 
           <director>Christopher Nolan</director> 
         - <subtitles>
             <subtitle value="ru">ru</subtitle> 
             <subtitle value="est">est</subtitle> 
           </subtitles>
         - <prices>
             <price-day value="0,5€" /> 
             <price-week value="4€" /> 
           </prices>
         </movie>
       - <movie id="5" year="2012" language="en">
           <title>The Avengers</title> 
           <description>Nick Fury of S.H.I.E.L.D. brings together a team of super humans to form The Avengers to help save the Earth from Loki and his army.</description> 
           <director>Joss Whedon</director> 
         - <subtitles>
             <subtitle value="ru">ru</subtitle> 
             <subtitle value="est">est</subtitle> 
           </subtitles>
         - <prices>
             <price-day value="1,3€" /> 
             <price-week value="4,2€" /> 
           </prices>
         </movie>
       </action>
     - <horror>
       - <movie id="1" year="2013" language="en">
           <title>Evil Dead</title> 
           <description>Five friends head to a remote cabin, where the discovery of a Book of the Dead leads them to unwittingly summon up demons living in the nearby woods.</description> 
           <director>Fede Alvarez</director> 
         - <subtitles>
             <subtitle value="ru">ru</subtitle> 
             <subtitle value="est">est</subtitle> 
           </subtitles>
         - <prices>
             <price-day value="1€" /> 
             <price-week value="3€" /> 
           </prices>
         </movie>
       - <movie id="2" year="2013" language="en">
           <title>Mama</title> 
           <description>Annabel and Lucas are faced with the challenge of raising his young nieces that were left alone in the forest for 5 years....</description> 
           <director>Andrés Muschietti</director> 
         - <subtitles>
             <subtitle value="ru">ru</subtitle> 
             <subtitle value="est">est</subtitle> 
             <subtitle value="fin">fin</subtitle> 
           </subtitles>
         - <prices>
             <price-day value="3,5€" /> 
             <price-week value="6€" /> 
           </prices>
         </movie>
       - <movie id="3" year="2013" language="en">
           <title>Hansel and Gretel: Witch Hunters</title> 
           <description>In this spin on the fairy tale, Hansel and Gretel are now bounty hunters who track and kill witches all over the world.</description> 
           <director>Tommy Wirkola</director> 
         - <subtitles>
             <subtitle value="ru">ru</subtitle> 
             <subtitle value="est">est</subtitle> 
           </subtitles>
         - <prices>
             <price-day value="1,5€" /> 
             <price-week value="4€" /> 
           </prices>
         </movie>
       - <movie id="4" year="2012" language="en">
           <title>Comedown</title> 
           <description>Six friends who turn the deserted the tower block they lived in as kids into a pirate radio station soon learn they are not alone, as a resident psychopath begins hunting them down.</description> 
           <director>Menhaj Huda</director> 
         - <subtitles>
             <subtitle value="ru">ru</subtitle> 
             <subtitle value="est">est</subtitle> 
           </subtitles>
         - <prices>
             <price-day value="2,5€" /> 
             <price-week value="7€" /> 
           </prices>
         </movie>
       - <movie id="5" year="2007" language="ru">
           <title>Captivity</title> 
           <description>The film centers on two people who have been abducted and driven mad.</description> 
           <director>Roland Joffé</director> 
       - <subtitles>
           <subtitle value="en" /> 
           <subtitle value="es" /> 
         </subtitles>
       - <prices>
           <price-day value="1,5€" /> 
           <price-week value="4€" /> 
         </prices>
       </movie>
     </horror>
   - <comedy>
     - <movie id="1" year="2013" language="en">
         <title>Õnneteraapia</title> 
         <description>After a stint in a mental institution, former teacher Pat Solitano moves back in with his parents and tries to reconcile with his ex-wife.</description> 
         <director>David O. Russell</director> 
       - <subtitles>
           <subtitle value="ru">ru</subtitle> 
           <subtitle value="est">est</subtitle> 
         </subtitles>
       - <prices>
           <price-day value="1,5€" /> 
           <price-week value="4€" /> 
         </prices>
       </movie>
     - <movie id="2" year="2013" language="en">
         <title>Identity Thief</title> 
         <description>Mild-mannered businessman Sandy Patterson travels from Denver to Miami to confront the deceptively harmless-looking woman who has been living it up after stealing Sandy's identity.</description> 
         <director>Seth Gordon</director> 
       - <subtitles>
           <subtitle value="ru">ru</subtitle> 
           <subtitle value="est">est</subtitle> 
         </subtitles>
       - <prices>
           <price-day value="1,5€" /> 
           <price-week value="4€" /> 
         </prices>
       </movie>
     - <movie id="3" year="2013" language="en">
         <title>Kick-Ass 2</title> 
         <description>The costumed high-school hero Kick-Ass joins with a group of normal citizens who have been inspired to fight crime in costume.</description> 
         <director>Jeff Wadlow</director> 
       - <subtitles>
           <subtitle value="ru">ru</subtitle> 
           <subtitle value="est">est</subtitle> 
         </subtitles>
       - <prices>
           <price-day value="2€" /> 
           <price-week value="6,5€" /> 
         </prices>
       </movie>
     - <movie id="4" year="2013" language="en">
         <title>Warm Bodies</title> 
         <description>After R (a highly unusual zombie) saves Julie from an attack, the two form a relationship that sets in motion a sequence of events that might transform the entire lifeless world.</description> 
         <director>Jonathan Levine</director> 
       - <subtitles>
           <subtitle value="ru">ru</subtitle> 
           <subtitle value="est">est</subtitle> 
         </subtitles>
       - <prices>
           <price-day value="0,5€" /> 
           <price-week value="4€" /> 
         </prices>
       </movie>
     - <movie id="5" year="2009" language="en">
         <title>He's Just Not That Into You</title> 
         <description>The Baltimore-set movie of interconnecting story arcs deals with the challenges of reading or misreading human behavior.</description> 
         <director>Ken Kwapis</director> 
       - <subtitles>
           <subtitle value="ru">ru</subtitle> 
           <subtitle value="est">est</subtitle> 
         </subtitles>
       - <prices>
           <price-day value="4,5€" /> 
           <price-week value="9€" /> 
         </prices>
       </movie>
      </comedy>
    </žanr>
  </movies>
</movieStore>

Stiilifail

Siin kuvatakse kõik filmid

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

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:output method="html"/>
	
	<xsl:template match="/">
	<html>
	    <body>
		 <h1>Movie Store</h1>
	         <h4>Action Movies</h4>
		  <table border="1" width="70%" >
		      <tr bgcolor="#82B4B4">
			 <td>Title</td>
		         <td>Description</td>
			 <td>Subtitles</td>
			 <td>Director</td>
			 <td>Prices</td>
		      </tr>
		       <xsl:for-each select="movieStore/movies/žanr/action/movie">
		          <tr>
		            <td style="width:15%;">
			        <xsl:value-of select="title"/>
			    </td>
			    <td>
			        <xsl:value-of select="description"/>
		            </td>
		            <td>
			        <xsl:for-each select="subtitles/subtitle">
			        <li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
			        </xsl:for-each>
			    </td>
		            <td  style="width:10%;">
			        <li style="list-style-type: none;"><xsl:value-of select="director"/></li>
                            </td>
			    <td style="width:10%;" >
                              <xsl:for-each select="prices/price-day">
			        <em>For Day:</em>
			         <li style="list-style-type: none; text-align:center;"><xsl:value-of select="@value"/></li>
			      </xsl:for-each>
			     <xsl:for-each select="prices/price-week">
                                <em>For Week:</em>
                                <li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
		              </xsl:for-each>
                            </td>
	                  </tr>
                        </xsl:for-each>
		  </table>
                  <h4>Horror Movies</h4>
		  <table border="1" width="70%" >
		      <tr bgcolor="#82B4B4">
			 <td>Title</td>
		         <td>Description</td>
			 <td>Subtitles</td>
			 <td>Director</td>
			 <td>Prices</td>
		      </tr>
		       <xsl:for-each select="movieStore/movies/žanr/horror/movie">
		          <tr>
		            <td style="width:15%;">
			        <xsl:value-of select="title"/>
			    </td>
			    <td>
			        <xsl:value-of select="description"/>
		            </td>
		            <td>
			        <xsl:for-each select="subtitles/subtitle">
			        <li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
			        </xsl:for-each>
			    </td>
		            <td  style="width:10%;">
			        <li style="list-style-type: none;"><xsl:value-of select="director"/></li>
                            </td>
			    <td style="width:10%;" >
                              <xsl:for-each select="prices/price-day">
			        <em>For Day:</em>
			         <li style="list-style-type: none; text-align:center;"><xsl:value-of select="@value"/></li>
			      </xsl:for-each>
			     <xsl:for-each select="prices/price-week">
                                <em>For Week:</em>
                                <li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
		              </xsl:for-each>
                            </td>
	                  </tr>
                        </xsl:for-each>
		  </table>
	         <h4>Comedy Movies</h4>
		  <table border="1" width="70%" >
		      <tr bgcolor="#82B4B4">
			 <td>Title</td>
		         <td>Description</td>
			 <td>Subtitles</td>
			 <td>Director</td>
			 <td>Prices</td>
		      </tr>
		       <xsl:for-each select="movieStore/movies/žanr/comedy/movie">
		          <tr>
		            <td style="width:15%;">
			        <xsl:value-of select="title"/>
			    </td>
			    <td>
			        <xsl:value-of select="description"/>
		            </td>
		            <td>
			        <xsl:for-each select="subtitles/subtitle">
			        <li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
			        </xsl:for-each>
			    </td>
		            <td  style="width:10%;">
			        <li style="list-style-type: none;"><xsl:value-of select="director"/></li>
                            </td>
			    <td style="width:10%;" >
                              <xsl:for-each select="prices/price-day">
			        <em>For Day:</em>
			         <li style="list-style-type: none; text-align:center;"><xsl:value-of select="@value"/></li>
			      </xsl:for-each>
			     <xsl:for-each select="prices/price-week">
                                <em>For Week:</em>
                                <li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
		              </xsl:for-each>
                            </td>
	                  </tr>
                        </xsl:for-each>
		  </table>
	    </body>
       </html>
</xsl:template>
</xsl:stylesheet>

Skeemifail

<!ELEMENT movieStore  ( movies )>

<!ELEMENT movies  ( žanr )>

<!ELEMENT žanr  ( action , horror , comedy )>

<!ELEMENT comedy  ( movie+ )>

<!ELEMENT movie  ( title , description , director , subtitles , prices )>
<!ATTLIST movie
id CDATA #REQUIRED
year CDATA #REQUIRED
language CDATA #REQUIRED
>

<!ELEMENT prices  ( price-day+ , price-week? )>

<!ELEMENT price-week  EMPTY>
<!ATTLIST price-week
value CDATA #REQUIRED
>

<!ELEMENT price-day  EMPTY>
<!ATTLIST price-day
value CDATA #REQUIRED
>

<!ELEMENT subtitles  ( subtitle+ )>

<!ELEMENT subtitle  ( #PCDATA )>
<!ATTLIST subtitle
value CDATA #REQUIRED
>

<!ELEMENT director  ( #PCDATA )>

<!ELEMENT description  ( #PCDATA )>

<!ELEMENT title  ( #PCDATA )>

<!ELEMENT horror  ( movie+ )>

<!ELEMENT movie  ( title , description , director , subtitles , prices )>
<!ATTLIST movie
id CDATA #REQUIRED
year CDATA #REQUIRED
language CDATA #REQUIRED
>

<!ELEMENT prices  ( price-day , price-week )>

<!ELEMENT price-week  EMPTY>
<!ATTLIST price-week
value CDATA #REQUIRED
>

<!ELEMENT price-day  EMPTY>
<!ATTLIST price-day
value CDATA #REQUIRED
>

<!ELEMENT subtitles  ( subtitle+ )>

<!ELEMENT subtitle  ( #PCDATA )>
<!ATTLIST subtitle
value CDATA #REQUIRED
>

<!ELEMENT director  ( #PCDATA )>

<!ELEMENT description  ( #PCDATA )>

<!ELEMENT title  ( #PCDATA )>

<!ELEMENT action  ( movie+ )>

<!ELEMENT movie  ( title , description , director , subtitles , prices )>
<!ATTLIST movie
id CDATA #REQUIRED
year CDATA #REQUIRED
language CDATA #REQUIRED
>

<!ELEMENT prices  ( price-day , price-week )>

<!ELEMENT price-week  EMPTY>
<!ATTLIST price-week
value CDATA #REQUIRED
>

<!ELEMENT price-day  EMPTY>
<!ATTLIST price-day
value CDATA #REQUIRED
>

<!ELEMENT subtitles  ( subtitle+ )>

<!ELEMENT subtitle  ( #PCDATA )>
<!ATTLIST subtitle
value CDATA #REQUIRED
>

<!ELEMENT director  ( #PCDATA )>

<!ELEMENT description  ( #PCDATA )>

<!ELEMENT title  ( #PCDATA )>

Klientrakendus

Kasutab teenuse meetodeid, teeb andmebaasi päringuid(võtab anbmebaasist infot, sisestab andmebaasi infot). Teeb mitte servererist sõltumatuid tingimuste kontrolle, lisab programmile interaktiivsema(kasutajaga suhtlevama) funktsionaalsuse.
Administraatoril on omad privileegid, tema on kogu süsteemi haldaja. Tal on võimalik lisada kasutajaid, neid kustutada ja muuta olemasolevate kasutajate infot. Lisaks võib ta lisada filme, neid kustutada ja muuta olemasolevate filmide infot. Veel saab ta otsida filme ja kasutajaid.
Kasutaja saab filme rentida, teostada filmide otsingut ja registreerida ennast kasutajaks. Ta saab ennast süsteemi sisse ja välja logida.

Teenuse meetodid

RegisterUser() - Kui kasutaja on sisestanud väljadesse kasutajanime, parooli ja emaili, siis luuakse uus kasutaja. Kui väljad on kõik tühjad siis kuvatakse veateade.
LoginUser() - Loob andmebaasiga ühenduse, saadab päringu, kus võrdleb kasutajanime, parooli. Sisse logides on igal kasutajal kindel id.
LogoutUser() - Kui vajutad pealehes "Log out" nuppu, tagastab väärtuse true ehk toiming on õnnestunud. Kuvatakse kasutajale uus login aken.
DeleteUser() - Administraator saab kasutajaid kustutada.
UpdateUser() - Administraator saab kasutajaid uuendada.
List<User> GetAllUsers() - Tagastab listi kasutaja andmetest läbi teenuse.
AddMovie() - Administraator saab lisada uusi filme, mis salvestatakse andmebaasi.
UpdateMovie() - Administraator saab andmebaasis olevat filmi uuendada.
DeleteMovie() - Administraator saab andmebaasis olevat filmi kustutada.
GetAllMovies() - Tagastab listi filmidest läbi teenuse.
List<Genre> GetAllGenres() - Tagastab filmitüüpide listi ja ühendab andmebaasiga.
GetUserCount() - Võtab klassist StatisticMethods() meetodi GetUserCount() ja tagastab väärtuse andmebaasis olevate kasutajate arvu kohta.
GetMovieCount() - Võtab klassist StatisticMethods() meetodi GetMovieCount() ja tagastab väärtuse andmebaasis olevate filmide arvu kohta.
List<Movie> SearchMovie() - Tagastab listi andmebaasis olevatest filmidest, mis on parameetrites ära kirjeldatud.
List<Movie> SearchMovieByGenre() - Tagastab listi andmebaasis olevatest filmidest tüübi järgi, mis on parameetrites ära kirjeldatud.
List<Movie> SearchMOvieByYear() - Tagastab listi andmebaasis olevatest filmidest aasta järgi, mis on parameetrites ära kirjeldatud.
List<Movie> SearchMovieByDirector() - Tagastab listi andmebaasis olevatest filmidest režissööri järgi, mis on parameetrites ära kirjeldatud.
AddMovieToRent() - Lisatakse kasutaja poolt valitud film läbi id laenutusse.
RemoveMovieInRent() - Kustutatakse parameetrites RemoveMovieInRent() olev renditud film id järgi.
List<Rent> GetAllRentedMovies() - Tagastatakse list andmebaasis olevatest kõikidest renditud filmidest.
List<Rent> GetRentedMoviesByUserName() - Tagastatakse list andmebaasis olevatest kõikidest renditud filmidest kasutaja id järgi.

Log

21.märts 2013

  • Kokkusaamine

23.märts 2013

  • Wiki lehe loomine, XML faili, stiilifaili ja skeemifaili lisamine.

30.märts 2013

  • Tegime XML-i retsensiooni meeskonnale GOW.