the configuration editor GUI () nees a HTTP API to read/write configuration data.
this is not a general-purpose API but only targeted to the needs of this configuration editor GUI. thus it does not necessarily support all features that Sling Context-Aware Configuration supports internally.
For the "Add" action for Configuration Collections, how are the available configuration list items derived?
display all configuration names that have "exists: false" in the configNames list.
I understand this is how it works for the "main"/"root" configs.
However, for configurations within a Configuration Collection's items array, there is no (?) corresponding configNames list. (Context: the current draft document outlines Add (and Delete) actions for list items.)
However, for configurations within a Configuration Collection's items array, there is no corresponding configNames list. (Context: the current draft document outlines Add (and Delete) actions for list items.)
if you want to delete the whole collection you can use the DELETE method
otherwise you have to post back always the full list of collection entires. if there are new entries post the existing ones plus a new. to remove one post the list minus one. etc.
- If I delete all the items in a collection and then save the collection - should the collection itself be (automatically) deleted (with the DELETE method - instead of saving with POST?
For now, if I post
to configPersist.json?configName=io.wcm.caconfig.sample.config.ConfigSampleList&collection=true, it gives a 200 response.
After this, calling configNames.json gives:
But then configData.json?configName=io.wcm.caconfig.sample.config.ConfigSampleList&collection=true results in an error (
) (though a successful 200 response)
EDIT: there seems to be a problem with the attachment of the error message: it is a java.lang.NullPointerException exception.
DELETE is correct in this case. i've fixed the problem in the backend.
i extended the HTTP API so that for configData responses of config collections an additional element "newItem" is included. this contains all declared parameters an it's metadata, together with the configured default values (if any).