Skip to content

Commit

Permalink
Merge pull request #11 from esmero/ISSUE-3
Browse files Browse the repository at this point in the history
ISSUE-3: OCR specific Processor and new features/processing option
  • Loading branch information
DiegoPino authored Dec 15, 2020
2 parents 93896a6 + 91ccc23 commit 92e4b41
Show file tree
Hide file tree
Showing 19 changed files with 1,876 additions and 386 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
.idea/modules.xml
.idea/misc.xml
.idea/codeStyles/codeStyleConfig.xml
src/.DS_Store
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "strawberryfield/strawberry_runners",
"description": "Strawberryfield post processing module for Drupal 8 using PHP React",
"description": "Strawberryfield post processing module for Drupal 8/9 using PHP React",
"type": "drupal-module",
"license": "GPL-2.0+",
"homepage": "https://github.com/esmero/strawberry_runners",
Expand All @@ -19,7 +19,9 @@
}
],
"require": {
"drupal/core": "^8.9 || ^9",
"ml/json-ld": "^1.0",
"drupal/search_api_solr": "~4.1",
"mtdowling/jmespath.php": "^2.4",
"strawberryfield/strawberryfield": "dev-1.0.0-RC1",
"react/event-loop": "^1.1",
Expand Down
79 changes: 79 additions & 0 deletions config/schema/strawberry_runners.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,44 @@ strawberryfield_runners.strawberry_runners_postprocessor.*:
strawberryfield_runners.strawberry_runners_postprocessor.binary:
type: config_object
label: 'Strawberry Runners Post Processor Config Entity Binary specific config'
mapping:
source_type:
type: string
label: 'The type of Source Data this Processor works on'
ado_type:
type: string
label: 'DO type(s) to limit this Processor to'
jsonkey:
type: sequence
label: 'The JSON key(s) containing the desired Source File(s)'
sequence:
- type: string
mime_type:
type: string
label: 'Mimetypes(s) to limit this Processor to'
path:
type: string
label: 'The path for he binary to execute'
arguments:
type: string
label: 'Any additional argument your executable binary requires'
output_type:
type: string
label: 'The expected and desired output of this processor'
output_destination:
type: sequence
label: 'Where and how the output will be used'
sequence:
- type: string
timeout:
type: integer
label: 'Timeout in seconds for this process'
weight:
type: integer
label: 'Order or execution in the global chain'
strawberryfield_runners.strawberry_runners_postprocessor.ocr:
type: config_object
label: 'Strawberry Runners Post Processor Config Entity OCR specific config'
mapping:
source_type:
type: string
Expand All @@ -49,6 +87,47 @@ strawberryfield_runners.strawberry_runners_postprocessor.binary:
arguments:
type: string
label: 'Any additional argument your executable binary requires'
tesseract_arguments:
type: string
label: 'Any additional argument your executable binary requires'
path:
type: string
label: 'The path for he binary to execute'
tesseract_path:
type: string
label: 'The path for he binary to execute'
output_type:
type: string
label: 'The expected and desired output of this processor'
output_destination:
type: sequence
label: 'Where and how the output will be used'
sequence:
- type: string
timeout:
type: integer
label: 'Timeout in seconds for this process'
weight:
type: integer
label: 'Order or execution in the global chain'
strawberryfield_runners.strawberry_runners_postprocessor.filesequence:
type: config_object
label: 'Strawberry Runners Post Processor Config Entity JSON sequence specific config'
mapping:
source_type:
type: string
label: 'The type of Source Data this Processor works on'
ado_type:
type: string
label: 'DO type(s) to limit this Processor to'
jsonkey:
type: sequence
label: 'The JSON key(s) containing the desired Source File(s)'
sequence:
- type: string
mime_type:
type: string
label: 'Mimetypes(s) to limit this Processor to'
output_type:
type: string
label: 'The expected and desired output of this processor'
Expand Down
16 changes: 11 additions & 5 deletions src/Annotation/StrawberryRunnersPostProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
class StrawberryRunnersPostProcessor extends Plugin {

const PRESAVE = 'preSave';
const INDEX = 'search_api';

const POSTSAVE = 'postSave';

/**
* The plugin id.
Expand Down Expand Up @@ -55,13 +54,20 @@ class StrawberryRunnersPostProcessor extends Plugin {
*/
public $input_property;

/**
* The Object property that contains the additional data needed by the Processor ::run method
*
* @var string $input_arguments;
*
*/
public $input_arguments;

/**
* Processing stage: can be Entity PreSave or Index time search_api
* Processing stage: can be Entity PreSave or PostSave
*
* @var string $when;
*
*/
public $when = StrawberryRunnersPostProcessor::PRESAVE;
public $when = StrawberryRunnersPostProcessor::POSTSAVE;

}
}
Loading

0 comments on commit 92e4b41

Please sign in to comment.