Load XML after creating types form inferType


#1

I followed the examples provided in How to generate source types for XML and How to write contents of inferred types to C3 type files.

Now I need to load the xml to the platform. Usually I would do this with a curl command like this

curl -v -H “Content-Type: application/xml” -X PUT --data-binary @/Users/ericmurray/documents/c3/DISA/ce/seed/sampleData.xml http://localhost:8080/import/1/ce/prod/[Canaonical]/sampleData.xml -u BA:BA

But I don’t have a traditional canonical. The catalog type is ‘supposed’ to serve as the canonical/source file for the xml. I tried creating a file source collection object for the catalog. Here is the contents of that file called CatalogXML.json

{
“id”: “CatalogXML”,
“name”: “CatalogXML”,
“source”: {
“typeName”: “Catalog”
},
“sourceSystem”: {
“id”: “Legacy”
}
}

After I provision and try to curl the file, I get this error

metadata C3Error 2290.53 FileSourceCollection for CatalogXML doesn't exist! 0 NotClassified

But you can clearly see that the FileSourceCollection object exists

Any help on uploading the file after the infertypes are created and provisioned?


#2

@eric.murray How is the Catalog.c3typ defined. Can you mix Catalog.c3typ with Source provision and run the curl command again.
you can check the definition using c3ShowType(Catalog) on static console.


#3

Also inferType method takes InferTypeSpec as input - @see c3ShowType(InferTypeSpec) for more details. Note that InferTypeSpec.baseType can be used to make sure new type mixes desired base type like Source