【问题标题】:How to give public access to files under webcontent in lotus domino如何在 Lotus domino 中授予对 webcontent 下文件的公共访问权限
【发布时间】:2015-07-20 15:11:02
【问题描述】:

我有一个想要公开的带有 XPage 的 domino 应用程序。因此,我在 ACL 中将“默认”设置为具有读取公共文档选项的存款人级别,以便将其公开。

当我想使用图像资源时,我会转到其属性安全选项卡并启用“可供公共访问用户使用”复选框。

现在,我想在我的应用程序中使用 font-awesome,并且我有 font-awesome 的文件夹及其子文件夹和 webcontent 文件夹下的文件。

我怎样才能将它们公开? (在非公共应用程序中,font-awesome 与 webcontent 文件夹下的 font-awesome 文件夹正常工作)

【问题讨论】:

标签: xpages acl lotus-domino font-awesome


【解决方案1】:

我只是创建了一个代理来设置标志。您可以在下方获取代码。我将它用于已添加到 NSF 的 Angular 应用程序。

HTH /约翰

编辑: 这里直接插入代码:

Option Public
Option DeclareSub Initialize
Const APP_DIR = “app/”
Const FN_PUBLICACCESS = “$PublicAccess”
Const FLAG_TRUE = “1”
Dim sess As New NotesSession
Dim db As NotesDatabase
Dim nc As NotesNoteCollection
Set db = sess.currentDatabase
Set nc = db.CreateNoteCollection(False)
Call nc.SelectAllDesignElements(True)
Call nc.BuildCollection
Dim d1 As Long
Dim d2 As Long
Dim title As String
Dim flagsExt As String
Dim noteid As String
Dim nextid As String
Dim i As Long
Dim doc As NotesDocument
noteid = nc.Getfirstnoteid()
For i = 1 To nc.Count
‘get the next note ID before removing any notes
nextid = nc.GetNextNoteId(noteid)
Set doc = db.GetDocumentByID(noteid)
title = doc.GetItemValue(“$title”)(0)
flagsExt = doc.GetItemValue(“$flagsExt”)(0)
If LCase(flagsExt) = “w” And Left(LCase(title),Len(APP_DIR)) = LCase(APP_DIR) Then
d1 = d1 + 1
If Not doc.Getitemvalue(FN_PUBLICACCESS)(0) = FLAG_TRUE Then
d2 = d2 + 1
Call  doc.replaceItemValue(FN_PUBLICACCESS,FLAG_TRUE)
Call doc.save(True, False)
Print title & ” – set to allow public access read”
End If
End If
noteid = nextid
Next

Print nc.count & ” design elements checked. “ & d1 & ” elements found in ‘” & APP_DIR & “‘ and “ & d2 & ” updated to give public access”

End Sub

【讨论】:

  • 我发现这个简单的改变确实加快了代理的速度。 Call nc.SelectAllDesignElements(False) ' We only care about the MiscFormatElements/WebContent, so we can ignore everything else. nc.SelectMiscFormatElements = True
  • 我无法从博客中获取代码。博客好像挂了。请分享代码
【解决方案2】:

它们仍然在 NSF 中注册为设计说明(这就是它们采用默认可见性的原因),所以我认为唯一真正的选择是运行一个代理来明确地更新它们的可见性。 Sven Hasselbach 曾写过关于 this topic a couple times 的博客(至少是关于以编程方式与 WebContent 文件夹中的项目交互),值得一读。最终,我尝试将这些公共不可知的公共资源放入我的 Domino /Data/domino/html/ 路径中,以使其始终公开(该路径始终公开可见),并且可在主题中设置。

[更新] 有关详细信息,请参阅在 cmets 中发布的 Per Henrik Lausten 到 Q 的链接。 [/更新]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-01-17
    • 1970-01-01
    • 2019-03-13
    • 2013-09-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多