4 Replies Latest reply on Apr 22, 2008 1:42 AM by rlacson

    [Solved] Is it Possible to List only Documents in a Folder?

    rlacson
      According to documentation, a folder can contain documents or other folders, and the FileManager.listFolder method can return both into an Items[] array.

      Is it possible to specify to the filemanager to only return Items of type Document into the Items[] array?

      Message was edited by:
      rlacson

      Marked thread as solved.
        • 1. Re: Is it Possible to List only Documents in a Folder?
          633939
          Hi
          If you're still looking for an answer to this - you can achieve this using SearchManager rather than FileManager, and effectively do an "all" search (eg. Name=*). This allows you to qualify the searched item types using a list of options, so in this case you'd want SEARCH_FOR_FOLDERS = false. You can also restrict the number of returned items, whereas the FileManager.listFolder approach only appears to be able to return everything, which surely must get slow once you have tens of thousands of items in the folder.
          Phil White
          • 2. Re: Is it Possible to List only Documents in a Folder?
            rlacson
            Hi Phil,

            That's a good idea! Thanks for the suggestion.

            However, I am looking at the Content Services Javadoc (version 10g Release 1) for the SearchManager, and cannot find SEARCH_FOR_FOLDERS as an option. Is there another option I can use?

            Cheers,

            Rey
            • 3. Re: Is it Possible to List only Documents in a Folder?
              633939
              Hi Rey

              I must admit that I'm using the Content DB API rather than Content Services, so possbly there's some slight difference. That said, I see the relevant options in the Content Services API at:
              http://www.oracle.com/technology/products/cs/developer/contentservicesdev/javadoc/10.1.2.3/oracle/ifs/fdk/SearchManager.html
              so maybe you're looking at a different API again. There's an Options.SEARCH_FOR_DOCUMENTS option to include/exclude documents from the search, and Options.SEARCH_FOR_FOLDERS for folders.

              Phil
              • 4. Re: Is it Possible to List only Documents in a Folder?
                rlacson
                Hi Phil,

                Thanks for pointing that out. I believe we are looking at 2 different versions of the same Java class. I am looking at is 10.1.1 while you are looking at 10.1.2. Unfortunately, the version we are using in this client is 10.1.1, and upgrading is not an option at this point.

                Thanks nevertheless for pointing that out. At least we have a solution to go with once we upgrade.

                Cheers,

                Rey