Skip to content

Commit 95329f0

Browse files
Revert "handling copy of invalid properties"
This reverts commit bcd24fa.
1 parent 52eec2f commit 95329f0

1 file changed

Lines changed: 5 additions & 16 deletions

File tree

sdm/src/main/java/com/sap/cds/sdm/service/handler/SDMCustomServiceHandler.java

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.io.IOException;
2323
import java.util.ArrayList;
2424
import java.util.HashMap;
25+
import java.util.HashSet;
2526
import java.util.List;
2627
import java.util.Map;
2728
import java.util.Optional;
@@ -103,25 +104,13 @@ public void copyAttachments(AttachmentCopyEventContext context) throws IOExcepti
103104
.toString()));
104105
}
105106

107+
Set<String> customPropertiesInSDM = new HashSet<>(customPropertyDefinitions.values());
108+
String upID = context.getUpId();
109+
String folderName = upID + "__" + compositionName;
106110
String repositoryId = SDMConstants.REPOSITORY_ID;
107111
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);
116112

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();
125114
// Check if folder exists before trying to create it
126115
boolean folderExists =
127116
sdmService.getFolderIdByPath(folderName, repositoryId, sdmCredentials, isSystemUser)

0 commit comments

Comments
 (0)