zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    AGC015E Mr.Aoki Incubator
    luogu P3520 [POI2011]SMI-Garbage
    442.Find All Duplicates in an Array
    SICP_2.61-2.62
    sicp_2.59-2.60
    SICP_2.58
    SICP_2.56-2.57
    SICP_2.53-2.55
    SICP_2.52-2.53
    SICP_2.50-2.51
  • 原文地址:https://www.cnblogs.com/hannover/p/2477516.html
Copyright © 2011-2022 走看看