Commit 313ec5ba authored by Julian Bigge's avatar Julian Bigge

Evaluate sccuot path dynamically

parent 99b63658
......@@ -50,8 +50,7 @@ class Application extends App
$container->registerService('ConfigService', function ($c) {
return new ConfigService(
$c->query('Config'),
$c->query('AppName'),
$c->getServer()->getAppManager()->getAppPath('sccuot')
$c->query('AppName')
);
});
......@@ -62,7 +61,8 @@ class Application extends App
$container->registerService('SccuotService', function($c) {
return new SccuotService(
$c->query('ConfigService'),
$c->query('CacheStorage')
$c->query('CacheStorage'),
$c->getServer()->getAppManager()
);
});
......
......@@ -5,14 +5,15 @@
<description>Sccuot test app</description>
<licence>AGPL</licence>
<author>Julian Bigge</author>
<version>0.1.1</version>
<version>0.3.0</version>
<namespace>Sccuot</namespace>
<category>tools</category>
<dependencies>
<owncloud min-version="10" max-version="10" />
</dependencies>
<summary>
Sccuot is a tool for monitoring usage of resources.
A frontend version of sccuot (Sciebo C++ Usage Observation Toolkit) bundled with
the binary backend.
</summary>
<documentation></documentation>
<website>https://zivgitlab.uni-muenster.de/j_bigg01/sccuot-owncloud</website>
......
......@@ -22,7 +22,7 @@ class ConfigService {
'snapshot_file_types' => NULL
];
public function __construct(IConfig $config, $appName, $appFolder) {
public function __construct(IConfig $config, $appName) {
$this->config = $config;
$this->appName = $appName;
......@@ -30,7 +30,6 @@ class ConfigService {
$this->DEFAULTS['db'] = $config->getSystemValue('dbname');
$this->DEFAULTS['username'] = $config->getSystemValue('dbuser');
$this->DEFAULTS['password'] = $config->getSystemValue('dbpassword');
$this->DEFAULTS['sccuot_path'] = $appFolder . '/bin/Sccuot-x86_64.AppImage';
$this->DEFAULTS['snapshot_file_types'] = json_encode([
"pdf" => TRUE,
"doc" => TRUE,
......
......@@ -8,6 +8,8 @@
namespace OCA\Sccuot\Service;
use \OCP\App\IAppManager;
use \OCA\Sccuot\Service\ConfigService;
use \OCA\Sccuot\Storage\CacheStorage;
......@@ -42,13 +44,15 @@ class SccuotOperation {
class SccuotService {
const BINARY_NAME = 'sccuot';
const BINARY_DIR = '/bin/';
const FORMAT = 'json';
private $command;
private $configService;
private $cache;
private $appManager;
private function update_command(ConfigService $configService) {
$ret = $configService->getAppValue('sccuot_path');
$ret = $this->appManager->getAppPath('sccuot') . SccuotService::BINARY_DIR . SccuotService::BINARY_NAME;
$ret .= ' -s ' . $configService->getAppValue('hostname');
$ret .= ' -d ' . $configService->getAppValue('db');
......@@ -59,9 +63,10 @@ class SccuotService {
return $ret;
}
public function __construct(ConfigService $configService, CacheStorage $cache) {
public function __construct(ConfigService $configService, CacheStorage $cache, IAppManager $appManager) {
$this->configService = $configService;
$this->cache = $cache;
$this->appManager = $appManager;
$this->command = $this->update_command($this->configService);
}
......
......@@ -25,5 +25,4 @@ style('sccuot', 'settings');
<a href="https://zivgitlab.uni-muenster.de/j_bigg01/sccuot-owncloud/issues" target="_blank">bugs & feature request</a>
</div>
<div id="footer">logo design by Christian Wollny</div>
</div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment