Team Echo: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Mvajak (talk | contribs)
No edit summary
Arzirk (talk | contribs)
Add pretty pictures
 
(11 intermediate revisions by 3 users not shown)
Line 5: Line 5:
* Mari-Liis Oldja
* Mari-Liis Oldja
* Arti Zirk
* Arti Zirk
* Joosep Voolma


=Projekt=
==Veebiteenuse analüüs==
=== Kirjeldus ===
Team Echo on kooli videosalvestuste mahamängimise veebirakendus. Selle abil konverteeritakse olemasolevad flash videod mp4 formaati, et seda oleks hea ja mugav meie veebirakenduses maha mängida. Selle boonuseks on sujuv ja probleemivaba salvestuste vaatamine, ning vanade salvestuste kätte saamine kui tulevikus echo360 tarkvara uueneb. Salvestused on kategoriseeritud kooli ja aine alusel. Salvestuste vaatamiseks pole vaja kasutajat, kuigi redigeerimiseks/lisamiseks on vaja.


==XML==
====Must have====
<source lang="xml">
 
<nowiki>
* Video konverteerimine
<?xml version="1.0" encoding="utf-8" ?>
* Kategoriseerimine EIK ainete alusel
<?xml-stylesheet type="text/xsl" href="Echo-html.xslt"?>
* Video striimimine meie veebiliides
<echo>
* Videode lisamine / eemaldamine
  <videos>
* Logi kirjete kogumine
    <video id="1" view-count="69" author-id="1">
* mp4 exportimine
      <title>Mihkli rännak</title>
 
      <streams>
====Nice to have====
        <stream type="primary">
 
          <stream-url mime-type="video/webm">https://u.wut.ee/ookutsu.webm</stream-url>
* Timestamp ja nende avalik kommenteerimine salvestusele
          <stream-url mime-type="audio/mp3">https://media/id/audio.mp3</stream-url>
* Konveteerimise progress
          <stream-url mime-type="video/mp4">https://media/id/video.mp4</stream-url>
* Kategoriseerimine Kooli ja aine alusel
        </stream>
* Kooli kasutajaga sisselogimine
        <stream type="secondary">
* Videote otsing aine/õppejõu alusel
          <stream-url mime-type="audio/*">https://media/id/audio2</stream-url>
* Saab vaadata playlist alusel
        </stream>
      </streams>
      <metadata>
        <description>
          Väga kurb
        </description> 
      </metadata>
      <comments>
        <comment author-id="1" post-timestamp="1489683470">
          Norm värk
        </comment>
      </comments>
    </video>
    <video id="2" view-count="69" author-id="2">
      <title>Lahe video</title>
      <streams>
        <stream type="primary">
          <stream-url mime-type="video/webm">https://u.wut.ee/youfuckedup.webm</stream-url>
          <stream-url mime-type="audio/mp3">https://media/id/audio.mp3</stream-url>
          <stream-url mime-type="video/mp4">https://media/id/video.mp4</stream-url>
        </stream>
        <stream type="secondary">
          <stream-url mime-type="audio/*">https://media/id/audio2</stream-url>
        </stream>
      </streams>
      <metadata>
        <description>
          See on väga äge video on see
        </description>
      </metadata>
      <comments>
        <comment author-id="1" post-timestamp="1489683470">
          Norm värk
        </comment>
        <comment author-id="2" post-timestamp="1489683470">
          Norm värk 2
        </comment>
      </comments>
    </video>


    <video id="3" view-count="69" author-id="3">
====Joonised====
      <title>Nalja kah</title>
