Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'runkeeper'

  • Loading branch information...
commit b981394d63d44996cc69a34e9c7a2706badd71ff 2 parents 3ee5809 + 01e1108
@ckemmler ckemmler authored
Showing with 2,577 additions and 116 deletions.
  1. +1 −0  .idea/artifacts/fluxtream_web_war_exploded.xml
  2. +13 −0 .idea/libraries/Maven__junit_junit_4_8_2.xml
  3. +13 −0 .idea/libraries/Maven__org_scribe_scribe_1_3_3.xml
  4. +2 −1  fluxtream-connectors/fluxtream-connectors.iml
  5. +6 −1 fluxtream-connectors/pom.xml
  6. +87 −0 fluxtream-connectors/src/main/java/com/fluxtream/connectors/evernote/EvernoteController.java
  7. +24 −0 fluxtream-connectors/src/main/java/com/fluxtream/connectors/evernote/EvernoteUpdater.java
  8. +0 −1  fluxtream-connectors/src/main/java/com/fluxtream/connectors/fitbit/FitBitTSUpdater.java
  9. +2 −2 fluxtream-connectors/src/main/java/com/fluxtream/connectors/google_latitude/GoogleLatitudeUpdater.java
  10. +16 −0 fluxtream-connectors/src/main/java/com/fluxtream/connectors/runkeeper/HeartRateMeasure.java
  11. +85 −0 fluxtream-connectors/src/main/java/com/fluxtream/connectors/runkeeper/RunKeeperController.java
  12. +113 −0 fluxtream-connectors/src/main/java/com/fluxtream/connectors/runkeeper/RunKeeperFitnessActivityExtractor.java
  13. +54 −0 fluxtream-connectors/src/main/java/com/fluxtream/connectors/runkeeper/RunKeeperFitnessActivityFacet.java
  14. +44 −0 fluxtream-connectors/src/main/java/com/fluxtream/connectors/runkeeper/RunKeeperFitnessActivityFacetVO.java
  15. +118 −0 fluxtream-connectors/src/main/java/com/fluxtream/connectors/runkeeper/RunKeeperUpdater.java
  16. +0 −2  fluxtream-connectors/src/main/java/com/fluxtream/connectors/zeo/ZeoSleepStatsFacetVO.java
  17. +1 −0  fluxtream-core/fluxtream-core.iml
  18. +9 −2 fluxtream-core/src/main/java/com/fluxtream/connectors/google_latitude/LocationFacet.java
  19. +0 −1  fluxtream-core/src/main/java/com/fluxtream/mvc/models/DurationModel.java
  20. +1 −2  fluxtream-core/src/main/java/com/fluxtream/services/ApiDataService.java
  21. +2 −16 fluxtream-core/src/main/java/com/fluxtream/services/impl/ApiDataServiceImpl.java
  22. +6 −5 fluxtream-core/src/main/java/com/fluxtream/services/impl/GuestServiceImpl.java
  23. +10 −0 fluxtream-core/src/main/java/com/fluxtream/services/impl/SystemServiceImpl.java
  24. +57 −0 fluxtream-web/db/0.9.0006/runkeeper.sql
  25. +1,781 −0 fluxtream-web/db/0.9.0006/schema-after-0.9.0006.sql
  26. +1 −0  fluxtream-web/fluxtream-web.iml
  27. +8 −7 fluxtream-web/src/main/resources/messages/connectors.properties
  28. +1 −1  fluxtream-web/src/main/webapp/WEB-INF/applicationContext.xml
  29. +1 −1  fluxtream-web/src/main/webapp/css/connectors.css
  30. +1 −1  fluxtream-web/src/main/webapp/css/flx.css
  31. BIN  fluxtream-web/src/main/webapp/images/connectors/connector-evernote.jpg
  32. BIN  fluxtream-web/src/main/webapp/images/connectors/connector-evernote@2x.jpg
  33. BIN  fluxtream-web/src/main/webapp/images/connectors/connector-runkeeper.jpg
  34. BIN  fluxtream-web/src/main/webapp/images/connectors/connector-runkeeper@2x.jpg
  35. BIN  fluxtream-web/src/main/webapp/images/devices-ic.png
  36. BIN  fluxtream-web/src/main/webapp/images/devices-ic.pxm
  37. BIN  fluxtream-web/src/main/webapp/images/devices-ic@2x.png
  38. BIN  fluxtream-web/src/main/webapp/images/mapicons/cup.png
  39. +6 −6 fluxtream-web/src/main/webapp/js/App.js
  40. +12 −0 fluxtream-web/src/main/webapp/js/ConnectorConfig.js
  41. +3 −4 fluxtream-web/src/main/webapp/js/ManageConnectors.js
  42. +1 −1  fluxtream-web/src/main/webapp/js/applications/calendar/App.js
  43. +44 −18 fluxtream-web/src/main/webapp/js/applications/calendar/facetTemplates.html
  44. +9 −7 fluxtream-web/src/main/webapp/js/core/TabInterface.js
  45. +36 −33 fluxtream-web/src/main/webapp/less/connectors.less
  46. +3 −4 fluxtream-web/src/main/webapp/less/flx.less
  47. +1 −0  maven/install.sh
  48. BIN  maven/scribe-1.3.3.jar
  49. +5 −0 pom.xml
