Questions about implementing REST endpoint in OpenConceptLab module

Hi, I’m currently working on this ticket and I would like to hear your thoughts about the REST endpoints implementation in OpenConceptLab module. So far I’ve created two endpoints:

  1. “/subscription” - we have only one subscription and there is no uuid. I’ve created SubscriptionResource that extends DelegatingCrudResource. We’ll support GET “/openconcept/subscription” that will return current subscription if exist. and POST “/openconcept/subscription” to save new subscription.

  2. “/update” - I thought about creating UpdateResource that extends DelegatingCrudResource. I want to add 2 subresources ItemResource and UpdateProgress Resource. To check if there is currently running update I would like to implenet searchHandler with “runningUpdate=true” param. I’m not sure how to start update manually(@raff any thoughts?)

This is probably not all logic needed, but those are my questions so far.

So please share your thoughts and ideas here :slight_smile:

1 Like
  1. You can have just one subscription at the moment, but in the future (v 2.0 or 3.0) we may add support for more. Please add uuid to the subscription (you can make it a constant for now).

  2. Could we switch to using “Import” instead of “Update”? What fields do you have in ItemResource and ImportProgress? Can ImportProgress fields be incorporated into ImportResource instead of creating a subresource?

Implementing a searchHandler sounds right assuming /import returns all historical imports run on the system.

I would think you can start an import by POSTing to the /import resource.