Create "view" classes (similar to Django) which can be used to add REST endpoints to Orthanc
The Orthanc plugin for Sonador has the potential to become extremely complicated as the number of endpoints and their capabilities grow. For that reason, it would be nice to have an interface that makes it possible to implement endpoint functionality in a consistent (and familiar) way.
The popular web framework Django introduced class based views to help solve these problems. Given the familiarity of Django, implementing a similar pattern in Orthanc might provide a paradigm for encouraging code-reuse and helping to organize code via a familiar pattern.
Development tasks:
- Create a class (
OrthancBaseView
) which provides a clear pattern for handling requests and responses.-
__init__
->setup
-> handle method (likeget
orpost
)
-
- Implement web views for caching logic as a proof-of-concept
- Drop/re-initialize cache tables
- Views to allow for launching of background processes to re-populate cache tables after clearing them
- Views to enable indexing of single models as-needed/on-demand