Genesis JSON

Aug 16, 2023
info
Genesis Directory

Document JSON Format (version 1.0.0). You can also see a few examples below

1. Common fields
Property Description Type
versionjson JSON format version (1.0.0) string
title Name of package, used in console string
require Check requirements to install package ('notesversion': '11.0.0') object
error To inform that this package is broken and should not be used anymore string
config Updates config.txt file ('installdate': '16/08/2023', 'user': 'User Name') object
steps Defines needed steps to install application. See 2. Step array
2. Step
Property Description Type
runif Only run steps if certain OS (property 'os', possible values: 'win', 'unix') object
title Name of step, used in console string
dependencies Install other packages: ['packagename1', 'packagename2'] array
files Download files: [{'from': '$url', 'to': '${directory}\filename.nsf', 'replace': true|false}, {}, ...]] ${directory} - Domino\Data folder array
notesINI Update variables in notes.ini. [{'name': '$variableName', 'value': '$value'}, {'name': '$variableName', 'value': '$value', 'multivalue': true|false, 'sep': '$char'}, ...] array
updatedesign Update design of NSF: nconvert -d database.nsf * template.ntf | {"target": "$database", "template": "$template"} object
databases Operation with databases (nsf). See 3. Databases array
commands Sends command to Genesis. {'commands': ['restart']}, only 'restart' command is supported array
messages Display message in console string
3. Database
Property Description Type
action Create or just update a database? create (requires properties 'templatePath' or 'replicaPath') string
filePath Path to database string
sign Sign database (sign all design elements) boolean
replace Delete a database (using Domino classes) before creating a new one boolean
templatePath Create a new database from this template (requires action: 'true') string
replicaPath Create a replica from value (requires 'action': 'true') string
replicaServer Create a replica from server (requires 'action': 'true') string
title Title for a new database (requires action: 'true') string
ACL Define ACL for a database. See 4. ACL array (object)
Documents Create or update documents. See 5. Documents array (object)
4. ACL
Property Description Type
roles An array of role names. Example: ['SpecApprover', 'SpecAuthor'] array (string)
ACLEntries An array of ACL entries. Example: ['name': 'editorsGroup', 'level': 'editor', 'type': 'personGroup', canCreateDocuments: true, 'roles': ['SpecAuthor']]
Other attributes: canCreateDocuments, canDeleteDocuments, canCreatePersonalAgent, canCreatePersonalFolder, canCreateSharedFolder, canCreateLSOrJavaAgent, isPublicReader, isPublicWriter, canReplicateOrCopyDocuments
array (obect)
5. Documents
Property Description Type
action values: create, update (default) or export string
computeWithForm Perform computeWithForm boolean
items propery: value (value could be a string or an array) object
evaluate Run evaluate on documents string
search Search documents (required for action: update). 'formula': '$formula' and 'max' : 20 (max documents return) object

Examples

1. Download an NTF, sign the NTF and create a new database based on it. Perform update design task after all.

{
    "title": "Netmonitor v${version} (Prominic.NET)",
    "versionjson": "${versionjson}",

    "config":
    {
        "version": "${version}"
    },

    "steps": [
    {
        "title": "--- Step 1. Download file ---",
        "files": [
            {"from": "${baseurl}/0/${docid}/$FILE/netmonitor_v1.0.0.ntf", "to": "${directory}/netmonitor_v1.0.0.ntf"}
        ]
    },
    {
        "title": "--- Step 2. Sign template with server.id ---",
        "databases": [
             {
                "action": "update",
                "filePath": "netmonitor_v1.0.0.ntf",
                "sign": true
              }
        ]
    },
    {
        "title": "--- Step 3. Create netmonitor database from template (if not already) ---",
        "databases": [
             {
                "action": "create",
                "filePath": "netmonitor.nsf",
                "title": "Network Monitor ${version}",
                "templatePath": "netmonitor_v1.0.0.ntf"
              }
        ]
    },
    {
        "title": "--- Step 4. Update design ---",
        "updatedesign": [{"target": "netmonitor.nsf", "template": "netmonitor_v1.0.0.ntf"}]
    },
    {
        "title": "--- Step 5. Completed ---",
        "messages": ["You have installed Network Monitor v${version}"]
    }

    ]
}

2. Manipulate with ACL

{
    "title": "Create a document into already created database and also add ACL and roles",
    "versionjson": "1.0.0",
    "steps": [
        {
            "title": "--- Create a document ---",
            "databases": [
                {
                    "filePath": "test1.nsf",
                    "action": "update",
                    "documents": [
                        {
                            "action": "create",
                            "computeWithForm": true,
                            "items": {
                                "Form": "Person",
                                "field1": "value1",
                                "field2": "value2",
                                "field3": ""
                           }
                        }
                    ],
                    "ACL": {
                        "roles": [
                            "role1",
                            "role2"
                        ],
                        "ACLEntries": [
                            {
                                "name": "username1",
                                "level": "manager",
                                "type": "person",
                                "canCreateDocuments": true,
                                "roles": [
                                    "role2"
                                ]
                            },
                            {
                                "name": "username2",
                                "level": "editor",
                                "type": "person",
                                "canCreateDocuments": false,
                                "roles": [
                                    "role1", "role2"
                                ]
                            }
                        ]
                    }
                }
            ]
        }
    ]
}

3. Create a domcfg database based on template. After that update existing documents and create a new document.

{
    "title": "Domcfg.nsf for MFA",
    "versionjson": "${versionjson}",

    "config":
    {
        "version": "${version}"
    },

    "steps": [
    {
        "title": "--- Step 1. Configure domcfg and documents ---",
        "databases": [
             {
                "action": "create",
                "filePath": "domcfg.nsf",
                "title": "domcfg",
                "templatePath": "domcfg5.ntf",
                "documents":
                   [
                     {
                       "action": "update",
                       "search": {"formula": "Form=\"LoginMap\" & LF_ServerType=\"0\""},
                       "items": {"LF_ServerType": "1", "LF_Comment": "#Disabled by Genesis (Prominic.NET)"}
                     },
                     {
                       "action": "create",
                       "computeWithForm": true,
                       "items": {"Form":"LoginMap", "LF_LoginFormDB":"mfa.nsf", "LF_LoginForm":"Login", "LF_ServerType":"0", "LF_Comment":"#Created by Genesis (Prominic.NET)"}
                     }
                  ]
              }
        ]
    },
    {
        "title": "--- Step 2. (final). Instruction ---",
        "messages": ["SUCCESS", "Please review domcfg.nsf database to ensure setup looks correct"]
    }

    ]
}