Skip to content

ExtensibleTypes #52

Open
Open

Description

@wrgoff

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.

Activity

  1. wrgoff commented on Nov 10, 2020

    @wrgoff
    ContributorAuthor

    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);
    
  2. wrgoff commented on Nov 11, 2020

    @wrgoff
    ContributorAuthor

    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.

  3. stevespringett commented on Nov 11, 2020

    @stevespringett
    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

  4. wrgoff commented on Nov 11, 2020

    @wrgoff
    ContributorAuthor

    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.

  5. wrgoff commented on Nov 11, 2020

    @wrgoff
    ContributorAuthor

    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.

  6. wrgoff commented on Nov 11, 2020

    @wrgoff
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions