Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-3064

check for an existing repository mapping before adding a new workspace for a module

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 4.3
    • None
    • None
    • None

    Description

      This change is needed in order to be able to setup a separate clustered repository for specific workspaces.

      Although we have the repository mapping in place, which converts between a logical workspace name to a repository/workspace name pair for jackrabbit, the jackrabbit repository name is specified also in each module descriptor.

      So if we have a module with a repository declared as:

      <repositories>
          <repository>
            <name>magnolia</name>
            <workspaces>
              <workspace>commenting</workspace>
            </workspaces>
            <nodeTypeFile>/mgnl-nodetypes/commenting/magnolia-nodetypes.xml</nodeTypeFile>
          </repository>
        </repositories>
      

      the only way to move this workspace to a shared repository is to patch the module descriptor, changing the repository name to a different value, e.g. "shared".

      A good solution would have been avoiding the repository name in the module descriptor at all, defaulting to Magnolia if there is no mapping already defined in repositories.xml (but it's too late for a similar change, module descriptors needs to be compatible with previous versions).

      The proposed solution is to fix ModuleManagerImpl.loadRepository() in order to look for an existing repo mapping using the workspace name. If the mapping is found just use such repository instead of creating a new one, whatever repository name is set in the module descriptor.

      For the previous scenario, we will look for a mapping for the "commenting" workspace. If found, we proceed using the jackrabbit repository name specified in the mapping. (side note: ModuleManagerImpl actually always creates an additional workspace with the same name of the repository - this should not be done, the actual jackrabbit repository name could be any user-invented value)

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                fgiust Fabrizio Giustina
                fgiust Fabrizio Giustina
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Task DoD