Skip to content
Simmo Saan edited this page May 21, 2017 · 24 revisions

potatonet Wiki

Implemented techniques

Phase 1

  • 1.2 Andmebaasi andmete esitamine (sh. JOIN lause) (1)
  • 1.3 Agregeeritud andmete esitamine (1)
  • 1.4 Javascript-ga lehel muudatuste tegemine vastusena kasutaja tegevustele (1)
  • 1.8 Meldimise (i.k. log in) järel näidatakse lehte, millele kasutaja soovis minna (1)
    • Functionality was achieved by relying on Spring's request cache.
    • ID-card required modifications to Spring's default redirect strategy: DomainRedirectStrategy.
  • 1.9 CDN failide test: kui CDN serverile ligipääs puudub kasutatakse kohalikku faili (1)
  • 1.10 Rakenduse koodirepositooriumi üles seadmine (tähtajaline, 1. etapp) (1)
  • 2.1 Andmete surumine (st. data push) (3)
    • Websocket is used to update posts in the main feed.
    • For better browser compatibility SockJS and Spring integration STOMP are used.
    • Posting causes own and friends' feeds to automatically be updated. In addition, anyone looking at your profile also sees the post immediately.
  • 2.4 AJAX kasutamine (3)
    • New post creation is performed using AJAX.
    • The request body is the usual HTTP POST request body. This is preferred to XML or JSON for multiple reasons:
      • jQuery provides a straightforward way to serialize a <form> element using .serialize(),
      • Server-side logic does not need to be changed to parse a different data format than the initial form data.
    • The response body is empty, because there's nothing to be delivered back.
  • 2.7 XML-põhiste keelte kooskasutus (3)
  • 2.9 Autoriseerimine (st. ainult meldinutele kättesaadav funktsionaalsus ja sisu) (3)
    • All of the application's content (besides initial login page) is accessible only by logged in users.
  • 2.10 Prototüüp (tähtajaline, 1. etapp) (3)
    • See initial prototype in the prototype.
    • Static web pages were created to show rough visual layout using Bootstrap.
    • The prototype pages were later transformed into page templates to be used with actual data.
  • 3.1 Autentimine (ID-kaart) (6)
  • 3.5 Rakenduse ülesseadmine testkeskkonda (tähtajaline, 2. etapp) (6)
  • 3.6 Projektiplaan (tähtajaline, 1. etapp) (6)

Phase 2

  • 1.5 Leheosade hilisem laadimine
    • Instead of loading the entire feed at once, it is loaded 50 posts at the time.
    • Scrolling to the bottom of the page will trigger loading of more posts via AJAX.
  • 1.6 Interaktiivne ehk rakendusesisene abiinfo
    • Focusing the password input in Settings view will show password requirements in a popover.
    • No other input fields on the site require clarifying information.
    • See settings.js.
  • 1.7 AJAX viited (bookmarks)
    • Clicking on a post's time in feed opens a modal window displaying its location (related to "2.5 Veebilehel sisu esitamine kaardil")
    • While the modal window is open, the browser URL is changed to the post's. This can be bookmarked.
    • The bookmarked page contains only that post and its location on a separate page as opposed to in a modal window on top of the feed. This is so for multiple reasons:
      • The bookmarked post might not be in the feed when the bookmark is visited so showing the exact same page as when it was bookmarked possibly requires loading more of the feed (related to "1.5 Leheosade hilisem laadimine"). This, however, is infeasible when the feed contains many posts since the bookmarked one.
      • Allows specific posts to be linked.
    • Browser's back and forward buttons behave intuitively closing and reopening the modal window respectively.
  • 2.3 Autentimine (Google)
    • Existing users can link their user with a Google account in Settings view.
    • This allows logging into the user using Google later.
    • See ee.potatonet.oauth.google package for Google authentication details.
  • 2.5 Veebilehel sisu esitamine kaardil
    • Posting allows the user to share location using JS Geolocation API to be saved as the post's location.
    • Statistics view shows all posts' locations aggregated into clusters on a Google Map.
    • Clicking on a post's time in feed opens a modal window displaying its location (related to "1.7 AJAX viited (bookmarks)")
  • 2.6 Võrguühenduseta kasutatav vähemalt osa funktsionaalsust
    • If the feed page is open but creating new posts does not work (e.g. lost internet connection), the posts will be stored in browser's Local Storage.
    • A warning is displayed if there are such posts stored.
    • Locally stored posts are posted in the correct order when again possible. Posting locally stored posts is attempted when:
      • periodically when the page is open,
      • the page is opened some other time,
      • the user tries to make another post.
  • 2.8 Mitmekeelne kasutajaliides
    • Translations are stored in the messages resource bundle.
    • Logged in users can choose their preferred language in Settings view and is saved in the database.
    • Language information is put into a browser cookie after successful login.
  • Jooksvad nõuded

Phase 3

Phase 4

  • 3.2 Päringute arvu ja mahu piiramine (st. veebirakenduse optimeerimine, sh. cache päiste kasutamine, Google PageSpeed?)
  • 3.3 Automaattestid
    • Cucumber testing framework was used to write behavioural tests for the web application.
    • Selenium WebDriver was used as the underlying client for navigating in the application and checking the results.
    • The main test logic is in features test resources - each file describes a feature in human-readable form and these steps are ran using the classes in ee.potatonet.cucumber package.
    • The tests cover all the basic functionality: login, logout, redirect, changing settings, posting, liking, commenting, adding and removing friends, etc.
    • Donation and statistics functionality isn't tested.
    • Tests can be run by executing mvn test in the project's root directory.

Phase 5

  • Funktsionaalsus
    • All planned functionality has been added.
  • Jooksvad nõuded

Phase 6

Phase 7