[[File:Echo360teenustejoonis.jpg|500px|]]
      <streams>
        <stream type="primary">
          <stream-url mime-type="video/webm">https://u.wut.ee/perlvspython.webm</stream-url>
          <stream-url mime-type="audio/mp3">https://media/id/audio.mp3</stream-url>
          <stream-url mime-type="video/mp4">https://media/id/video.mp4</stream-url>
        </stream>
        <stream type="secondary">
          <stream-url mime-type="audio/*">https://media/id/audio2</stream-url>
        </stream>
      </streams>
      <metadata>
        <description>
          Väga hea huumor
        </description>
      </metadata>
      <comments>
        <comment author-id="1" post-timestamp="1489683470">
          Norm värk
        </comment>
      </comments>
    </video>
    <video id="4" view-count="69" author-id="1">
      <title>Arti areng</title>
      <streams>
        <stream type="primary">
          <stream-url mime-type="video/webm">https://u.wut.ee/sittmissitt.webm</stream-url>
          <stream-url mime-type="audio/mp3">https://media/id/audio.mp3</stream-url>
          <stream-url mime-type="video/mp4">https://media/id/video.mp4</stream-url>
        </stream>
        <stream type="secondary">
          <stream-url mime-type="audio/*">https://media/id/audio2</stream-url>
        </stream>
      </streams>
      <metadata>
        <description>
          Väga kurb
        </description>
      </metadata>
      <comments>
        <comment author-id="1" post-timestamp="1489683470">
          Imelik oli
        </comment>
      </comments>
    </video>
   
    <video id="4" view-count="69" author-id="4">
      <title>Oldja laulud</title>
      <streams>
        <stream type="primary">
          <stream-url mime-type="video/webm">https://u.wut.ee/healtscare.webm</stream-url>
          <stream-url mime-type="audio/mp3">https://media/id/audio.mp3</stream-url>
          <stream-url mime-type="video/mp4">https://media/id/video.mp4</stream-url>
        </stream>
        <stream type="secondary">
          <stream-url mime-type="audio/*">https://media/id/audio2</stream-url>
        </stream>
      </streams>
      <metadata>
        <description>
          Draama Queen
        </description>
      </metadata>
      <comments>
        <comment author-id="1" post-timestamp="1489683420">
          Norm värk
        </comment>
      </comments>
    </video>
   
    <video id="4" view-count="69" author-id="5">
      <title>Osa 13 ehk Oolo kadumine</title>
      <streams>
        <stream type="primary">
          <stream-url mime-type="video/webm">https://u.wut.ee/healtscare.webm</stream-url>
          <stream-url mime-type="audio/mp3">https://media/id/audio.mp3</stream-url>
          <stream-url mime-type="video/mp4">https://media/id/video.mp4</stream-url>
        </stream>
        <stream type="secondary">
          <stream-url mime-type="audio/*">https://media/id/audio2</stream-url>
        </stream>
      </streams>
      <metadata>
        <description>
          Lihtsalt kadus ära
        </description>
      </metadata>
      <comments>
        <comment author-id="1" post-timestamp="1489683470">
          Norm värk
        </comment>
      </comments>
    </video>


  </videos>
[[File:Echo360erdversion1.png|1000px|]]
  <users>
    <user id="1">
      <username>admin</username>
      <full-name>Admin</full-name>
    </user>
    <user id="2">
      <username>oolo</username>
      <full-name>Oolo</full-name>
    </user>
    <user id ="3">
      <username>zirk</username>
      <full-name>Hr. Zirk</full-name>
    </user>
  </users>
  <lists>
    <list owner-id="1">
      <video id="1" timestamp-added="1489684373"></video>
      <video id="3" timestamp-added="1489684379"></video>
    </list>
  </lists>
</echo>


</nowiki>


==XSLT XML==
=XML=
<nowiki>
<div class="mw-collapsible mw-collapsed" id="mw-customtoggle-xmlThings" style="float:left">
<?xml version="1.0" encoding="utf-8"?>
=== Miks ei leia siit xml failist CDATA kirjeid? ===
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
Sest, CDATA ei anna midagi juurde xml masin lugemisele. Sama hästi võiks problemaatilised märgid asendada vajalike paomärkidega mis oleks ka palju turvalisem.
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
    <xsl:output method="xml" indent="yes"/>


   <xsl:template match="/">
<source lang="xml">
   <?xml version="1.0" encoding="utf-8" ?>
  <?xml-stylesheet type="text/xsl" href="Echo-html.xslt"?>
  <echo>
     <videos>
     <videos>
       <xsl:for-each select="echo/videos/video">
       <video id="1" view-count="69" author-id="1">
         <video>
        <title>Mihkli rännak</title>
           <xsl:variable name="author-id" select="@author-id"/>
         <streams>
          <title>
           <stream type="primary">
             <xsl:value-of select="title"/>
            <stream-url mime-type="video/webm">https://u.wut.ee/ookutsu.webm</stream-url>
           </title>
            <stream-url mime-type="audio/mp3">https://media/id/audio.mp3</stream-url>
           <xsl:copy-of select="streams/stream[@type='primary']" />
             <stream-url mime-type="video/mp4">https://media/id/video.mp4</stream-url>
          <autor>
           </stream>
             <xsl:copy-of select="/echo/users/user[@id=$author-id]" />
           <stream type="secondary">
          </autor>
             <stream-url mime-type="audio/*">https://media/id/audio2</stream-url>
          </stream>
        </streams>
        <metadata>
           <description>
           <description>
             <xsl:value-of select="metadata/description"/>
             Väga kurb
           </description>
           </description>
           <comments>
        </metadata>
             <xsl:for-each select="comments/comment">
        <comments>
              <xsl:variable name="comment-author-id" select="@author-id"/>
           <comment author-id="1" post-timestamp="1489683470">
              <comment>
            Norm värk
                <text><xsl:value-of select="." /></text>
          </comment>
                <xsl:copy-of select="/echo/users/user[@id=$comment-author-id]/username" />
        </comments>
                <xsl:copy-of select="/echo/users/user[@id=$comment-author-id]/full-name" />
      </video>
              </comment>
      <video id="2" view-count="69" author-id="2">
             </xsl:for-each>
        <title>Lahe video</title>
           </comments>
        <streams>
         </video>
          <stream type="primary">
       </xsl:for-each>
             <stream-url mime-type="video/webm">https://u.wut.ee/youfuckedup.webm</stream-url>
            <stream-url mime-type="audio/mp3">https://media/id/audio.mp3</stream-url>
            <stream-url mime-type="video/mp4">https://media/id/video.mp4</stream-url>
          </stream>
          <stream type="secondary">
            <stream-url mime-type="audio/*">https://media/id/audio2</stream-url>
          </stream>
        </streams>
        <metadata>
          <description>
            See on väga äge video on see
          </description>
        </metadata>
        <comments>
          <comment author-id="1" post-timestamp="1489683470">
            Norm värk
          </comment>
          <comment author-id="2" post-timestamp="1489683470">
            Norm värk 2
          </comment>
        </comments>
      </video>
 
      <video id="3" view-count="69" author-id="3">
        <title>Nalja kah</title>
        <streams>
          <stream type="primary">
            <stream-url mime-type="video/webm">https://u.wut.ee/perlvspython.webm</stream-url>
            <stream-url mime-type="audio/mp3">https://media/id/audio.mp3</stream-url>
            <stream-url mime-type="video/mp4">https://media/id/video.mp4</stream-url>
          </stream>
          <stream type="secondary">
            <stream-url mime-type="audio/*">https://media/id/audio2</stream-url>
          </stream>
        </streams>
        <metadata>
          <description>
            Väga hea huumor
          </description>
        </metadata>
        <comments>
          <comment author-id="1" post-timestamp="1489683470">
            Norm värk
          </comment>
        </comments>
      </video>
 
      <video id="4" view-count="69" author-id="1">
        <title>Arti areng</title>
        <streams>
          <stream type="primary">
            <stream-url mime-type="video/webm">https://u.wut.ee/sittmissitt.webm</stream-url>
            <stream-url mime-type="audio/mp3">https://media/id/audio.mp3</stream-url>
            <stream-url mime-type="video/mp4">https://media/id/video.mp4</stream-url>
          </stream>
          <stream type="secondary">
            <stream-url mime-type="audio/*">https://media/id/audio2</stream-url>
          </stream>
        </streams>
        <metadata>
          <description>
            Väga kurb
          </description>
        </metadata>
        <comments>
          <comment author-id="1" post-timestamp="1489683470">
            Imelik oli
          </comment>
        </comments>
      </video>
 
      <video id="4" view-count="69" author-id="4">
        <title>Oldja laulud</title>
        <streams>
          <stream type="primary">
            <stream-url mime-type="video/webm">https://u.wut.ee/healtscare.webm</stream-url>
            <stream-url mime-type="audio/mp3">https://media/id/audio.mp3</stream-url>
            <stream-url mime-type="video/mp4">https://media/id/video.mp4</stream-url>
          </stream>
          <stream type="secondary">
             <stream-url mime-type="audio/*">https://media/id/audio2</stream-url>
           </stream>
        </streams>
        <metadata>
          <description>
            Draama Queen
          </description>
        </metadata>
        <comments>
          <comment author-id="1" post-timestamp="1489683420">
            Norm värk
          </comment>
         </comments>
      </video>
 
       <video id="4" view-count="69" author-id="5">
        <title>Osa 13 ehk Oolo kadumine</title>
        <streams>
          <stream type="primary">
            <stream-url mime-type="video/webm">https://u.wut.ee/healtscare.webm</stream-url>
            <stream-url mime-type="audio/mp3">https://media/id/audio.mp3</stream-url>
            <stream-url mime-type="video/mp4">https://media/id/video.mp4</stream-url>
          </stream>
          <stream type="secondary">
            <stream-url mime-type="audio/*">https://media/id/audio2</stream-url>
          </stream>
        </streams>
        <metadata>
          <description>
            Lihtsalt kadus ära
          </description>
        </metadata>
        <comments>
          <comment author-id="1" post-timestamp="1489683470">
            Norm värk
          </comment>
        </comments>
      </video>
 
     </videos>
     </videos>
   </xsl:template>
    <users>
</xsl:stylesheet>
      <user id="1">
        <username>admin</username>
        <full-name>Admin</full-name>
      </user>
      <user id="2">
        <username>oolo</username>
        <full-name>Oolo</full-name>
      </user>
      <user id="3">
        <username>zirk</username>
        <full-name>Hr. Zirk</full-name>
      </user>
    </users>
    <lists>
      <list owner-id="1">
        <video id="1" timestamp-added="1489684373"></video>
        <video id="3" timestamp-added="1489684379"></video>
      </list>
    </lists>
   </echo>
</source>
 
