ResolveRootDirectoryAsTree being called multiple times

3 posts, 1 answers
  1. Chris
    Chris avatar
    20 posts
    Member since:
    Jan 2009

    Posted 19 May 2009 Link to this post

    I am implementing my own File Browser Content Provider and have observed "ResolveRootDirectoryAsTree" being called for the subdirectory paths as well as my intended root (the first ViewPath). Am I misunderstanding what ResolveRootDirectoryAsTree is for?

    I have my FileExplorer in a UserControl and I'm initializing it during the Init event of the UserControl.


    <rad:RadFileExplorer ID="radFileExplorer" runat="server" EnableOpenFile="false" OnClientFileOpen="ClientFileOpenHandler" Width="588"></rad:RadFileExplorer> 
            Private Sub Page_Init(ByVal sender As ObjectByVal e As System.EventArgs) Handles MyBase.Init  
                Dim path = String.Format("{0}/{1}", myOwnerID, myOwnerType)  
                If myOwnerType = DocumentOwnerType.Employee Then 
                    radFileExplorer.Upload.OnClientAdded = "AddFieldsForEEDocuments" 
                    radFileExplorer.WindowManager.Height = 100  
                    radFileExplorer.Upload.OnClientAdded = "AddFields" 
                    radFileExplorer.WindowManager.Height = 150  
                End If 
                radFileExplorer.Upload.InitialFileInputsCount = 1  
                radFileExplorer.Upload.ControlObjectsVisibility = Telerik.Web.UI.ControlObjectsVisibility.None  
                radFileExplorer.VisibleControls = _  
                 Telerik.Web.UI.FileExplorer.FileExplorerControls.ContextMenus Or _  
                 Telerik.Web.UI.FileExplorer.FileExplorerControls.Grid Or _  
                 Telerik.Web.UI.FileExplorer.FileExplorerControls.Toolbar Or _  
                radFileExplorer.Configuration.ContentProviderTypeName = GetType(DocumentStorageContentProvider).AssemblyQualifiedName  
                radFileExplorer.Configuration.ViewPaths = New String() {path}  
    End Sub 

  2. Answer
    Lini avatar
    2150 posts

    Posted 22 May 2009 Link to this post

    Hi Chris,

    We plan to update the FileExplorer online documentation next week as part of our RadControls service pack release and offer much more detailed information about the file browser content provider model.

    The ResolveRootDirectoryAsTree method is called when the FileExplorer control wants to get the subfolders of a particular folder. Since the folders in the explorer tree are expanded using ajax requests, the function is called for each expanded folders. If you are concerned about the performance of your provider, you should make the function return only one level of child folders. For example if you have the following folder structure:

       - sub_folder1
       - sub_folder2
        - sub_folder3

    If you call the ResolveRootDirectoryAsTree method for the "root_folder" above, you should only return "sub_folder1","sub_folder2", and "sub_folder3" in the list of sub-folders. There is no need to go further down in the folder structure and return the subfolders of "sub_folder2". Note that you can also skip the files. Only the folders are important in the return value of this method.

    The ResolveDirectory method is called for two reasons - to get the files in a particular folder and to check a folder's permissions.

    To populate the file explorer's grid control, we first call ResolveRootDirectoryAsTree to get the sub-folders of the current folder and then ResolveDirectory to get the files.

    Best wishes,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Chris
    Chris avatar
    20 posts
    Member since:
    Jan 2009

    Posted 26 May 2009 Link to this post

    Thanks for the reply.
    I wish your explanation was in the documentation a week ago! :-)
Back to Top