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

发布于 2024-10-21 17:43:00 字数 136 浏览 1 评论 0原文

因此,我正在构建一个模块,必须在其中向内置文档库功能添加注释功能。我正试图找到我从哪里提取文件。我还希望对列表进行安全修剪。我真的希望有一个 API,而且我不必构建一个在文档库更新时中断的手动解决方案...

有关从哪里获取此信息的任何帮助吗?

So I'm building a module where I have to add commenting ability to the built-in Document library feature. I'm trying to find where I pull the documents from. I also want the list security-trimmed. I'm really hoping there's an API and I don't have to build a manual solution that breaks on an update of the document library...

Any help on where to get this information?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

短暂陪伴 2024-10-28 17:43:00

您也许能够使用 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

You may be able to use the DNN File Picker control, or re-purpose some of it's logic.

The source code available on Codeplex has examples of retrieving folders for a user and an example of retrieving files for a folder (for a user):

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

and

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文