Hi Sylvian,
You’re correct in assuming that RepositoryHookService is not the right choice. AO is generally the recommended option, but the two points you raised are valid. Two things to note though:
- You can use a CLOB field to store your document by setting the string length to unlimited for that field (
@StringLength(UNLIMITED)). The documentation says:
The value can be a positive integer or {@link #UNLIMITED}; an unlimited-length string is stored as the corresponding “long string” database type (TEXT, CLOB, etc. depending on the database provider).
- Cleaning up the data if a repo is deleted can be done by adding an event listener which listens to the
RepositoryDeletedEvent
@EventListener
public void onRepositoryDeleted(RepositoryDeletedEvent event) {
delete(event.getRepository());
}
Another option is to use plugin settings, though it is intended for storing settings at a global plugin-level, not at a repo level. That said, you can still find examples of this being used for repository settings. Note that you will still have to listen to the RepositoryDeletedEvent to remove old settings data.
My answer on a previous question about how to store data might also be of use to you.
Hope that helps!
Kristy