This PR addresses the renaming of the contentstore/xblock_services folder to contentstore/xblock_storage_handlers as a follow-up to PR #32282. The renaming is done to prevent naming conflicts with xblock runtime services and to make the purpose of the files more understandable. The file xblock_service.py has been renamed to view_handlers.py to better reflect its functionality. Justification and Future Refactoring Outlook: The xblock_storage_handlers folder contains service methods that implement the business logic for view endpoints located in contentstore/views/block.py. It is renamed to xblock_storage_handlers to reflect its responsibility of handling storage-related operations of xblocks, such as creation, retrieval, and deletion. The view_handlers.py file includes business methods called by the view endpoints. These methods, such as handle_xblock, delete_orphans, etc., interact with the required modulestore methods, handle any errors, and aggregate and serialize data for the response. The term 'handler' in the context of 'view_handlers.py' represents methods that facilitate business logic for view endpoints. It is critical to note the distinction between these 'handler methods' and the xblock_handler method. The xblock_handler is a view endpoint itself, residing in contentstore/views/block.py, and is well known in this context. Although its name might suggest otherwise, it is not a handler in the sense of the 'handler methods' we've defined in 'view_handlers.py'. To maintain consistency with existing naming conventions, it remains as xblock_handler.
21 lines
668 B
Python
21 lines
668 B
Python
""" Course API URLs. """
|
|
|
|
|
|
from django.conf import settings
|
|
from django.urls import re_path
|
|
|
|
from cms.djangoapps.contentstore.api.views import course_import, course_quality, course_validation
|
|
|
|
|
|
app_name = 'contentstore'
|
|
|
|
urlpatterns = [
|
|
re_path(fr'^v0/import/{settings.COURSE_ID_PATTERN}/$',
|
|
course_import.CourseImportView.as_view(), name='course_import'),
|
|
re_path(fr'^v1/validation/{settings.COURSE_ID_PATTERN}/$',
|
|
course_validation.CourseValidationView.as_view(), name='course_validation'),
|
|
re_path(fr'^v1/quality/{settings.COURSE_ID_PATTERN}/$',
|
|
course_quality.CourseQualityView.as_view(), name='course_quality'),
|
|
|
|
]
|