==XSLT 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"
      xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
    <xsl:output method="xml" indent="yes"/>
 
    <xsl:template match="/">
      <videos>
        <xsl:for-each select="echo/videos/video">
          <video>
            <xsl:variable name="author-id" select="@author-id"/>
            <title>
              <xsl:value-of select="title"/>
            </title>
            <xsl:copy-of select="streams/stream[@type='primary']" />
            <autor>
              <xsl:copy-of select="/echo/users/user[@id=$author-id]" />
            </autor>
            <description>
              <xsl:value-of select="metadata/description"/>
            </description>
            <comments>
              <xsl:for-each select="comments/comment">
                <xsl:variable name="comment-author-id" select="@author-id"/>
                <comment>
                  <text>
                    <xsl:value-of select="." />
                  </text>
                  <xsl:copy-of select="/echo/users/user[@id=$comment-author-id]/username" />
                  <xsl:copy-of select="/echo/users/user[@id=$comment-author-id]/full-name" />
                </comment>
              </xsl:for-each>
            </comments>
          </video>
        </xsl:for-each>
      </videos>
    </xsl:template>
  </xsl:stylesheet>
</source>


</nowiki>


==XSLT HTML==
==XSLT HTML==
<pre>
<nowiki>
<nowiki>
<?xml version="1.0" encoding="utf-8"?>
  <?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">
>
     <xsl:output method="html" indent="yes"/>
     <xsl:output method="html" indent="yes"/>


  <xsl:template match="/">
    <xsl:template match="/">
    <html>
      <html>
      <title>Media Kogumik</title>
        <title>Media Kogumik</title>
      <xsl:for-each select="echo/videos/video">
        <link rel="stylesheet" type="text/css" href="https://d.arti.ee/media.css"/>
        <div>
        <xsl:for-each select="echo/videos/video">
          <xsl:variable name="author-id" select="@author-id"/>
          <div>
          <h3>
            <xsl:variable name="author-id" select="@author-id"/>
            <xsl:value-of select="title"/>
            <h3>
          </h3>
              <xsl:value-of select="title"/>
          <h4>
            </h3>
            <xsl:value-of select="/echo/users/user[@id=$author-id]/full-name" />
            <h4>
          </h4>
              <xsl:value-of select="/echo/users/user[@id=$author-id]/full-name" />
          <video controls="" loop="">
            </h4>
            <xsl:for-each select="streams/stream[@type='primary']">
            <video controls="" loop="">
              <xsl:for-each select="stream-url">
              <xsl:for-each select="streams/stream[@type='primary']">
                <source>
                <xsl:for-each select="stream-url">
                  <xsl:attribute name="type">
                  <source>
                    <xsl:value-of select="@mime-type"/>
                    <xsl:attribute name="type">
                  </xsl:attribute>
                      <xsl:value-of select="@mime-type"/>
                  <xsl:attribute name="src">
                    </xsl:attribute>
                    <xsl:value-of select="."/>
                    <xsl:attribute name="src">
                  </xsl:attribute>
                      <xsl:value-of select="."/>
                 </source>
                    </xsl:attribute>
                  </source>
                 </xsl:for-each>
               </xsl:for-each>
               </xsl:for-each>
             </xsl:for-each>
             </video>
          </video>
            <p>
          <p>
              <xsl:value-of select="metadata/description"/>
            <xsl:value-of select="metadata/description"/>
            </p>
          </p>
            <div>
          <div>
              <h4>Komentaarid:</h4>
            <h4>Komentaarid:</h4>
              <ol>
            <ol>
                <xsl:for-each select="comments/comment">
            <xsl:for-each select="comments/comment">
                  <li>
              <li>
                    <xsl:variable name="comment-author-id" select="@author-id"/>
                <xsl:variable name="comment-author-id" select="@author-id"/>
                    <div>
                <div>
                      <xsl:value-of select="." />
                  <xsl:value-of select="." />
                    </div>
                </div>
                    <div>
                <div>
                      <b>Autor:</b>
                  <b>Autor:</b>
                      <xsl:value-of select="/echo/users/user[@id=$comment-author-id]/full-name" />
                  <xsl:value-of select="/echo/users/user[@id=$comment-author-id]/full-name" />
                    </div>
                </div>
                  </li>
              </li>
                </xsl:for-each>
            </xsl:for-each>
              </ol>
             </ol>
             </div>
           </div>
           </div>
        </div>
          <hr/>
         <hr/>
         </xsl:for-each>
      </xsl:for-each>
      </html>
    </html>
    </xsl:template>
  </xsl:template>
  </xsl:stylesheet>
</xsl:stylesheet>
</nowiki>
</nowiki>
</pre>
[[File:Echoxmlxstlhtml.png|320px]]


==XSD==
==XSD==
<source lang="xml">
<source lang="xml">
<nowiki>
  <?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
  <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="echo">
  <xs:element name="echo">
      <xs:complexType>
    <xs:complexType>
        <xs:sequence>
      <xs:sequence>
          <xs:element name="videos">
        <xs:element name="videos">
            <xs:complexType>
          <xs:complexType>
              <xs:sequence>
            <xs:sequence>
                <xs:element maxOccurs="unbounded" name="video">
              <xs:element maxOccurs="unbounded" name="video">
                  <xs:complexType>
                <xs:complexType>
                    <xs:sequence>
                  <xs:sequence>
                      <xs:element name="title" type="xs:string" />
                    <xs:element name="title" type="xs:string" />
                      <xs:element name="streams">
                    <xs:element name="streams">
                        <xs:complexType>
                      <xs:complexType>
                          <xs:sequence>
                        <xs:sequence>
                            <xs:element maxOccurs="unbounded" name="stream">
                          <xs:element maxOccurs="unbounded" name="stream">
                              <xs:complexType>
                            <xs:complexType>
                                <xs:sequence>
                              <xs:sequence>
                                  <xs:element maxOccurs="unbounded" name="stream-url">
                                <xs:element maxOccurs="unbounded" name="stream-url">
                                    <xs:complexType>
                                  <xs:complexType>
                                      <xs:simpleContent>
                                    <xs:simpleContent>
                                        <xs:extension base="xs:string">
                                      <xs:extension base="xs:string">
                                          <xs:attribute name="mime-type" type="xs:string" use="required" />
                                        <xs:attribute name="mime-type" type="xs:string" use="required" />
                                        </xs:extension>
                                      </xs:extension>
                                      </xs:simpleContent>
                                    </xs:simpleContent>
                                    </xs:complexType>
                                  </xs:complexType>
                                  </xs:element>
                                </xs:element>
                                </xs:sequence>
                              </xs:sequence>
                                <xs:attribute name="type" type="xs:string" use="required" />
                              <xs:attribute name="type" type="xs:string" use="required" />
                              </xs:complexType>
                            </xs:complexType>
                            </xs:element>
                          </xs:element>
                          </xs:sequence>
                        </xs:sequence>
                        </xs:complexType>
                      </xs:complexType>
                      </xs:element>
                    </xs:element>
                      <xs:element name="metadata">
                    <xs:element name="metadata">
                        <xs:complexType>
                      <xs:complexType>
                          <xs:sequence>
                        <xs:sequence>
                            <xs:element name="description" type="xs:string" />
                          <xs:element name="description" type="xs:string" />
                          </xs:sequence>
                        </xs:sequence>
                        </xs:complexType>
                      </xs:complexType>
                      </xs:element>
                    </xs:element>
                      <xs:element name="comments">
                    <xs:element name="comments">
                        <xs:complexType>
                      <xs:complexType>
                          <xs:sequence>
                        <xs:sequence>
                            <xs:element maxOccurs="unbounded" name="comment">
                          <xs:element maxOccurs="unbounded" name="comment">
                              <xs:complexType>
                            <xs:complexType>
                                <xs:simpleContent>
                              <xs:simpleContent>
                                  <xs:extension base="xs:string">
                                <xs:extension base="xs:string">
                                    <xs:attribute name="author-id" type="xs:unsignedInt" use="required" />
                                  <xs:attribute name="author-id" type="xs:unsignedInt" use="required" />
                                    <xs:attribute name="post-timestamp" type="xs:unsignedInt" use="required" />
                                  <xs:attribute name="post-timestamp" type="xs:unsignedInt" use="required" />
                                  </xs:extension>
                                </xs:extension>
                                </xs:simpleContent>
                              </xs:simpleContent>
                              </xs:complexType>
                            </xs:complexType>
                            </xs:element>
                          </xs:element>
                          </xs:sequence>
                        </xs:sequence>
                        </xs:complexType>
                      </xs:complexType>
                      </xs:element>
                    </xs:element>
                    </xs:sequence>
                  </xs:sequence>
                    <xs:attribute name="id" type="xs:unsignedInt" use="required" />
                  <xs:attribute name="id" type="xs:unsignedInt" use="required" />
                    <xs:attribute name="view-count" type="xs:unsignedInt" use="required" />
                  <xs:attribute name="view-count" type="xs:unsignedInt" use="required" />
                    <xs:attribute name="author-id" type="xs:unsignedInt" use="required" />
                  <xs:attribute name="author-id" type="xs:unsignedInt" use="required" />
                  </xs:complexType>
                </xs:complexType>
                </xs:element>
              </xs:element>
              </xs:sequence>
            </xs:sequence>
            </xs:complexType>
          </xs:complexType>
          </xs:element>
        </xs:element>
          <xs:element name="users">
        <xs:element name="users">
            <xs:complexType>
          <xs:complexType>
              <xs:sequence>
            <xs:sequence>
                <xs:element maxOccurs="unbounded" name="user">
              <xs:element maxOccurs="unbounded" name="user">
                  <xs:complexType>
                <xs:complexType>
                    <xs:sequence>
                  <xs:sequence>
                      <xs:element name="username" type="xs:string" />
                    <xs:element name="username" type="xs:string" />
                      <xs:element name="full-name" type="xs:string" />
                    <xs:element name="full-name" type="xs:string" />
                    </xs:sequence>
                  </xs:sequence>
                    <xs:attribute name="id" type="xs:unsignedInt" use="required" />
                  <xs:attribute name="id" type="xs:unsignedInt" use="required" />
                  </xs:complexType>
                </xs:complexType>
                </xs:element>
              </xs:element>
              </xs:sequence>
            </xs:sequence>
            </xs:complexType>
          </xs:complexType>
          </xs:element>
        </xs:element>
          <xs:element name="lists">
        <xs:element name="lists">
            <xs:complexType>
          <xs:complexType>
              <xs:sequence>
            <xs:sequence>
                <xs:element name="list">
              <xs:element name="list">
                  <xs:complexType>
                <xs:complexType>
                    <xs:sequence>
                  <xs:sequence>
                      <xs:element maxOccurs="unbounded" name="video">
                    <xs:element maxOccurs="unbounded" name="video">
                        <xs:complexType>
                      <xs:complexType>
                          <xs:attribute name="id" type="xs:unsignedInt" use="required" />
                        <xs:attribute name="id" type="xs:unsignedInt" use="required" />
                          <xs:attribute name="timestamp-added" type="xs:unsignedInt" use="required" />
                        <xs:attribute name="timestamp-added" type="xs:unsignedInt" use="required" />
                        </xs:complexType>
                      </xs:complexType>
                      </xs:element>
                    </xs:element>
                    </xs:sequence>
                  </xs:sequence>
                    <xs:attribute name="owner-id" type="xs:unsignedInt" use="required" />
                  <xs:attribute name="owner-id" type="xs:unsignedInt" use="required" />
                  </xs:complexType>
                </xs:complexType>
                </xs:element>
              </xs:element>
              </xs:sequence>
            </xs:sequence>
            </xs:complexType>
          </xs:complexType>
          </xs:element>
        </xs:element>
        </xs:sequence>
      </xs:sequence>
      </xs:complexType>
    </xs:complexType>
    </xs:element>
  </xs:element>
  </xs:schema>
</xs:schema>
</source>
</nowiki>
</div>

Latest revision as of 20:54, 16 April 2017

Team Echo Võrgurakendused II

  • Mihkel Vajak
  • Janno Oolo
  • Mari-Liis Oldja
  • Arti Zirk

Projekt

Veebiteenuse analüüs

Kirjeldus

Team Echo on kooli videosalvestuste mahamängimise veebirakendus. Selle abil konverteeritakse olemasolevad flash videod mp4 formaati, et seda oleks hea ja mugav meie veebirakenduses maha mängida. Selle boonuseks on sujuv ja probleemivaba salvestuste vaatamine, ning vanade salvestuste kätte saamine kui tulevikus echo360 tarkvara uueneb. Salvestused on kategoriseeritud kooli ja aine alusel. Salvestuste vaatamiseks pole vaja kasutajat, kuigi redigeerimiseks/lisamiseks on vaja.

Must have

  • Video konverteerimine
  • Kategoriseerimine EIK ainete alusel
  • Video striimimine meie veebiliides
  • Videode lisamine / eemaldamine
  • Logi kirjete kogumine
  • mp4 exportimine

Nice to have

  • Timestamp ja nende avalik kommenteerimine salvestusele
  • Konveteerimise progress
  • Kategoriseerimine Kooli ja aine alusel
  • Kooli kasutajaga sisselogimine
  • Videote otsing aine/õppejõu alusel
  • Saab vaadata playlist alusel

Joonised


XML

Miks ei leia siit xml failist CDATA kirjeid?

