48 Commits

Author SHA1 Message Date
3d49c959e0
Update DropFile to handle object versioning 2024-09-03 15:42:04 +02:00
00cc3b7806
Refactor backend for getting signed url 2024-08-28 18:00:20 +02:00
2d82c1e105
rector fixes after rector's upgrade 2024-08-28 15:34:13 +02:00
0db2652f08
Add cron job for removing expired stored objects
Introduced `RemoveExpiredStoredObjectCronJob` to automate the deletion of expired stored objects every 7 days. Enhanced associated tests and updated relevant interfaces and classes to support the new cron job functionality.
2024-08-28 14:06:11 +02:00
cb90261309
Update random_bytes length in filename and prefix generation
The size of the random byte string used in the generateFilename method of StoredObjectVersion has been reduced from 16 to 8. Conversely, the size of the random byte string used in the generatePrefix method of StoredObject has been increased from 8 to 32.

The naming generation fit better with the usage, as 16bytes are generated for each file (more version), and less for the version.
2024-08-28 14:06:09 +02:00
2b7ea4178b
Add versioning to stored objects
This update introduces a versioning system to the stored objects in the ChillDocStoreBundle. The 'StoredObject' entity now includes several new methods, and maintains a collection of 'StoredObjectVersion' instances. Each time a 'StoredObject' is modified, a new version instance is created and added to the collection, ensuring a history of changes. Migration file for the addition of new database column included. Corresponding tests are also updated.
2024-08-28 14:06:06 +02:00
916724c0c5
Merge branch 'master' into upgrade-sf5 2024-06-24 10:46:21 +02:00
ea1d4c48f2
Add history support to StoredObject entity
This commit adds a history saving feature to the StoredObject entity, which allows saving versions of the object's changes over time. This is achieved by implementing a saveHistory method that captures data attributes like filename, IV, key information, and type. The corresponding Automated tests were also created. Furthermore, adjustments were made to the StoredObject test to align with the new feature.
2024-06-04 22:31:50 +02:00
84f515d451
Merge remote-tracking branch 'origin/master' into upgrade-sf5 2024-05-28 14:16:01 +02:00
47a928a6cd
Add DAV edit link to StoredObject serialization
Enabled the adding of access link, specifically DAV edit link to the JSON serialization of the StoredObject entity. The patch also adjusted the serializer groups of various attributes of StoredObject from "read, write" to "write". Lastly, these changes were reflected in the accompanying CourseWork Controller and the FormEvaluation Vue component.
2024-05-23 18:25:20 +02:00
5be85a4fc6
Refactored code to use PHP8 attributes instead of annotations
In this change, Doctrine and validation annotations have been replaced with PHP8 Attributes. The Rector tool has been configured with a list of annotations to convert to attributes. As a consequence, the PHPStan's rules have been updated to reflect these changes. The PHP8's nullable operator (?) has been added where required, and comments in field declaration have been replaced with #[Attribute] syntax.
2024-04-08 12:11:29 +02:00
0ff4593863
Apply rector rules: add annotation for doctrine mapping 2024-04-05 13:11:42 +02:00
72016e1a21
Apply rector rules: add annotation for doctrine mapping 2024-04-05 00:01:30 +02:00
579bd829f8
Apply rector rules: symfony up to 54 2024-04-04 23:30:25 +02:00
931c69eee4
Merge remote-tracking branch 'origin/master' into upgrade-sf5 2024-04-04 18:45:01 +02:00
fc88a5f40d Improve admin UX for configuration of document template (document generation) 2024-03-26 17:06:49 +00:00
f131572344
Remove references to old async upload bundle 2023-12-12 15:55:14 +01:00
28d09a8206
Add form and types to handle async files 2023-12-12 15:55:13 +01:00
bc2041cbdd
apply more cs rules for php-cs 2023-10-17 13:27:03 +02:00
6d63177ff4
apply rules rector up to php82 2023-05-01 21:39:45 +02:00
dde3002100
DX: apply rector rules up to php8.0 2023-04-28 22:30:33 +02:00
858ade467c
DX: rector rules upt to PHP 74 2023-04-15 00:20:19 +02:00
c35ca3dbeb
DX: fix cs 2023-02-28 22:39:33 +01:00
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
6254303392
Revert "Feature: [docgen][stored object] update model to store status, template_id and fix defaults"
This reverts commit 55918bcafb9b958e83696a9eaa4f6f17e90a9602.
2023-02-16 14:08:16 +01:00
55918bcafb
Feature: [docgen][stored object] update model to store status, template_id and fix defaults 2023-02-14 20:57:34 +01:00
bb05ba0f17
Feature: [docgen] create a service to generate a document from a template 2023-02-14 19:35:28 +01: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
dea554ced4 storedObject: add title field on StoredObject entity 2022-05-25 16:32:52 +02:00
452c4b85c6 Merge remote-tracking branch 'origin/master' into issue565_document_storedObject 2022-04-27 08:43:35 +02:00
nobohan
3f47503528 storedObject: allow for null data in storedObject 2022-04-26 11:53:17 +02:00
e72a2004d7 Merge remote-tracking branch 'origin/master' into feat/add-document-encrypter-service 2022-04-26 09:37:30 +02:00
Pol Dellaiera
6ddbf35a7b
misc: Add return types. 2022-03-15 09:40:32 +01:00
nobohan
1beae4d713 AccompanyingCourseWorkEdit: download existing documents 2022-03-14 14:42:04 +01:00
nobohan
3f43574371 docstore: use API entrypoint for storing storedObject in AddAsyncUpload.vue 2022-02-24 12:11:34 +01:00
Pol Dellaiera
8f96a1121d
cs: Fix code style (safe rules only). 2021-11-23 14:08:50 +01:00
7fabe0214e household list of accompanying periods + upgrade DBAL version to 3.1 2021-11-08 10:57:14 +00:00
c793159593 quick fix stored boject 2021-09-29 15:27:11 +02:00
26140de7de Merge remote-tracking branch 'origin/master' 2021-09-29 15:15:17 +02:00
2c1d3d08c3 temporary stored object fixes 2021-09-29 15:15:10 +02:00
Pol Dellaiera
664fcd07ef fix: Update StoredObject uuid property. 2021-09-29 14:52:22 +02:00
Pol Dellaiera
dcb92b1378 Update StoredObject entity. 2021-09-28 17:49:32 +02:00
7f28effc1e Associate generate document with evaluation and update UX to go back to
documents
2021-08-20 12:44:15 +02:00
06abefd576 add redirection to wopi after doc generation 2021-08-19 23:30:45 +02:00
Pol Dellaiera
c208797daf fix: Update StoredObject entity. 2021-08-19 14:17:54 +02:00
Pol Dellaiera
c6b6fa5bf6 refactor: Update ChillDocStoreBundle - Add StoredObject repository. 2021-08-19 14:17:54 +02:00
eaa0ad925f fix folder name 2021-03-18 13:37:13 +01:00