-
Notifications
You must be signed in to change notification settings - Fork 1
Config File 1 Presentation
The plugin uses configuration files to configure its behaviour.
The plugin can manage several configuration files, and each configuration file can describe several forms. It's up to you decide whether to put all your forms in a single file or split up the forms into several configuration files.
Configuration files can be edited using the WYSIWYG editor which shows real times changes to the form appearance and content.
Alternatively, configuration files can be edited manually in a text editor or IDE. They are JSON files and therefore must comply with JSON syntax:
- Data is separated by commas
- Curly braces hold objects
- Square brackets hold arrays
- Data is in {"NAME":"VALUE"} pairs
- Nested objects follow the above rules and look like {"MAIN_OBJECT":{"NESTED_OBJECT_1":"DATA1", "NESTED_OBJECT_2": "DATA2"}}
For a more thorough overview of JSON syntax visit this link
The library used to parse the configuration file isn't always able to retrieve the line numbers of errors that appear while you're editing your JSON file. If you'd like to view more accurate errors, we recommend using the native JSON error handler that your IDE uses (if you're using an IDE) or by visiting a JSON syntax editor online. One suggestion is jsonlint.com
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Schema for the Archi form plugin's configuration file",
"properties": {
"version": {
"description": "Version of the file structure",
"type": "integer"
},
"org.archicontribs.form": {
"description": "List of the forms",
"items": {
"properties": {
"name": {
"description": "Name of the form",
"type": "string"
},
"refers": {
"description": "Archi object the forms refers to",
"enum": [
"selected",
"view",
"model"
],
"type": "string"
},
"filter": {
"properties": {
"genre": {
"description": "genre of the filter",
"enum": [
"OR",
"AND"
],
"default": "AND",
"type": "string"
},
"tests": {
"items": {
"properties": {
"attibute": {
"description": "value to test (can be a variable)",
"type": "string"
},
"operation": {
"description": "Operation of the test",
"enum": [
"exists",
"equals",
"iequals",
"matches"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"attribute",
"operation"
],
"type": "object"
},
"type": "array"
},
},
},
"background": {
"description": "RGB values to define the background color of the form window",
"pattern": "\\d{1,3}, *\\d{1,3}, *\\d{1,3}",
"type": "string"
},
"height": {
"default": 600,
"description": "Height of the form window in pixels",
"type": "integer",
"minimum": 0
},
"width": {
"default": 850,
"description": "Width of the form window in pixels",
"type": "integer",
"minimum": 0
},
"spacing": {
"default": 4,
"description": "Spacing between graphical objects in the form window in pixels",
"type": "integer",
"minimum": 0
},
"buttonWidth": {
"default": 90,
"description": "Width of the Ok, Cancel and Export buttons",
"type": "integer",
"minimum": 0
},
"buttonHeight": {
"default": 25,
"description": "Height of the Ok, Cancel and Export buttons",
"type": "integer",
"minimum": 0
},
"buttonOk": {
"default": "Ok",
"description": "Label of the Ok button",
"type": "string"
},
"buttonCancel": {
"default": "Cancel",
"description": "Label of the Cancel button",
"type": "string"
},
"buttonExport": {
"default": "Export to Excel",
"description": "Label of the Export button",
"type": "string"
},
"tabs": {
"description": "List of tabs to create in the form window",
"items": {
"type": "object",
"properties": {
"name": {
"description": "Name of the tab",
"default": "(no name)",
"type": "string"
},
"background": {
"description": "RGB values to define the background color of the tab",
"pattern": "\\d{1,3}, *\\d{1,3}, *\\d{1,3}",
"default": "240, 240, 240",
"type": "string"
},
"controls": {
"description": "List of the controls to create in the tab",
"items": {
"properties": {
"class": {
"description": "Class of the control",
"enum": [
"check",
"combo",
"label",
"table",
"text"
],
"type": "string"
},
"background": {
"description": "RGB values to define the background color of the control",
"pattern": "\\d{1,3}, *\\d{1,3}, *\\d{1,3}",
"default": "240, 240, 240",
"type": "string"
},
"foreground": {
"description": "RGB values to define the foreground color of the control",
"pattern": "\\d{1,3}, *\\d{1,3}, *\\d{1,3}",
"default": "0, 0, 0",
"type": "string"
},
"tooltip": {
"description": "Tooltip when the mouse stands above the control",
"type": "string"
},
"regexp": {
"description": "Regexp to validate data entered => in text controls only",
"type": "string"
},
"x": {
"default": 0,
"description": "The horizontal location of the control on the tab in pixels",
"type": "integer",
"minimum": 0
},
"y": {
"default": 0,
"description": "The vertical location of the control on the tab in pixels",
"type": "integer",
"minimum": 0
},
"width": {
"description": "Width of the control in pixels",
"type": "integer",
"minimum": 0
},
"height": {
"description": "Height of the control in pixels",
"type": "integer",
"minimum": 0
},
"text": {
"description": "The text content of the control => when class is label only <= can contain variables",
"default": "",
"type": "string"
},
"variable": {
"description": "the variable to get the content from and to save the content to => when class is check, combo, or text",
"type": "string"
},
"default": {
"description": "default value to set in the control's text => when class is check, combo, or text",
"type": "string"
},
"whenEmpty": {
"description": "Action to do when the value is empty => when class is check, combo, or text",
"enum": [
"ignore",
"create",
"delete"
]
},
"excelSheet": {
"description": "Name of the Excel sheet where the content should be exported",
"type": "string"
},
"excelCell": {
"description": "Name of the Excel cell where the content should be exported",
"type": "string"
},
"excelCellType": {
"description": "Type of the Excel cell where the content should be exported",
"enum": [
"numeric",
"string",
"boolean",
"formula",
"blank"
]
},
"excelCellType": {
"description": "Type of cell in case the value is empty (blank means an existing blank cell, zero means that we delete the cell if one exists)",
"enum": [
"blank",
"zero"
]
},
"columns": {
"description": "List of the columns of the control when the class is table",
"items": {
"properties": {
"class": {
"description": "Class of the cells in table column",
"enum": [
"check",
"combo",
"label",
"text"
],
"type": "string"
},
"tooltip": {
"description": "Tooltip when the mouse stands above the table column",
"type": "string"
},
"regexp": {
"description": "Regexp to validate data entered in table columns of class text",
"type": "string"
},
"width": {
"description": "Width of the table column in pixels",
"type": "integer",
"minimum": 0
},
"excelcellcolumn": {
"description": "Excel column where to export table column content",
"type": "string"
},
"excelcelltype": {
"description": "Type of the Excel cells when data is exported",
"enum": [
"blank",
"boolean",
"formula",
"numeric",
"string"
],
"type": "string"
},
"exceldefault": {
"description": "Type of cell in case the value is empty (blank means an existing blank cell, zero means that we delete the cell if one exists)",
"enum": [
"blank",
"zero"
],
"type": "string"
}
}
},
"required": [
"class"
],
"type": "array"
},
"lines": {
"items": {
"properties": {
"generate": {
"description": "Indicates if lines must be generated using the object children",
"type": "boolean",
"default": false
},
"cells": {
"description": "Values of each cell, can contain variables",
"type": "array"
},
"filter": {
"properties": {
"genre": {
"description": "genre of the filter",
"enum": [
"OR",
"AND"
],
"default": "AND",
"type": "string"
},
"tests": {
"items": {
"properties": {
"attibute": {
"description": "value to test (can be a variable)",
"type": "string"
},
"operation": {
"description": "Operation of the test",
"enum": [
"exists",
"equals",
"iequals",
"matches"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"attribute",
"operation"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
}
}
},
"type": "array",
"required": [
"category",
"values"
]
},
"excelsheet": {
"description": "Name of the Excel sheet to export to",
"type": "string"
},
"excelcell": {
"description": "Excell Cell reference when the class is label or text",
"default": 0,
"type": "integer",
"minimum": 0
},
"excelfirstline": {
"description": "Number of the first Excel row when the class is table",
"default": 0,
"type": "integer",
"minimum": 0
}
},
"type": "object",
"required": [
"class"
]
},
"type": "array"
}
}
},
"type": "array"
}
},
"type": "object",
"required": [
"name"
]
},
"type": "object"
}
},
"required": [
"version",
"org.archicontribs.form"
],
"type": "object"
}