4.21.3.1. Aggiungere pulsanti all'interfaccia utente

Pulsanti devono essere soggetti a /libs/pappserver/webapps/3dfindit-enterprise/custom_config.json .

[Nota]Nota

Cambiamenti deve essere inserito sotto "$CADENAS_SITESETUP/3df/custom_config.json" (dalla V12.6).

La configurazione predefinita e il codice aggiuntivo sono stati uniti.

Quando si esegue l'aggiornamento, salvare il file "custom_config.json" prima o Posizionali sotto $CADENAS_SITESETUP/3df. Il file dovrebbe contenere solo le modifiche.

Il file di configurazione contiene una sezione principale con alcune impostazioni predefinite per 3Dfindit e una sezione di barre degli strumenti.

È possibile visualizzare un pulsante della barra degli strumenti sopra la tabella o sopra la vista 3D. Questo viene definito nel visualizzatore di elementi visualizzatore di.

I pulsanti stessi e la loro funzionalità sono definiti nella sezione Pulsanti. Ogni pulsante ha un tipo che può essere JS o VBS:

  • JS viene eseguito direttamente nel browser. Può solo accedere alle funzioni del browser, ad esempio chiamare altri siti web o API.

  • VBS viene eseguito sul lato server e nell'ambiente AppServer.

Ogni pulsante ha un'icona e un nome.

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

  "toolbars": {
    "viewer": ["exampleButton"],
    "table": ["exampleVBSButton"],
    "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"
        }
      }
    }
  }
}

Esempio di risultato utilizzando il codice sopra riportatoPulsante "Esempio VBS Pulsante "Esempio JS

Figura 4.394. Esempio di risultato utilizzando il codice sopra riportato

A partire dalla V12.9 ci sono più possibilità. I pulsanti possono essere aggiunti anche nella barra principale e nell'area dei risultati della ricerca (a seconda che ci siano o meno dei risultati).

  • Nella barra principale:

    Pulsanti nella barra principale

    Figura 4.395. Pulsanti nella barra principale

  • Sopra i risultati della ricerca:

    Pulsanti sopra i risultati della ricerca

    Figura 4.396. Pulsanti sopra i risultati della ricerca

  • Nell'area dei risultati della ricerca per i risultati esistenti:

    Pulsanti nell'area dei risultati della ricerca

    Figura 4.397. Pulsanti nell'area dei risultati della ricerca

  • Nel menu contestuale dei risultati della ricerca

    {
      "baseApiPath": "",
      "basename": "/webapps/3dfindit-enterprise/",
      "erp": true,
      "startRoute": "CadBim",
      "isEnterprise": true,
    
      "toolbars": {
        "viewer": ["exampleButton"],
        "table": ["exampleVBSButton"],
        "searchResultsContextMenu": ["exampleButton", "exampleVBSButton"],
        "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"
            }
          }
        }
      }
    }
    Pulsanti nel menu contestuale dei risultati della ricerca

    Figura 4.398. Pulsanti nel menu contestuale dei risultati della ricerca

Nel seguente esempio di codice, le nuove opzioni sono evidenziate in blu.

