|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.fabula.timeline.service.rest.impl.TimelineResource
public class TimelineResource
REST services for Fabula Timeline Android Application.
Constructor Summary | |
---|---|
TimelineResource()
|
Method Summary | |
---|---|
void |
addUserToGroup(java.lang.String groupid,
java.lang.String username)
PUT Adds a user to a group URL: /group/{groupid}/user/{username}/ TODO: Register user if not registered |
Experiences |
GetAllExperiences()
GET Gets all experiences in server URL: /experiences/ Gets all the experiences stored. |
Experiences |
GetAllExperiencesWithSharedEventsAndUsersMoodEvent(java.lang.String username)
Helper method to retrieve all shared experiences of a user as well as the MoodEvents of the user. |
Mood |
getAverageMoodByID(java.lang.String experienceid)
GET Gets the average mood of an experience by ID URL: /mood/id/{experienceid}/ Produces a JSON String with the average mood including valence and arousal. |
Mood |
getAverageMoodByName(java.lang.String title)
GET Gets the average mood of an experience by title Note: Not as accurate as ID, and is case sensitive. |
java.lang.String |
getEvents()
GET Get events as String (Mainly for testing purposes) URL: /events/ Produces toString of all events as String |
Experiences |
getExperiences(java.lang.String username)
Helper method to retrieve all experiences of a user |
Group |
getGroup(java.lang.String groupid)
GET Gets the group with the id sent as parameter URL: /group/{groupid} Produces JSON or XML with group information. |
Groups |
getGroups()
GET Gets all the groups URL: /groups/ Produces JSON or XML with list of all groups |
Groups |
getGroupsOfUser(java.lang.String username)
GET Gets the groups the user is member of URL: /groups/{username} Produces JSON or XML with list of groups the user is member of. |
java.lang.String |
getRabbitAverageMoodByName(java.lang.String title)
A test method to satisfy input format(csv) for the Nabaztag rabbit. |
Experiences |
GetSharedExperiences(java.lang.String username)
GET Gets all experiences of a user URL: /experiences/{username} Takes username of the user to get experiences Produces the all experiences shared with the user as JSON or XML |
User |
getUser(java.lang.String username)
GET Gets the user with the username sent as parameter URL: /user/{username} Produces JSON or XML with user information. |
Users |
getUsers()
GET Gets all the users URL: /users/ Produces JSON or XML with all users. |
java.lang.String |
isUserInGroup(java.lang.String groupid,
java.lang.String username)
GET Gets if user is member in a group. |
void |
putEvent(Event event)
PUT Store or update one Event URL: /event/ Consumes a complete event as JSON or XML and stores/updates in Google App Engine. |
void |
putExperience(Experience experience)
PUT Store or update one Experience URL: /experience/ Consumes a complete experience as JSON or XML and stores/updates in Google App Engine. |
void |
putExperiences(Experiences experiences)
PUT Stores/updates all experiences in server URL: /experiences/ Stores all the experiences sent in. |
void |
putGroup(Group group)
PUT Registers a group URL: /group/ Consumes a JSON or XML with the group information. |
void |
putMood(Mood mood,
java.lang.String username,
java.lang.String id)
PUT Inserts a mood to an experience Uses experience id to identify experience URL: /mood/id/{id}/{username}/{moodX}/{moodY} Consumes a Mood as JSON or XML. |
void |
putMoodByID(java.lang.String id,
java.lang.String username,
double valence,
double arousal)
PUT Inserts a mood to an experience only by parameters, and no content needed Uses experience id to identify experience Merely for testing.Should use the method taking in mood as JSON, not in parameters. |
void |
putMoodByName(java.lang.String title,
java.lang.String username,
double valence,
double arousal)
PUT Inserts a mood to an experience only by parameters, and no content needed. |
void |
putUser(User user)
PUT Registers a user URL: /user/ Consumes a JSON or XML with the user information. |
void |
removeGroup(java.lang.String groupid)
DELETE Deletes a group URL: /group/{groupid} Takes a group id as parameter. |
void |
removeUserFromGroup(java.lang.String groupid,
java.lang.String username)
DELETE Removes a user form a group URL: /group/{groupid}/user/{username}/ |
void |
sendTimelineActivityReport(java.lang.String username)
The resource to send Timeline Activity Report. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TimelineResource()
Method Detail |
---|
public void putEvent(Event event)
{"eventItems":[
{"className":"SimpleNote",
"creator":"anderskri@gmail.com",
"id":"516733c5-ef9e-4324-bd93-ee204a582036",
"noteText":"Examplenote","noteTitle":"Example"}
],
"className":"Event",
"creator":"anderskri@gmail.com",
"experienceid":"a6a18076-9b96-4952-8bb6-cf56fee7b759",
"id":"7f8189b9-11cf-4b8a-9456-29d9359f6dad",
"latitude":63.40958633333333,
"longitude":10.431676433333333,
"valence":0.0,
"arousal":0.0,
"datetimemillis":1304362625287,
"shared":true,
"average":false
}
public java.lang.String getEvents()
public void putExperience(Experience experience)
{
"creator":"anderskri@gmail.com",
"events":[
{
"className":"MoodEvent",
"creator":"anderskri@gmail.com",
"datetimemillis":"1301556003782",
"experienceid":"4cfb71dc-30f6-47e5-829a-a21e08e568b9",
"id":"43799bf7-53fa-4acc-8045-0d8a0f29ea8b",
"latitude":"63.41652448",
"longitude":"10.4027416",
"valence":"1.0",
"arousal":"1.0",
"shared":"false",
"average":false
},
{
"className":"MoodEvent",
"creator":"andrstor87@gmail.com",
"datetimemillis":"1301556030401",
"experienceid":"4cfb71dc-30f6-47e5-829a-a21e08e568b9",
"id":"9689012d-520b-4bf1-b19f-06c1072f9f8b",
"latitude":"63.4165383",
"longitude":"10.40269734",
"valence":"0.0",
"arousal":"1.0",
"shared":"false",
"average":false
},
{
"className":"Event",
"creator":"andrstor87@gmail.com",
"datetimemillis":"1301556205024",
"emotionList":[
{
"emotionType":"LIKE",
"emotionid":"22d08b27-0266-4561-8a16-96b86b099aa9"
}
],
"eventItems":[
{
"className":"SimplePicture",
"creator":"andrstor87@gmail.com",
"filename":"-1779601815.jpg",
"id":"91e0b5ba-a384-40b4-88ac-edecf8c28e91"
},
{
"className":"SimpleNote",
"creator":"andrstor87@gmail.com",
"id":"9b3dd9a7-ac7e-44e2-a62d-e6191c2a3aff",
"noteText":"The most productive in the world.",
"noteTitle":"My workplace"
}
],
"experienceid":"4cfb71dc-30f6-47e5-829a-a21e08e568b9",
"id":"b05348b2-d827-4192-b153-c283ac251586",
"latitude":"63.41654401",
"longitude":"10.4027174",
"valence":"0.0",
"arousal":"0.0",
"shared":"true",
"average":false
},
{
"className":"Event",
"creator":"anderskri@gmail.com",
"datetimemillis":"1301564716999",
"eventItems":[
{
"className":"SimpleNote",
"creator":"test@timelineapp.no",
"id":"5c58f9ae-3f6a-4a79-b09e-a3ad9b58d26b",
"noteText":"Finally Fabula is on Timeline!",
"noteTitle":"Fabula on Timeline"
}
],
"experienceid":"4cfb71dc-30f6-47e5-829a-a21e08e568b9",
"id":"adf77be1-fc8d-4a5b-b465-16c4d09a68f6",
"latitude":"63.41654447",
"longitude":"10.402711",
"valence":"0.0",
"arousal":"0.0",
"shared":"true",
"average":false
},
{
"className":"Event",
"creator":"test@timelineapp.no",
"datetimemillis":"1301567596334",
"eventItems":[
{
"className":"SimplePicture",
"creator":"test@timelineapp.no",
"filename":"1689419062.mp4",
"id":"5fc3463d-31ef-42a4-8b5e-3ae5a9a58f57"
}
],
"experienceid":"4cfb71dc-30f6-47e5-829a-a21e08e568b9",
"id":"76d46599-eda8-487d-a829-b5517bc6ab43",
"latitude":"0.0",
"longitude":"0.0",
"valence":"0.0",
"arousal":"0.0",
"shared":"true",
"average":false
}
],
"id":"4cfb71dc-30f6-47e5-829a-a21e08e568b9",
"shared":"true",
"sharingGroup":"4bbd7541-5c49-45e5-87c9-d75ac1e3a36a",
"title":"Fabula"
}
public Experiences GetSharedExperiences(java.lang.String username)
username
- The username of the user to get shared experiences from
public Experiences getExperiences(java.lang.String username)
username
- The username of the user to get experiences from
public Experiences GetAllExperiencesWithSharedEventsAndUsersMoodEvent(java.lang.String username)
username
- The username of the user to get experiences from
public Experiences GetAllExperiences()
public void putExperiences(Experiences experiences)
experiences
- Experiences
to insertpublic void putUser(User user)
{"username":"yourusername@mail.com"}
user
- User
to insertpublic User getUser(java.lang.String username)
username
- of user to get
User
the user with the username sent as parameterpublic Users getUsers()
{"users":[{"username":"user1@gmail.com"},{"username":"user2@gmail.com"},{"username":"test@timelineapp.no"}]}
Users
the userspublic Group getGroup(java.lang.String groupid)
groupid
- of group to get
Group
the group with the id sent as parameterpublic void putGroup(Group group)
group
- The Group
to registerpublic void removeGroup(java.lang.String groupid)
groupid
- groupid of group to deletepublic Groups getGroupsOfUser(java.lang.String username)
username
- of user to get groups from.
Groups
the user is member of.public Groups getGroups()
Groups
the user is member of.public java.lang.String isUserInGroup(java.lang.String groupid, java.lang.String username)
groupid
- username
-
public void addUserToGroup(java.lang.String groupid, java.lang.String username)
groupid
- Id of group to add user tousername
- username of already registered userpublic void removeUserFromGroup(java.lang.String groupid, java.lang.String username)
groupid
- id of group to remove user fromusername
- of user to removepublic Mood getAverageMoodByID(java.lang.String experienceid)
{"valence":"0.1", "arousal":"0.4"}
experienceid
- Experience id of the experience to get average mood from.
Mood
of the Experience
public Mood getAverageMoodByName(java.lang.String title)
title
- title of the experience to get average mood from.
Mood
of the Experience
public java.lang.String getRabbitAverageMoodByName(java.lang.String title)
title
- public void putMoodByName(java.lang.String title, java.lang.String username, double valence, double arousal)
title
- of experience to insert moodusername
- of user to set as creatorvalence
- Mood valence to insert. Double from 0 to 1.arousal
- Mood arousal to insert. Double from 0 to 1.public void putMoodByID(java.lang.String id, java.lang.String username, double valence, double arousal)
id
- of experience to insert moodusername
- of user to set as creatorvalence
- Mood valence to insert. Double from 0 to 1.arousal
- Mood arousal to insert. Double from 0 to 1.public void putMood(Mood mood, java.lang.String username, java.lang.String id)
{"valence":"0.1", "arousal":"0.4"}
id
- of experience to insert moodusername
- of user to set as creatormood
- The Mood
to insert.public void sendTimelineActivityReport(java.lang.String username)
username
- of the user to create and send activity report to.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |