Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExtensibleTypes #52

Open
wrgoff opened this issue Nov 10, 2020 · 6 comments
Open

ExtensibleTypes #52

wrgoff opened this issue Nov 10, 2020 · 6 comments

Comments

@wrgoff
Copy link
Contributor

wrgoff commented Nov 10, 2020

I added an extensible type to a component. Code wise it looks good. I see the extensible type. XML wise looks a little wierd.

<component>
      .....
     </externalReferences>
     <packageManager unixPackageManager="apt"/>
</component>

I would have expected it to be

<component>
     .....
     </externalReferences>
     <extensibleTypes>
          <extensibleType>
               <attributes>
                    <attribute>
                         <packageManager unixPackageManager="apt"/>
                    </attribute>
               </attributes>
         </extensibleType>
     </extensibleTypes>
</component>

And when attempting to read back in the bom.xml file, sure enough the extensible type is no where to be found.

@wrgoff
Copy link
Contributor Author

wrgoff commented Nov 10, 2020

Java code to produce the attributes (extensibleType).

List<Attribute> attributes = new ArrayList<Attribute>();
Attribute packageManagerAttribute = new Attribute("unixPackageManager", packageManager);
attributes.add(packageManagerAttribute);
ExtensibleType et = new ExtensibleType("manager", "packageManager", attributes);
List<ExtensibleType> ets = component.getExtensibleTypes();
if(ets == null)
	ets = new ArrayList<ExtensibleType>();
ets.add(et);
component.setExtensibleTypes(ets);

@wrgoff
Copy link
Contributor Author

wrgoff commented Nov 11, 2020

Any chance we can get a base constructor (and getters for fields in) in the ExtensibleType class. This will allow the user of other generators, such as Jackson to be used.

Thanks.

@stevespringett
Copy link
Member

Getters are already there, but certainly, a non arg constructor could be added. PRs welcome.

Also based on the type of data you're adding, you may be interested in CycloneDX/specification#31 and CycloneDX/specification#42

@wrgoff
Copy link
Contributor Author

wrgoff commented Nov 11, 2020

Sorry. Not getters, but setters. For jackson to work correctly we would need getters and setters. I actually have a clone of the ExtensibleType class, but just had to make those changes. This way we can read in actaully what was in the bom, and reproduce it with the "ExtensibleType" not getting lost.

Thanks a bunch. This is a great product. Keep up the good work.

@wrgoff
Copy link
Contributor Author

wrgoff commented Nov 11, 2020

On another note, if you are interested. I created a standalone application (java) that can be used to produce a Bom for Unix environments. To include Alpine, Centos, Debian, Redhat, and Ubuntu. It currently only uses the PackageManger (yum, apt, apk) to produce the boms. I am also working on a "non" package manger bom creator.

@wrgoff
Copy link
Contributor Author

wrgoff commented Nov 11, 2020

I can also just give you my changes to the ExtensibleType class if you would like? Just let me know.

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

No branches or pull requests

2 participants