Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-8215

Make attachment manager / dao pluggable

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Timed out
    • None
    • None
    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

    Description

      NOTE: This suggestion is for Confluence Server. Using Confluence Cloud? See the corresponding suggestion.

      The subconf plugin (http://confluence.atlassian.com/display/CONFEXT/Subconf) has to hook into the attachment subsystem.
      Unfortunately when I first wrote it, I couldn't find a clean way to integrate it.
      Basically there is a delegating attachment manager that delegates to either the file based, database based or web dav based attachment manager based on a global setting.
      The component names for these three managers is hardcoded in a bit of logic in the delegating attachment manager.
      Further, I wanted to only delegate to the subconf attachment manager if svn integration was set up for a particular space.
      I initially thought about just hacking the confluence spring xml file to replace the delegating attachment manager. But you can't even do that, as the classes for the plugin havent been loaded at confluence start up, so you get a class not found error.

      So the nasty solution I came up with is this - get the spring app context, and inject my attachment manager in place of the file based attachment manager. This only works because the delegating attachment manager looks up the file based attachment manager every call, rather than having it injected at startup time.
      This involves quite a lot of down casting of the app context and (ahem) a couple of calls to private methods.

      So my question is - is there a better way to do this without the hack? I guess I need either a plugin point in the attachment sub system, or a more generalised method of replacing confluence components.

      Attachments

        Issue Links

          Activity

            People

              barconati BillA
              9f7dc9981cd2 Jon Nermut
              Votes:
              4 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: