Context-Aware Configuration Editor HTTP API

Description

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.

Activity

Show:
David Ding
December 6, 2016, 8:42 PM

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.)

Stefan Seifert
December 6, 2016, 9:08 PM

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.)

two points:

  • 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.

David Ding
December 9, 2016, 12:46 AM
Edited

- 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.

Stefan Seifert
December 9, 2016, 4:40 AM

DELETE is correct in this case. i've fixed the problem in the backend.

Stefan Seifert
December 16, 2016, 11:41 PM

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).

Fixed

Assignee

Unassigned

Reporter

Stefan Seifert

Labels

None

Components

Priority

Major