Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/gh 178 #194

Merged
merged 15 commits into from
Dec 6, 2021
Merged

Feature/gh 178 #194

merged 15 commits into from
Dec 6, 2021

Conversation

aaronforshaw
Copy link
Contributor

Add endpoints for bulk retrieval and edit of many profiles against many data elements of a data model.

  • POST /dataModels/{dataModelId}/profile/getMany
  • POST /dataModels/{dataModelId}/profile/validateMany
  • POST /dataModels/{dataModelId}/profile/saveMany

There are examples of the POST bodies added to the postman-library (separate PR).

Although the examples above are for data model, and this PR includes tests for data model, I would expect it also to work for the general case of retrieving and editing profiles against many model items of a model.

The deprecated MapBasedProfile has been removed.

Because the change requires retrieval or save of many resources in one request, this PR includes a slightly new pattern in that most security checks are done in the ProfileController rather than ProfileInterceptor. The pattern in the ProfileController is:

  • check that the MultiFacetAwareItem referenced in the URL is a Model
  • check that every MultiFacetAwareItem specified in the POST body is a ModelItem which belongs to the Model

@aaronforshaw aaronforshaw linked an issue Nov 18, 2021 that may be closed by this pull request
@olliefreeman
Copy link
Contributor

i will review this next week....theres a lot going on and i need to sit and work through it

Copy link
Contributor

@olliefreeman olliefreeman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few changes but the logic all looks good

  • I have historically used the package rest.transport for defining command objects/pogos for binding data in and out of rest json.
  • the _profileProvided.gson should be in /profileProvided/_profileProvided.gson so that grails can auto find it as any class can be found this way where the template is in the folder with that class name. It allows grails to handle any fallback of rendering to use the template we want not a default object template

Copy link
Contributor

@olliefreeman olliefreeman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the updated comments on the unresolved issues

… for these. Return not found for model not found, return bad request if object found is not a model.
@olliefreeman olliefreeman merged commit afc24bf into develop Dec 6, 2021
@olliefreeman olliefreeman deleted the feature/gh-178 branch December 6, 2021 13:49
@olliefreeman olliefreeman added this to the 4.12.0 milestone Dec 6, 2021
@olliefreeman olliefreeman added the enhancement New feature or request label Dec 6, 2021
@olliefreeman olliefreeman removed this from the 4.12.0 milestone Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Endpoints to support bulk actions of profile elements
2 participants