Voting Tool: Unterschied zwischen den Versionen

Aus Java Student User Group Austria - Java + JVM in Wien Österreich / Vienna Austria
Wechseln zu: Navigation, Suche
(Die Seite wurde neu angelegt: This site contains a short overview of the JSUG Voting tool hosted at [http://code.google.com/p/jsugvoting/ googlecode]. Its frontend is realized with Adobe Flex, where...)
 
(Protocol)
 
(33 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
This site contains a short overview of the JSUG Voting tool hosted at [http://code.google.com/p/jsugvoting/ googlecode]. Its frontend is realized with Adobe Flex, whereas the complete backend is written in PHP.
+
<!--<p align="center" style="font-size:22pt;padding-top:10px;padding-bottom:15px;">[http://jsugvoting.at.tt http://jsugvoting.at.tt]<span style="font-size:8pt;bold;color:#999999;">&nbsp;&nbsp;&nbsp;Beta v0.4</span></p>-->
  
==Hard Facts==
+
This site contains a short overview of the JSUG Voting Tool hosted at [http://code.google.com/p/jsugvoting/ googlecode]. Its aim is to provide an easy way figuring out which topics are preferred by the members.
  
Whole communication is done via sending/parsing simple XML.
+
__TOC__
  
===Flex Frontend===
+
=General=
 +
==Technologies used==
  
* Flex SDK 3.2
+
* GWT 1.5.3
* FlexBuilder 3.0.2
+
* RESTful Webservices
* Cairngorm
+
* PHP 5
  
===PHP Backend===
 
  
* PHP5
+
==Access Sourcecode==
* Simple XML for parsing communication data
 
* FrontController
 
* PDO
 
* MySQL and SQLite implementations
 
 
 
==Sources==
 
  
 
You can check out the full source code by:
 
You can check out the full source code by:
 
<code>
 
<code>
  # Non-members may check out a read-only working copy anonymously over HTTP.
+
# anonymous read-only access:
  svn checkout http://jsugvoting.googlecode.com/svn/jsugvoting-read-only  
+
  svn checkout <nowiki>http://jsugvoting.googlecode.com/svn/</nowiki> jsugvoting-read-only  
 +
 +
# project members only:
 +
svn checkout <nowiki>https://jsugvoting.googlecode.com/svn/trunk/</nowiki> jsugvoting --username <your_name>
 
</code>
 
</code>
  
Or just browse it via the url: [http://code.google.com/p/jsugvoting/source/browse/#svn/v1 http://code.google.com/p/jsugvoting/source/browse/]
+
=Technical Documentation=
 +
 
 +
... kind of ...
 +
 
 +
==Usecases==
 +
 
 +
* Anonym
 +
** View Topics
 +
** Register
 +
** Login
 +
* Member
 +
** Logout
 +
** Vote
 +
** Unvote
 +
** Request Talk
 +
** Offer Talk
 +
** Join Talk
 +
* ''Admin''
 +
** Edit Topic
 +
 
 +
=== Commands/Events ===
 +
 
 +
* ??? ReloadData
 +
* Register
 +
* Login
 +
* Logout
 +
* GiveVote
 +
* RevokeVote
 +
* RequestTalk
 +
* OfferTalk
 +
* JoinTalk
 +
 
 +
== Valueobjects==
 +
 
 +
* TalkEntity
 +
** id: long
 +
** createdOn: timestamp
 +
** createdBy: User
 +
** title: String
 +
** votes: Vote[]
 +
** tags: Tag[]
 +
** detail: String
 +
** link: String // LUXURY // about topic itself
 +
** thumbnail: image // LUXURY
 +
** state: Enum {need | offer | next | past}
 +
** attribute1: String // attributes are state depending (?)
 +
** attribute2: String
 +
** attribute3: String
 +
** attribute4: String
 +
 
 +
* VoteEntity
 +
** topicId: long
 +
** userId: long
 +
** createdOn: timestamp
  
==Data Model==
+
* <span style="text-decoration:line-through;">UserEntity</span>
 +
** id: long
 +
** createdOn: timestamp
 +
** username: String
 +
** password: String // SHA-1 encrypted
 +
** email: String
 +
 
 +
* Tag
 +
** id: long
 +
** word: String
 +
 
 +
 
 +
==Protocol==
 +
 
 +
* describes passed json/xml dataformats
 +
* mimetypes:
 +
** application/json
 +
** application/xml
 +
 
 +
===Overview===
 +
 
 +
* Request
 +
** Head
 +
*** Message Version; e.g. "0.1"
 +
*** Message Code (unique for this request/response); e.g. "7"
 +
*** Status Code
 +
** Body
 +
*** ...
 +
 
 +
===Talk===
 +
 
 +
GET: /users; response:
  
 
<code>
 
<code>
  +====================================================+
+
  [
| user                                              |
+
    {
+====================================================+
+
      Id: 1,
| *) user_id: INTEGER, PRIMARY KEY                  |
+
      Username: "foo"
| *) username: VARCHAR(80)                          |
+
    },
| *) password: VARCHAR(80)                          |
+
    {
+----------------------------------------------------+
+
      Id: 2,
+
      Username: "bar"
+====================================================+
+
    }
| category                                          |
+
  ]
+====================================================+
 
|                                                    |
 
| *) category_id: INTEGER, PRIMARY KEY              |
 
| *) title: VARCHAR(255)                            |
 
|                                                    |
 
+----------------------------------------------------+
 
 
+====================================================+
 
| topic                                              |
 
+====================================================+
 
| *) topic_id: INTEGER, PRIMARY KEY                  |
 
| *) title: VARCHAR(255)                            |
 
+----------------------------------------------------+
 
 
+====================================================+
 
| offered_topic                                      |
 
+====================================================+
 
| *) offered_topic_id: INTEGER, PRIMARY KEY          |
 
| *) topic_id: INTEGER, REF(topic.topic_id)          |
 
| *) user_id: INTEGER, REF(user.user_id)            |
 
+----------------------------------------------------+
 
 
+====================================================+
 
| needed_topic                                      |
 
+====================================================+
 
| *) needed_topic_id: INTEGER, PRIMARY KEY          |
 
| *) topic_id: INTEGER, REF(topic.topic_id)          |
 
| *) category_id: INTEGER, REF(category.category_id) |
 
+----------------------------------------------------+
 
 
+====================================================+
 
| vote                                              |
 
+====================================================+
 
| *) user_id: INTEGER, REF(user.user_id)            |
 
| *) topic_id: INTEGER, REF(topic.topic_id)          |
 
  +----------------------------------------------------+
 
 
</code>
 
</code>
  
==Requirements==
+
== REST ==
  
===Important===
+
* /session ... von REST vordefined
 +
** GET: X
 +
** PUT: X
 +
** POST: login
 +
** DELETE: logout
 +
* /users
 +
** GET: list all users
 +
** PUT: X
 +
** POST: register new user
 +
** DELETE: X
 +
* /talks
 +
** GET: list all talks
 +
** PUT: X
 +
** POST: new talk
 +
** DELETE: X
 +
* /talks/{talkId}
 +
** GET: X (evtl: display talk)
 +
** PUT: X
 +
** POST: X
 +
** DELETE: X (admin: delete talk)
 +
* /talks/{talkId}/speakers
 +
** GET: X
 +
** PUT: X
 +
** POST: join that talk
 +
** DELETE: delete yourself
 +
* /talks/{talkId}/vote
 +
** GET: X (evtl: returned true/false if yet voted)
 +
** PUT: X
 +
** POST: add vote
 +
** DELETE: unvote
  
* Login/Logout
+
== Service API ==
* View topics + details
 
* Add topic
 
* Submit vote
 
  
===Luxury===
+
* AuthService
 +
** login(username: String, password: String): boolean
 +
** logout(): void
 +
** register(username: String, password: String, email: String): boolean
 +
* TopicsService
 +
** ...
  
* Search ... with continuous filtering
+
[[Category:Project]]
* Use already existing wiki-users instead of separate User database table
+
[[Category:JsugTool]]

Aktuelle Version vom 23. März 2009, 17:12 Uhr


This site contains a short overview of the JSUG Voting Tool hosted at googlecode. Its aim is to provide an easy way figuring out which topics are preferred by the members.

General

Technologies used

  • GWT 1.5.3
  • RESTful Webservices
  • PHP 5


Access Sourcecode

You can check out the full source code by:

# anonymous read-only access:
svn checkout http://jsugvoting.googlecode.com/svn/ jsugvoting-read-only 

# project members only:
svn checkout https://jsugvoting.googlecode.com/svn/trunk/ jsugvoting --username <your_name>

Technical Documentation

... kind of ...

Usecases

  • Anonym
    • View Topics
    • Register
    • Login
  • Member
    • Logout
    • Vote
    • Unvote
    • Request Talk
    • Offer Talk
    • Join Talk
  • Admin
    • Edit Topic

Commands/Events

  •  ??? ReloadData
  • Register
  • Login
  • Logout
  • GiveVote
  • RevokeVote
  • RequestTalk
  • OfferTalk
  • JoinTalk

Valueobjects

  • TalkEntity
    • id: long
    • createdOn: timestamp
    • createdBy: User
    • title: String
    • votes: Vote[]
    • tags: Tag[]
    • detail: String
    • link: String // LUXURY // about topic itself
    • thumbnail: image // LUXURY
    • state: Enum {need | offer | next | past}
    • attribute1: String // attributes are state depending (?)
    • attribute2: String
    • attribute3: String
    • attribute4: String
  • VoteEntity
    • topicId: long
    • userId: long
    • createdOn: timestamp
  • UserEntity
    • id: long
    • createdOn: timestamp
    • username: String
    • password: String // SHA-1 encrypted
    • email: String
  • Tag
    • id: long
    • word: String


Protocol

  • describes passed json/xml dataformats
  • mimetypes:
    • application/json
    • application/xml

Overview

  • Request
    • Head
      • Message Version; e.g. "0.1"
      • Message Code (unique for this request/response); e.g. "7"
      • Status Code
    • Body
      • ...

Talk

GET: /users; response:

[
   {
     Id: 1,
     Username: "foo"
   },
   {
     Id: 2,
     Username: "bar"
   }
]

REST

  • /session ... von REST vordefined
    • GET: X
    • PUT: X
    • POST: login
    • DELETE: logout
  • /users
    • GET: list all users
    • PUT: X
    • POST: register new user
    • DELETE: X
  • /talks
    • GET: list all talks
    • PUT: X
    • POST: new talk
    • DELETE: X
  • /talks/{talkId}
    • GET: X (evtl: display talk)
    • PUT: X
    • POST: X
    • DELETE: X (admin: delete talk)
  • /talks/{talkId}/speakers
    • GET: X
    • PUT: X
    • POST: join that talk
    • DELETE: delete yourself
  • /talks/{talkId}/vote
    • GET: X (evtl: returned true/false if yet voted)
    • PUT: X
    • POST: add vote
    • DELETE: unvote

Service API

  • AuthService
    • login(username: String, password: String): boolean
    • logout(): void
    • register(username: String, password: String, email: String): boolean
  • TopicsService
    • ...