-
Notifications
You must be signed in to change notification settings - Fork 9
Fix for incorrect filename if copying attachments after renaming the source attachment #351
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
Conversation
…source attachment
…ap-java/sdm into fileNameIssueInCopyafterRename
| String mimeType = attachmentMetadata.get(1); | ||
| if (mimeType.equalsIgnoreCase("application/internet-shortcut")) { | ||
| int dotIndex = fileName.lastIndexOf('.'); | ||
| fileName = fileName.substring(0, dotIndex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this is removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Earlier we were reading cmis:contentStreamFileName from DMS copyAttachments response as filename property in DB. cmis:contentStreamFileName contains .url appended in name and this name doesn't gets updated when we rename the file in DMS. That's why customer was facing the issue.
Whereas cmis:name doesn't have .url appended with the name of the link, so I have removed this part of code
|
gemini review |
|
Gemini Automated Review Best Practices Review 💡
Potential Bugs 🐛
Recommendations & Required Changes 🛠️
Quality Rating ⭐ Overall Assessment |
Describe your changes
In copyAttachments method after copying the attachments to target entity, we need to update the draft tables metadata with newly copied attachments in target entity. To update the filename, we were reading "cmis:contentStreamFileName" property of response, which doesn't changes if we are renaming the attachments. So, on UI always the initial name was showing. Updated "cmis:contentStreamFileName" with "cmis:name" which will be updated with every name update.
Type of change
Please delete options that are not relevant.
Checklist before requesting a review
Upload Screenshots/lists of the scenarios tested
Create an entity and upload an attachment, Save. Edit entity, rename attachment, Save. Create another entity and Copy the attachment from 1st entity. Attachment copied with the updated name.
Create an entity and create a link, Save. Edit entity, rename link, Save. Create another entity and Copy the link from 1st entity. Link copied with the updated name.
Single-tenant Integration tests: https://github.com/cap-java/sdm/actions/runs/18935195679
Multi-tenant Integration tests: https://github.com/cap-java/sdm/actions/runs/18936619831