Sest, CDATA ei anna midagi juurde xml masin lugemisele. Sama hästi võiks problemaatilised märgid asendada vajalike paomärkidega mis oleks ka palju turvalisem.

  <?xml version="1.0" encoding="utf-8" ?>
  <?xml-stylesheet type="text/xsl" href="Echo-html.xslt"?>
  <echo>
    <videos>
      <video id="1" view-count="69" author-id="1">
        <title>Mihkli rännak</title>
        <streams>
          <stream type="primary">
            <stream-url mime-type="video/webm">https://u.wut.ee/ookutsu.webm</stream-url>
            <stream-url mime-type="audio/mp3">https://media/id/audio.mp3</stream-url>
            <stream-url mime-type="video/mp4">https://media/id/video.mp4</stream-url>
          </stream>
          <stream type="secondary">
            <stream-url mime-type="audio/*">https://media/id/audio2</stream-url>
          </stream>
        </streams>
        <metadata>
          <description>
            Väga kurb
          </description>
        </metadata>
        <comments>
          <comment author-id="1" post-timestamp="1489683470">
            Norm värk
          </comment>
        </comments>
      </video>
      <video id="2" view-count="69" author-id="2">
        <title>Lahe video</title>
        <streams>
          <stream type="primary">
            <stream-url mime-type="video/webm">https://u.wut.ee/youfuckedup.webm</stream-url>
            <stream-url mime-type="audio/mp3">https://media/id/audio.mp3</stream-url>
            <stream-url mime-type="video/mp4">https://media/id/video.mp4</stream-url>
          </stream>
          <stream type="secondary">
            <stream-url mime-type="audio/*">https://media/id/audio2</stream-url>
          </stream>
        </streams>
        <metadata>
          <description>
            See on väga äge video on see
          </description>
        </metadata>
        <comments>
          <comment author-id="1" post-timestamp="1489683470">
            Norm värk
          </comment>
          <comment author-id="2" post-timestamp="1489683470">
            Norm värk 2
          </comment>
        </comments>
      </video>

      <video id="3" view-count="69" author-id="3">
        <title>Nalja kah</title>
        <streams>
          <stream type="primary">
            <stream-url mime-type="video/webm">https://u.wut.ee/perlvspython.webm</stream-url>
            <stream-url mime-type="audio/mp3">https://media/id/audio.mp3</stream-url>
            <stream-url mime-type="video/mp4">https://media/id/video.mp4</stream-url>
          </stream>
          <stream type="secondary">
            <stream-url mime-type="audio/*">https://media/id/audio2</stream-url>
          </stream>
        </streams>
        <metadata>
          <description>
            Väga hea huumor
          </description>
        </metadata>
        <comments>
          <comment author-id="1" post-timestamp="1489683470">
            Norm värk
          </comment>
        </comments>
      </video>

      <video id="4" view-count="69" author-id="1">
        <title>Arti areng</title>
        <streams>
          <stream type="primary">
            <stream-url mime-type="video/webm">https://u.wut.ee/sittmissitt.webm</stream-url>
            <stream-url mime-type="audio/mp3">https://media/id/audio.mp3</stream-url>
            <stream-url mime-type="video/mp4">https://media/id/video.mp4</stream-url>
          </stream>
          <stream type="secondary">
            <stream-url mime-type="audio/*">https://media/id/audio2</stream-url>
          </stream>
        </streams>
        <metadata>
          <description>
            Väga kurb
          </description>
        </metadata>
        <comments>
          <comment author-id="1" post-timestamp="1489683470">
            Imelik oli
          </comment>
        </comments>
      </video>

      <video id="4" view-count="69" author-id="4">
        <title>Oldja laulud</title>
        <streams>
          <stream type="primary">
            <stream-url mime-type="video/webm">https://u.wut.ee/healtscare.webm</stream-url>
            <stream-url mime-type="audio/mp3">https://media/id/audio.mp3</stream-url>
            <stream-url mime-type="video/mp4">https://media/id/video.mp4</stream-url>
          </stream>
          <stream type="secondary">
            <stream-url mime-type="audio/*">https://media/id/audio2</stream-url>
          </stream>
        </streams>
        <metadata>
          <description>
            Draama Queen
          </description>
        </metadata>
        <comments>
          <comment author-id="1" post-timestamp="1489683420">
            Norm värk
          </comment>
        </comments>
      </video>

      <video id="4" view-count="69" author-id="5">
        <title>Osa 13 ehk Oolo kadumine</title>
        <streams>
          <stream type="primary">
            <stream-url mime-type="video/webm">https://u.wut.ee/healtscare.webm</stream-url>
            <stream-url mime-type="audio/mp3">https://media/id/audio.mp3</stream-url>
            <stream-url mime-type="video/mp4">https://media/id/video.mp4</stream-url>
          </stream>
          <stream type="secondary">
            <stream-url mime-type="audio/*">https://media/id/audio2</stream-url>
          </stream>
        </streams>
        <metadata>
          <description>
            Lihtsalt kadus ära
          </description>
        </metadata>
        <comments>
          <comment author-id="1" post-timestamp="1489683470">
            Norm värk
          </comment>
        </comments>
      </video>

    </videos>
    <users>
      <user id="1">
        <username>admin</username>
        <full-name>Admin</full-name>
      </user>
      <user id="2">
        <username>oolo</username>
        <full-name>Oolo</full-name>
      </user>
      <user id="3">
        <username>zirk</username>
        <full-name>Hr. Zirk</full-name>
      </user>
    </users>
    <lists>
      <list owner-id="1">
        <video id="1" timestamp-added="1489684373"></video>
        <video id="3" timestamp-added="1489684379"></video>
      </list>
    </lists>
  </echo>

XSLT 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="/">
      <videos>
        <xsl:for-each select="echo/videos/video">
          <video>
            <xsl:variable name="author-id" select="@author-id"/>
            <title>
              <xsl:value-of select="title"/>
            </title>
            <xsl:copy-of select="streams/stream[@type='primary']" />
            <autor>
              <xsl:copy-of select="/echo/users/user[@id=$author-id]" />
            </autor>
            <description>
              <xsl:value-of select="metadata/description"/>
            </description>
            <comments>
              <xsl:for-each select="comments/comment">
                <xsl:variable name="comment-author-id" select="@author-id"/>
                <comment>
                  <text>
                    <xsl:value-of select="." />
                  </text>
                  <xsl:copy-of select="/echo/users/user[@id=$comment-author-id]/username" />
                  <xsl:copy-of select="/echo/users/user[@id=$comment-author-id]/full-name" />
                </comment>
              </xsl:for-each>
            </comments>
          </video>
        </xsl:for-each>
      </videos>
    </xsl:template>
  </xsl:stylesheet>


