Skip to content

MNT-24883 sourcefile name added in transform options #3379

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

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

Conversation

bsayan2
Copy link
Contributor

@bsayan2 bsayan2 commented Jun 5, 2025

Sending source file name in transform options.

core aio pr: Alfresco/alfresco-transform-core#1081

tests branch : fix/MNT-24883-transformoptions-test

test cases successful pipeline : alfresco-community-repo/actions/runs/15527733234

@@ -155,10 +161,13 @@ protected void transformImpl(ContentReader reader,
transformOptions.put(SOURCE_NODE_REF, sourceNodeRef.toString());
}

String filename = transformUtil.getFilenameFromNodeRef(sourceNodeRef, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

I would use just nodeSerivce

// Build an array of option names and values and extract the timeout.
long timeoutMs = 0;
int nonOptions = transformOptions.containsKey(RenditionDefinition2.TIMEOUT) ? 1 : 0;
int size = (transformOptions.size() - nonOptions + 3) * 2;
int argAdditionalSize = StringUtils.isNotEmpty(filename) ? 4 : 3;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we add SOURCE_FILENAME to transformOptions to simplify it?

@@ -71,6 +72,7 @@
private Map<String, LocalTransform> localTransforms = new HashMap<>();
}

private NodeService nodeService;

Check warning

Code scanning / PMD

Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. Warning

Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes.
@@ -205,6 +206,9 @@
@Mock
private MimetypeMap mimetypeMap;

@Mock
private NodeService nodeService;

Check warning

Code scanning / PMD

Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. Warning test

Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes.
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