Meeskond:Valar Morghulis

From ICO wiki
Jump to navigationJump to search

Liikmed

Urmas Hoogma

Põhjendus

Põhjenduse tõi Andres Käver oma 23.02.2015 loengus. Kuna ma deklareerisin nii Võrgurakendused II kui ASP.NET-i siis on ainuke mõistlik viis need ained ühendada ja ASP.NET-is on meeskonna suurus x+Anders Käver (kus x on meeskonnaliikmete arv mis on maksimaalselt 2). Kui eelmine semester mulle üldse midagi õpetas siis seda et midagi nii mahukat kui 9 EAP väärtuses aineid ei saa jätta juhuse hooleks. Peab olema võimalik aega planeerida (st. kui vaja siis tegeleda vaid nendega) muidu läheb nagu eelmisel semestril mil ma projekti kallal sisulist tööd alustasin alles 28.detsembril 2014.

Üldine logi

22.02.2015

XML osa realiseerimine.

07.03.2015

Viki loomine.

XML töö

Tähtaeg: 07. märts 2015

Esitatud: 07. märts 2015

Failid saab kätte siit

XML fail

Tegu on "Star Treki" raamatuseeriatesse kuuluvate teoste nimekirjaga. Atribuut "bookseries" tähistab seda millise sarja (kas TV või raamatusari) juurde raamat kuulub (

DS9 - Star Trek: Deep Space Nine

TNG - Star Trek: The Next Generation

Titan - Star Trek: Titan)

Hinnad USA dollarites, kuna pärinevad Amazoni USA lehelt. Mõned elemendid on osalt meelega tühjaks jäetud, et skeemifailides peaks erijuhtumitega arvestama.