View
1  .idea/artifacts/fluxtream_web_war_exploded.xml
@@ -183,6 +183,7 @@
<element id="library" level="project" name="Maven: com.sun.jersey:jersey-servlet:1.11" />
<element id="library" level="project" name="Maven: com.sun.jersey:jersey-server:1.11" />
<element id="library" level="project" name="Maven: org.aspectj:aspectjrt:1.5.4" />
+ <element id="library" level="project" name="Maven: org.scribe:scribe:1.3.3" />
<element id="archive" name="fluxtream-connectors-1.0.jar">
<element id="module-output" name="fluxtream-connectors" />
</element>
View
13 .idea/libraries/Maven__junit_junit_4_8_2.xml
@@ -0,0 +1,13 @@
+<component name="libraryTable">
+ <library name="Maven: junit:junit:4.8.2">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.8.2/junit-4.8.2.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.8.2/junit-4.8.2-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.8.2/junit-4.8.2-sources.jar!/" />
+ </SOURCES>
+ </library>
+</component>
View
13 .idea/libraries/Maven__org_scribe_scribe_1_3_3.xml
@@ -0,0 +1,13 @@
+<component name="libraryTable">
+ <library name="Maven: org.scribe:scribe:1.3.3">
+ <CLASSES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/scribe/scribe/1.3.3/scribe-1.3.3.jar!/" />
+ </CLASSES>
+ <JAVADOC>
+ <root url="jar://$MAVEN_REPOSITORY$/org/scribe/scribe/1.3.3/scribe-1.3.3-javadoc.jar!/" />
+ </JAVADOC>
+ <SOURCES>
+ <root url="jar://$MAVEN_REPOSITORY$/org/scribe/scribe/1.3.3/scribe-1.3.3-sources.jar!/" />
+ </SOURCES>
+ </library>
+</component>
View
3  fluxtream-connectors/fluxtream-connectors.iml
@@ -31,7 +31,7 @@
<orderEntry type="library" name="Maven: com.ocpsoft:ocpsoft-pretty-time:1.0.7" level="project" />
<orderEntry type="library" name="Maven: com.postmark:postmark-client:0.3.1" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:1.7.1" level="project" />
- <orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.8.1" level="project" />
+ <orderEntry type="library" name="Maven: junit:junit:4.8.2" level="project" />
<orderEntry type="library" name="Maven: joda-time:joda-time:1.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.0.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.0.1" level="project" />
@@ -191,6 +191,7 @@
<orderEntry type="library" name="Maven: com.sun.jersey:jersey-servlet:1.11" level="project" />
<orderEntry type="library" name="Maven: com.sun.jersey:jersey-server:1.11" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjrt:1.5.4" level="project" />
+ <orderEntry type="library" name="Maven: org.scribe:scribe:1.3.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.easymock:easymock:2.5.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:servlet-api:2.5" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.tomcat:tomcat-servlet-api:7.0.6" level="project" />
View
7 fluxtream-connectors/pom.xml
@@ -13,5 +13,10 @@
<artifactId>fluxtream-core</artifactId>
<version>1.0</version>
</dependency>
- </dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.2</version>
+ </dependency>
+ </dependencies>
</project>
View
87 fluxtream-connectors/src/main/java/com/fluxtream/connectors/evernote/EvernoteController.java
@@ -0,0 +1,87 @@
+package com.fluxtream.connectors.evernote;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import com.fluxtream.Configuration;
+import com.fluxtream.auth.AuthHelper;
+import com.fluxtream.connectors.Connector;
+import com.fluxtream.domain.Guest;
+import com.fluxtream.services.GuestService;
+import org.scribe.builder.ServiceBuilder;
+import org.scribe.builder.api.EvernoteApi;
+import org.scribe.model.Token;
+import org.scribe.model.Verifier;
+import org.scribe.oauth.OAuthService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+/**
+ *
+ * @author Candide Kemmler (candide@fluxtream.com)
+ */
+@Controller
+@RequestMapping(value = "/evernote")
+public class EvernoteController {
+
+ private static final String EVERNOTE_SERVICE = "evernoteService";
+ private static final String EVERNOTE_REQUEST_TOKEN = "evernoteRequestToken";
+
+ @Autowired
+ Configuration env;
+
+ @Autowired
+ GuestService guestService;
+
+
+ @RequestMapping(value = "/token")
+ public String getEvernoteToken(HttpServletRequest request) throws IOException, ServletException {
+ OAuthService service = new ServiceBuilder()
+ .provider(EvernoteApi.Sandbox.class)
+ .apiKey(getConsumerKey())
+ .apiSecret(getConsumerSecret())
+ .callback(env.get("homeBaseUrl") + "evernote/upgradeToken")
+ .build();
+ request.getSession().setAttribute(EVERNOTE_SERVICE, service);
+
+ // Obtain the Authorization URL
+ Token requestToken = service.getRequestToken();
+ request.getSession().setAttribute(EVERNOTE_REQUEST_TOKEN, requestToken);
+ String authorizationUrl = service.getAuthorizationUrl(requestToken);
+
+ return "redirect:" + authorizationUrl;
+ }
+
+ @RequestMapping(value = "/upgradeToken")
+ public String upgradeToken(HttpServletRequest request) throws IOException {
+ final String code = request.getParameter("oauth_verifier");
+ Verifier verifier = new Verifier(code);
+ OAuthService service = (OAuthService)request.getSession().getAttribute(EVERNOTE_SERVICE);
+
+ Token requestToken = (Token)request.getSession().getAttribute(EVERNOTE_REQUEST_TOKEN);
+ Token accessToken = service.getAccessToken(requestToken, verifier);
+
+ final String token = accessToken.getToken();
+ final String secret = accessToken.getSecret();
+
+ Guest guest = AuthHelper.getGuest();
+
+ guestService.setApiKeyAttribute(guest.getId(), Connector.getConnector("evernote"), "accessToken", token);
+ guestService.setApiKeyAttribute(guest.getId(), Connector.getConnector("evernote"), "tokenSecret", secret);
+
+ request.getSession().removeAttribute(EVERNOTE_REQUEST_TOKEN);
+ request.getSession().removeAttribute(EVERNOTE_SERVICE);
+ return "redirect:/app/from/evernote";
+ }
+
+ String getConsumerKey() {
+ return env.get("evernoteConsumerKey");
+ }
+
+ String getConsumerSecret() {
+ return env.get("evernoteConsumerSecret");
+ }
+
+
+}
View
24 fluxtream-connectors/src/main/java/com/fluxtream/connectors/evernote/EvernoteUpdater.java
@@ -0,0 +1,24 @@
+package com.fluxtream.connectors.evernote;
+
+import com.fluxtream.connectors.annotations.Updater;
+import com.fluxtream.connectors.updaters.AbstractUpdater;
+import com.fluxtream.connectors.updaters.UpdateInfo;
+import org.springframework.stereotype.Component;
+
+/**
+ *
+ * @author Candide Kemmler (candide@fluxtream.com)
+ */
+@Component
+@Updater(prettyName = "Evernote", value = 17, objectTypes ={})
+public class EvernoteUpdater extends AbstractUpdater {
+
+ @Override
+ protected void updateConnectorDataHistory(final UpdateInfo updateInfo) throws Exception {
+ }
+
+ @Override
+ protected void updateConnectorData(final UpdateInfo updateInfo) throws Exception {
+ }
+
+}
View
1  fluxtream-connectors/src/main/java/com/fluxtream/connectors/fitbit/FitBitTSUpdater.java
@@ -90,7 +90,6 @@
final ObjectType loggedActivityOT = ObjectType.getObjectType(
connector(), "logged_activity");
-
static {
ObjectType.registerCustomObjectType(GET_STEPS_CALL);
ObjectType.registerCustomObjectType(GET_USER_PROFILE_CALL);
View
4 ...nectors/src/main/java/com/fluxtream/connectors/google_latitude/GoogleLatitudeUpdater.java
@@ -69,10 +69,10 @@ private void loadHistory(UpdateInfo updateInfo, long from, long to)
continue;
locationResource.start = locationResource.timestampMs;
locationResource.end = locationResource.timestampMs;
+ locationResource.source = LocationFacet.Source.GOOGLE_LATITUDE;
apiDataService.addGuestLocation(updateInfo.getGuestId(),
- locationResource,
- LocationFacet.Source.GOOGLE_LATITUDE);
+ locationResource);
storedLocations.add(locationResource);
}
View
16 fluxtream-connectors/src/main/java/com/fluxtream/connectors/runkeeper/HeartRateMeasure.java
@@ -0,0 +1,16 @@
+package com.fluxtream.connectors.runkeeper;
+
+import javax.persistence.Embeddable;
+
+/**
+ *
+ * @author Candide Kemmler (candide@fluxtream.com)
+ */
+
+@Embeddable
+public class HeartRateMeasure {
+
+ public double heartRate;
+ public double timestamp;
+
+}
View
85 ...ream-connectors/src/main/java/com/fluxtream/connectors/runkeeper/RunKeeperController.java
@@ -0,0 +1,85 @@
+package com.fluxtream.connectors.runkeeper;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import com.fluxtream.Configuration;
+import com.fluxtream.auth.AuthHelper;
+import com.fluxtream.connectors.Connector;
+import com.fluxtream.domain.Guest;
+import com.fluxtream.services.GuestService;
+import org.scribe.builder.ServiceBuilder;
+import org.scribe.builder.api.RunKeeperApi;
+import org.scribe.model.Token;
+import org.scribe.model.Verifier;
+import org.scribe.oauth.OAuthService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+/**
+ *
+ * @author Candide Kemmler (candide@fluxtream.com)
+ */
+@Controller
+@RequestMapping(value = "/runkeeper")
+public class RunKeeperController {
+
+ private static final String RUNKEEPER_SERVICE = "runkeeperService";
+
+ @Autowired
+ Configuration env;
+
+ @Autowired
+ GuestService guestService;
+
+ private static final Token EMPTY_TOKEN = null;
+
+ @RequestMapping(value = "/token")
+ public String getRunkeeperToken(HttpServletRequest request) throws IOException, ServletException {
+
+ OAuthService service = getOAuthService();
+ request.getSession().setAttribute(RUNKEEPER_SERVICE, service);
+
+ // Obtain the Authorization URL
+ String authorizationUrl = service.getAuthorizationUrl(EMPTY_TOKEN);
+
+ return "redirect:" + authorizationUrl;
+ }
+
+ public OAuthService getOAuthService() {
+ return new ServiceBuilder()
+ .provider(RunKeeperApi.class)
+ .apiKey(getConsumerKey())
+ .apiSecret(getConsumerSecret())
+ .callback(env.get("homeBaseUrl") + "runkeeper/upgradeToken")
+ .build();
+ }
+
+ @RequestMapping(value = "/upgradeToken")
+ public String upgradeToken(HttpServletRequest request) throws IOException {
+ final String code = request.getParameter("code");
+ Verifier verifier = new Verifier(code);
+ OAuthService service = (OAuthService)request.getSession().getAttribute(RUNKEEPER_SERVICE);
+
+ Token accessToken = service.getAccessToken(EMPTY_TOKEN, verifier);
+ final String token = accessToken.getToken();
+
+ Guest guest = AuthHelper.getGuest();
+
+ guestService.setApiKeyAttribute(guest.getId(), Connector.getConnector("runkeeper"), "accessToken", token);
+
+ request.getSession().removeAttribute(RUNKEEPER_SERVICE);
+ return "redirect:/app/from/runkeeper";
+ }
+
+ String getConsumerKey() {
+ return env.get("runkeeperConsumerKey");
+ }
+
+ String getConsumerSecret() {
+ return env.get("runkeeperConsumerSecret");
+ }
+
+
+}
View
113 ...s/src/main/java/com/fluxtream/connectors/runkeeper/RunKeeperFitnessActivityExtractor.java
@@ -0,0 +1,113 @@
+package com.fluxtream.connectors.runkeeper;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.TimeZone;
+import com.fluxtream.ApiData;
+import com.fluxtream.connectors.ObjectType;
+import com.fluxtream.connectors.google_latitude.LocationFacet;
+import com.fluxtream.domain.AbstractFacet;
+import com.fluxtream.facets.extractors.AbstractFacetExtractor;
+import com.fluxtream.services.ApiDataService;
+import com.fluxtream.services.MetadataService;
+import com.google.api.client.util.Key;
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+import org.apache.velocity.util.ArrayListWrapper;
+import org.hibernate.annotations.Index;
+import org.joda.time.DateTimeZone;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ *
+ * @author Candide Kemmler (candide@fluxtream.com)
+ */
+@Component
+public class RunKeeperFitnessActivityExtractor extends AbstractFacetExtractor {
+
+ final DateTimeFormatter timeFormatter = DateTimeFormat.forPattern("EEE, dd MMM yyyy HH:mm:ss");
+
+ @Autowired
+ MetadataService metadataService;
+
+ @Autowired
+ ApiDataService apiDataService;
+
+ @Override
+ public List<AbstractFacet> extractFacets(final ApiData apiData, final ObjectType objectType) throws Exception {
+ List<AbstractFacet> facets = new ArrayList<AbstractFacet>();
+ JSONObject jsonObject = JSONObject.fromObject(apiData.json);
+
+ RunKeeperFitnessActivityFacet facet = new RunKeeperFitnessActivityFacet();
+
+ super.extractCommonFacetData(facet, apiData);
+
+ String uri = jsonObject.getString("uri") + "|" + jsonObject.getString("userID");
+
+ boolean startTimeSet = false;
+ if (jsonObject.has("path")) {
+ final JSONArray path = jsonObject.getJSONArray("path");
+ for (int i=0; i<path.size(); i++) {
+ JSONObject pathElement = path.getJSONObject(i);
+ LocationFacet locationFacet = new LocationFacet();
+ locationFacet.latitude = (float) pathElement.getDouble("latitude");
+ locationFacet.longitude = (float) pathElement.getDouble("longitude");
+ if (!startTimeSet) {
+ // we need to know the user's location in order to figure out
+ // his timezone
+ final String start_time = jsonObject.getString("start_time");
+ final TimeZone timeZone = metadataService.getTimeZone(locationFacet.latitude, locationFacet.longitude);
+ facet.start = timeFormatter.withZone(DateTimeZone.forTimeZone(timeZone)).parseMillis(start_time);
+ facet.timeZone = timeZone.getID();
+ final int duration = jsonObject.getInt("duration");
+ facet.end = facet.start + duration*1000;
+ facet.duration = duration;
+ startTimeSet = true;
+ }
+ locationFacet.altitude = (int) pathElement.getDouble("altitude");
+ locationFacet.timestampMs = facet.start + pathElement.getLong("timestamp");
+ locationFacet.source = LocationFacet.Source.RUNKEEPER;
+ locationFacet.uri = uri;
+
+ apiDataService.addGuestLocation(updateInfo.getGuestId(), locationFacet);
+ }
+ } else {
+ //TODO: abort elegantly if we don't have gps data as we are unable to figure out time
+ //in this case
+ return facets;
+ }
+
+ facet.userID = jsonObject.getString("userID");
+ facet.duration = jsonObject.getInt("duration");
+ facet.type = jsonObject.getString("type");
+ facet.equipment = jsonObject.getString("equipment");
+ facet.total_distance = jsonObject.getDouble("total_distance");
+ facet.is_live = jsonObject.getBoolean("is_live");
+ facet.comments = jsonObject.getString("comments");
+ if (jsonObject.has("total_climb"))
+ facet.total_climb = jsonObject.getDouble("total_climb");
+
+
+ if (jsonObject.has("heart_rate")) {
+ final JSONArray heart_rateArray = jsonObject.getJSONArray("heart_rate");
+ HeartRateMeasure heartRateMeasure = new HeartRateMeasure();
+ facet.heart_rate = new ArrayList<HeartRateMeasure>(heart_rateArray.size());
+ for (int i=0; i<heart_rateArray.size(); i++) {
+ final JSONObject heartRateTuple = heart_rateArray.getJSONObject(i);
+ heartRateMeasure.timestamp = heartRateTuple.getDouble("timestamp");
+ heartRateMeasure.heartRate = heartRateTuple.getDouble("heart_rate");
+ facet.heart_rate.add(heartRateMeasure);
+ }
+ }
+ if (jsonObject.has("calories")) {
+ // ignore calories for now
+ }
+
+ facets.add(facet);
+
+ return facets;
+ }
+}
View
54 ...ctors/src/main/java/com/fluxtream/connectors/runkeeper/RunKeeperFitnessActivityFacet.java
@@ -0,0 +1,54 @@
+package com.fluxtream.connectors.runkeeper;
+
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.CollectionTable;
+import javax.persistence.ElementCollection;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.JoinColumn;
+import javax.persistence.Lob;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToMany;
+import com.fluxtream.connectors.annotations.ObjectTypeSpec;
+import com.fluxtream.domain.AbstractFacet;
+
+/**
+ *
+ * @author Candide Kemmler (candide@fluxtream.com)
+ */
+@Entity(name="Facet_RunKeeperFitnessActivity")
+@NamedQueries({
+ @NamedQuery(name = "runkeeper.fitnessactivity.deleteAll", query = "DELETE FROM Facet_RunKeeperFitnessActivity facet WHERE facet.guestId=?"),
+ @NamedQuery(name = "runkeeper.fitnessactivity.between", query = "SELECT facet FROM Facet_RunKeeperFitnessActivity facet WHERE facet.guestId=? AND facet.start>=? AND facet.end<=?")
+})
+@ObjectTypeSpec(name = "fitnessActivity", value = 1, extractor=RunKeeperFitnessActivityExtractor.class, prettyname = "Fitness Activity", isDateBased = false)
+ public class RunKeeperFitnessActivityFacet extends AbstractFacet {
+
+ public String uri;
+ public String userID;
+ public String type;
+ public String equipment;
+ public double total_distance;
+ public int duration;
+
+ @ElementCollection(fetch=FetchType.EAGER)
+ @CollectionTable(
+ name = "FitnessActivityHeartRate",
+ joinColumns = @JoinColumn(name="FitnessActivityID")
+ )
+ public List<HeartRateMeasure> heart_rate;
+
+ public double total_climb;
+ public String source;
+ public boolean is_live;
+ public String comments;
+ public String timeZone;
+
+ @Override
+ protected void makeFullTextIndexable() {
+
+ }
+
+}
View
44 ...ors/src/main/java/com/fluxtream/connectors/runkeeper/RunKeeperFitnessActivityFacetVO.java
@@ -0,0 +1,44 @@
+package com.fluxtream.connectors.runkeeper;
+
+import java.util.Date;
+import java.util.TimeZone;
+import com.fluxtream.TimeInterval;
+import com.fluxtream.connectors.vos.AbstractTimedFacetVO;
+import com.fluxtream.domain.GuestSettings;
+import com.fluxtream.mvc.models.DurationModel;
+
+/**
+ *
+ * @author Candide Kemmler (candide@fluxtream.com)
+ */
+public class RunKeeperFitnessActivityFacetVO extends AbstractTimedFacetVO<RunKeeperFitnessActivityFacet> {
+
+ double averageHeartRate = 0d;
+ public double total_distance;
+ public DurationModel duration;
+ public double total_climb;
+ public String activityType;
+
+ @Override
+ protected void fromFacet(final RunKeeperFitnessActivityFacet facet, final TimeInterval timeInterval, final GuestSettings settings) {
+ double totalMeasures = 0d;
+ int nMeasures = 0;
+ for (HeartRateMeasure measure : facet.heart_rate) {
+ nMeasures++;
+ totalMeasures += measure.heartRate;
+ }
+ TimeZone timeZone = TimeZone.getTimeZone(facet.timeZone);
+ this.startMinute = toMinuteOfDay(new Date(facet.start), timeZone);
+ this.endMinute = toMinuteOfDay(new Date(facet.end), timeZone);
+ averageHeartRate = round(totalMeasures/nMeasures);
+ this.total_distance = facet.total_distance;
+ this.duration = new DurationModel(facet.duration);
+ this.total_climb = facet.total_climb;
+ this.activityType = facet.type;
+ }
+
+ double round(double v) {
+ return (double) Math.round(v * 100) / 100;
+ }
+
+}
View
118 fluxtream-connectors/src/main/java/com/fluxtream/connectors/runkeeper/RunKeeperUpdater.java
@@ -0,0 +1,118 @@
+package com.fluxtream.connectors.runkeeper;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import com.fluxtream.connectors.Connector;
+import com.fluxtream.connectors.annotations.Updater;
+import com.fluxtream.connectors.updaters.AbstractUpdater;
+import com.fluxtream.connectors.updaters.UpdateInfo;
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+import org.apache.log4j.Logger;
+import org.hibernate.search.sandbox.standalone.InstanceTransactionContext;
+import org.joda.time.DateTimeZone;
+import org.joda.time.Instant;
+import org.joda.time.format.DateTimeFormat;
+import org.joda.time.format.DateTimeFormatter;
+import org.scribe.model.OAuthRequest;
+import org.scribe.model.Response;
+import org.scribe.model.Token;
+import org.scribe.model.Verb;
+import org.scribe.oauth.OAuthService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ *
+ * @author Candide Kemmler (candide@fluxtream.com)
+ */
+@Component
+@Updater(prettyName = "RunKeeper", value = 35, updateStrategyType = Connector.UpdateStrategyType.INCREMENTAL,
+ objectTypes = {RunKeeperFitnessActivityFacet.class})
+public class RunKeeperUpdater extends AbstractUpdater {
+
+ Logger logger = Logger.getLogger(RunKeeperUpdater.class);
+
+ final String DEFAULT_ENDPOINT= "https://api.runkeeper.com";
+
+ @Autowired
+ RunKeeperController runKeeperController;
+
+ @Override
+ protected void updateConnectorDataHistory(final UpdateInfo updateInfo) throws Exception {
+ long beginningOfTime = new Date(0).getTime();
+ updateData(updateInfo, beginningOfTime);
+ guestService.setApiKeyAttribute(updateInfo.getGuestId(), updateInfo.apiKey.getConnector(),
+ "lastUpdated", String.valueOf(System.currentTimeMillis()));
+ }
+
+ private void updateData(final UpdateInfo updateInfo, final long since) throws Exception {
+ String url = DEFAULT_ENDPOINT+"/user?oauth_token=";
+ final String accessToken = updateInfo.apiKey.getAttributeValue("accessToken", env);
+ final Token token = new Token(accessToken, env.get("runkeeperConsumerSecret"));
+ final String userEndpoint = url + accessToken;
+ OAuthRequest request = new OAuthRequest(Verb.GET, userEndpoint);
+ request.addHeader("Accept", "application/vnd.com.runkeeper.User+json");
+ final OAuthService service = runKeeperController.getOAuthService();
+ service.signRequest(token, request);
+ Response response = request.send();
+ String body = response.getBody();
+ JSONObject jsonObject = JSONObject.fromObject(body);
+ String fitnessActivities = jsonObject.getString("fitness_activities");
+ List<String> activities = new ArrayList<String>();
+ String activityFeedURL = DEFAULT_ENDPOINT+"/" + fitnessActivities;
+ getFitnessActivityFeed(service, token, activityFeedURL, 25, activities, since);
+ getFitnessActivities(updateInfo, service, token, activities);
+ }
+
+ private void getFitnessActivities(final UpdateInfo updateInfo, final OAuthService service,
+ final Token token, final List<String> activities) throws Exception {
+ for (String activity : activities) {
+ String activityURL = DEFAULT_ENDPOINT + activity;
+ OAuthRequest request = new OAuthRequest(Verb.GET, activityURL);
+ request.addQuerystringParameter("oauth_token", token.getToken());
+ request.addHeader("Accept", "application/vnd.com.runkeeper.FitnessActivity+json");
+ service.signRequest(token, request);
+ Response response = request.send();
+ String body = response.getBody();
+ apiDataService.cacheApiDataJSON(updateInfo, body, -1, -1);
+ }
+ }
+
+ final DateTimeFormatter dateFormatter = DateTimeFormat.forPattern("EEE, dd MMM yyyy HH:mm:ss Z").withZone(DateTimeZone.forID("GMT"));
+
+ private void getFitnessActivityFeed(final OAuthService service, final Token token,
+ String activityFeedURL, final int pageSize,
+ List<String> activities, long since) {
+ OAuthRequest request = new OAuthRequest(Verb.GET, activityFeedURL);
+ request.addQuerystringParameter("pageSize", String.valueOf(pageSize));
+ request.addQuerystringParameter("oauth_token", token.getToken());
+ request.addHeader("Accept", "application/vnd.com.runkeeper.FitnessActivityFeed+json");
+ request.addHeader("If-Modified-Since", dateFormatter.print(since));
+ service.signRequest(token, request);
+ Response response = request.send();
+ if (response.getCode()==200) {
+ String body = response.getBody();
+ JSONObject jsonObject = JSONObject.fromObject(body);
+ final JSONArray items = jsonObject.getJSONArray("items");
+ for(int i=0; i<items.size(); i++) {
+ JSONObject item = items.getJSONObject(i);
+ activities.add(item.getString("uri"));
+ }
+ if (jsonObject.has("next")) {
+ activityFeedURL = DEFAULT_ENDPOINT + jsonObject.getString("next");
+ getFitnessActivityFeed(service, token, activityFeedURL, pageSize, activities, since);
+ }
+ }
+ }
+
+ @Override
+ protected void updateConnectorData(final UpdateInfo updateInfo) throws Exception {
+ final String lastUpdatedString = guestService.getApiKeyAttribute(updateInfo.getGuestId(),
+ updateInfo.apiKey.getConnector(), "lastUpdated");
+ final long lastUpdated = Long.valueOf(lastUpdatedString);
+ updateData(updateInfo, lastUpdated);
+ }
+
+}
View
2  fluxtream-connectors/src/main/java/com/fluxtream/connectors/zeo/ZeoSleepStatsFacetVO.java
@@ -25,8 +25,6 @@
@Override
public void fromFacet(ZeoSleepStatsFacet facet, TimeInterval timeInterval, GuestSettings settings) {
- startMinute = minuteOfDayFromTimeStorage(facet.startTimeStorage);
- endMinute = minuteOfDayFromTimeStorage(facet.endTimeStorage);
minutesAsleep = new DurationModel(facet.totalZ*60);
minutesAwake = new DurationModel((int) ((double)facet.totalZ*60d/100d*(double)facet.timeInWakePercentage));
minutesToFallAsleep = new DurationModel(facet.timeToZ*60);
View
1  fluxtream-core/fluxtream-core.iml
@@ -197,6 +197,7 @@
<orderEntry type="library" name="Maven: com.sun.jersey:jersey-servlet:1.11" level="project" />
<orderEntry type="library" name="Maven: com.sun.jersey:jersey-server:1.11" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjrt:1.5.4" level="project" />
+ <orderEntry type="library" name="Maven: org.scribe:scribe:1.3.3" level="project" />
</component>
</module>
View
11 fluxtream-core/src/main/java/com/fluxtream/connectors/google_latitude/LocationFacet.java
@@ -41,7 +41,7 @@
private static final long serialVersionUID = 2882496521084143121L;
public static enum Source {
- OTHER, USER, GOOGLE_LATITUDE, GEO_IP_DB, IP_TO_LOCATION, OPEN_PATH
+ OTHER, USER, GOOGLE_LATITUDE, GEO_IP_DB, IP_TO_LOCATION, OPEN_PATH, RUNKEEPER
}
public Source source = Source.GOOGLE_LATITUDE;
@@ -81,7 +81,14 @@
public String version;
public String os;
-
+
+ /**
+ * serves as a backreference to the resource that originated in this coordinate,
+ * e.g. a runkeeper run or bike ride
+ */
+ @Index(name = "uri")
+ public String uri;
+
public boolean equals(Object o) {
if (!(o instanceof LocationFacet))
return false;
View
1  fluxtream-core/src/main/java/com/fluxtream/mvc/models/DurationModel.java
@@ -22,7 +22,6 @@ public DurationModel(int secs) {
int divisor_for_seconds = divisor_for_minutes % 60;
seconds = (int)Math.ceil(divisor_for_seconds);
-
}
}
View
3  fluxtream-core/src/main/java/com/fluxtream/services/ApiDataService.java
@@ -114,7 +114,6 @@ public void cacheEmptyData(UpdateInfo updateInfo, long fromMidnight,
public long getNumberOfDays(long guestId);
- void addGuestLocation(long guestId, LocationFacet locationResource,
- LocationFacet.Source source);
+ void addGuestLocation(long guestId, LocationFacet locationResource);
}
View
18 fluxtream-core/src/main/java/com/fluxtream/services/impl/ApiDataServiceImpl.java
@@ -552,23 +552,9 @@ public void setFacetComment(long guestId, Connector connector,
@Override
@Transactional(readOnly = false)
- public void addGuestLocation(final long guestId, LocationFacet locationResource,
- final LocationFacet.Source source) {
- LocationFacet payload = new LocationFacet();
- payload.source = source;
- payload.latitude = locationResource.latitude;
- payload.longitude = locationResource.longitude;
- payload.start = locationResource.timestampMs;
- payload.end = locationResource.timestampMs;
- payload.api = Connector.getConnector("google_latitude").value();
- payload.guestId = guestId;
- payload.timestampMs = locationResource.timestampMs;
- payload.accuracy = locationResource.accuracy;
- payload.timeUpdated = System.currentTimeMillis();
-
+ public void addGuestLocation(final long guestId, LocationFacet locationResource) {
updateDayMetadata(guestId, locationResource.timestampMs, locationResource.latitude, locationResource.longitude);
-
- em.persist(payload);
+ em.persist(locationResource);
}
@Transactional(readOnly = false)
View
11 fluxtream-core/src/main/java/com/fluxtream/services/impl/GuestServiceImpl.java
@@ -377,16 +377,17 @@ public void checkIn(long guestId, String ipAddress) throws IOException {
locationFacet.accuracy = 7000;
locationFacet.latitude = ipLocation.latitude;
locationFacet.longitude = ipLocation.longitude;
+ locationFacet.source = LocationFacet.Source.GEO_IP_DB;
apiDataService.addGuestLocation(guestId,
- locationFacet, LocationFacet.Source.GEO_IP_DB);
+ locationFacet);
} else if (env.get("environment").equals("local")) {
try{
locationFacet.accuracy = 7000;
locationFacet.latitude = env.getFloat("defaultLocation.latitude");
locationFacet.longitude = env.getFloat("defaultLocation.longitude");
+ locationFacet.source = LocationFacet.Source.OTHER;
apiDataService.addGuestLocation(guestId,
- locationFacet,
- LocationFacet.Source.OTHER);
+ locationFacet);
}
catch (Exception ignored){
}
@@ -406,9 +407,9 @@ public void checkIn(long guestId, String ipAddress) throws IOException {
locationFacet.accuracy = 7000;
locationFacet.latitude = lat;
locationFacet.longitude = lon;
+ locationFacet.source = LocationFacet.Source.IP_TO_LOCATION;
apiDataService.addGuestLocation(guestId,
- locationFacet,
- LocationFacet.Source.IP_TO_LOCATION);
+ locationFacet);
}
}
}
View
10 fluxtream-core/src/main/java/com/fluxtream/services/impl/SystemServiceImpl.java
@@ -132,6 +132,16 @@ private void initializeConnectorList() {
res.getString("fluxtream_capture"),
"ajax:/fluxtream_capture/about",
Connector.getConnector("fluxtream_capture"), order++, true));
+ em.persist(new ConnectorInfo("RunKeeper",
+ "/images/connectors/connector-runkeeper.jpg",
+ res.getString("runkeeper"),
+ "/runkeeper/token",
+ Connector.getConnector("runkeeper"), order++, true));
+ em.persist(new ConnectorInfo("Evernote",
+ "/images/connectors/connector-evernote.jpg",
+ res.getString("evernote"),
+ "/evernote/token",
+ Connector.getConnector("evernote"), order, false));
}
private String singlyAuthorizeUrl(final String service) {
View
57 fluxtream-web/db/0.9.0006/runkeeper.sql
@@ -0,0 +1,57 @@
+DROP TABLE IF EXISTS `FitnessActivityHeartRate`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `FitnessActivityHeartRate` (
+ `FitnessActivityID` bigint(20) NOT NULL,
+ `heartRate` double NOT NULL,
+ `timestamp` double NOT NULL,
+ KEY `FK64EE970F6B3E8E7` (`FitnessActivityID`),
+ CONSTRAINT `FK64EE970F6B3E8E7` FOREIGN KEY (`FitnessActivityID`) REFERENCES `Facet_RunKeeperFitnessActivity` (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Table structure for table `Facet_RunKeeperFitnessActivity`
+--
+
+DROP TABLE IF EXISTS `Facet_RunKeeperFitnessActivity`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_RunKeeperFitnessActivity` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `tags` longtext,
+ `timeUpdated` bigint(20) NOT NULL,
+ `comments` varchar(255) DEFAULT NULL,
+ `duration` int(11) NOT NULL,
+ `equipment` varchar(255) DEFAULT NULL,
+ `is_live` bit(1) NOT NULL,
+ `source` varchar(255) DEFAULT NULL,
+ `total_climb` double NOT NULL,
+ `total_distance` double NOT NULL,
+ `type` varchar(255) DEFAULT NULL,
+ `uri` varchar(255) DEFAULT NULL,
+ `userID` varchar(255) DEFAULT NULL,
+ `timeZone` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=latin1;
+
+
+ALTER TABLE `Facet_GoogleLatitudeLocation` ADD COLUMN `date` varchar(10) DEFAULT NULL;
+ALTER TABLE `Facet_GoogleLatitudeLocation` ADD COLUMN `timezone` varchar(256) DEFAULT NULL;
+ALTER TABLE `Facet_GoogleLatitudeLocation` ADD COLUMN `timezoneMinutesOffset` int(11) DEFAULT NULL;
+ALTER TABLE `Facet_GoogleLatitudeLocation` ADD COLUMN `uri` varchar(255) DEFAULT NULL;
+ALTER TABLE `Facet_GoogleLatitudeLocation` ADD INDEX `uri` (`uri`);
View
1,781 fluxtream-web/db/0.9.0006/schema-after-0.9.0006.sql
@@ -0,0 +1,1781 @@
+-- MySQL dump 10.13 Distrib 5.5.25, for osx10.6 (i386)
+--
+-- Host: localhost Database: flx
+-- ------------------------------------------------------
+-- Server version 5.5.25
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
+/*!40103 SET TIME_ZONE='+00:00' */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+--
+-- Table structure for table `Address`
+--
+
+DROP TABLE IF EXISTS `Address`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Address` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `address` varchar(255) DEFAULT NULL,
+ `guestId` bigint(20) NOT NULL,
+ `jsonStorage` longtext,
+ `latitude` double NOT NULL,
+ `longitude` double NOT NULL,
+ `radius` double NOT NULL,
+ `since` bigint(20) NOT NULL,
+ `type` varchar(255) DEFAULT NULL,
+ `until` bigint(20) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `ApiKey`
+--
+
+DROP TABLE IF EXISTS `ApiKey`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `ApiKey` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `guestId` bigint(20) NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `api_index` (`api`),
+ KEY `guestId_index` (`guestId`)
+) ENGINE=MyISAM AUTO_INCREMENT=132 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `ApiKeyAttribute`
+--
+
+DROP TABLE IF EXISTS `ApiKeyAttribute`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `ApiKeyAttribute` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `attributeKey` varchar(255) DEFAULT NULL,
+ `attributeValue` longtext,
+ `apiKey_id` bigint(20) DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `FK63B21617FB39AB73` (`apiKey_id`)
+) ENGINE=MyISAM AUTO_INCREMENT=1182 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `ApiNotifications`
+--
+
+DROP TABLE IF EXISTS `ApiNotifications`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `ApiNotifications` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `content` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `ts` bigint(20) NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `ts` (`ts`),
+ KEY `guestId` (`guestId`),
+ KEY `api` (`api`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `ApiUpdates`
+--
+
+DROP TABLE IF EXISTS `ApiUpdates`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `ApiUpdates` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `elapsed` bigint(20) NOT NULL,
+ `guestId` bigint(20) NOT NULL,
+ `objectTypes` int(11) NOT NULL,
+ `query` text,
+ `success` char(1) NOT NULL,
+ `ts` bigint(20) NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `elapsed` (`elapsed`),
+ KEY `ts` (`ts`),
+ KEY `objectTypes` (`objectTypes`),
+ KEY `guestId` (`guestId`),
+ KEY `api` (`api`),
+ KEY `success` (`success`)
+) ENGINE=MyISAM AUTO_INCREMENT=47461 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `ChannelStyle`
+--
+
+DROP TABLE IF EXISTS `ChannelStyle`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `ChannelStyle` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `channelName` varchar(255) DEFAULT NULL,
+ `deviceName` varchar(255) DEFAULT NULL,
+ `guestId` bigint(20) NOT NULL,
+ `json` longtext,
+ PRIMARY KEY (`id`),
+ KEY `guestId` (`guestId`),
+ KEY `channelName` (`channelName`),
+ KEY `deviceName` (`deviceName`)
+) ENGINE=MyISAM AUTO_INCREMENT=25 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `CoachingBuddies`
+--
+
+DROP TABLE IF EXISTS `CoachingBuddies`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `CoachingBuddies` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `guestId` bigint(20) NOT NULL,
+ `buddyId` bigint(20) NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `guestId_index` (`guestId`),
+ KEY `buddyId_index` (`buddyId`),
+ KEY `buddyId` (`buddyId`),
+ KEY `guestId` (`guestId`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Connector`
+--
+
+DROP TABLE IF EXISTS `Connector`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Connector` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `channels` tinyblob,
+ `connectUrl` varchar(255) DEFAULT NULL,
+ `connectorName` varchar(255) DEFAULT NULL,
+ `count` int(11) NOT NULL,
+ `enabled` char(1) NOT NULL,
+ `image` varchar(255) DEFAULT NULL,
+ `manageable` char(1) NOT NULL,
+ `name` varchar(255) DEFAULT NULL,
+ `text` longtext,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM AUTO_INCREMENT=106 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `ConnectorChannelSet`
+--
+
+DROP TABLE IF EXISTS `ConnectorChannelSet`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `ConnectorChannelSet` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `channels` longtext,
+ `guestId` bigint(20) NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `guestId` (`guestId`),
+ KEY `api` (`api`)
+) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `ConnectorFilterState`
+--
+
+DROP TABLE IF EXISTS `ConnectorFilterState`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `ConnectorFilterState` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `guestId` bigint(20) NOT NULL,
+ `stateJSON` longtext,
+ PRIMARY KEY (`id`),
+ KEY `guestId` (`guestId`)
+) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `ContextualInfo`
+--
+
+DROP TABLE IF EXISTS `ContextualInfo`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `ContextualInfo` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `timeUpdated` bigint(20) NOT NULL,
+ `cities` longtext,
+ `date` varchar(255) DEFAULT NULL,
+ `inTransit` int(11) DEFAULT NULL,
+ `maxTempC` float NOT NULL,
+ `maxTempF` float NOT NULL,
+ `minTempC` float NOT NULL,
+ `minTempF` float NOT NULL,
+ `otherTimeZone` varchar(255) DEFAULT NULL,
+ `timeZone` varchar(255) DEFAULT NULL,
+ `title` varchar(255) DEFAULT NULL,
+ `travelType` int(11) DEFAULT NULL,
+ `tags` longtext,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `inTransit_index` (`inTransit`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `travelType_index` (`travelType`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=MyISAM AUTO_INCREMENT=6746 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Dashboard`
+--
+
+DROP TABLE IF EXISTS `Dashboard`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Dashboard` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `active` char(1) NOT NULL,
+ `guestId` bigint(20) NOT NULL,
+ `name` varchar(255) DEFAULT NULL,
+ `ordering` int(11) NOT NULL,
+ `widgetNames` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `guestId` (`guestId`)
+) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `DashboardWidgetsRepository`
+--
+
+DROP TABLE IF EXISTS `DashboardWidgetsRepository`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `DashboardWidgetsRepository` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `created` datetime DEFAULT NULL,
+ `guestId` bigint(20) NOT NULL,
+ `url` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_BodymediaBurn`
+--
+
+DROP TABLE IF EXISTS `Facet_BodymediaBurn`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_BodymediaBurn` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `timeUpdated` bigint(20) NOT NULL,
+ `json` longtext,
+ `date` varchar(255) DEFAULT NULL,
+ `lastSync` bigint(20) NOT NULL,
+ `estimatedCalories` int(11) NOT NULL,
+ `predictedCalories` int(11) NOT NULL,
+ `totalCalories` int(11) NOT NULL,
+ `tags` longtext,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=MyISAM AUTO_INCREMENT=373 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_BodymediaSleep`
+--
+
+DROP TABLE IF EXISTS `Facet_BodymediaSleep`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_BodymediaSleep` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `timeUpdated` bigint(20) NOT NULL,
+ `json` longtext,
+ `date` varchar(255) DEFAULT NULL,
+ `lastSync` bigint(20) NOT NULL,
+ `efficiency` double NOT NULL,
+ `totalLying` int(11) NOT NULL,
+ `totalSleeping` int(11) NOT NULL,
+ `tags` longtext,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=MyISAM AUTO_INCREMENT=259 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_BodymediaSteps`
+--
+
+DROP TABLE IF EXISTS `Facet_BodymediaSteps`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_BodymediaSteps` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `timeUpdated` bigint(20) NOT NULL,
+ `json` longtext,
+ `date` varchar(255) DEFAULT NULL,
+ `lastSync` bigint(20) NOT NULL,
+ `totalSteps` int(11) NOT NULL,
+ `tags` longtext,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=MyISAM AUTO_INCREMENT=405 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_CalendarEventEntry`
+--
+
+DROP TABLE IF EXISTS `Facet_CalendarEventEntry`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_CalendarEventEntry` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `timeUpdated` bigint(20) NOT NULL,
+ `edited` bigint(20) NOT NULL,
+ `entryId` varchar(255) DEFAULT NULL,
+ `icalUID` varchar(255) DEFAULT NULL,
+ `kind` varchar(255) DEFAULT NULL,
+ `linkHref` longtext,
+ `linkTitle` longtext,
+ `locationsStorage` longblob,
+ `participantsStorage` longblob,
+ `plainTextContent` longtext,
+ `published` bigint(20) NOT NULL,
+ `summary` longtext,
+ `textContent` longtext,
+ `title` longtext,
+ `whenStorage` longblob,
+ `tags` longtext,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=MyISAM AUTO_INCREMENT=401 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_CallLog`
+--
+
+DROP TABLE IF EXISTS `Facet_CallLog`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_CallLog` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `timeUpdated` bigint(20) NOT NULL,
+ `date` datetime DEFAULT NULL,
+ `personName` varchar(255) DEFAULT NULL,
+ `personNumber` varchar(255) DEFAULT NULL,
+ `seconds` int(11) NOT NULL,
+ `type` int(11) DEFAULT NULL,
+ `tags` longtext,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_FitbitActivity`
+--
+
+DROP TABLE IF EXISTS `Facet_FitbitActivity`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_FitbitActivity` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `timeUpdated` bigint(20) NOT NULL,
+ `endTimeStorage` varchar(255) DEFAULT NULL,
+ `startTimeStorage` varchar(255) DEFAULT NULL,
+ `activeScore` int(11) NOT NULL,
+ `activityCalories` int(11) NOT NULL,
+ `caloriesJson` longtext,
+ `caloriesOut` int(11) NOT NULL,
+ `date` varchar(255) DEFAULT NULL,
+ `elevation` int(11) NOT NULL,
+ `fairlyActiveMinutes` int(11) NOT NULL,
+ `floors` int(11) NOT NULL,
+ `lightlyActiveDistance` double NOT NULL,
+ `lightlyActiveMinutes` int(11) NOT NULL,
+ `loggedActivitiesDistance` double NOT NULL,
+ `moderatelyActiveDistance` double NOT NULL,
+ `sedentaryActiveDistance` double NOT NULL,
+ `sedentaryMinutes` int(11) NOT NULL,
+ `steps` int(11) NOT NULL,
+ `stepsJson` longtext,
+ `totalDistance` double NOT NULL,
+ `trackerDistance` double NOT NULL,
+ `veryActiveDistance` double NOT NULL,
+ `veryActiveMinutes` int(11) NOT NULL,
+ `tags` longtext,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=MyISAM AUTO_INCREMENT=17056 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_FitbitLoggedActivity`
+--
+
+DROP TABLE IF EXISTS `Facet_FitbitLoggedActivity`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_FitbitLoggedActivity` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `timeUpdated` bigint(20) NOT NULL,
+ `activityId` bigint(20) NOT NULL,
+ `activityParentId` bigint(20) NOT NULL,
+ `calories` int(11) NOT NULL,
+ `date` varchar(255) DEFAULT NULL,
+ `distance` double NOT NULL,
+ `duration` int(11) NOT NULL,
+ `isFavorite` bit(1) NOT NULL,
+ `logId` bigint(20) NOT NULL,
+ `name` varchar(255) DEFAULT NULL,
+ `steps` int(11) NOT NULL,
+ `endTimeStorage` varchar(255) DEFAULT NULL,
+ `startTimeStorage` varchar(255) DEFAULT NULL,
+ `tags` longtext,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_FitbitSleep`
+--
+
+DROP TABLE IF EXISTS `Facet_FitbitSleep`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_FitbitSleep` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `timeUpdated` bigint(20) NOT NULL,
+ `endTimeStorage` varchar(255) DEFAULT NULL,
+ `startTimeStorage` varchar(255) DEFAULT NULL,
+ `awakeningsCount` int(11) NOT NULL,
+ `date` varchar(255) DEFAULT NULL,
+ `isMainSleep` bit(1) NOT NULL,
+ `logId` bigint(20) NOT NULL,
+ `minutesAfterWakeup` int(11) NOT NULL,
+ `minutesAsleep` int(11) NOT NULL,
+ `minutesAwake` int(11) NOT NULL,
+ `minutesToFallAsleep` int(11) NOT NULL,
+ `timeInBed` int(11) NOT NULL,
+ `duration` int(11) NOT NULL,
+ `tags` longtext,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=MyISAM AUTO_INCREMENT=18613 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_FitbitWeight`
+--
+
+DROP TABLE IF EXISTS `Facet_FitbitWeight`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_FitbitWeight` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `timeUpdated` bigint(20) NOT NULL,
+ `endTimeStorage` varchar(255) DEFAULT NULL,
+ `startTimeStorage` varchar(255) DEFAULT NULL,
+ `bmi` double NOT NULL,
+ `date` varchar(255) DEFAULT NULL,
+ `fat` double NOT NULL,
+ `weight` double NOT NULL,
+ `tags` longtext,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=InnoDB AUTO_INCREMENT=3768 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_FlickrPhoto`
+--
+
+DROP TABLE IF EXISTS `Facet_FlickrPhoto`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_FlickrPhoto` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `timeUpdated` bigint(20) NOT NULL,
+ `accuracy` int(11) NOT NULL,
+ `datetaken` bigint(20) NOT NULL,
+ `dateupload` bigint(20) NOT NULL,
+ `farm` varchar(255) DEFAULT NULL,
+ `flickrId` varchar(255) DEFAULT NULL,
+ `isfamily` bit(1) NOT NULL,
+ `isfriend` bit(1) NOT NULL,
+ `ispublic` bit(1) NOT NULL,
+ `latitude` varchar(255) DEFAULT NULL,
+ `longitude` varchar(255) DEFAULT NULL,
+ `owner` varchar(255) DEFAULT NULL,
+ `secret` varchar(255) DEFAULT NULL,
+ `server` varchar(255) DEFAULT NULL,
+ `title` varchar(255) DEFAULT NULL,
+ `date` varchar(255) DEFAULT NULL,
+ `endTimeStorage` varchar(255) DEFAULT NULL,
+ `startTimeStorage` varchar(255) DEFAULT NULL,
+ `tags` longtext,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=MyISAM AUTO_INCREMENT=282 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_FluxtreamCapturePhoto`
+--
+
+DROP TABLE IF EXISTS `Facet_FluxtreamCapturePhoto`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_FluxtreamCapturePhoto` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `tags` longtext,
+ `timeUpdated` bigint(20) NOT NULL,
+ `altitude` float DEFAULT NULL,
+ `altitudeRef` int(11) DEFAULT NULL,
+ `captureYYYYDDD` varchar(255) DEFAULT NULL,
+ `gpsDatestamp` varchar(255) DEFAULT NULL,
+ `gpsPrecision` float DEFAULT NULL,
+ `gpsTimestamp` varchar(255) DEFAULT NULL,
+ `hash` varchar(255) DEFAULT NULL,
+ `heading` float DEFAULT NULL,
+ `headingRef` varchar(255) DEFAULT NULL,
+ `latitude` double DEFAULT NULL,
+ `longitude` double DEFAULT NULL,
+ `orientation` int(11) NOT NULL,
+ `thumbnailLarge` longblob,
+ `thumbnailLargeHeight` int(11) NOT NULL,
+ `thumbnailLargeWidth` int(11) NOT NULL,
+ `thumbnailSmall` longblob,
+ `thumbnailSmallHeight` int(11) NOT NULL,
+ `thumbnailSmallWidth` int(11) NOT NULL,
+ `title` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_GithubPush`
+--
+
+DROP TABLE IF EXISTS `Facet_GithubPush`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_GithubPush` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `timeUpdated` bigint(20) NOT NULL,
+ `commmitsJSON` longtext,
+ `repoName` varchar(255) DEFAULT NULL,
+ `repoURL` varchar(255) DEFAULT NULL,
+ `commitsJSON` longtext,
+ `tags` longtext,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=MyISAM AUTO_INCREMENT=1553 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_GoogleLatitudeLocation`
+--
+
+DROP TABLE IF EXISTS `Facet_GoogleLatitudeLocation`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_GoogleLatitudeLocation` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `timeUpdated` bigint(20) NOT NULL,
+ `accuracy` int(11) NOT NULL,
+ `altitude` int(11) NOT NULL,
+ `altitudeAccuracy` int(11) NOT NULL,
+ `device` varchar(255) DEFAULT NULL,
+ `heading` int(11) NOT NULL,
+ `latitude` float NOT NULL,
+ `longitude` float NOT NULL,
+ `os` varchar(255) DEFAULT NULL,
+ `placeid` int(11) NOT NULL,
+ `source` int(11) DEFAULT NULL,
+ `speed` int(11) NOT NULL,
+ `timestampMs` bigint(20) NOT NULL,
+ `version` varchar(255) DEFAULT NULL,
+ `tags` longtext,
+ `date` varchar(10) DEFAULT NULL,
+ `timezone` varchar(256) DEFAULT NULL,
+ `timezoneMinutesOffset` int(11) DEFAULT NULL,
+ `uri` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `longitude_index` (`longitude`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `latitude_index` (`latitude`),
+ KEY `timestamp_index` (`timestampMs`),
+ KEY `timeUpdated_index` (`timeUpdated`),
+ KEY `uri` (`uri`)
+) ENGINE=MyISAM AUTO_INCREMENT=303685 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_InstagramPhoto`
+--
+
+DROP TABLE IF EXISTS `Facet_InstagramPhoto`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_InstagramPhoto` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `timeUpdated` bigint(20) NOT NULL,
+ `caption` varchar(255) DEFAULT NULL,
+ `filter` varchar(255) DEFAULT NULL,
+ `instagramId` varchar(255) DEFAULT NULL,
+ `latitude` double NOT NULL,
+ `link` varchar(255) DEFAULT NULL,
+ `locationId` varchar(255) DEFAULT NULL,
+ `locationName` varchar(255) DEFAULT NULL,
+ `longitude` double NOT NULL,
+ `lowResolutionHeight` int(11) NOT NULL,
+ `lowResolutionUrl` varchar(255) DEFAULT NULL,
+ `lowResolutionWidth` int(11) NOT NULL,
+ `standardResolutionHeight` int(11) NOT NULL,
+ `standardResolutionUrl` varchar(255) DEFAULT NULL,
+ `standardResolutionWidth` int(11) NOT NULL,
+ `thumbnailHeight` int(11) NOT NULL,
+ `thumbnailUrl` varchar(255) DEFAULT NULL,
+ `thumbnailWidth` int(11) NOT NULL,
+ `tags` longtext,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_LastFmLovedTrack`
+--
+
+DROP TABLE IF EXISTS `Facet_LastFmLovedTrack`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_LastFmLovedTrack` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `timeUpdated` bigint(20) NOT NULL,
+ `album_mbid` varchar(255) DEFAULT NULL,
+ `artist` varchar(255) DEFAULT NULL,
+ `artist_mbid` varchar(255) DEFAULT NULL,
+ `imgUrls` longtext,
+ `name` varchar(255) DEFAULT NULL,
+ `time` bigint(20) NOT NULL,
+ `url` varchar(255) DEFAULT NULL,
+ `tags` longtext,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=MyISAM AUTO_INCREMENT=196 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_LastFmRecentTrack`
+--
+
+DROP TABLE IF EXISTS `Facet_LastFmRecentTrack`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_LastFmRecentTrack` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `timeUpdated` bigint(20) NOT NULL,
+ `album_mbid` varchar(255) DEFAULT NULL,
+ `artist` varchar(255) DEFAULT NULL,
+ `artist_mbid` varchar(255) DEFAULT NULL,
+ `imgUrls` longtext,
+ `name` varchar(255) DEFAULT NULL,
+ `time` bigint(20) NOT NULL,
+ `url` varchar(255) DEFAULT NULL,
+ `tags` longtext,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=MyISAM AUTO_INCREMENT=17995 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_MymeeObservation`
+--
+
+DROP TABLE IF EXISTS `Facet_MymeeObservation`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_MymeeObservation` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `tags` longtext,
+ `timeUpdated` bigint(20) NOT NULL,
+ `note` longtext,
+ `mymeeId` varchar(255) NOT NULL,
+ `name` varchar(255) DEFAULT NULL,
+ `user` varchar(255) DEFAULT NULL,
+ `timezoneOffset` int(11) NOT NULL,
+ `amount` double DEFAULT NULL,
+ `baseAmount` int(11) DEFAULT NULL,
+ `unit` varchar(255) DEFAULT NULL,
+ `baseUnit` varchar(255) DEFAULT NULL,
+ `imageURL` varchar(255) DEFAULT NULL,
+ `longitude` double DEFAULT NULL,
+ `latitude` double DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `name` (`name`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_PicasaPhotoEntry`
+--
+
+DROP TABLE IF EXISTS `Facet_PicasaPhotoEntry`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_PicasaPhotoEntry` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `timeUpdated` bigint(20) NOT NULL,
+ `description` longtext,
+ `photoId` varchar(255) DEFAULT NULL,
+ `photoUrl` varchar(255) DEFAULT NULL,
+ `thumbnailUrl` varchar(255) DEFAULT NULL,
+ `thumbnailsJson` longtext,
+ `title` varchar(255) DEFAULT NULL,
+ `tags` longtext,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=MyISAM AUTO_INCREMENT=12574 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_QuantifiedMindTest`
+--
+
+DROP TABLE IF EXISTS `Facet_QuantifiedMindTest`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_QuantifiedMindTest` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `timeUpdated` bigint(20) NOT NULL,
+ `result_name` varchar(255) DEFAULT NULL,
+ `result_value` double NOT NULL,
+ `session_timestamp` bigint(20) NOT NULL,
+ `test_name` varchar(255) DEFAULT NULL,
+ `tags` longtext,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_RunKeeperFitnessActivity`
+--
+
+DROP TABLE IF EXISTS `Facet_RunKeeperFitnessActivity`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_RunKeeperFitnessActivity` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `tags` longtext,
+ `timeUpdated` bigint(20) NOT NULL,
+ `comments` varchar(255) DEFAULT NULL,
+ `duration` int(11) NOT NULL,
+ `equipment` varchar(255) DEFAULT NULL,
+ `is_live` bit(1) NOT NULL,
+ `source` varchar(255) DEFAULT NULL,
+ `total_climb` double NOT NULL,
+ `total_distance` double NOT NULL,
+ `type` varchar(255) DEFAULT NULL,
+ `uri` varchar(255) DEFAULT NULL,
+ `userID` varchar(255) DEFAULT NULL,
+ `timeZone` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_SmsEntry`
+--
+
+DROP TABLE IF EXISTS `Facet_SmsEntry`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_SmsEntry` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `timeUpdated` bigint(20) NOT NULL,
+ `dateReceived` datetime DEFAULT NULL,
+ `message` longtext,
+ `personName` varchar(255) DEFAULT NULL,
+ `personNumber` varchar(255) DEFAULT NULL,
+ `type` int(11) DEFAULT NULL,
+ `tags` longtext,
+ PRIMARY KEY (`id`),
+ KEY `isEmpty_index` (`isEmpty`),
+ KEY `end_index` (`end`),
+ KEY `start_index` (`start`),
+ KEY `api_index` (`api`),
+ KEY `objectType_index` (`objectType`),
+ KEY `guestId_index` (`guestId`),
+ KEY `timeUpdated_index` (`timeUpdated`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Table structure for table `Facet_ToodledoGoal`
+--
+
+DROP TABLE IF EXISTS `Facet_ToodledoGoal`;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `Facet_ToodledoGoal` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `api` int(11) NOT NULL,
+ `comment` longtext,
+ `end` bigint(20) NOT NULL,
+ `fullTextDescription` longtext,
+ `guestId` bigint(20) NOT NULL,
+ `isEmpty` char(1) NOT NULL,
+ `objectType` int(11) NOT NULL,
+ `start` bigint(20) NOT NULL,
+ `timeUpdated` bigint(20) NOT NULL,
+ `archived` tinyint(4) NOT NULL,
+ `contributes` bigint(20) NOT NULL,
+ `level` int(11) NOT NULL,
+ `name` varchar(255) DEFAULT NULL,
+ `note` longtext,
+ `toodledo_id` bigint(20)