-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NC 18 Flow integration #10
Comments
The API for 18 is supposed to stay like this as we are post feature freeze now.
There is no howto or documentation yet unfortunately, but for a reference implementation nextcloud/spreed#2487 is probably the best for a basic operation (the others files_accesscontrol/files_automatedtagging are more special cases) |
@Rello There's also the talk @juliushaertl and I gave at the conf. The basics are the same, specifics have changed a little. Otherwise, yes, the Talk implementation @juliushaertl mentioned is the latest app, that got a very new implementation and this is a great reference. |
@Rello btw, when you were here we were talking about a Timer like event. In fact, it's probably easier (UX wise, too) if you solve it with a background job. |
@blizzz it would require a complete new UX for the cron job customisation. I would like the flow part. perhaps I will look at it if I have fee time |
Hello @blizzz @juliushaertl I think it would make it easier to have it as a filter. without I would hand over every added file to my operator and check for the mime-type there. but the initial trigger sounds more reasonable to me |
@Rello the event is being thrown and caught in any case. So, basically check it in your onEvent implementation and exit early if it is not relevant. The PDF converter does it similar: https://github.com/nextcloud/workflow_pdf_converter/blob/master/lib/Operation.php#L87-L108 |
Hello @blizzz
but it is not showing up. |
@Rello Timing. When you do not instantiate your Application instance yourself, it will happen too late. Also, it is better to keep logic out of the constructor. This does: diff --git a/appinfo/app.php b/appinfo/app.php
index 539c8bf..bff433f 100644
--- a/appinfo/app.php
+++ b/appinfo/app.php
@@ -14,6 +14,9 @@ namespace OCA\Analytics\AppInfo;
use OCP\Util;
+$app = \OC::$server->query(Application::class);
+$app->register();
+
$navigationEntry = function () {
return [
'id' => 'analytics',
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php
index 9594c26..7cb6ec6 100644
--- a/lib/AppInfo/Application.php
+++ b/lib/AppInfo/Application.php
@@ -25,7 +25,6 @@ class Application extends App
{
parent::__construct('analytics', $urlParams);
- $this->register();
}
public function register() |
one more question: |
@juliushaertl ^ is this possible? |
alternatively I could need your help because I don´t have the vue environment. |
Plain javascript would be possible with some vue component boilerplate code (similar to https://github.com/nextcloud/workflow_script/blob/master/js/admin.js) so you won't need any vue dependencies in your app. I can help out and provide you with an example for that. Otherwise I can also prepare a pull request for a vue implementation so that the app also uses the default multiselect component, but might need to wait until next week. Up to you. 😉 |
I like that idea. seams reasonable for this very basic requirement So I guess the questions are:
I am trying to compare against |
OK, it works! If I may ask for some minutes: could you have quick review of my flow.js if there are any no-gos or if it looks acceptable? thank you very much |
Looks sane to me. When testing, i encountered that your Application class is not loaded in app.php, so the operation is not registered. Please see the comment from @blizzz for that. |
yes. sorry for that. did not commit the app/application to this ticket I think for documentation purpose, there is a lot of topics to write up e.g. like the way from $event to the fileid or path currently its a lot of try/error/debug for an external
or
|
its working Wiki: |
@Rello btw, you can add it to the flow category, too: diff --git a/appinfo/info.xml b/appinfo/info.xml
index d32c6b4..5aa1ea4 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -22,6 +22,7 @@ From data to report. Data Analytics provides modular datasources, a realtime or
<author>Marcel Scherello</author>
<namespace>Analytics</namespace>
<category>office</category>
+ <category>workflow</category>
<website>https://github.com/rello/analytics</website>
<bugs>https://github.com/rello/analytics/issues</bugs>
<repository type="git">https://github.com/rello/analytics.git</repository> |
Yes, this is certainly true |
Hello Masters, what check could I put in application.php to register only on NC18? |
did you try to wrap it in a |
the class is existing. I ended up using |
Hello @blizzz I still need help. another suggestion? |
I take a closer look today |
@Rello this works: diff --git a/lib/Flow/Operation.php b/lib/Flow/Operation.php
index 0ab2f4e..25686f5 100644
--- a/lib/Flow/Operation.php
+++ b/lib/Flow/Operation.php
@@ -52,11 +52,13 @@ class Operation implements IOperation
public static function register(IEventDispatcher $dispatcher): void
{
- $dispatcher->addListener(IManager::EVENT_NAME_REG_OPERATION, function (GenericEvent $event) {
- $operation = \OC::$server->query(Operation::class);
- $event->getSubject()->registerOperation($operation);
- Util::addScript('analytics', 'flow');
- });
+ if(interface_exists(IRuleMatcher::class)) {
+ $dispatcher->addListener(IManager::EVENT_NAME_REG_OPERATION, function (GenericEvent $event) {
+ $operation = \OC::$server->query(Operation::class);
+ $event->getSubject()->registerOperation($operation);
+ Util::addScript('analytics', 'flow');
+ });
+ }
}
public function getDisplayName(): string
@@ -116,4 +118,4 @@ class Operation implements IOperation
return;
}
}
-}
\ No newline at end of file
+} |
Hello @blizzz, @juliushaertl
I would like to follow up our conversation regarding Workflow.
My last status was, that you were still working several basic classes.
thank you,
Rello
The text was updated successfully, but these errors were encountered: