Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALFREDAPI-568 Separated upload to native Alfresco webscript as a workaround to broken multipart upload with Alfresco MVC #238

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

todorinskiz
Copy link
Member

@todorinskiz todorinskiz commented Feb 9, 2025

Fixes https://xenitsupport.jira.com/browse/ALFREDAPI-568

  • Is CHANGELOG.md extended?
  • Does this PR avoid breaking the API?
    Breaking changes include adding, changing or removing endpoints and/or JSON objects used in requests and responses.
  • Are all Alfresco services wired via ServiceRegistry (and not per service)?
  • Does the PR comply to REST HTTP result codes policy outlined in the user guide?
  • Is error handling done through a method annotated with @ExceptionHandler in the webscript classes?
  • Does the PR follow our coding styleguide and other active procedures?
  • Is usage of this. prefix avoided?

See README.md for full explanation.

TL;DR

  1. Disabled old upload endpoint (Alfresco MVC)
  2. Added a new classic Alfresco webscript, incl descriptor and Spring XML bean definition
  3. Reused existing code (node info construction and object mapper for noderef and qname serialization)

Reproduce

Fix Share upload for local testing and break Alfresco MVC multipart upload

Test fix

curl --location 'http://localhost:8080/alfresco/s/apix/v1/nodes/upload' \
--header 'Content-Type: multipart/form-data' \
--header 'Accept: application/json' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--form 'parent="workspace://SpacesStore/<target-folder-uuid>"' \
--form 'file=@"your-file.txt"' \
--form 'type="cm:content"' \
--form 'extractMetadata="false"'


public class ObjectMapperFactory {
public static ObjectMapper getNewObjectMapper(RestJsonModule alfrescoRestJsonModule) {
ObjectMapper om = new SearchNodeJsonParser().getObjectMapper();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move configureObjectMapper from SearchNodeJsonParser to this class and call ObjectMapperFactory from SearchNodeJsonParser instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants