Rule based processing of files through specified external scripts
Перейти к файлу
blizzz b86039b870
Merge pull request #82 from nextcloud/backport/81/stable20
[stable20] fix substitution of n placholder
2021-03-02 13:17:45 +01:00
.github s/files_external_script/workflow_script/g 2018-11-02 14:33:14 +01:00
.tx s/files_external_script/workflow_script/g 2018-11-02 14:33:14 +01:00
appinfo bump version 2021-01-15 13:57:06 +01:00
img own app icons 2018-11-02 16:23:20 +01:00
js Keep the variable private 2019-10-10 14:57:27 +02:00
l10n add l10n dir 2018-10-31 19:47:31 +01:00
lib fix substitution of n placholder 2021-03-01 19:45:33 +01:00
screenshots update screenshot 2020-01-16 14:43:05 +01:00
.drone.yml Update stable20 target versions 2020-09-18 09:02:43 +02:00
.gitignore ship own parallel-lint for testing 2020-09-10 22:53:26 +02:00
.nextcloudignore ignore empty vendor (only dev dependencies) 2020-09-10 23:03:08 +02:00
COPYING initial commit 2018-10-31 19:42:14 +01:00
README.md s/files_external_script/workflow_script/g 2018-11-02 14:33:14 +01:00
composer.json ship own parallel-lint for testing 2020-09-10 22:53:26 +02:00
krankerl.toml ignore empty vendor (only dev dependencies) 2020-09-10 23:03:08 +02:00

README.md

Nextcloud Workflow Script app

This app enables Nextcloud to pass on files to external scripts when they were created or changed. By utilizing the workflow engine it allows Nextcloud administrators to define rules upon which matching files are enqueued to be run against a specified script. Eventually, the command is executed in a background job.

Learn more about workflows on https://nextcloud.com/workflow

The settings screen

Placeholders

After enabling this app, rules can be defined in the admin settings, "External scripts" section.

When defining the script, you can specify one of the following placeholders that will be replaced with the appropriate value:

Placeholder Description example value
%e the event type create, update or rename
%i file id 142430
%a actor's user id bob
%o owner's user id alice
%n nextcloud-relative path alice/files/Pictures/Wonderland/20180717_192103.jpg
%f locally available file /tmp/oc_tmp_m6E6OO-.jpg
%x old nextcloud-relative file path (only on rename) alice/files/Workbench/20180717_192103.jpg

When no placeholder was specified, then the exact command as given is being executed.

Example

All plain text files should be passed to a tool that collects statistics of the writing style of a document and writes them back to a specified mount on the host, in a subfolder that matches the actor's ID, and filename consisting of the basename plus ".style" appended:

pass a file to style and write back the results

style -L de %f > /Lektorat/%a/$(basename %n).style

And after the cron job was run, you'll find the results on the expected place:

$ cat /Lektorat/bob/Sanin\ -\ Artsybashev.txt.style
readability grades:
        Kincaid: 10.2
        ARI: 10.4
        Coleman-Liau: 10.6
        Flesch Index: 55.7/100
        Fog Index: 12.5
        Lix: 39.0 = school year 6
        SMOG-Grading: 6.4
sentence info:
        684404 characters
        143798 words, average length 4.76 characters = 1.56 syllables
        7606 sentences, average length 18.9 words
        47% (3591) short sentences (at most 14 words)
        18% (1390) long sentences (at least 29 words)
        1 paragraphs, average length 7606.0 sentences
        4% (378) questions
        24% (1849) passive sentences
        longest sent 164 wds at sent 339; shortest sent 1 wds at sent 4
word usage:
        verb types:
        to be (2154) auxiliary (1581) 
        types as % of total:
        conjunctions 7% (10560) pronouns 9% (12733) prepositions 8% (10894)
        nominalizations 1% (1638)
sentence beginnings:
        pronoun (1209) interrogative pronoun (306) article (795)
        subordinating conjunction (275) conjunction (701) preposition (529)

Limitations

This app does not work with either encryption method.