从文档库(专业版)获取修剪文档列表

时间:2011-03-13 16:22:37

标签: dotnetnuke dotnetnuke-5

所以我正在构建一个模块,我必须在内置文档库功能中添加注释功能。我正试图找到从哪里提取文件。我还希望列表安全修剪。我真的希望有一个API,我不需要构建一个手动解决方案来打破文档库的更新......

有关从何处获取此信息的任何帮助?

1 个答案:

答案 0 :(得分:0)

您可以使用DNN文件选择器控件,或者重新使用它的一些逻辑。

Codeplex上提供的源代码包含为用户检索文件夹的示例以及检索文件夹(用户)文件的示例:

http://dotnetnuke.codeplex.com/SourceControl/changeset/view/58672#612642

Private Sub LoadFolders()
    cboFolders.Items.Clear()

    'Add Personal Folder
    If UsePersonalFolder Then
        Dim userFolder As String = FileSystemUtils.GetUserFolderPath(UserController.GetCurrentUserInfo().UserID)
        Dim userFolderItem As ListItem = cboFolders.Items.FindByValue(userFolder)
        If userFolderItem IsNot Nothing Then
            userFolderItem.Text = Utilities.GetLocalizedString("MyFolder")
        Else
            'Add Dummy Folder
            cboFolders.Items.Add(New ListItem(Utilities.GetLocalizedString("MyFolder"), userFolder))
        End If
    Else
        Dim folders As ArrayList = FileSystemUtils.GetFoldersByUser(PortalId, ShowSecure, ShowDatabase, Permissions)
        For Each folder As FolderInfo In folders
            Dim folderItem As New ListItem
            If folder.FolderPath = Null.NullString Then
                folderItem.Text = Utilities.GetLocalizedString("PortalRoot")
            Else
                folderItem.Text = folder.DisplayPath
            End If
            folderItem.Value = folder.FolderPath
            cboFolders.Items.Add(folderItem)
        Next
    End If

End Sub

Private Function GetFileList(ByVal NoneSpecified As Boolean, ByVal Folder As String) As ArrayList
    Dim fileList As ArrayList

    If IsHost Then
        fileList = Globals.GetFileList(Null.NullInteger, FileFilter, NoneSpecified, cboFolders.SelectedItem.Value)
    Else
        fileList = Globals.GetFileList(PortalId, FileFilter, NoneSpecified, cboFolders.SelectedItem.Value)
    End If

    Return fileList
End Function