Skip to content
This repository has been archived by the owner on Jul 25, 2018. It is now read-only.

feat(lics): also import and export external IDs #660

Merged
merged 1 commit into from
Nov 9, 2017

Conversation

maxhbr
Copy link
Member

@maxhbr maxhbr commented Oct 17, 2017

also add (optional) external IDs for Licenses and TODOs (only used while importing and exporting)

also add (optional) external IDs for TODOs
@maxhbr maxhbr force-pushed the dev/exportAndImportExternalIDs branch from 4ac43e2 to 2f44328 Compare October 17, 2017 18:28
Copy link
Contributor

@alexbrdn alexbrdn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code looks good

@mcjaeger
Copy link
Contributor

mcjaeger commented Nov 6, 2017

how to test it?

  • create some licenses (maybe A B C) and then some todos (maybe 1 2 3)
  • then export the licesenses (in the admin section)
  • Then open the *.lics archive (using unzipper tool)
  • edit the text file with the licenses
    • change some external Ids there for license (maybe go to License 1 and then add some external id) (example format: '{"internal":"LicenseNr-11","SPDX":"Libpng"}')
  • edit the text file with the todos
    • change some external Ids there for todo (maybe go to TODO 1 and then add some external id) (example format: '{"internal":"TodoNr-11"}')
  • then compress again the folder with the files inside
  • rename extension to *.lics again
  • then clean up the database (remove all licenses and todos)
  • try to upload / import to an empty database.

-> then look into the couchdb if the license todo has a externalid

@adrian-evo
Copy link

Tested and seems to work partially for License IDs, however importing TODOs is not working due to #625

Even if a single license and a single TODO is exported and imported back, the TODO is not imported.

@mcjaeger
Copy link
Contributor

mcjaeger commented Nov 7, 2017

did you see this in the database or in the sw360portal?

@maxhbr
Copy link
Member Author

maxhbr commented Nov 7, 2017

@adrian-evo You need to add the todos via import and not via the ui. Then it will work.

One might be able to fix that by adding the sw360 internal id as external id with key "sw360" to the export. And by adding some functionallity.

@adrian-evo
Copy link

Imported the following file as lics, containing a single license and a single todo, both with external ids. The external ids are displayed fine in database, including for todo, but the todo cannot be seen on the UI.

LicensesBackup4.zip

@mcjaeger mcjaeger merged commit b11cf21 into sw360:master Nov 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants