Skip to content

feat(licensedb): Add data transformation layer for LicenseDB integration#3898

Open
ADITYA-CODE-SOURCE wants to merge 2 commits intoeclipse-sw360:mainfrom
ADITYA-CODE-SOURCE:licensedb/data-transformers
Open

feat(licensedb): Add data transformation layer for LicenseDB integration#3898
ADITYA-CODE-SOURCE wants to merge 2 commits intoeclipse-sw360:mainfrom
ADITYA-CODE-SOURCE:licensedb/data-transformers

Conversation

@ADITYA-CODE-SOURCE
Copy link
Contributor

@ADITYA-CODE-SOURCE ADITYA-CODE-SOURCE commented Mar 14, 2026

Summary

Add transformer classes to convert LicenseDB data format to SW360 internal format for licenses and obligations.

Changes

File Description
LicenseTransformer.java Transform LicenseDB License to SW360 License
ObligationTransformer.java Transform LicenseDB Obligation to SW360 Obligation

Location: rest/resource-server/src/main/java/org/eclipse/sw360/rest/resourceserver/licensedb/transformer/

Field Mapping

License Fields

LicenseDB SW360
shortname shortname
fullname fullname
text text
url url
licenseType licenseType
osiApproved osiApproved

Obligation Fields

LicenseDB SW360
text text
title title
type obligationType
level obligationLevel

Usage

LicenseDBLicense licenseDbData = licenseDBClient.getLicense("Apache-2.0");
LicenseTransformer transformer = new LicenseTransformer();
License sw360License = transformer.transform(licenseDbData);

Testing

  • Files compile without errors
  • Follows SW360 code style
  • EPL-2.0 license headers included
  • Javadoc documentation added
  • No new dependencies

Verification

  • Java Version: 21.0.9 LTS
  • Maven Version: 3.9.12
  • OS: Windows 11

Development Proof

Created 2 transformer classes:

  • LicenseTransformer.java
  • ObligationTransformer.java
    [
image ]

Dependencies

None - This is an independent component.

Related

Fixes #3897

Part of: #3685 (LicenseDB integration)

@GMishx @deo002

Added transformer classes to convert LicenseDB data to SW360 format:
- LicenseTransformer: Maps LicenseDB License to SW360 License
- ObligationTransformer: Maps LicenseDB Obligation to SW360 Obligation

These transformers handle field mapping between external LicenseDB
format and internal SW360 data model for licenses and obligations.

Fixes eclipse-sw360#3897
- LicenseTransformer: use setExternalLicenseLink() instead of setUrl()
- LicenseTransformer: use setLicenseTypeDatabaseId() for license type
- LicenseTransformer: use setOSIApproved(Quadratic) enum instead of Boolean
- ObligationTransformer: use ObligationType.valueOf() for enum conversion
- ObligationTransformer: use ObligationLevel.valueOf() for enum conversion
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.

Add LicenseDB data transformation layer for license and obligation mapping

1 participant