stable

Clone or download

Read-only

Embedded files can be copied via the REST API

The REST route to create a new embedded files now also allow the users to create a new embedded file from an existing one. Ideally, we should manipulate either a representation for a copy or a representation for a creation from scratch but our current technical stack does not allow us to do such thing (we would need something supporting OpenAPI 3.0 to achieve that [0]). As result both representations have been merged together are manually validated. Part of story #12456: Cut/Copy/paste items [0] https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/ Change-Id: I7993305556d2d9fb17d55302c471760229434ff9

Modified Files

Name
M plugins/docman/include/Docman_Actions.class.php +2 −8 Go to diff View file
M plugins/docman/include/Docman_MetadataFactory.class.php +0 −8 Go to diff View file
A plugins/docman/include/Metadata/MetadataFactoryBuilder.php +34 −0 Go to diff View file
A plugins/docman/include/REST/v1/CopyItem/BeforeCopyVisitor.php +131 −0 Go to diff View file
A plugins/docman/include/REST/v1/CopyItem/CanContainACopyRepresentation.php +31 −0 Go to diff View file
A plugins/docman/include/REST/v1/CopyItem/DocmanCopyItemRepresentation.php +31 −0 Go to diff View file
A plugins/docman/include/REST/v1/CopyItem/DocmanItemCopier.php +132 −0 Go to diff View file
A plugins/docman/include/REST/v1/CopyItem/DocmanValidateRepresentationForCopy.php +71 −0 Go to diff View file
A plugins/docman/include/REST/v1/CopyItem/ItemBeingCopiedExpectation.php +41 −0 Go to diff View file
M plugins/docman/include/REST/v1/DocmanFoldersResource.php +49 −14 Go to diff View file
M plugins/docman/include/REST/v1/EmbeddedFiles/DocmanEmbeddedPOSTRepresentation.php +16 −3 Go to diff View file
M plugins/docman/include/REST/v1/Folders/ItemCanHaveSubItemsChecker.php +2 −0 Go to diff View file
M plugins/docman/include/constants.php +0 −8 Go to diff View file
A plugins/docman/phpunit/Metadata/MetadataFactoryBuilderTest.php +48 −0 Go to diff View file
A plugins/docman/phpunit/REST/v1/CopyItem/BeforeCopyVisitorTest.php +130 −0 Go to diff View file
A plugins/docman/phpunit/REST/v1/CopyItem/DocmanItemCopierTest.php +251 −0 Go to diff View file
A plugins/docman/phpunit/REST/v1/CopyItem/DocmanValidateRepresentationForCopyTest.php +111 −0 Go to diff View file
A plugins/docman/phpunit/REST/v1/CopyItem/ItemBeingCopiedExpectationTest.php +35 −0 Go to diff View file
M plugins/docman/site-content/fr_FR/LC_MESSAGES/tuleap-docman.po +6 −2 Go to diff View file
M plugins/docman/tests/rest/Docman/DocmanFoldersTest.php +20 −1 Go to diff View file
M src/common/plugin/PluginFileInfo.class.php +3 −3 Go to diff View file