• Document versioning


    I needed versioning for my Wiki. The older versions of each WikiPage are stored in a separate database. The version number of the WikiPage is updated each time the page is saved.

    The LotusScript

    In the following routine, 'OVERFLOW_DB' is a constant with the path of the database to store all the versions. After copying all the items from the original document, I've added two fields containing the original database path and the original UniqueId of the document. After saving the version document, the version number of the original is updated.

    Sub makeVersion(doc As notesdocument)
        On Error Goto catch
        Dim s As New notessession
        Dim db As NotesDatabase
        Dim newDoc As NotesDocument
       
        Set db=s.GetDatabase("", OVERFLOW_DB)
        Set newDoc=db.CreateDocument
        doc.CopyAllItems newDoc
        newDoc.ReplaceItemValue "OrigDb", doc.ParentDatabase.FilePath
        newDoc.ReplaceItemValue "OrigUnid", doc.UniversalID
        newDoc.Save True, False, True
        doc.ReplaceItemValue "version", doc.version(0)+1
       
        Goto finally
    catch:
        Print "Error " & Err & " in line " & Erl & ": " & Error$
        Resume finally
    finally:
    End Sub

  • 相关阅读:
    租店笔记
    pycharm debug调试【Mute Breakpoints】【Run to Curson】按钮
    教师岗位职业技能分享—备课小秘籍
    交换机基础
    路由基础
    IPv6端口转发联机软件 4to6
    数据库_关键词用法
    1_Shell脚本入门
    MySQL_linux下mysql数据库自动定时备份
    Unity URP 安装配置
  • 原文地址:https://www.cnblogs.com/hannover/p/2477516.html
Copyright © 2020-2023  润新知