I have created a page, and found the page using
Content content = contentService.find(expandAll()).withId(id).fetch().get();
id is the ContentId and
expandAll() returns an array of all Content.Expansions. I am not concerned about performance because I am only finding one content, and I know the content exists because I am the one who created it. Just to get that out of the way.
So, I have three problems that are almost certainly related, and I simply cannot get around. First,
content.getBody() returns an empty Map. It is not supposed to be empty, because there is content. Second, when I try to pass in a new ContentBody, ‘ContentService.update()’ throws an IllegalStateException “Request-local WebResourceAssembler has already been initialised”. And third, even when I simply omit the body altogether so that the update succeeds, when I visit the page it tells me there are unpublished changes.
Long story short - why is it so hard to update content using the ContentService ???
Addendum #1 - The REST API helped me past the first issue. It is not enough to expand “body”. You must actually expand “body.storage”.