Skip to content
This repository has been archived by the owner on Jul 14, 2024. It is now read-only.

Alternate "set" behaviour & mode for List field & in import tool #113

Open
mdutoo opened this issue Oct 15, 2015 · 2 comments
Open

Alternate "set" behaviour & mode for List field & in import tool #113

mdutoo opened this issue Oct 15, 2015 · 2 comments

Comments

@mdutoo
Copy link
Collaborator

mdutoo commented Oct 15, 2015

Useful using the Import tool, so that list doesn't grow when importing twice (and when there is not a set number of items, in which case each of them could be specifically targeted using dotted paths like translations: odisp:name.0.v). However, not that useful outside import, since this doesn't happen.

Checking unicity of primitive fields is easy. For Resource types (links or embedded sub-Resources), obviously id is their URI (@id). By the way, in the case of embedded sub-Resources, obviously it would work even better with server-side auto id building (#89). Additionally, i18n should be supported as a specific case where id is the language.

Would not work for field types without defined id, i.e. maps. But the solution would be replacing maps by embedded sub-Resources - which is a good general goal (the alternative being ).

This is best done on server-side, by adding a boolean "isSet" option to DCList, and using it in ResourceEntityMapperService to parse it in a Java LinkedHashSet (preserving order) rather than a mere list. In the Import tool, a new corresponding "isSet" column must be parsed from model csv and sent along.

(it could also be done only on client side, but server-side code will be simpler, better tested and obviously more efficient)

@mdutoo
Copy link
Collaborator Author

mdutoo commented Jan 11, 2016

This would also allow a smarter PATCH-like / POST / merge behaviour: merging two versions of a Resource having such a set list field would mean also merging their set lists (and recursively if their items are sub-Resources) rather than merely replacing the first's by the second's. Notably useful to merge a project's (set) list of dcmp:visibleProjects.

@mdutoo mdutoo changed the title Alternate "set" behaviour & mode for List field Alternate "set" behaviour & mode for List field in import tool Jan 14, 2016
@mdutoo mdutoo changed the title Alternate "set" behaviour & mode for List field in import tool Alternate "set" behaviour & mode for List field & in import tool Jan 14, 2016
@mdutoo
Copy link
Collaborator Author

mdutoo commented Jan 14, 2016

The server-side part has been done in #154 set list. Still keeping this one open for the import part.

@mdutoo mdutoo mentioned this issue Jan 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant