9 Replies Latest reply on Sep 23, 2009 11:58 AM by piyush.sh

    Configuring a FileSystemSource

    ygoldstein

      I'm trying to configure a FileSystemSource to use a file system path, as follows:

      <dna:source jcr:name="SourceE" dna:name="AirplanesRepo" dna:classname="org.jboss.dna.connector.filesystem.FileSystemSource"
      dna:fileSystemPaths="mypath"/>

      Using the above, DNA is able to initialize the FileSystemSource but the fileSystemPaths property never gets set. Calling the setFileSystemPaths method programmatically on the FileSystemSource will get around the problem but I'd like to avoid this approach if possible.

      Thanks.

        • 1. Re: Configuring a FileSystemSource
          rhauch

          That's probably a bug in the code that uses reflection to set the property to an array of values. Could you open a JIRA and upload your XML file?

          Best regards.

          • 2. Re: Configuring a FileSystemSource
            ygoldstein
            • 3. Re: Configuring a FileSystemSource
              rhauch

              Thanks! I've added a comment where I think the problem lies, along with two possible ways of fixing it, and it's in our queue to fix before the next release.

              • 4. Re: Configuring a FileSystemSource
                rhauch

                I've fixed this problem in trunk, and I attached to the JIRA issue two patch files: 'dna-283.patch' has the changes that were applied to trunk; 'dna-283-version0.3.patch' has the equivalent changes that CAN be applied to the 0.3 branch. Currently trunk is not stable (and the examples won't run), but if you're using 0.3, you could get the source, apply the 0.3 patch, then build the artifacts, and run the examples.

                Note that we don't currently plan on issuing patch releases to any release prior to 1.0. If this is an issue, please let us know.

                Best regards.

                • 5. Re: Configuring a FileSystemSource
                  rhauch

                  Marking as resolved, since this has been tested as being corrected.

                  @Yaron: if this still doesn't work for you, please reopen with the details.

                  • 6. Re: Configuring a FileSystemSource

                    Could you please elaborate on how to configure a local filesystem source using JBossDNA0.6 programmatically?
                    I am trying to do the configuration based on sample "InMemoryRepositorySource".
                    JcrConfiguration config = new JcrConfiguration();
                    config.repositorySource("store")
                    .usingClass(FileSystemSource.class)
                    .setDescription("The repository for our content")
                    .setProperty("defaultWorkspaceName", "workspaceName");

                    My file system path is: c:/TestDNA/
                    In API I could not find how to add the the path to the configuration.

                    Could you please direct me in this regard ?

                    Thanks
                    Piyush


                    • 7. Re: Configuring a FileSystemSource

                      Hello all,
                      I was able to connect to the file system source :-)
                      I set the workspace name to a directory location and added a file node to the source.
                      Thanks.

                      Regards,
                      Piyush

                      • 8. Re: Configuring a FileSystemSource

                         

                        "piyush.sh@gmail.com" wrote:
                        Hello all,
                        I was able to connect to the file system source :-)
                        I set the workspace name to a directory location and added a file node to the source.

                        Questions:
                        - Do I need to manually add the files in my workspace as "rep.addnode("a") to access them through JCR API ?
                        - How does JBoss DNA provides an abstraction layer to a file system source without loading any files ?


                        Thanks.

                        Regards,
                        Piyush


                        • 9. Re: Configuring a FileSystemSource

                          Hello all,
                          I successfully configured programmatically the filesystem source.
                          Kindly ignore all my questions.

                          Thanks.

                          Best regards,
                          Piyush