<?xml version="1.0" encoding="utf-8" ?>
<books>
  <series id="1" seriesname="The Fall (2013)">
    <book id="1" bookseries="DS9">
      <title><![CDATA[Revelation and Dust]]></title>
      <author id="1">
        <givenname><![CDATA[David]]></givenname>
        <middlename><![CDATA[R.]]></middlename>
        <surname><![CDATA[George III]]></surname>
      </author>
      <price unit="USD">7.99</price>
      <released>2013-08-27</released>
      <description><![CDATA[After the destruction of the original space station by a rogue faction of the Typhon Pact, Miles O’Brien and Nog have led the Starfleet Corps of Engineers in designing and constructing a larger, more advanced starbase in the Bajoran system. Now, as familiar faces such as Benjamin Sisko, Kasidy Yates, Ezri Dax, Odo, and Quark arrive at the new station, Captain Ro Laren will host various heads of state at an impressive dedication ceremony. The dignitaries include not only the leaders of allies—such as Klingon Chancellor Martok, Ferengi Grand Nagus Rom, the Cardassian castellan, and the Bajoran first minister—but also those of rival powers, such as the Romulan praetor and the Gorn imperator. But as Ro’s crew prepares to open DS9 to the entire Bajor Sector and beyond, disaster looms. A faction has already set in action a shocking plan that, if successful, will shake the Alpha and Beta Quadrants to the core. ]]></description>
    </book>
    <book id="2" bookseries="TNG">
      <title><![CDATA[The Crimson Shadow]]></title>
      <author id="2">
        <givenname><![CDATA[Una]]></givenname>
        <middlename><![CDATA[]]></middlename>
        <surname><![CDATA[McCormack]]></surname>
      </author>
      <price unit="USD">3.24</price>
      <released>2013-09-24</released>
      <description><![CDATA[Cardassia Prime is home to a prideful people who, for centuries, forged alliances with those they believed would strengthen them and their place in the Alpha Quadrant, and expanded their empire at great cost to other worlds. For generations, dissenting voices were silenced by either fear or an early grave. When their wartime ally, the Dominion, suddenly turned on them, seeking to transform Cardassia into a tomb for every last member of their race, their old adversary—the United Federation of Planets— put an end to the carnage, and even now works to help rebuild Cardassia Prime. ]]></description>
    </book>
    <book id="3" bookseries="DS9">
      <title><![CDATA[A Ceremony of Losses]]></title>
      <author id="3">
        <givenname><![CDATA[David]]></givenname>
        <middlename><![CDATA[]]></middlename>
        <surname><![CDATA[Mack]]></surname>
      </author>
      <price unit="USD">2.07</price>
      <released>2013-09-29</released>
      <description><![CDATA[<h2>THE NEEDS OF THE MANY</h2><p>Despite heroic efforts by Thirishar ch’Thane, the Andorian species is headed for extinction. Its slow march toward oblivion has reached a tipping point, one from which there will be no hope of return.</p><h2>THE NEEDS OF THE FEW</h2><p>With countless lives at stake, the leaders of Andor, the Federation, and the Typhon Pact all scheme to twist the crisis to their political gain—at any price.</p><h2>THE NEEDS OF THE ONE</h2><p>Unwilling to be a mere bystander to tragedy, Doctor Julian Bashir risks everything to find a cure for the Andorians. But his courage will come at a terrible cost: his career, his freedom . . . and maybe his life.</p>]]></description>
    </book>
    <book id="4" bookseries="Titan">
      <title><![CDATA[The Poisoned Chalice]]></title>
      <author id="4">
        <givenname><![CDATA[James]]></givenname>
        <middlename><![CDATA[]]></middlename>
        <surname><![CDATA[Swallow]]></surname>
      </author>
      <price unit="USD">7.99</price>
      <released>2013-11-26</released>
      <description><![CDATA[One simple act, and the troubles of the United Federation of Planets have grown darker overnight. The mystery behind the heinous terrorist attack that has rocked the Federation to its core grows ever deeper, and William Riker finds himself beset by rumors and half-truths as the U.S.S. Titan is ordered back to Earth on emergency orders from the admiralty. Soon, Riker finds himself drawn into a game of political intrigue, bearing witness to members of Starfleet being detained—including people he considered friends—pending an investigation at the highest levels. And while Riker tries to navigate the corridors of power, Titan’s tactical officer, Tuvok, is given a series of clandestine orders that lead him into a gray world of secrets, lies, and deniable operations. Who can be trusted when the law falls silent and justice becomes a quest for revenge? For the crew of the U.S.S. Titan, the search for answers will become a battle for every ideal the Federation stands for. . . .]]></description>
    </book>
    <book id="5" bookseries="TNG">
      <title><![CDATA[Peaceable Kingdoms]]></title>
      <author id="5">
        <givenname><![CDATA[Dayton]]></givenname>
        <middlename><![CDATA[]]></middlename>
        <surname><![CDATA[Ward]]></surname>
      </author>
      <price unit="USD">0.98</price>
      <released>2013-12-31</released>
      <description><![CDATA[Following the resolution of the fertility crisis that nearly caused their extinction, the Andorian people now stand ready to rejoin the United Federation of Planets. The return of one of its founding member worlds is viewed by many as the first hopeful step beyond the uncertainty and tragedy that have overshadowed recent events in the Alpha Quadrant. But as the Federation looks to the future and the special election to name President Bacco’s permanent successor, time is running out to apprehend those responsible for the respected leader’s brutal assassination. Even as elements of the Typhon Pact are implicated for the murder, Admiral William Riker holds key knowledge of the true assassins— a revelation that could threaten the fragile Federation-Cardassian alliance.]]></description>
    </book>
  </series>
  <series id="2" seriesname="Other">
      <book id="6" bookseries="Section 31">
      <title><![CDATA[Star Trek: Section 31: Disavowed]]></title>
        <author id="3">
          <givenname><![CDATA[David]]></givenname>
          <middlename><![CDATA[]]></middlename>
          <surname><![CDATA[Mack]]></surname>
        </author>
      <price unit="USD">7.99</price>
      <released>2014-10-28</released>
      <description><![CDATA[Amoral, shrouded in secrecy, and answerable to no one, Section 31 is the mysterious covert operations division of Starfleet, a rogue shadow group committed to safeguarding the Federation at any cost. Doctor Julian Bashir sacrificed his career for a chance to infiltrate Section 31 and destroy it from within. Now it’s asking him to help it stop the Breen from stealing a dangerous new technology from the Mirror Universe—one that could give the Breen control over the galaxy. It’s a mission Bashir can’t refuse—but is it really the shot he’s been waiting for? Or is it a trap from which even his genetically enhanced intellect can’t escape?]]></description>
    </book>
    <book id="7" bookseries="Section 31">
      <title><![CDATA[Star Trek: Section 31: Control]]></title>
      <author id="3">
        <givenname><![CDATA[David]]></givenname>
        <middlename><![CDATA[]]></middlename>
        <surname><![CDATA[Mack]]></surname>
      </author>
    </book>
  </series>
</books>

XML skeemifail

Automaatselt genereeritud. Atribuudi tüübis asendasin maksimaalse väärtuse järgi tekkinud

type="xs:unsignedByte"

type="xs:unsignedInt" -iga.

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="books">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" name="series">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" name="book">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="title" type="xs:string" />
                    <xs:element name="author">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="givenname" type="xs:string" />
                          <xs:element name="middlename" type="xs:string" />
                          <xs:element name="surname" type="xs:string" />
                        </xs:sequence>
                        <xs:attribute name="id" type="xs:unsignedInt" use="required" />
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="price">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="xs:decimal">
                            <xs:attribute name="unit" type="xs:string" use="required" />
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" name="released" type="xs:date" />
                    <xs:element minOccurs="0" name="description" type="xs:string" />
                  </xs:sequence>
                  <xs:attribute name="id" type="xs:unsignedInt" use="required" />
                  <xs:attribute name="bookseries" type="xs:string" use="required" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="id" type="xs:unsignedInt" use="required" />
            <xs:attribute name="seriesname" type="xs:string" use="required" />
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

XML stiilifailid

1.stiilifail

Esimene transformatsioon (HTML-iks). Tekitatakse kena tabel (värvilahendus pärineb W3Schoolsilt) mida saab vaadata faili järel.

<?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="/">
    <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text>
    <html>
      <head>
        <title>Book data</title>
        <style>
          // Style borrowed from: http://www.w3schools.com/css/tryit.asp?filename=trycss_table_fancy
          table {
          font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
          border-collapse: collapse;
          }
          .description {
          max-width: 600px;
          }
          .totop {
          vertical-align: text-top;
          }
          th {
          text-align: left;
          background-color: #A7C942;
          }
          tr td {
          font-size: 1em;
          border: 1px solid #98bf21;
          padding: 3px 7px 2px 7px;
          }
          tr.firstrow td {
          color: #000000;
          background-color: #EAF2D3;
          }
        </style>
      </head>
      <body>
        <table>
          <tr>
            <th>Id</th>
            <th>Title</th>
            <th>Published</th>
            <th>Price</th>
          </tr>
          <xsl:for-each select="books/series">
            <xsl:for-each select="book">
              <tr class="firstrow">
                <td>
                  <xsl:value-of select="@id"/>
                </td>
                <td>
                  <xsl:value-of select="title"/>
                </td>
                <td>
                  <xsl:choose>
                    <xsl:when test="released">
                      <xsl:value-of select="released"/>
                    </xsl:when>
                    <xsl:otherwise>To be determined...</xsl:otherwise>
                  </xsl:choose>
                </td>
                <td>
                  <xsl:choose>
                    <xsl:when test="price">
                      <xsl:value-of select="concat(price,' ',price/@unit)"/>
                    </xsl:when>
                    <xsl:otherwise>Not set</xsl:otherwise>
                  </xsl:choose>
                </td>
              </tr>
              <tr>
                <td>
                  <xsl:text> </xsl:text>
                </td>
                <td class="totop">
                  <xsl:value-of select="concat('by ', author/givenname, ' ' ,author/middlename,' ',author/surname)"></xsl:value-of>
                </td>
                <td colspan="2" class="description">
                  <xsl:choose>
                    <xsl:when test="description">
                      <xsl:value-of disable-output-escaping="yes" select="description"></xsl:value-of>
                    </xsl:when>
                    <xsl:otherwise>Coming soon...</xsl:otherwise>
                  </xsl:choose>
                </td>
              </tr>
            </xsl:for-each>
          </xsl:for-each>
        </table>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

HTML tabel

2.stiilifail

Teine transformatsioon (HTML-iks). Tekitatakse kena tabel (värvilahendus pärineb W3Schoolsilt) mida saab vaadata faili järel. Tabelis on vaid unikaalsed raamatusarjade nimed neile eelnevate järjekorranumbritega.

<?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:key name="DistinctSeries" match="book" use="@bookseries"/>
  <xsl:template match="/">
    <xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text>
    <html>
      <head>
        <title>Distinct series</title>
        <style type="text/css">
          // Style borrowed from: http://www.w3schools.com/css/tryit.asp?filename=trycss_table_fancy
          table {
          font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
          border-collapse: collapse;
          }
          th {
          text-align: left;
          background-color: #A7C942;
          }
          tr td {
          font-size: 1em;
          border: 1px solid #98bf21;
          padding: 3px 7px 2px 7px;
          }
        </style>
      </head>
      <body>
        <table>
          <tr>
            <th>Id</th>
            <th>Series name</th>
          </tr>
          <!-- Borrowed from: http://stackoverflow.com/questions/5331532/unique-elements-with-xsl-generate-key -->
          <xsl:for-each select="books/series/book[generate-id() = generate-id(key('DistinctSeries', @bookseries)[1])]">
            <tr>
              <td>
                <xsl:value-of select="position()"/>
              </td>
              <td>
                <xsl:value-of select="@bookseries"/>
              </td>
            </tr>
          </xsl:for-each>
        </table>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

HTML tabel

3.stiilifail

Kolmas transformatsioon (XML-iks). Tekitatakse XML fail mis sisaldab vaid hetkel vajalikku infot.

<?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="/">
    <books>
      <xsl:for-each select="books/series">
        <xsl:for-each select="book">
          <xsl:if test="price > 2.07">
            <book id="{@id}">
              <title>
                <xsl:value-of select="title" />
              </title>
              <price unit="{price/@unit}">
                <xsl:value-of select="price" />
              </price>
              <released>
                <xsl:value-of select="released" />
              </released>
            </book>
          </xsl:if>
        </xsl:for-each>
      </xsl:for-each>
    </books>
  </xsl:template>
</xsl:stylesheet>

Eksporditav XML fail:

<?xml version="1.0" encoding="utf-8"?>
<books>
  <book id="1">
    <title>Revelation and Dust</title>
    <price unit="USD">7.99</price>
    <released>2013-08-27</released>
  </book>
  <book id="2">
    <title>The Crimson Shadow</title>
    <price unit="USD">3.24</price>
    <released>2013-09-24</released>
  </book>
  <book id="4">
    <title>The Poisoned Chalice</title>
    <price unit="USD">7.99</price>
    <released>2013-11-26</released>
  </book>
  <book id="6">
    <title>Star Trek: Section 31: Disavowed</title>
    <price unit="USD">7.99</price>
    <released>2014-10-28</released>
  </book>
</books>

XML failide retsensioonid

Tähtaeg: 14. märts 2015

retsensioon meeskonnale Vertigo Esitatud: 08. märts 2015

retsensioon meeskonnale Error 503 Esitatud: 14. märts 2015

Projekti analüüs

(tähtaeg 4.aprill 2015)

Rakenduse ideeks on luua ask.com-i sarnane keskkond kus kasutajatele saaks (anonüümselt) küsimusi esitada. See koosneb järgmistest osadest:

  1. Veebiteenus
  2. Kliendirakendus - mobiiliveeb (mõeldud kasutamiseks ekraanidel laiuse alates 480 pikslit)
  3. Administraatoripaneel – mõeldud kasutamiseks tavaarvutis (ekraani laius alates 960 pikslit)

2. ja 3. osa teostatakse ASP.NET-i veebisaidina mis saavad andmebaasilt infot läbi veebi-teenuse JSON päringute kaudu.

Keskkonna nimeks saab KVK (lühend fraasist „Küsida võib kõike“), selle ärilisel eesmär-gil kasutamiseks võiks seal müüa reklaami.


KVK üldine kasutamine oleks järgmine:

Kõik saavad sisse logimata otsida kasutajaid ja vaadata küsimusi mida nood on vastanud. Küsimuse esitamiseks peab sisse logima. Isik kellele küsimus esitati ei näe küsimuse esitaja andmeid. Kui esitatud küsimus ei meeldi, saab selle vastamata kustutada. Administraatori-le kaebamise võimalust ei ole. Kui esitatud küsimus kustutatakse, blokeeritakse küsija võimalus edasisi küsimusi esitada 1 tunniks. Teise järjestikuse kustutatud küsimuse korral samale kasutajale 24-ks tunniks. Kõik sisse logitud kasutajad saavad kliendirakendust (ja seega ka veebiteenust) kasutada ainult piiratud mahus (1000 JSON päringut 2 jooksva tunni jooksul). Sama kehtib ka anonüümsete kasutajate kohta (neid eristatakse IP-aadressi põhjal). Vajab kaalumist võimalus lasta anonüümsetel kasutajatel teha rohkem päringuid kui sisse logitud kasutajatel (kuna NAT-i (Network Address Translation) tõttu võib ühelt IP-aadressilt teenust kasutada mitu inimest). Administraatorite juurdepääs veebiteenusele pole piiratud.

Sisse logimine käib kasutajanime ja salasõna kombinatsiooniga. Registreerimiseks tuleb kasutada emaili, registreerijale saadetakse kinnituslink http://www.aspsnippets.com/Articles/Send-user-Confirmation-email-after-Registration-with-Activation-Link-in-ASPNet.aspx. Email peab pärinema domeenilt @itcollege.ee sel-leks et vähendada kasutajate arvu (eesmärgiks on seada süsteem üles hostingusse (nt. Azu-re’i http://azure.microsoft.com/en-us/documentation/articles/web-sites-dotnet-deploy-aspnet-mvc-mobile-app/) ning tasuta pakkumiste puhul on andmebaasi maht piiratud, het-kel on andmebaasis 900 testküsimust ning andmebaasi maht on juba üle 4 MB). Emaili on seega vaja registreerimiseks, kasutajanime selleks, et seda saidil näidata.

Sellest tulenevalt on vaja luua järgmised vaated koos kaasneva funktsionaalsusega:

Kliendirakenduse vaated

(teostamisel kasutan põhiliselt Bootstrap-i ja Angulari)

kuna wiki ei võimalda mugavalt suure tasemete arvuga nimekirja loomist on vaadete nimistu (ja kogu analüüs) koos funktsionaalsusega saadaval siit []

Administraatoripaneel

(teostamisel kasutan ASP.NET-i poolt pakutavaid võimalusi ja püüan töömahu vähendamiseks erikujundusi vältida)

kuna wiki ei võimalda mugavalt suure tasemete arvuga nimekirja loomist on vaadete nimistu (ja kogu analüüs) koos funktsionaalsusega saadaval siit []

Veebiteenus

Päringute nimekiri selgub töö käigus

Muud tööd

Nice to have

  1. Saidi ülesseadmine hostingupakkujasse (nt. Azure)
  2. Hostingus oleva kliendirakenduse testimine erinevate mobiilibrauseritega (testi-miskeskkondade valik on lai http://www.practicalecommerce.com/articles/3883-19-Tools-to-Test-your-Site-for-Mobile-Devices)

Pildid

Esialgne andmemudel (vajab täiendamist)

File:Pilt

Märkus - kasutan code first lähenemist, ülalpool toodud mudel on tekitatud skriptiga andmete kontekstist.

Näidisvaade


pilt

Mis on veel lahtine

Kasutajate juurdepääsu haldamine ja veebiteenuse kaitsmine

Projekt

Veebiteenus

(tähtaeg 24. mai 2015)

Veebiteenuste retsensioonid

(600 sõna - tähtaeg 30. mai 2015)

Klientrakendus

(tähtaeg 24. mai 2015)

Klientrakenduste retsensioonid

(600 sõna - tähtaeg 30. mai 2015)