|
22 | 22 | import java.io.IOException; |
23 | 23 | import java.util.ArrayList; |
24 | 24 | import java.util.HashMap; |
| 25 | +import java.util.HashSet; |
25 | 26 | import java.util.List; |
26 | 27 | import java.util.Map; |
27 | 28 | import java.util.Optional; |
@@ -103,25 +104,13 @@ public void copyAttachments(AttachmentCopyEventContext context) throws IOExcepti |
103 | 104 | .toString())); |
104 | 105 | } |
105 | 106 |
|
| 107 | + Set<String> customPropertiesInSDM = new HashSet<>(customPropertyDefinitions.values()); |
| 108 | + String upID = context.getUpId(); |
| 109 | + String folderName = upID + "__" + compositionName; |
106 | 110 | String repositoryId = SDMConstants.REPOSITORY_ID; |
107 | 111 | Boolean isSystemUser = context.getSystemUser(); |
108 | | - SDMCredentials sdmCredentials = tokenHandler.getSDMCredentials(); |
109 | | - |
110 | | - // Fetch secondary types and valid secondary properties from SDM |
111 | | - List<String> secondaryTypes = |
112 | | - sdmService.getSecondaryTypes(repositoryId, sdmCredentials, isSystemUser); |
113 | | - List<String> validSecondaryProperties = |
114 | | - sdmService.getValidSecondaryProperties( |
115 | | - secondaryTypes, sdmCredentials, repositoryId, isSystemUser); |
116 | 112 |
|
117 | | - // Filter custom properties to only include those that are valid in SDM |
118 | | - Set<String> customPropertiesInSDM = |
119 | | - customPropertyDefinitions.values().stream() |
120 | | - .filter(validSecondaryProperties::contains) |
121 | | - .collect(Collectors.toSet()); |
122 | | - |
123 | | - String upID = context.getUpId(); |
124 | | - String folderName = upID + "__" + compositionName; |
| 113 | + SDMCredentials sdmCredentials = tokenHandler.getSDMCredentials(); |
125 | 114 | // Check if folder exists before trying to create it |
126 | 115 | boolean folderExists = |
127 | 116 | sdmService.getFolderIdByPath(folderName, repositoryId, sdmCredentials, isSystemUser) |
|
0 commit comments