Laenutajad: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Ktonisma (talk | contribs)
Ktonisma (talk | contribs)
 
(74 intermediate revisions by 2 users not shown)
Line 3: Line 3:
* Kristjan Tõnismäe  
* Kristjan Tõnismäe  
* Veiko Lääts
* Veiko Lääts
* Andreas Plado
* Xiangwei Zuo


== Kirjeldus ==
== Kirjeldus ==


Eesmärk on luua kodune filmide laenutus.
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 [http://enos.itcollege.ee/~ktonisma/vorgurakendused%20II/moviestore1.htm siin].


=== XML fail ===
=== XML fail ===
<source lang="xml">
<source lang="xml">
   <?xml version="1.0" encoding="UTF-8" ?>  
   <?xml version="1.0" encoding="UTF-8" ?>  
- <!--  New document created with EditiX XML Editor (http://www.editix.com) at Sat Mar 23 07:59:36 EET 2013
  -->
- <movieStore>
- <movieStore>
   - <movies>
   - <movies>
Line 27: Line 31:
               <subtitle value="est">est</subtitle>  
               <subtitle value="est">est</subtitle>  
             </subtitles>
             </subtitles>
- <prices>
          - <prices>
  <price-day value="1,5€" />  
              <price-day value="4,5€" />  
  <price-week value="4€" />  
              <price-week value="7€" />  
  </prices>
            </prices>
  </movie>
          </movie>
- <movie id="2" year="2013" language="en">
        - <movie id="2" year="2013" language="en">
  <title>Kick-Ass 2</title>  
            <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>  
            <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>  
            <director>Jeff Wadlow</director>  
- <subtitles>
          - <subtitles>
  <subtitle value="ru">ru</subtitle>  
              <subtitle value="ru">ru</subtitle>  
  <subtitle value="est">est</subtitle>  
              <subtitle value="est">est</subtitle>  
  </subtitles>
            </subtitles>
- <prices>
          - <prices>
  <price-day value="2,5€" />  
              <price-day value="1,5€" />  
  <price-week value="4,4€" />  
              <price-week value="4,4€" />  
  </prices>
            </prices>
  </movie>
          </movie>
- <movie id="3" year="2013" language="en">
        - <movie id="3" year="2013" language="en">
  <title>Iron Man 3</title>  
            <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>  
            <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>  
            <director>Shane Black</director>  
- <subtitles>
          - <subtitles>
  <subtitle value="ru">ru</subtitle>  
              <subtitle value="ru">ru</subtitle>  
  <subtitle value="est">est</subtitle>  
              <subtitle value="est">est</subtitle>  
  </subtitles>
            </subtitles>
- <prices>
          - <prices>
  <price-day value="1€" />  
              <price-day value="1,5€" />  
  <price-week value="3,4€" />  
              <price-week value="3,4€" />  
  </prices>
            </prices>
  </movie>
          </movie>
- <movie id="4" year="2012" language="en">
        - <movie id="4" year="2012" language="en">
  <title>The Dark Knight Rises</title>  
          <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>  
          <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>  
          <director>Christopher Nolan</director>  
- <subtitles>
        - <subtitles>
  <subtitle value="ru">ru</subtitle>  
            <subtitle value="ru">ru</subtitle>  
  <subtitle value="est">est</subtitle>  
            <subtitle value="est">est</subtitle>  
  </subtitles>
          </subtitles>
- <prices>
        - <prices>
  <price-day value="1,5€" />  
            <price-day value="0,5€" />  
  <price-week value="4€" />  
            <price-week value="4€" />  
  </prices>
          </prices>
  </movie>
        </movie>
- <movie id="5" year="2012" language="en">
      - <movie id="5" year="2012" language="en">
  <title>The Avengers</title>  
          <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>  
          <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>  
          <director>Joss Whedon</director>  
- <subtitles>
        - <subtitles>
  <subtitle value="ru">ru</subtitle>  
            <subtitle value="ru">ru</subtitle>  
  <subtitle value="est">est</subtitle>  
            <subtitle value="est">est</subtitle>  
  </subtitles>
          </subtitles>
- <prices>
        - <prices>
  <price-day value="1,3€" />  
            <price-day value="1,3€" />  
  <price-week value="4,4€" />  
            <price-week value="4,2€" />  
  </prices>
          </prices>
  </movie>
        </movie>
  </action>
      </action>
- <horror>
    - <horror>
- <movie id="1" year="2013" language="en">
      - <movie id="1" year="2013" language="en">
  <title>Evil Dead</title>  
          <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>  
          <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>  
          <director>Fede Alvarez</director>  
- <subtitles>
        - <subtitles>
  <subtitle value="ru">ru</subtitle>  
            <subtitle value="ru">ru</subtitle>  
  <subtitle value="est">est</subtitle>  
            <subtitle value="est">est</subtitle>  
  </subtitles>
          </subtitles>
- <prices>
        - <prices>
  <price-day value="1€" />  
            <price-day value="1€" />  
  <price-week value="3€" />  
            <price-week value="3€" />  
  </prices>
          </prices>
  </movie>
        </movie>
- <movie id="2" year="2013" language="en">
      - <movie id="2" year="2013" language="en">
  <title>Mama</title>  
          <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>  
          <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>  
          <director>Andrés Muschietti</director>  
- <subtitles>
        - <subtitles>
  <subtitle value="ru">ru</subtitle>  
            <subtitle value="ru">ru</subtitle>  
  <subtitle value="est">est</subtitle>  
            <subtitle value="est">est</subtitle>  
  <subtitle value="fin">fin</subtitle>  
            <subtitle value="fin">fin</subtitle>  
  </subtitles>
          </subtitles>
- <prices>
        - <prices>
  <price-day value="3,5€" />  
            <price-day value="3,5€" />  
  <price-week value="6€" />  
            <price-week value="6€" />  
  </prices>
          </prices>
  </movie>
        </movie>
- <movie id="3" year="2013" language="en">
      - <movie id="3" year="2013" language="en">
  <title>Hansel and Gretel: Witch Hunters</title>  
          <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>  
          <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>  
          <director>Tommy Wirkola</director>  
- <subtitles>
        - <subtitles>
  <subtitle value="ru">ru</subtitle>  
            <subtitle value="ru">ru</subtitle>  
  <subtitle value="est">est</subtitle>  
            <subtitle value="est">est</subtitle>  
  </subtitles>
          </subtitles>
- <prices>
        - <prices>
  <price-day value="1,5€" />  
            <price-day value="1,5€" />  
  <price-week value="4€" />  
            <price-week value="4€" />  
  </prices>
          </prices>
  </movie>
        </movie>
- <movie id="4" year="2012" language="en">
      - <movie id="4" year="2012" language="en">
  <title>Comedown</title>  
          <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>  
          <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>  
          <director>Menhaj Huda</director>  
- <subtitles>
        - <subtitles>
  <subtitle value="ru">ru</subtitle>  
            <subtitle value="ru">ru</subtitle>  
  <subtitle value="est">est</subtitle>  
            <subtitle value="est">est</subtitle>  
  </subtitles>
          </subtitles>
- <prices>
        - <prices>
  <price-day value="3,5€" />  
            <price-day value="2,5€" />  
  <price-week value="7€" />  
            <price-week value="7€" />  
  </prices>
          </prices>
  </movie>
        </movie>
- <movie id="5" year="2007" language="ru">
      - <movie id="5" year="2007" language="ru">
  <title>Captivity</title>  
          <title>Captivity</title>  
  <description>The film centers on two people who have been abducted and driven mad.</description>  
          <description>The film centers on two people who have been abducted and driven mad.</description>  
  <director>Roland Joffé</director>  
          <director>Roland Joffé</director>  
- <subtitles>
      - <subtitles>
  <subtitle value="en" />  
          <subtitle value="en" />  
  <subtitle value="es" />  
          <subtitle value="es" />  
  </subtitles>
        </subtitles>
- <prices>
      - <prices>
  <price-day value="1,5€" />  
          <price-day value="1,5€" />  
  <price-week value="4€" />  
          <price-week value="4€" />  
  </prices>
        </prices>
  </movie>
      </movie>
  </horror>
    </horror>
- <comedy>
  - <comedy>
- <movie id="1" year="2013" language="en">
    - <movie id="1" year="2013" language="en">
  <title>Õnneteraapia</title>  
        <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>  
        <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>  
        <director>David O. Russell</director>  
- <subtitles>
      - <subtitles>
  <subtitle value="ru">ru</subtitle>  
          <subtitle value="ru">ru</subtitle>  
  <subtitle value="est">est</subtitle>  
          <subtitle value="est">est</subtitle>  
  </subtitles>
        </subtitles>
- <prices>
      - <prices>
  <price-day value="1,5€" />  
          <price-day value="1,5€" />  
  <price-week value="4€" />  
          <price-week value="4€" />  
  </prices>
        </prices>
  </movie>
      </movie>
- <movie id="2" year="2013" language="en">
    - <movie id="2" year="2013" language="en">
  <title>Identity Thief</title>  
        <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>  
        <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>  
        <director>Seth Gordon</director>  
- <subtitles>
      - <subtitles>
  <subtitle value="ru">ru</subtitle>  
          <subtitle value="ru">ru</subtitle>  
  <subtitle value="est">est</subtitle>  
          <subtitle value="est">est</subtitle>  
  </subtitles>
        </subtitles>
- <prices>
      - <prices>
  <price-day value="0,5€" />  
          <price-day value="1,5€" />  
  <price-week value="4€" />  
          <price-week value="4€" />  
  </prices>
        </prices>
  </movie>
      </movie>
- <movie id="3" year="2013" language="en">
    - <movie id="3" year="2013" language="en">
  <title>Kick-Ass 2</title>  
        <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>  
        <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>  
        <director>Jeff Wadlow</director>  
- <subtitles>
      - <subtitles>
  <subtitle value="ru">ru</subtitle>  
          <subtitle value="ru">ru</subtitle>  
  <subtitle value="est">est</subtitle>  
          <subtitle value="est">est</subtitle>  
  </subtitles>
        </subtitles>
- <prices>
      - <prices>
  <price-day value="3€" />  
          <price-day value="2€" />  
  <price-day value="5,5€" />  
          <price-week value="6,5€" />  
  </prices>
        </prices>
  </movie>
      </movie>
- <movie id="4" year="2013" language="en">
    - <movie id="4" year="2013" language="en">
  <title>Warm Bodies</title>  
        <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>  
        <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>  
        <director>Jonathan Levine</director>  
- <subtitles>
      - <subtitles>
  <subtitle value="ru">ru</subtitle>  
          <subtitle value="ru">ru</subtitle>  
  <subtitle value="est">est</subtitle>  
          <subtitle value="est">est</subtitle>  
  </subtitles>
        </subtitles>
- <prices>
      - <prices>
  <price-day value="0,5€" />  
          <price-day value="0,5€" />  
  <price-week value="4€" />  
          <price-week value="4€" />  
  </prices>
        </prices>
  </movie>
      </movie>
- <movie id="5" year="2009" language="en">
    - <movie id="5" year="2009" language="en">
  <title>He's Just Not That Into You</title>  
        <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>  
        <description>The Baltimore-set movie of interconnecting story arcs deals with the challenges of reading or misreading human behavior.</description>  
  <director>Ken Kwapis</director>  
        <director>Ken Kwapis</director>  
- <subtitles>
      - <subtitles>
  <subtitle value="ru">ru</subtitle>  
          <subtitle value="ru">ru</subtitle>  
  <subtitle value="est">est</subtitle>  
          <subtitle value="est">est</subtitle>  
  </subtitles>
        </subtitles>
- <prices>
      - <prices>
  <price-day value="4,5€" />  
          <price-day value="4,5€" />  
  <price-week value="9€" />  
          <price-week value="9€" />  
  </prices>
        </prices>
  </movie>
      </movie>
  </comedy>
      </comedy>
  </žanr>
    </žanr>
   </movies>
   </movies>
  </movieStore>
</movieStore>
</source>
</source>


=== Stiilifail ===
=== Stiilifail ===
==== Siin kuvatakse kõik filmid ====
<source lang="xml">
<source lang="xml">
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!-- New document created with EditiX at Sat Mar 23 09:17:50 EET 2013 -->


<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">
Line 237: Line 242:
<xsl:template match="/">
<xsl:template match="/">
<html>
<html>
<body>
    <body>
<h1>Movie Store</h1>
<h1>Movie Store</h1>
<h4>Action Movies</h4>
        <h4>Action Movies</h4>
<table border="1" width="70%" >
  <table border="1" width="70%" >
<tr bgcolor="#82B4B4">
      <tr bgcolor="#82B4B4">
<td>Title</td>
<td>Title</td>
<td>Description</td>
        <td>Description</td>
<td>Subtitles</td>
<td>Subtitles</td>
<td>Director</td>
<td>Director</td>
<td>Prices</td>
<td>Prices</td>
</tr>
      </tr>
<xsl:for-each select="movieStore/movies/žanr/action/movie">
      <xsl:for-each select="movieStore/movies/žanr/action/movie">
<tr>
          <tr>
<td style="width:15%;">
            <td style="width:15%;">
<xsl:value-of select="title"/>
        <xsl:value-of select="title"/>
</td>
    </td>
<td>
    <td>
<xsl:value-of select="description"/>
        <xsl:value-of select="description"/>
</td>
            </td>
<td>
            <td>
<xsl:for-each select="subtitles/subtitle">
        <xsl:for-each select="subtitles/subtitle">
<li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
        <li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
</xsl:for-each>
        </xsl:for-each>
</td>
    </td>
<td  style="width:10%;">
            <td  style="width:10%;">
<li style="list-style-type: none;"><xsl:value-of select="director"/>
        <li style="list-style-type: none;"><xsl:value-of select="director"/></li>
</li>
                            </td>
</td>
    <td style="width:10%;" >
<td style="width:10%;" >
                              <xsl:for-each select="prices/price-day">
<xsl:for-each select="prices/price-day">
        <em>For Day:</em>
<em>For Day:</em>
        <li style="list-style-type: none; text-align:center;"><xsl:value-of select="@value"/></li>
<li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
      </xsl:for-each>
</xsl:for-each>
    <xsl:for-each select="prices/price-week">
<xsl:for-each select="prices/price-week">
                                <em>For Week:</em>
<em>For Week:</em>
                                <li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
<li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
              </xsl:for-each>
</xsl:for-each>
                            </td>
</td>
                  </tr>
</tr>
                        </xsl:for-each>
</xsl:for-each>
  </table>
</table>
                  <h4>Horror Movies</h4>
  <table border="1" width="70%" >
<h4>Horror Movies</h4>
      <tr bgcolor="#82B4B4">
<table border="1" width="70%" >
<td>Title</td>
<tr bgcolor="#82B4B4">
        <td>Description</td>
<td>Title</td>
<td>Subtitles</td>
<td>Description</td>
<td>Director</td>
<td>Subtitles</td>
<td>Prices</td>
<td>Director</td>
      </tr>
<td>Prices</td>
      <xsl:for-each select="movieStore/movies/žanr/horror/movie">
</tr>
          <tr>
<xsl:for-each select="movieStore/movies/žanr/horror/movie">
            <td style="width:15%;">
<tr>
        <xsl:value-of select="title"/>
<td style="width:15%;">
    </td>
<xsl:value-of select="title"/>
    <td>
</td>
        <xsl:value-of select="description"/>
<td>
            </td>
<xsl:value-of select="description"/>
            <td>
</td>
        <xsl:for-each select="subtitles/subtitle">
<td>
        <li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
<xsl:for-each select="subtitles/subtitle">
        </xsl:for-each>
<li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
    </td>
</xsl:for-each>
            <td  style="width:10%;">
</td>
        <li style="list-style-type: none;"><xsl:value-of select="director"/></li>
<td  style="width:10%;">
                            </td>
<li style="list-style-type: none;"><xsl:value-of select="director"/>
    <td style="width:10%;" >
</li>
                              <xsl:for-each select="prices/price-day">
</td>
        <em>For Day:</em>
<td style="width:10%;" >
        <li style="list-style-type: none; text-align:center;"><xsl:value-of select="@value"/></li>
<xsl:for-each select="prices/price-day">
      </xsl:for-each>
<em>For Day:</em>
    <xsl:for-each select="prices/price-week">
<li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
                                <em>For Week:</em>
</xsl:for-each>
                                <li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
<xsl:for-each select="prices/price-week">
              </xsl:for-each>
<em>For Week:</em>
                            </td>
<li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
                  </tr>
</xsl:for-each>
                        </xsl:for-each>
</td>
  </table>
</tr>
        <h4>Comedy Movies</h4>
</xsl:for-each>
  <table border="1" width="70%" >
</table>
      <tr bgcolor="#82B4B4">
<td>Title</td>
<h4>Comedy Movies</h4>
        <td>Description</td>
<table border="1" width="70%" >
<td>Subtitles</td>
<tr bgcolor="#82B4B4">
<td>Director</td>
<td>Title</td>
<td>Prices</td>
<td>Description</td>
      </tr>
<td>Subtitles</td>
      <xsl:for-each select="movieStore/movies/žanr/comedy/movie">
<td>Director</td>
          <tr>
<td>Prices</td>
            <td style="width:15%;">
</tr>
        <xsl:value-of select="title"/>
<xsl:for-each select="movieStore/movies/žanr/comedy/movie">
    </td>
<tr>
    <td>
<td style="width:15%;">
        <xsl:value-of select="description"/>
<xsl:value-of select="title"/>
            </td>
</td>
            <td>
<td>
        <xsl:for-each select="subtitles/subtitle">
<xsl:value-of select="description"/>
        <li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
</td>
        </xsl:for-each>
<td>
    </td>
<xsl:for-each select="subtitles/subtitle">
            <td  style="width:10%;">
<li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
        <li style="list-style-type: none;"><xsl:value-of select="director"/></li>
</xsl:for-each>
                            </td>
</td>
    <td style="width:10%;" >
<td  style="width:10%;">
                              <xsl:for-each select="prices/price-day">
<li style="list-style-type: none;"><xsl:value-of select="director"/>
        <em>For Day:</em>
</li>
        <li style="list-style-type: none; text-align:center;"><xsl:value-of select="@value"/></li>
</td>
      </xsl:for-each>
<td style="width:10%;" >
    <xsl:for-each select="prices/price-week">
<xsl:for-each select="prices/price-day">
                                <em>For Week:</em>
<em>For Day:</em>
                                <li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
<li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
              </xsl:for-each>
</xsl:for-each>
                            </td>
<xsl:for-each select="prices/price-week">
                  </tr>
<em>For Week:</em>
                        </xsl:for-each>
<li style="list-style-type: none; text-align:center;" ><xsl:value-of select="@value"/></li>
  </table>
</xsl:for-each>
    </body>
</td>
      </html>
</tr>
</xsl:template>
</xsl:for-each>
</table>
</body>
</html>
 
</xsl:template>
 
</xsl:stylesheet>
</xsl:stylesheet>
</source>
</source>
Line 477: Line 475:
<!ELEMENT title  ( #PCDATA )>
<!ELEMENT title  ( #PCDATA )>
</source>
</source>
== 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. <br />
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. <br />
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. <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. Kuvatakse kasutajale uus login aken. <br />
'''DeleteUser()''' - Administraator saab kasutajaid kustutada. <br />
'''UpdateUser()''' - Administraator saab kasutajaid uuendada. <br />
'''List<User> GetAllUsers()''' - Tagastab listi kasutaja andmetest läbi teenuse. <br />
'''AddMovie()''' - Administraator saab lisada uusi filme, mis salvestatakse andmebaasi. <br />
'''UpdateMovie()''' - Administraator saab andmebaasis olevat filmi uuendada. <br />
'''DeleteMovie()''' - Administraator saab andmebaasis olevat filmi kustutada. <br />
'''GetAllMovies()''' - Tagastab listi filmidest läbi teenuse. <br />
'''List<Genre> GetAllGenres()''' - Tagastab filmitüüpide listi ja ühendab andmebaasiga. <br />
'''GetUserCount()''' - Võtab klassist StatisticMethods() meetodi GetUserCount() ja tagastab väärtuse andmebaasis olevate kasutajate arvu kohta. <br />
'''GetMovieCount()''' - Võtab klassist StatisticMethods() meetodi GetMovieCount() ja tagastab väärtuse andmebaasis olevate filmide arvu kohta. <br />
'''List<Movie> SearchMovie()''' - Tagastab listi andmebaasis olevatest filmidest, mis on parameetrites ära kirjeldatud. <br />
'''List<Movie> SearchMovieByGenre()''' - Tagastab listi andmebaasis olevatest filmidest tüübi 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 />
'''AddMovieToRent()''' - Lisatakse kasutaja poolt valitud film läbi id laenutusse. <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> GetRentedMoviesByUserName()''' - Tagastatakse list andmebaasis olevatest kõikidest renditud filmidest kasutaja id järgi. <br />
== Lõpptoode ==
Lisan tehtud töö koos kommentaaridega zip formaadis [http://enos.itcollege.ee/~ktonisma/VR%202%20projekt/ siia].


== Log ==
== Log ==
Line 484: Line 515:
==== 23.märts 2013====
==== 23.märts 2013====
*Wiki lehe loomine, XML faili, stiilifaili ja skeemifaili lisamine.
*Wiki lehe loomine, XML faili, stiilifaili ja skeemifaili lisamine.
==== 30.märts 2013====
*Tegime XML-i retsensiooni meeskonnale GOW.
==== 01-02.juuni 2013====
*Esitasime lõpptoote.

Latest revision as of 13:10, 5 June 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.

Lõpptoode

Lisan tehtud töö koos kommentaaridega zip formaadis siia.

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.

01-02.juuni 2013

  • Esitasime lõpptoote.