0 Replies Latest reply on Feb 15, 2013 10:53 AM by vasilievip

    Mounting repositories into federation

    vasilievip

      The current approach on how external repositories plugged into modeshape assumes that there will be no everlapping between existing content and federation entry point.

      Lets say I have following setup:

      • Existing content in repository: /fs/node1/node2
      • Some folder on filesystem e.g.: /tmp/somefolder
      • Federation configuration:

      {code:javascript} 

          "externalSources" : {

              "file-source" : {

               "classname" : "org.modeshape.connector.filesystem.FileSystemConnector",

                  "directoryPath" : "/tmp",

                  "extraPropertiesStorage" : "json",

                  "projections" : [

                       "default:/fs => /",

                  ]

              }

          }

      {code}

       

       

      Then, I will not see /fs/somefolder, but will get /fs/node1/node2 as an result. This must generate warnings I assume, but if you take a look on how unix filesystem handles mounting external devieces, they went another waym which is makes sence:


      [mount|http://linux.about.com/od/commands/l/blcmdl8_mount.htm]

       

      {quote}

      This tells the kernel to attach the file system found on device (which is of type type) at the directory dir. The previous contents (if any) and owner and mode of dir

      become invisible, and as long as this file system remains mounted, the pathname dir refers to the root of the file system ondevice.

      {quote}

       

       

      So the idea is when FederationManager.createProjection("/","sourcename","/tmp", "fs") invoked the "fs" node must overlay existing content. FederationManager.removeProjection invoked - overlay must be removed.

       

      If this deserves feature request, let me know.