2 * Copyright (c) 2016 highstreet technologies GmbH and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 define(['app/mwtnLog/mwtnLog.module','app/mwtnCommons/mwtnCommons.services'],function(mwtnLogApp) {
11 mwtnLogApp.register.factory('$mwtnLogView', function($q, $mwtnCommons, $mwtnDatabase, $mwtnLog) {
15 service.checkModules = $mwtnCommons.checkModules;
16 service.highlightFilteredHeader = $mwtnCommons.highlightFilteredHeader;
17 service.gridOptions = $mwtnCommons.gridOptions;
18 service.formatTimeStamp = $mwtnCommons.formatTimeStamp;
19 service.deleteDocType = $mwtnDatabase.deleteDocType;
22 service.getAllLogEntries = function(from, size) {
28 var deferred = $q.defer();
29 $mwtnDatabase.getAllData('mwtn', 'log', from, size, sort).then(function(success){
30 deferred.resolve(success);
32 $mwtnLog.error({component: '$mwtnLogView.getAllLogEntries', message: JSON.stringify(error.data)});
33 deferred.reject(error);
35 return deferred.promise;