26 Commits

Author SHA1 Message Date
a16244a3f5 Feature: [docgen] generate documents in an async queue
The documents are now generated in a queue, using symfony messenger. This queue should be configured:

```yaml
# app/config/messenger.yaml
framework:
    messenger:
        # reset services after consuming messages
        # reset_on_message: true

        failure_transport: failed

        transports:
            # https://symfony.com/doc/current/messenger.html#transport-configuration
            async: '%env(MESSENGER_TRANSPORT_DSN)%'
            priority:
                dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
            failed: 'doctrine://default?queue_name=failed'

        routing:
            # ... other messages
            'Chill\DocGeneratorBundle\Service\Messenger\RequestGenerationMessage': priority
```

`StoredObject`s now have additionnal properties:

* status (pending, failure, ready (by default) ), which explain if the document is generated;
* a generationTrialCounter, which is incremented on each generation trial, which prevent each generation more than 5 times;

The generator computation is moved from the `DocGenTemplateController` to a `Generator` (implementing `GeneratorInterface`. 

There are new methods to `Context` which allow to normalize/denormalize context data to/from a messenger's `Message`.
2023-02-28 15:25:47 +00:00
9699e2304a fix cs: declare type and license header mismatch 2022-10-06 22:25:43 +02:00
67c3f3a840 fix cs with licencse header 2022-10-05 17:08:14 +02:00
nobohan
b7ed658f96 admin: fix new document category 2022-05-10 17:01:09 +02:00
27e74014ce replace fqdn in docstore bundle 2022-04-30 00:48:38 +02:00
26d5bf03bd add order by on document list 2022-04-20 10:00:48 +02:00
6edf0bcb3b fix delete links in documents 2022-03-03 13:57:00 +01:00
6171b3411f fix creation of document when overriding center resolver 2022-03-03 13:07:36 +01:00
c8e5ba4738 phpcsfixes 2022-02-11 16:04:01 +01:00
bf0b7f1bb2 Create AccompanyingCourseDocumentRepository and use to add pagination 2022-02-11 16:04:01 +01:00
d6cc69b919 Add pagination in the findBy() 2022-02-11 16:04:01 +01:00
89383a5ec4 deprecated service replaced and error removed from phpstan file 2022-02-11 16:04:00 +01:00
6fa99655b2 delegates the acl for fetching person documents to an ACLAwareREpository 2022-02-11 16:04:00 +01:00
e0c7daf3fd Pagination added 2022-02-11 16:04:00 +01:00
36890a2256 person document: fix use of deprecated role class 2021-12-17 00:33:02 +01:00
Pol Dellaiera
cd3be25c22
cs: Remove duplicated headers. 2021-11-30 13:54:58 +01:00
Pol Dellaiera
47c5855a21
cs: Switch to a stricter way of coding - this might break in a lot of places. 2021-11-30 13:33:18 +01:00
Pol Dellaiera
f531cdc0ec
cs: Enable a couple of risky rules. 2021-11-30 09:39:45 +01:00
Pol Dellaiera
8f96a1121d
cs: Fix code style (safe rules only). 2021-11-23 14:08:50 +01:00
Pol Dellaiera
c68bda5c9b
fix: SA: Fix "...invoked with..." rule.
SA stands for Static Analysis.
2021-11-16 12:16:02 +01:00
250bd29ab3 add voter for documents 2021-11-04 23:40:30 +01:00
2e5c2de363 Documents can be added/viewed/edited for an accompanyingCourse + menu entry added 2021-09-14 15:44:06 +02:00
5211fb2fe9 Documents added to accompanying course menu 2021-09-09 16:42:53 +02:00
b11592fb6d templates added and adapted, still problems with scope 2021-09-03 16:05:55 +02:00
46560da67d start of controller and formtype: adaptation from DocumentPersonController 2021-09-03 12:20:34 +02:00
eaa0ad925f fix folder name 2021-03-18 13:37:13 +01:00