Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

Commit

Permalink
initial services for sqldatabase and rdfstore
Browse files Browse the repository at this point in the history
  • Loading branch information
appelgriebsch committed Aug 31, 2016
1 parent fbca481 commit 1fd0f4a
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
}
])
var PouchDBService = require('./shell/services/PouchDBService')
var LovefieldService = require('./shell/services/LovefieldService')
var RDFStoreService = require('./shell/services/RDFStoreService')
var ActivityDataService = require('./shell/services/ActivityDataService')
var ActivityService = require('./shell/services/ActivityService')
var ModuleProvider = require('./scripts/ModuleProvider')
Expand All @@ -39,6 +41,8 @@
ModuleProvider.loadModules()
angular.module('electron-app').provider('modules', [ModuleProvider])
angular.module('electron-app').service('PouchDBService', [PouchDBService])
angular.module('electron-app').service('LovefieldService', [LovefieldService])
angular.module('electron-app').service('RDFStoreService', [RDFStoreService])
angular.module('electron-app').service('ActivityDataService', ['PouchDBService', ActivityDataService])
angular.module('electron-app').service('ActivityService', ['ActivityDataService', ActivityService])
angular.module('electron-app').controller('ShellController', ['$scope', '$log', '$q', '$mdSidenav', 'modules', 'ActivityService', ShellController])
Expand Down
1 change: 0 additions & 1 deletion app/shell/controllers/ShellController.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
*/
$scope.notify = (title, message) => {
$q.when(true).then(() => {
console.log("Notification", title, message)
notifier.notify(title, {
message: message,
icon: appCfg.app.icon
Expand Down
25 changes: 25 additions & 0 deletions app/shell/services/LovefieldService.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
(function () {
'use strict'
/**
* LovefieldService - description
*
* @return {type} description
*/
function LovefieldService () {

var lf = require('lovefield')

return {
/**
* initialize function - description
*
* @param {type} dbName description
* @return {type} description
*/
initialize: function (dbName) {
return lf.schema.create(dbName);
}
}
}
module.exports = LovefieldService
})()
43 changes: 43 additions & 0 deletions app/shell/services/RDFStoreService.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
(function () {
'use strict'
/**
* RDFStoreService - description
*
* @return {type} description
*/
function RDFStoreService () {

var rdfStore = require('rdfStore')
/**
* DataService - description
*
* @param {type} dbName description
* @return {type} description
*/
function DataService (dbName) {
var promise = new Promise((resolve, reject) => {
rdfStore.Store({ persistent: true, name: dbName })
.then((result) => {
resolve(result)
})
.catch((err) => {
console.log(err)
reject(err)
})
})
return promise
}
return {
/**
* initialize function - description
*
* @param {type} dbName description
* @return {type} description
*/
initialize: function (dbName) {
return new DataService(dbName)
}
}
}
module.exports = RDFStoreService
})()

0 comments on commit 1fd0f4a

Please sign in to comment.