High level requirement
High level: We want to support static assets in content libraries.
Less obvious implication: We need to support copying those assets back and forth when copy/pasting between courses and libraries, and when using library content in a course.
Strategy
Overall strategy for managing library <-> course content sharing is that a course gets a copy of the content, with some back-pointer.
...
Library assets are local to a Component. Course assets have a shared Files and Uploads across all Components.
Library asset->component relations are explicit, in that there's a database model for it. Course asset->component relationships are interpreted via scanning the content.
Library assets are versioned along with the Component, i.e. they obey draft/publish semantics. Course assets are not versioned.
Course assets have AssetKeys, Library assets are just relative paths against a particular version of a Component.
Current work in flight
I have a PR in flight that implements static assets on the libraries side: https://github.com/openedx/edx-platform/pull/35557
It requires three other PRs, two of which have merged:
...
...
Copy content into the clipboard (content_staging), which will hold the file data and "normalized" name for the asset.
When pasting into a course from a library, create the assets in a subdirectory based on the UsageKey.
Longer Term Plans
As a long term thing, we want to serve static assets in a very different way from Learning Core, as outlined in this ADR. But that's out of scope for Sumac. Because we’re copying everything to contentstore anyway, Learning Core backed assets are never getting served directly to students (there’s actually an auth check to make sure people have read rights to the library in question).
Work to be picked up
The one case this PR still doesn't handle is if someone copies from a library into a course, and then copies that thing they just pasted into the course and pastes it again. (i.e. it doesn't know how to convert a path to a course asset in a subdirectory back into the abstract "normal" form to put on the clipboard). I should have this addressed soon.
...