Skip to content

Conversation

@rashmiangadi11
Copy link
Collaborator

@rashmiangadi11 rashmiangadi11 commented Dec 18, 2025

Describe your changes

As a user of CAP Application, I am able to see the status of upload of attachments so that I have transparency of documents in the SDM Backend.

SDM backend is implementing async virus scan on documents when they are uploaded on object store using Trend Micro scan. This is planned specifically for large files as Malware service has a limitation of 400 MB. SDM Tenants will have one bucket per tenant and Trend Micro is a bucket configuration. Currently this is scan only supported in GCP.

As a plugin, we will have a generic column for upload status. This will be a common and general behavior irrespective of the virus scan feature and data center.

This column will show the status for all the below use cases

Upload of attachment (Success)
Malware scanning service result (Virus scanning in Progress, Virus detected?, Success)
Trend Micro (Virus scanning in Progress, Virus detected, Success)

Any documentation

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist before requesting a review

  • I follow Java Development Guidelines for SAP
  • I have tested the functionality on my cloud environment.
  • I have provided sufficient automated/ unit tests for the code.
  • I have increased or maintained the test coverage.
  • I have ran integration tests on my cloud environment.
  • I have validated blackduck portal for any vulnerability after my commit.

Upload Screenshots/lists of the scenarios tested

  • I have Uploaded Screenshots or added lists of the scenarios tested in description

"\"%s\" contains unsupported characters (‘/’ or ‘\\’). Rename and try again.";
public static final String SINGLE_DUPLICATE_FILENAME =
"An object named \"%s\" already exists. Rename the object and try again.";
public static final String VIRUS_DETECTED_ERROR_MSG =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't these messages to support internationalisation?

&& cmisDocument
.getUploadStatus()
.equalsIgnoreCase(SDMConstants.UPLOAD_STATUS_VIRUS_DETECTED))
throw new ServiceException("Virus Detected in this file kindly delete it.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please update the error messages to use the SDMErrorMessages file and make it compatible for internationalisation

long totalSize = cmisDocument.getContentLength();
int chunkSize = SDMConstants.CHUNK_SIZE;

CdsModel model = eventContext.getModel();

@Before
@HandlerOrder(OrderConstants.Before.CHECK_CAPABILITIES)
void processBeforeForDraft(CdsCreateEventContext context, List<CdsData> data) {

@Before
@HandlerOrder(OrderConstants.Before.CHECK_CAPABILITIES)
void processBeforeForDraft(CdsCreateEventContext context, List<CdsData> data) {

@Before
@HandlerOrder(OrderConstants.Before.CHECK_CAPABILITIES)
void processBeforeForDraft(CdsCreateEventContext context, List<CdsData> data) {

@Before
@HandlerOrder(OrderConstants.Before.CHECK_CAPABILITIES)
void processBeforeForDraft(CdsCreateEventContext context, List<CdsData> data) {
String sdmUrl,
int chunkSize,
boolean isSystemUser,
CdsEntity entity,
int chunkSize,
boolean isSystemUser,
CdsEntity entity,
PersistenceService persistenceService)
Comment on lines +216 to +218
Result r =
dbQuery.updateUploadStatusByScanStatus(
attachmentDraftEntity, persistenceService, objectId, scanStatusEnum);
doc.get("uploadStatus")
.eq(SDMConstants.UPLOAD_STATUS_IN_PROGRESS))));

Result r = persistenceService.run(updateQuery);
SDMAttachmentsService service = spy(new SDMAttachmentsService());
doNothing().when(service).emit(any());
CreateAttachmentInput input = mock(CreateAttachmentInput.class);
MediaData mediaData = MediaData.create();
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