5.23.3.1. Adding buttons to the user interface

[Note]Note

The Default configuration is below /libs/pappserver/webapps/3dfindit-enterprise/custom_config.json and contains only a few default settings:

{
  "baseApiPath": "",
  "basename": "/webapps/3dfindit-enterprise",
  "erp": true,
  "startRoute": "CadBim",
  "isEnterprise": true
}

If you make any changes (e.g. additional buttons) save See the complete configuration under "$CADENAS_SITESETUP/3df/custom_config.json". If the file does not already exist, set it accordingly .

The configuration file contains a main section with some default settings for 3Dfindit and then a "toolbars" section.

Toolbar buttons can be set at the following positions:

  • Main menu -> "mainMenu"

  • Above table -> "table"

  • Above 3D view -> "viewer"

  • In the search results at different positions or for different events:

    • Above existing search results -> "searchResults"

    • Instead of non-existent search results -> "noResults"

    • In the context menu of search results -> "searchResultsContextMenu"

Buttons themselves and their functionality are defined in the "buttons" section. Each button has a type that is either JS or VBS:

  • JS is executed directly in the browser. It can only access browser functions, e.g. call other websites or APIs.

  • VBS is executed on the server side and in the AppServer environment.

Each button has anicon and a name .

{
  "baseApiPath": "",
  "basename": "/webapps/3dfindit-enterprise",
  "erp": true,
  "startRoute": "CadBim",
  "isEnterprise": true,

  "toolbars": {
    "mainMenuIcon": "./plugins/img/3dFinditEyeColor.svg",
    "mainMenu": [
      ["customButton1_Group1", "customButton2_Group1", "customButton3_Group1"],
      ["customButton1_Group2", "customButton2_Group2", "customButton3_Group2"]
    ],
    "viewer": ["exampleButton", "exampleVBSButton"],
    "table": ["exampleButton", "exampleVBSButton"],
    
    "noResults": ["customButton1", "customButton2", "customButton3"],
    "searchResults": ["customButton1", "customButton2", "customButton3"],
    "searchResultsContextMenu": ["customButton1", "customButton2", "customButton3"],
  
    "buttons": {
      "exampleButton": {
        "type": "JS",
        "name": {
          "de-DE": "JS Beispiel",
          "en-GB": "JS Example"
        },
        "callback": "onExampleButtonClicked",
        "icon": "images/bell-solid.svg",
        "tooltip": {
          "de-DE": "JS Beispiel",
          "en-GB": "JS Example"
        }
      },
      "exampleVBSButton": {
        "type": "VBS",
        "icon": "images/bell-solid.svg",
        "name": {
          "de-DE": "VBS Beispiel",
          "en-GB": "VBS Example"
        },
        "script": "/plugins/vbb/wstest.vbs",
        "requestFromPdm": "currentuser",
        "tooltip": {
          "de-DE": "VBS Beispiel",
          "en-GB": "VBS Example"
        }
      }
    }
  }
}