diff --git a/consumer-backend/productpass/pom.xml b/consumer-backend/productpass/pom.xml index d1b67a64e..05270a8eb 100644 --- a/consumer-backend/productpass/pom.xml +++ b/consumer-backend/productpass/pom.xml @@ -33,7 +33,7 @@ org.eclipse.tractusx productpass - 1.0.0 + 1.2.0 jar Catena-X Digital Product Passport Backend Product Passport Consumer Backend System for Product Passport Consumer Frontend Application diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java index 1a1cda7ce..6c4dc2d72 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/http/controllers/AppController.java @@ -187,7 +187,6 @@ public Response getDigitalTwin(@RequestBody Object body, @PathVariable String pr digitalTwin = digitalTwinRegistry.getDigitalTwin(); subModel = digitalTwinRegistry.getSubModel(); semanticId = Objects.requireNonNull(subModel.getSemanticId().getKeys().stream().filter(k -> k.getType().equalsIgnoreCase("Submodel") || k.getType().equalsIgnoreCase("GlobalReference")).findFirst().orElse(null)).getValue(); - LogUtil.printMessage("SemanticId "+ semanticId); connectorId = subModel.getIdShort(); EndPoint3 endpoint = subModel.getEndpoints().stream().filter(obj -> obj.getInterfaceName().equals(dtrConfig.getEndpointInterface())).findFirst().orElse(null); if (endpoint == null) { diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/DataDestination.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/DataDestination.java deleted file mode 100644 index f46beaf7c..000000000 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/DataDestination.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.eclipse.tractusx.productpass.models.negotiation; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * This class consists exclusively to define attributes related to the Transfer's and Transfer request's data destination property. - **/ -@JsonInclude(JsonInclude.Include.NON_NULL) -public class DataDestination { - - /** ATTRIBUTES **/ - @JsonProperty("edc:type") - String type; - - /** GETTERS AND SETTERS **/ - public String getType() { - return type; - } - public void setType(String type) { - this.type = type; - } -} diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Transfer.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Transfer.java index fa5491284..ba2899a5b 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Transfer.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/Transfer.java @@ -188,6 +188,18 @@ public void setConnectorId(String connectorId) { this.connectorId = connectorId; } } + @JsonInclude(JsonInclude.Include.NON_NULL) + static class DataDestination { + @JsonProperty("edc:type") + String type; + + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + } } diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/TransferRequest.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/TransferRequest.java index 5eec26999..4b09917dc 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/TransferRequest.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/models/negotiation/TransferRequest.java @@ -152,4 +152,18 @@ public void setReceiverHttpEndpoint(String receiverHttpEndpoint) { this.receiverHttpEndpoint = receiverHttpEndpoint; } } + @JsonInclude(JsonInclude.Include.NON_NULL) + public static class DataDestination { + @JsonProperty("type") + String type; + + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + } } diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/AasService.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/AasService.java index ada154c25..333ddc03a 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/AasService.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/AasService.java @@ -995,10 +995,10 @@ public DecentralDigitalTwinRegistryQueryById(Search search, DataPlaneEndpoint ed @Override public void run() { this.setDigitalTwin(searchDigitalTwin3(this.getIdType(), this.getAssetId(), this.getDtIndex(), this.getEdr().getEndpoint(), this.getEdr())); - if(semanticId.isEmpty()){ + if(this.semanticId == null || this.semanticId.isEmpty()){ this.setSubModel(searchSubModel3BySemanticId(this.getDigitalTwin())); }else { - this.setSubModel(searchSubModel3BySemanticId(this.getDigitalTwin(), semanticId)); + this.setSubModel(searchSubModel3BySemanticId(this.getDigitalTwin(), this.semanticId)); } } /** GETTERS AND SETTERS **/ diff --git a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataTransferService.java b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataTransferService.java index ac881e622..d9253682e 100644 --- a/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataTransferService.java +++ b/consumer-backend/productpass/src/main/java/org/eclipse/tractusx/productpass/services/DataTransferService.java @@ -943,7 +943,7 @@ public TransferRequest buildTransferRequest(Dataset dataset, Status status, Nego transferType.setIsFinite(true); - DataDestination dataDestination = new DataDestination(); + TransferRequest.DataDestination dataDestination = new TransferRequest.DataDestination(); dataDestination.setType("HttpProxy"); TransferRequest.PrivateProperties privateProperties = new TransferRequest.PrivateProperties(); @@ -1205,7 +1205,7 @@ public TransferRequest buildTransferRequest(String processId, Dtr dtr, String en transferType.setContentType("application/octet-stream"); transferType.setIsFinite(true); - DataDestination dataDestination = new DataDestination(); + TransferRequest.DataDestination dataDestination = new TransferRequest.DataDestination(); dataDestination.setType("HttpProxy"); TransferRequest.PrivateProperties privateProperties = new TransferRequest.PrivateProperties();