-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #141 from catenax-ng/CX_R24.05_part_type_information
feat : New maven module for part type information submodel
- Loading branch information
Showing
11 changed files
with
408 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
modules/sde-submodules/part-type-information/part-type-information.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# PartTypeInformation (SDE Maven module) | ||
--- | ||
## Description | ||
|
||
This module use for PartTypeInformation submodel specification and descriptors. It's contain the codes related to PartTypeInformation to validate, parse and transfer data for DigitalTwins and EDC to create aspect twins and data offer. | ||
|
||
--- | ||
#### Version: 1.0.0 | ||
#### PartTypeInformation Aspect Model URN: urn:bamm:io.catenax.part_as_planned:1.0.0#PartTypeInformation | ||
#### Semantic Id: urn:samm:io.catenax.part_type_information:1.0.0#PartTypeInformation | ||
--- | ||
|
||
### Schema | ||
|
||
Please find below links for schema details: | ||
|
||
- [PartTypeInformation V1.0.0 schema](src/main/resources/part-type-information-v1.0.0.json) | ||
|
||
### CSV file headers | ||
|
||
| Headers Name | Mandatory | Position | | ||
|------------------------ |---------------------------|-------- | | ||
| uuid | Yes | 1 | | ||
| manufacturer_part_id | Yes | 2 | | ||
| classification_standard | Yes | 3 | | ||
| classification_id | Yes | 4 | | ||
| classification_description | No | 5 | | ||
| function | Yes | 6 | | ||
| function_valid_from | No | 7 | | ||
| function_valid_until | No | 8 | | ||
| name_at_manufacturer | Yes | 9 | | ||
|
||
#### [CSV Sample File Link] | ||
|
||
#### Example for submodel PartAsPlanned | ||
|
||
### Work Flow | ||
|
||
- CSV to POJO | ||
- CSV column validation and mandatory field validation | ||
- POJO TO DTO | ||
- UUID generate v4 | ||
- DigitalTwins API's calls | ||
- EDC API's calls | ||
- BPN Discovery calls | ||
- DB Store | ||
|
||
### External Services Call | ||
|
||
- DigitalTwins | ||
- EDC Connectors | ||
- BPN Discovery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<!-- | ||
/******************************************************************************** | ||
* Copyright (c) 2024 T-Systems International GmbH | ||
* Copyright (c) 2024 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
********************************************************************************/ | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>org.eclipse.tractusx</groupId> | ||
<artifactId>sde</artifactId> | ||
<version>0.0.1</version> | ||
<relativePath>../../../</relativePath> | ||
</parent> | ||
|
||
<artifactId>part-type-information</artifactId> | ||
<name>part-type-information</name> | ||
<description>part-type-information</description> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.eclipse.tractusx</groupId> | ||
<artifactId>sde-common</artifactId> | ||
<version>0.0.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.tractusx</groupId> | ||
<artifactId>edc</artifactId> | ||
<version>0.0.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.tractusx</groupId> | ||
<artifactId>digital-twins</artifactId> | ||
<version>0.0.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.eclipse.tractusx</groupId> | ||
<artifactId>bpn-discovery</artifactId> | ||
<version>0.0.1</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<annotationProcessorPaths> | ||
<path> | ||
<groupId>org.projectlombok</groupId> | ||
<artifactId>lombok</artifactId> | ||
<version>${lombok.version}</version> | ||
</path> | ||
<path> | ||
<groupId>org.mapstruct</groupId> | ||
<artifactId>mapstruct-processor</artifactId> | ||
<version>${org.mapstruct.processor.version}</version> | ||
</path> | ||
</annotationProcessorPaths> | ||
<compilerArgs> | ||
<compilerArg> | ||
-Amapstruct.unmappedTargetPolicy=IGNORE | ||
</compilerArg> | ||
</compilerArgs> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
57 changes: 57 additions & 0 deletions
57
...rmation/src/main/java/org/eclipse/tractusx/sde/submodels/pti/PartTypeInformationV100.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2024 T-Systems International GmbH | ||
* Copyright (c) 2024 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Apache License, Version 2.0 which is available at | ||
* https://www.apache.org/licenses/LICENSE-2.0. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations | ||
* under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
********************************************************************************/ | ||
|
||
package org.eclipse.tractusx.sde.submodels.pti; | ||
|
||
import java.io.InputStream; | ||
|
||
import org.eclipse.tractusx.sde.common.extensions.SubmodelExtension; | ||
import org.eclipse.tractusx.sde.common.model.Submodel; | ||
import org.springframework.stereotype.Component; | ||
|
||
import jakarta.annotation.PostConstruct; | ||
|
||
@Component | ||
public class PartTypeInformationV100 extends SubmodelExtension { | ||
|
||
private Submodel submodel = null; | ||
|
||
@PostConstruct | ||
public void init() { | ||
|
||
String resource = "part-type-information-v1.0.0.json"; | ||
// this is the path within the jar file | ||
InputStream input = PartTypeInformationV100.class.getResourceAsStream("/resources/" + resource); | ||
if (input == null) { | ||
// this is how we load file within editor (eg eclipse) | ||
input = this.getClass().getClassLoader().getResourceAsStream(resource); | ||
} | ||
|
||
submodel = loadSubmodel(input); | ||
|
||
submodel.addProperties("tableName", "parttypeinformation_v_100"); | ||
} | ||
|
||
@Override | ||
public Submodel submodel() { | ||
return submodel; | ||
} | ||
|
||
} |
Oops, something went wrong.