{
  "defaultLoginMethod": "openid"
  
  "baseApiPath": "",
  "basename": "/webapps/3dfindit-enterprise",
  "erp": true,
  "startRoute": "CadBim",
  "isEnterprise": true,
  
  "toolbars": {
    "viewer": ["exampleButton"],
    "table": ["exampleVBSButton"],

    "mainMenuIcon": "./plugins/img/3dFinditEyeColor.svg",
    "mainMenu": [
      ["customButton1_Group1", "customButton2_Group1", "customButton3_Group1"],
      ["customButton1_Group2", "customButton2_Group2", "customButton3_Group2"]
    ],
    "noResults": ["customButton1", "customButton2", "customButton3"],
    "searchResults": ["customButton1", "customButton2", "customButton3"],

    "buttons": {
      "customButton1_Group1": {
        "type": "VBS",
        "icon": "./plugins/img/3dFinditEyeColor.svg",
        "name": {
          "de-DE": "custom button 1 de",
          "en-GB": "custom button 1 en"
        },
        "script": "/plugins/vbb/custom1_startup.vbs",
        "tooltip": {
          "de-DE": "custom button 1 de",
          "en-GB": "custom button 1 en"
        }
      },
      "customButton2_Group1": {
        "type": "VBS",
        "icon": "./plugins/img/3dFinditEyeColor.svg",
        "name": {
          "de-DE": "custom button 2 de",
          "en-GB": "custom button 2 en"
        },
        "script": "/plugins/vbb/custom2_startup.vbs",
        "tooltip": {

Esempio completo: le illustrazioni precedenti mostrano un esempio del risultato.

{
  "defaultLoginMethod": "openid"
  
  "baseApiPath": "",
  "basename": "/webapps/3dfindit-enterprise",
  "erp": true,
  "startRoute": "CadBim",
  "isEnterprise": true,
  
  "toolbars": {
    "viewer": ["exampleButton"],
    "table": ["exampleVBSButton"],

    "mainMenuIcon": "./plugins/img/3dFinditEyeColor.svg",
    "mainMenu": [
      ["customButton1_Group1", "customButton2_Group1", "customButton3_Group1"],
      ["customButton1_Group2", "customButton2_Group2", "customButton3_Group2"]
    ],
    "noResults": ["customButton1", "customButton2", "customButton3"],
    "searchResults": ["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"
        }
      },

      "customButton1_Group1": {
        "type": "VBS",
        "icon": "./plugins/img/3dFinditEyeColor.svg",
        "name": {
          "de-DE": "custom button 1 de",
          "en-GB": "custom button 1 en"
        },
        "script": "/plugins/vbb/custom1_startup.vbs",
        "tooltip": {
          "de-DE": "custom button 1 de",
          "en-GB": "custom button 1 en"
        }
      },
      "customButton2_Group1": {
        "type": "VBS",
        "icon": "./plugins/img/3dFinditEyeColor.svg",
        "name": {
          "de-DE": "custom button 2 de",
          "en-GB": "custom button 2 en"
        },
        "script": "/plugins/vbb/custom2_startup.vbs",
        "tooltip": {
          "de-DE": "custom button 2 de",
          "en-GB": "custom button 2 en"
        }
      },
      "customButton3_Group1": {
        "type": "VBS",
        "icon": "./plugins/img/3dFinditEyeColor.svg",
        "name": {
          "de-DE": "custom button 3 de",
          "en-GB": "custom button 3 en"
        },
        "script": "/plugins/vbb/custom1_startup.vbs",
        "tooltip": {
          "de-DE": "custom button 3 de",
          "en-GB": "custom button 3 en"
        }
      },

      "customButton1_Group2": {
        "type": "VBS",
        "icon": "./plugins/img/3dFinditEyeColor.svg",
        "name": {
          "de-DE": "custom button 1 de",
          "en-GB": "custom button 1 en"
        },
        "script": "/plugins/vbb/custom1_startup.vbs",
        "tooltip": {
          "de-DE": "custom button 1 de",
          "en-GB": "custom button 1 en"
        }
      },
      "customButton2_Group2": {
        "type": "VBS",
        "icon": "./plugins/img/3dFinditEyeColor.svg",
        "name": {
          "de-DE": "custom button 2 de",
          "en-GB": "custom button 2 en"
        },
        "script": "/plugins/vbb/custom2_startup.vbs",
        "tooltip": {
          "de-DE": "custom button 2 de",
          "en-GB": "custom button 2 en"
        }
      },
      "customButton3_Group2": {
        "type": "VBS",
        "icon": "./plugins/img/3dFinditEyeColor.svg",
        "name": {
          "de-DE": "custom button 3 de",
          "en-GB": "custom button 3 en"
        },
        "script": "/plugins/vbb/custom1_startup.vbs",
        "tooltip": {
          "de-DE": "custom button 3 de",
          "en-GB": "custom button 3 en"
        }
      },

      "customButton1": {
        "type": "VBS",
        "icon": "./plugins/img/3dFinditEyeColor.svg",
        "name": {
          "de-DE": "custom button 1 de",
          "en-GB": "custom button 1 en"
        },
        "script": "/plugins/vbb/custom1_startup.vbs",
        "tooltip": {
          "de-DE": "custom button 1 de",
          "en-GB": "custom button 1 en"
        }
      },
      "customButton2": {
        "type": "VBS",
        "icon": "./plugins/img/3dFinditEyeColor.svg",
        "name": {
          "de-DE": "custom button 2 de",
          "en-GB": "custom button 2 en"
        },
        "script": "/plugins/vbb/custom2_startup.vbs",
        "tooltip": {
          "de-DE": "custom button 2 de",
          "en-GB": "custom button 2 en"
        }
      },
      "customButton3": {
        "type": "VBS",
        "icon": "./plugins/img/3dFinditEyeColor.svg",
        "name": {
          "de-DE": "custom button 3 de",
          "en-GB": "custom button 3 en"
        },
        "script": "/plugins/vbb/custom1_startup.vbs",
        "tooltip": {
          "de-DE": "custom button 3 de",
          "en-GB": "custom button 3 en"
        }
    }
  }
}
}