You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"As a content author, I want to see all the tags applied to my content so I can see what needs to be added or changed."
Description
Implement a REST API that allows retrieving the full list of tags applied to a given object.
This ticket implements the API in the oel_tagging library, but a later ticket will use to fetch the tags applied to content edited in Studio.
Completion criteria
Build on/subclass the "taxonomy REST API view" added by #73, and implement these REST API endpoints:
oel_tagging:
GET /tagging/rest_api/v1/object_tags/<object_id>/?taxonomy=<pk>&page_size=<size>&page=1
Bring the above REST API into content_tagging under this path:
GET /api/content_tagging/v1/object_tags/<object_id>/?taxonomy=<pk>&page_size=<size>&page=1
Uses oel_tagging.api.get_object_tags to return a paginated list of ObjectTag metadata for the given <object_id>: name, value, taxonomy_id, tag_ref, is_valid
The returned list of object tags is sorted (descending) by taxonomy_id, name, value, tag_id -- this will require updating the oel_tagging.api.get_object_tags() method.
taxonomy parameter: (optional) Taxonomy pk
Return only ObjectTags for the given taxonomy, if it exists.
Paginate this data, with a default MAX_PAGE_SIZE = 100, to allow most people to retrieve all of their object tags in one hit.
Objects with more ObjectTags will need to know where to go to get their next page of data, and so this endpoint should support that too.
Bringing the oel_tagging REST API into content_tagging shouldn't require much? You should be able to just register the oel_tagging viewset under the content_tagging REST API router
Automated testing must cover common paths in behavioral specification.
Pagination
Use the same Pagination parameters and serialized response data as was developed for #74.
Behavioral specifications
Suppose the Open edX instance has these taxonomies:
system-defined language taxonomy: st1 (enabled) linked to 1 (valid) object tag for object_id="abc".
closed taxonomies created by taxonomy admins: t1 (enabled), t2 (disabled), each linked to 20 object tags for object_id="abc"
2 free-text taxonomies created by taxonomy admins: o1 (enabled), o2 (disabled), each linked to 200 object tags for object_id="abc"
Suppose the pagination defaults are:
page_size = 100
max_page_size = 100
page = 1
and the following users:
userA: non-staff
userS: global staff user
Note: because anyone can view an object tag, there is no difference between what userA and userS see from this endpoint.
/tagging/rest_api/v1/object_tags/<object_id>/
When userA or userS requests ^, they receive a list of object tag metadata, max 100, matching the given object_id, and linked to any (or no) taxonomy.
When userA or userS requests ^, they will receive only invalid object tags, because taxonomy t2 is disabled, which renders all of its object tags "invalid".
Story
"As a content author, I want to see all the tags applied to my content so I can see what needs to be added or changed."
Description
Implement a REST API that allows retrieving the full list of tags applied to a given object.
This ticket implements the API in the
oel_tagging
library, but a later ticket will use to fetch the tags applied to content edited in Studio.Completion criteria
Build on/subclass the "taxonomy REST API view" added by #73, and implement these REST API endpoints:
oel_tagging:
GET /tagging/rest_api/v1/object_tags/<object_id>/?taxonomy=<pk>&page_size=<size>&page=1
Bring the above REST API into content_tagging under this path:
GET /api/content_tagging/v1/object_tags/<object_id>/?taxonomy=<pk>&page_size=<size>&page=1
oel_tagging.api.get_object_tags
to return a paginated list of ObjectTag metadata for the given<object_id>
:name
,value
,taxonomy_id
,tag_ref
,is_valid
taxonomy_id
,name
,value
,tag_id
-- this will require updating theoel_tagging.api.get_object_tags()
method.taxonomy
parameter: (optional) Taxonomy pkMAX_PAGE_SIZE = 100
, to allow most people to retrieve all of their object tags in one hit.Objects with more ObjectTags will need to know where to go to get their next page of data, and so this endpoint should support that too.
Automated testing must cover common paths in behavioral specification.
Pagination
Use the same Pagination parameters and serialized response data as was developed for #74.
Behavioral specifications
Suppose the Open edX instance has these taxonomies:
Suppose the pagination defaults are:
and the following users:
Note: because anyone can view an object tag, there is no difference between what userA and userS see from this endpoint.
/tagging/rest_api/v1/object_tags/<object_id>/
object_id
, and linked to any (or no) taxonomy./tagging/rest_api/v1/object_tags/<object_id>/?taxonomy=<pk>
object_id
, withtaxonomy_id=<pk>
./tagging/rest_api/v1/object_tags/<object_id>/?taxonomy=t2
/tagging/rest_api/v1/object_tags/<object_id>/?taxonomy=<pk>&page=2
object_id
, withtaxonomy_id=<pk>
./tagging/rest_api/v1/object_tags/<object_id>/?taxonomy=<pk>&page=3&page_size=2
object_id
, withtaxonomy_id=<pk>
.POST/PUT/PATCH /tagging/rest_api/v1/object_tags/<object_id>/
Documentation updates & improvements criteria
Relevant PRs/repositories
The text was updated successfully, but these errors were encountered: