| // |
| // Licensed to the Apache Software Foundation (ASF) under one |
| // or more contributor license agreements. See the NOTICE file |
| // distributed with this work for additional information |
| // regarding copyright ownership. The ASF licenses this file |
| // to you under the Apache License, Version 2.0 (the |
| // "License"); you may not use this file except in compliance |
| // with the License. You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, |
| // software distributed under the License is distributed on an |
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| // KIND, either express or implied. See the License for the |
| // specific language governing permissions and limitations under the License. |
| // |
| |
| // WARNING! Changing this file will affect unit-tests |
| // A canonical JSON backed DB of OpenSocial datastructures in their RESTful forms |
| // |
| // Basic structure: |
| // { people : Array<Person>, |
| // activity : Map<Person.Id, Array<Activity>> |
| // data : Map<Person.Id, Map<String,String>> |
| // friendLinks : Map<Person.Id, Array<Person.Id>> |
| // userApplications : Map<Person.Id, Array<Application.Id>> |
| // messages : Map<Person.Id, Array<Message>> |
| // } |
| // |
| // Notes: |
| // - The structure of Person, Activity MUST! match those in the RESTful spec |
| // - Data for "canonical" user should exercise every field in the spec. And is relied on |
| // for unit-testing so change at your peril |
| // - Consider adding a structure for Map<Person.Id, Array<appId>> to represent installed gadgets |
| // |
| // TODO: |
| // - Use URLs for appIds |
| // |
| // |
| { |
| "people" : [ |
| { |
| "id" : "canonical", |
| "aboutMe" : "I have an example of every piece of data", |
| "activities" : ["Coding Shindig"], |
| "addresses" : [{ |
| "country" : "US", |
| "latitude" : "28.3043", |
| "longitude" : "143.0859", |
| "locality" : "who knows", |
| "postalCode" : "12345", |
| "region" : "Apache, CA", |
| "streetAddress" : "1 OpenStandards Way", |
| "type" : "home", |
| "formatted" : "PoBox 3565, 1 OpenStandards Way, Apache, CA" |
| }], |
| "age" : 33, |
| "bodyType" : { |
| "build" : "svelte", |
| "eyeColor" : "blue", |
| "hairColor" : "black", |
| "height" : 1.84, |
| "weight" : 74 |
| }, |
| "books" : ["The Cathedral & the Bazaar","Catch 22"], |
| "cars" : ["beetle","prius"], |
| "children" : "3", |
| "currentLocation" : { |
| "latitude" : "48.858193", |
| "longitude" : "2.29419" |
| }, |
| "birthday" : "1975-01-01", |
| "displayName" : "Shin Digg", |
| "drinker" : { |
| "value" : "SOCIALLY", |
| "displayValue" : "Socially" |
| }, |
| "emails" : [{ |
| "value" : "dev@shindig.apache.org", |
| "type" : "work" |
| }], |
| "ethnicity" : "developer", |
| "fashion" : "t-shirts", |
| "food" : ["sushi","burgers"], |
| "gender" : "male", |
| "happiestWhen" : "coding", |
| "hasApp" : true, |
| "heroes" : ["Doug Crockford", "Charles Babbage"], |
| "humor" : "none to speak of", |
| "interests" : ["PHP","Java"], |
| "jobInterests" : "will work for beer", |
| "organizations" : [{ |
| "address" : { |
| "formatted" : "1 Shindig Drive" |
| }, |
| "description" : "lots of coding", |
| "endDate" : "2010-10-10", |
| "field" : "Software Engineering", |
| "name" : "Apache.com", |
| "salary" : "$1000000000", |
| "startDate" : "1995-01-01", |
| "subField" : "Development", |
| "title" : "Grand PooBah", |
| "webpage" : "http://shindig.apache.org/", |
| "type" : "job" |
| },{ |
| "address" : { |
| "formatted" : "1 Skid Row" |
| }, |
| "description" : "", |
| "endDate" : "1995-01-01", |
| "field" : "College", |
| "name" : "School of hard Knocks", |
| "salary" : "$100", |
| "startDate" : "1991-01-01", |
| "subField" : "Lab Tech", |
| "title" : "Gopher", |
| "webpage" : "", |
| "type" : "job" |
| }], |
| "languagesSpoken" : ["English","Dutch","Esperanto"], |
| "updated" : "2006-06-06T12:12:12Z", |
| "livingArrangement" : "in a house", |
| "lookingFor" : [ |
| {"value" : "RANDOM", "displayValue" : "Random"}, |
| {"value" : "NETWORKING", "displayValue" : "Networking"} |
| ], |
| "movies" : ["Iron Man", "Nosferatu"], |
| "music" : ["Chieftains","Beck"], |
| "name" : { |
| "additionalName" : "H", |
| "familyName" : "Digg", |
| "givenName" : "Shin", |
| "honorificPrefix" : "Sir", |
| "honorificSuffix" : "Social Butterfly", |
| "formatted" : "Sir Shin H. Digg Social Butterfly" |
| }, |
| "networkPresence" : { |
| "value" : "ONLINE", |
| "displayValue" : "Online" |
| }, |
| "nickname" : "diggy", |
| "pets" : "dog,cat", |
| "phoneNumbers" : [{ |
| "value" : "111-111-111", |
| "type" : "work" |
| },{ |
| "value" : "999-999-999", |
| "type" : "mobile" |
| }], |
| "politicalViews" : "open leaning", |
| "profileSong" : { |
| "value" : "http://www.example.org/songs/OnlyTheLonely.mp3", |
| "linkText" : "Feelin' blue", |
| "type" : "road" |
| }, |
| "profileUrl" : "http://www.example.org/?id=1", |
| "profileVideo" : { |
| "value" : "http://www.example.org/videos/Thriller.flv", |
| "linkText" : "Thriller", |
| "type" : "video" |
| }, |
| "quotes" : ["I am therfore I code", "Doh!"], |
| "relationshipStatus" : "married to my job", |
| "religion" : "druidic", |
| "romance" : "twice a year", |
| "scaredOf" : "COBOL", |
| "sexualOrientation" : "north", |
| "smoker" : { |
| "value" : "NO", |
| "displayValue" : "No" |
| }, |
| "sports" : ["frisbee","rugby"], |
| "status" : "happy", |
| "tags" : ["C#","JSON","template"], |
| "thumbnailUrl" : "http://www.example.org/pic/?id=1", |
| "utcOffset" : "-8", |
| "turnOffs" : ["lack of unit tests","cabbage"], |
| "turnOns" : ["well document code"], |
| "tvShows" : ["House","Battlestar Galactica"], |
| "urls" : [{ |
| "value" : "http://www.example.org/?id=1", |
| "linkText" : "my profile", |
| "type" : "Profile" |
| },{ |
| "value" : "http://www.example.org/pic/?id=1", |
| "linkText" : "my awesome picture", |
| "type" : "Thumbnail" |
| }] |
| }, |
| { |
| "id" : "john.doe", |
| "displayName" : "Johnny", |
| "gender" : "male", |
| "hasApp" : true, |
| "name" : { |
| "familyName" : "Doe", |
| "givenName" : "John", |
| "formatted" : "John Doe" |
| } |
| }, |
| { |
| "id" : "jane.doe", |
| "displayName" : "Janey", |
| "gender" : "female", |
| "hasApp" : true, |
| "name" : { |
| "familyName" : "Doe", |
| "givenName" : "Jane", |
| "formatted" : "Jane Doe" |
| } |
| }, |
| { |
| "id" : "george.doe", |
| "displayName" : "Georgey", |
| "gender" : "male", |
| "hasApp" : true, |
| "name" : { |
| "familyName" : "Doe", |
| "givenName" : "George", |
| "formatted" : "George Doe" |
| } |
| }, |
| { |
| "id" : "mario.rossi", |
| "displayName" : "Mario", |
| "gender" : "male", |
| "hasApp" : true, |
| "name" : { |
| "familyName" : "Rossi", |
| "givenName" : "Mario", |
| "formatted" : "Mario Rossi" |
| } |
| }, |
| { |
| "id" : "maija.m", |
| "displayName" : "Maija", |
| "gender" : "female", |
| "hasApp" : true, |
| "name" : { |
| "familyName" : "Meikäläinen", |
| "givenName" : "Maija", |
| "formatted" : "Maija Meikäläinen" |
| } |
| }], |
| // |
| // ----------------------------- Data --------------------------------------- |
| // |
| "data" : { |
| "canonical" : { |
| "count" : "2", |
| "size" : "100" |
| }, |
| "john.doe" : { |
| "count" : "0" |
| }, |
| "george.doe" : { |
| "count" : "2" |
| }, |
| "jane.doe" : { |
| "count" : "7" |
| } |
| }, |
| "activities" : { |
| "canonical" : [{ |
| "appId" : "1", |
| "body" : "Went rafting", |
| "bodyId" : "1", |
| "externalId" : "http://www.example.org/123456", |
| "id" : "1", |
| "updated" : "2008-06-06T12:12:12Z", |
| "mediaItems" : [{ |
| "mimeType" : "image/*", |
| "type" : "image", |
| "url" : "http://upload.wikimedia.org/wikipedia/commons/thumb/7/77/Rafting_em_Brotas.jpg/800px-Rafting_em_Brotas.jpg" |
| },{ |
| "mimeType" : "audio/mpeg", |
| "type" : "audio", |
| "url" : "http://www.archive.org/download/testmp3testfile/mpthreetest.mp3" |
| }], |
| "postedTime" : "1111111111", |
| "priority" : "0.7", |
| "streamFaviconUrl" : "http://upload.wikimedia.org/wikipedia/commons/0/02/Nuvola_apps_edu_languages.gif", |
| "streamSourceUrl" : "http://www.example.org/canonical/streamsource", |
| "streamTitle" : "All my activities", |
| "streamUrl" : "http://www.example.org/canonical/activities", |
| "templateParams" : { |
| "small" : "true", |
| "otherContent" : "and got wet" |
| }, |
| "title" : "My trip", |
| "titleId" : "1", |
| "url" : "http://www.example.org/canonical/activities/1", |
| "userId" : "canonical" |
| },{ |
| "appId" : "1", |
| "body" : "Went skiing", |
| "bodyId" : "1", |
| "externalId" : "http://www.example.org/123457", |
| "id" : "1", |
| "updated" : "2008-06-10T12:12:12Z", |
| "postedTime" : "1111111112", |
| "priority" : "0.7", |
| "streamFaviconUrl" : "http://upload.wikimedia.org/wikipedia/commons/0/02/Nuvola_apps_edu_languages.gif", |
| "streamSourceUrl" : "http://www.example.org/canonical/streamsource", |
| "streamTitle" : "All my activities", |
| "streamUrl" : "http://www.example.org/canonical/activities", |
| "templateParams" : { |
| "small" : "true", |
| "otherContent" : "and went fast" |
| }, |
| "title" : "My next trip", |
| "titleId" : "1", |
| "url" : "http://www.example.org/canonical/activities/2", |
| "userId" : "canonical" |
| }], |
| "john.doe" : [{ |
| "id" : "1", |
| "userId" : "john.doe", |
| "title" : "yellow", |
| "body" : "what a color!" |
| }], |
| "jane.doe" : [{ |
| "id" : "1", |
| "body" : "and she thinks you look like him", |
| "mediaItems" : [{ |
| "mimeType" : "image/jpeg", |
| "type" : "image", |
| "url" : "http://animals.nationalgeographic.com/staticfiles/NGS/Shared/StaticFiles/animals/images/primary/black-spider-monkey.jpg" |
| },{ |
| "mimeType" : "image/jpeg", |
| "type" : "image", |
| "url" : "http://image.guardian.co.uk/sys-images/Guardian/Pix/gallery/2002/01/03/monkey300.jpg" |
| }], |
| "streamTitle" : "jane's photos", |
| "title" : "Jane just posted a photo of a monkey", |
| "userId" : "jane.doe" |
| },{ |
| "id" : "2", |
| "body" : "or is it you?", |
| "mediaItems" : [{ |
| "mimeType" : "image/jpeg", |
| "type" : "image", |
| "url" : "http://www.funnyphotos.net.au/images/fancy-dress-dog-yoda-from-star-wars1.jpg" |
| }], |
| "streamTitle" : "jane's photos", |
| "title" : "Jane says George likes yoda!", |
| "userId" : "jane.doe" |
| }] |
| |
| }, |
| // |
| // ----------------------------- Data --------------------------------------- |
| // |
| "friendLinks" : { |
| "canonical" : ["john.doe", "jane.doe", "george.doe", "maija.m"], |
| "john.doe" : ["jane.doe", "george.doe", "maija.m"], |
| "jane.doe" : ["john.doe"], |
| "george.doe" : ["john.doe"], |
| "maija.m" : [] |
| }, |
| // |
| // ----------------------------- Groups --------------------------------------- |
| // |
| "groups" : { |
| "john.doe" : ["1", "2", "3"], |
| "george.doe" : ["13","14"], |
| }, |
| // |
| //---------------------------- Data For User Applications -------------------------------------------- |
| // |
| "userApplications" : { |
| "canonical" : ["9158", "9703", "9143", "8877"], |
| "john.doe" : ["8877", "9143", "9158"], |
| "jane.doe" : ["9158", "9703"], |
| "george.doe" : ["9143"], |
| "maija.m" : [] |
| }, |
| // |
| //--------------------------- Message Collections. ----------------------------------------- |
| // |
| "messages" : { |
| "canonical" : { |
| "notification" : {"title" : "Notifications", |
| "messages" : [ |
| {"id": "1", "title": "whazzup", "type": "notification", "body": "hey dude."}, |
| {"id": "2", "title": "play checkers", "type": "notification", "body": "hot online checkers action"}, |
| {"id": "3", "title": "you won!", "type": "notification", "body": "<b>yes, you really, really won!</b>"} |
| |
| ]}, |
| "publicMessage" : { "title" : "Profile Comments", |
| "messages" : [ |
| {"id": "1", "senderId": "john.doe", "title": "Hairdo", "type": "publicMessage", "body": "nice "haircut!"", "replies": ["1a","1b"]}, |
| {"id": "1a", "senderId": "canonical", "title": "", "type": "publicMessage", "body": "that's not hair, it's a wig!", "inReplyTo": "1"}, |
| {"id": "1b", "senderId": "john.doe", "title": "100% polyester", "type": "publicMessage", "body": "only the finest hyrdrocarbons :)","inReplyTo": "1"}, |
| {"id": "2", "senderId": "jane.doe", "title": "hola", "type": "publicMessage", "body": "be my bff?"} |
| |
| ]}, |
| "privateMessage" : {"title" : "Inbox", |
| "messages" : []} |
| |
| }, |
| |
| "john.doe" : { |
| "notification" : {"title" : "Notifications", |
| "messages" : [ |
| {"id": "1", "title": "you received a peanut", "type": "notification", "body": "peanuts are healthy"}, |
| {"id": "3", "title": "Group Request", "type": "notification", "body": "Join Cat Lovers Anonymous"} |
| ]}, |
| "privateMessage" : {"title" : "Inbox", "messages" : []}, |
| "publicMessage" : {"title" : "Inbox", "messages" : []} |
| }, |
| "jane.doe" : { |
| "notification" : {"title" : "Notifications", "messages" : []}, |
| "privateMessage" : {"title" : "Inbox", "messages" : []}, |
| "publicMessage" : {"title" : "Inbox", "messages" : []} |
| }, |
| "george.doe" : { |
| "notification" : {"title" : "Notifications", "messages" : []}, |
| "privateMessage" : {"title" : "Inbox", "messages" : []}, |
| "publicMessage" : {"title" : "Inbox", "messages" : []} |
| }, |
| "maija.m" : { |
| "notification" : {"title" : "Notifications", "messages" : []}, |
| "privateMessage" : {"title" : "Inbox", "messages" : []}, |
| "publicMessage" : {"title" : "Inbox", "messages" : []} |
| } |
| }, |
| // |
| // Gadgets/App information. OAuth Consumer Key defaults to the app url. |
| // |
| "apps" : { |
| "http://localhost:8080/gadgets/files/samplecontainer/examples/SocialHelloWorld.xml": |
| { "title" : "Social Hello World", |
| "consumerSecret" : "secret", |
| "icon" : "http://localhost:8080/gadgets/files/samplecontainer/examples/icon.png"}, |
| "http://localhost:8080/gadgets/files/samplecontainer/examples/SocialActivitiesWorld.xml" : |
| { "title" : "Social Activities World", |
| "consumerSecret" : "secret", |
| "icon" : "http://localhost:8080/gadgets/files/samplecontainer/examples/icon.png"}, |
| "http://localhost:8080/gadgets/files/samplecontainer/examples/oauth.xml" : |
| { "title" : "Demo OAuth Gadget", |
| "consumerSecret" : "secret", |
| "icon" : "http://localhost:8080/gadgets/files/samplecontainer/examples/icon.png"} |
| }, |
| |
| // duplicates userApplications as above.. |
| "permissions": { |
| "john.doe" : { "http://localhost:8080/gadgets/files/samplecontainer/examples/SocialHelloWorld.xml" : { installed : true}, |
| "http://localhost:8080/gadgets/files/samplecontainer/examples/SocialActivitiesWorld.xml" : { installed : true} |
| }, |
| "canonical" :{ "http://localhost:8080/gadgets/files/samplecontainer/examples/SocialHelloWorld.xml" : { installed : true}, |
| "http://localhost:8080/gadgets/files/samplecontainer/examples/SocialActivitiesWorld.xml" : { installed : true} |
| } |
| }, |
| // Passwords for authenticaiton service |
| "passwords" : { |
| "john.doe" : "password", |
| "jane.doe" : "password", |
| "canonical" : "password" |
| } |
| } |