Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@
],
'routes' => [
['name' => 'dashboard#page', 'url' => '/', 'verb' => 'GET'],
['name' => 'sources#test', 'url' => '/api/source-test/{id}', 'verb' => 'POST'],
['name' => 'sources#logs', 'url' => '/api/sources-logs/{id}', 'verb' => 'GET'],
['name' => 'jobs#run', 'url' => '/api/jobs-test/{id}', 'verb' => 'POST'],
['name' => 'jobs#logs', 'url' => '/api/jobs-logs/{id}', 'verb' => 'GET'],
],
];
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
},
"require": {
"php": "^8.1",
"adbario/php-dot-notation": "^3.3.0",
"adbario/php-dot-notation": "^3.3",
"bamarni/composer-bin-plugin": "^1.8",
"elasticsearch/elasticsearch": "^v8.14.0",
"adbario/php-dot-notation": "^3.3.0",
"guzzlehttp/guzzle": "^7.0",
"symfony/uid": "^6.4"
"symfony/uid": "^6.4",
"twig/twig": "^3.14"
},
"require-dev": {
"nextcloud/ocp": "dev-stable29",
Expand Down
240 changes: 239 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,17 @@ services:
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud

# init-ubuntu:
# image: ubuntu
# command: sh /home/ubuntu/docker/init-ubuntu.sh
# volumes:
# - ./docker:/home/ubuntu/docker
# - .:/home/ubuntu/app

nextcloud:
user: root
container_name: nextcloud
# entrypoint: occ app:enable openconnector
image: nextcloud
restart: always
ports:
Expand All @@ -29,14 +37,13 @@ services:
- db
volumes:
- nextcloud:/var/www/html:rw
- ./custom-apps:/var/www/html/custom_apps
- ./custom_apps:/var/www/html/custom_apps
- .:/var/www/html/custom_apps/openconnector

environment:
- MYSQL_PASSWORD='!ChangeMe!'
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_HOST=db
- TZ=Europe/Amsterdam
- NEXTCLOUD_ADMIN_USER=admin
- NEXTCLOUD_ADMIN_PASSWORD=admin
- TZ=Europe/Amsterdam
33 changes: 33 additions & 0 deletions lib/Action/EventAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace OCA\OpenConnector\Action;

use OCA\OpenConnector\Service\CallService;
use OCA\OpenConnector\Db\SourceMapper;

/**
* This class is used to run the action tasks for the OpenConnector app. It hooks into the cron job list and runs the classes that are set as the job class in the job.
*
* @package OCA\OpenConnector\Cron
*/
class EventAction
{
private CallService $callService;
private SourceMapper $sourceMapper;
public function __construct(
CallService $callService,
SourceMapper $sourceMapper,
) {
$this->callService = $callService;
}

//@todo: make this a bit more generic :')
public function run($argument)
{
// @todo: implement this

// Lets report back about what we have just done
return;
}

}
41 changes: 41 additions & 0 deletions lib/Action/PingAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

namespace OCA\OpenConnector\Action;

use OCA\OpenConnector\Service\CallService;
use OCA\OpenConnector\Db\SourceMapper;

/**
* This class is used to run the action tasks for the OpenConnector app. It hooks into the cron job list and runs the classes that are set as the job class in the job.
*
* @package OCA\OpenConnector\Cron
*/
class PingAction
{
private CallService $callService;
private SourceMapper $sourceMapper;
public function __construct(
CallService $callService,
SourceMapper $sourceMapper,
) {
$this->callService = $callService;
}

//@todo: make this a bit more generic :')
public function run($argument)
{
// For now we only have one action, so this is a bit overkill, but it's a good starting point
if (isset($arguments['sourceId']) && is_int($argument['sourceId'])) {
$source = $this->sourceMapper->find($argument['sourceId']);
$this->callService->call($source);
}
else {
$source = $this->sourceMapper->find(1);
$this->callService->call($source);
}

// Lets report back about what we have just done
return;
}

}
Loading