I'm currently writing a custom component in Java that instead of writing a static HTML file will write a static docx file with all the metadata when a specific checkbox is selected.
What I'm currently doing is:
Having a user perform a check_in without a primary file, only metadata. This obviously fails because a check-in requires a file to be checked in. In the background, however, I generate a docx file and perform a new checkin with the meta values and the newly generated docx, which works fine. What I'm having trouble with at the moment is redirecting the user to the file which was generated in the background. The user's check-in fails and it seems to overwrite the redirect, leaving the user at a red screen.
What I'm looking for is a way to either overwrite the file missing error OR send a Location header to the client to force a redirect.
Kyle Hatlestad has a blog post on allowing metadata only check-ins. Chance this will side step the issue completely.
Doing check-ins without files in UCM