restfulobjects / restfulobjects-spec

The Restful Objects specification defines a set of RESTful resources, and corresponding JSON representations, for accessing and manipulating a domain object model.
http://restfulobjects.org
73 stars 10 forks source link

Support for auto-complete and conditional choices #14

Closed richardpawson closed 10 years ago

richardpawson commented 11 years ago

In Naked Objects for .NET we now support auto-complete for reference properties (when editing an object) or parameters (in an action dialog).

At present, here is no obvious way to expose this via RO other than using implementation-specific extensions. My suggestion (for RO v 1.1. or greater) is that this could be supported simply by adding one or more links to the property or parameter JSON, with a new recognised rel-type. The link would take a single string argurment and would return a List representation of links to the objects. One unresolved part of this solution would be whether the URL link looked like an action, or had a new form, representing a 'method' rather than an an action.

If sufficiently generalised, the same pattern could also cover another NOF capability we would like to surface, which is 'conditional choices' - where the list of choices can vary dependent upon values entered for other properties/parameters (e.g. selection of a Country specified/filters the list of Counties).

Note: Need to make sure we cover the scenario where auto-complete and/or conditional choices needs to return a set of value types (e.g. a set of strings) rather than reference object list. I assume that in this case the list of strings would just need to be turned into a single scalar type e.g. a single string with the values comma separated. (This would be consistent with the way that a (fixed) set of choices is handled in the spec right now.

danhaywood commented 10 years ago

addressed in RO spec 1.1, see for example https://github.com/danhaywood/restfulobjects-spec/commit/ed2e79fdc177b1f560ef904a0a4ac795792fcbd5

danhaywood commented 10 years ago

addressed in RO spec 1.1, eg https://github.com/danhaywood/restfulobjects-spec/commit/90f7b4e4fbe49564bcf3b3cc356ac9a99fa9f7a3

On 29 April 2013 15:29, Richard Pawson notifications@github.com wrote:

In Naked Objects for .NET we now support auto-complete for reference properties (when editing an object) or parameters (in an action dialog).

At present, here is no obvious way to expose this via RO other than using implementation-specific extensions. My suggestion (for RO v 1.1. or greater) is that this could be supported simply by adding one or more links to the property or parameter JSON, with a new recognised rel-type. The link would take a single string argurment and would return a List representation of links to the objects. One unresolved part of this solution would be whether the URL link looked like an action, or had a new form, representing a 'method' rather than an an action.

If sufficiently generalised, the same pattern could also cover another NOF capability we would like to surface, which is 'conditional choices' - where the list of choices can vary dependent upon values entered for other properties/parameters (e.g. selection of a Country specified/filters the list of Counties).

— Reply to this email directly or view it on GitHubhttps://github.com/danhaywood/restfulobjects-spec/issues/14 .