XSLT 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="/">
      <html>
        <title>Media Kogumik</title>
        <link rel="stylesheet" type="text/css" href="https://d.arti.ee/media.css"/>
        <xsl:for-each select="echo/videos/video">
          <div>
            <xsl:variable name="author-id" select="@author-id"/>
            <h3>
              <xsl:value-of select="title"/>
            </h3>
            <h4>
              <xsl:value-of select="/echo/users/user[@id=$author-id]/full-name" />
            </h4>
            <video controls="" loop="">
              <xsl:for-each select="streams/stream[@type='primary']">
                <xsl:for-each select="stream-url">
                  <source>
                    <xsl:attribute name="type">
                      <xsl:value-of select="@mime-type"/>
                    </xsl:attribute>
                    <xsl:attribute name="src">
                      <xsl:value-of select="."/>
                    </xsl:attribute>
                  </source>
                </xsl:for-each>
              </xsl:for-each>
            </video>
            <p>
              <xsl:value-of select="metadata/description"/>
            </p>
            <div>
              <h4>Komentaarid:</h4>
              <ol>
                <xsl:for-each select="comments/comment">
                  <li>
                    <xsl:variable name="comment-author-id" select="@author-id"/>
                    <div>
                      <xsl:value-of select="." />
                    </div>
                    <div>
                      <b>Autor:</b>
                      <xsl:value-of select="/echo/users/user[@id=$comment-author-id]/full-name" />
                    </div>
                  </li>
                </xsl:for-each>
              </ol>
            </div>
          </div>
          <hr/>
        </xsl:for-each>
      </html>
    </xsl:template>
  </xsl:stylesheet>

XSD

  <?xml version="1.0" encoding="utf-8"?>
  <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="echo">
      <xs:complexType>
        <xs:sequence>
          <xs:element name="videos">
            <xs:complexType>
              <xs:sequence>
                <xs:element maxOccurs="unbounded" name="video">
                  <xs:complexType>
                    <xs:sequence>
                      <xs:element name="title" type="xs:string" />
                      <xs:element name="streams">
                        <xs:complexType>
                          <xs:sequence>
                            <xs:element maxOccurs="unbounded" name="stream">
                              <xs:complexType>
                                <xs:sequence>
                                  <xs:element maxOccurs="unbounded" name="stream-url">
                                    <xs:complexType>
                                      <xs:simpleContent>
                                        <xs:extension base="xs:string">
                                          <xs:attribute name="mime-type" type="xs:string" use="required" />
                                        </xs:extension>
                                      </xs:simpleContent>
                                    </xs:complexType>
                                  </xs:element>
                                </xs:sequence>
                                <xs:attribute name="type" type="xs:string" use="required" />
                              </xs:complexType>
                            </xs:element>
                          </xs:sequence>
                        </xs:complexType>
                      </xs:element>
                      <xs:element name="metadata">
                        <xs:complexType>
                          <xs:sequence>
                            <xs:element name="description" type="xs:string" />
                          </xs:sequence>
                        </xs:complexType>
                      </xs:element>
                      <xs:element name="comments">
                        <xs:complexType>
                          <xs:sequence>
                            <xs:element maxOccurs="unbounded" name="comment">
                              <xs:complexType>
                                <xs:simpleContent>
                                  <xs:extension base="xs:string">
                                    <xs:attribute name="author-id" type="xs:unsignedInt" use="required" />
                                    <xs:attribute name="post-timestamp" type="xs:unsignedInt" use="required" />
                                  </xs:extension>
                                </xs:simpleContent>
                              </xs:complexType>
                            </xs:element>
                          </xs:sequence>
                        </xs:complexType>
                      </xs:element>
                    </xs:sequence>
                    <xs:attribute name="id" type="xs:unsignedInt" use="required" />
                    <xs:attribute name="view-count" type="xs:unsignedInt" use="required" />
                    <xs:attribute name="author-id" type="xs:unsignedInt" use="required" />
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="users">
            <xs:complexType>
              <xs:sequence>
                <xs:element maxOccurs="unbounded" name="user">
                  <xs:complexType>
                    <xs:sequence>
                      <xs:element name="username" type="xs:string" />
                      <xs:element name="full-name" type="xs:string" />
                    </xs:sequence>
                    <xs:attribute name="id" type="xs:unsignedInt" use="required" />
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
          <xs:element name="lists">
            <xs:complexType>
              <xs:sequence>
                <xs:element name="list">
                  <xs:complexType>
                    <xs:sequence>
                      <xs:element maxOccurs="unbounded" name="video">
                        <xs:complexType>
                          <xs:attribute name="id" type="xs:unsignedInt" use="required" />
                          <xs:attribute name="timestamp-added" type="xs:unsignedInt" use="required" />
                        </xs:complexType>
                      </xs:element>
                    </xs:sequence>
                    <xs:attribute name="owner-id" type="xs:unsignedInt" use="required" />
                  </xs:complexType>
                </xs:element>
              </xs:sequence>
            </xs:complexType>
          </xs:element>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
  </xs:schema>