2023.1:Scripting Setup: Difference between revisions

From Grooper Wiki
No edit summary
No edit summary
Line 91: Line 91:
[[image:2023_Remote-Scripting-Setup_02_How-To_14.png]]
[[image:2023_Remote-Scripting-Setup_02_How-To_14.png]]
<br><br>
<br><br>
When bebugging and testing your scripts the default page that will open in your browser will be the '''Grooper''' "Home" page. If you want to set this to a different page to save time, you can change the debug target to whichever page you prefer.
When debugging and testing your scripts the default page that will open in your browser will be the '''Grooper''' "Home" page. If you want to set this to a different page to save time, you can change the debug target to whichever page you prefer.
<br>
<br>
[[image:2023_Remote-Scripting-Setup_02_How-To_15.png]]
[[image:2023_Remote-Scripting-Setup_02_How-To_15.png]]

Revision as of 14:32, 17 November 2023

This article seeks to elucidate the requirements for setup of remote scripting in Grooper 2023.1.

About

.Net scripting is a fantastic way to expand the capabilities of Grooper but has historically been a procedure that was inherently tied to the machine that Grooper is installed on.

With Grooper 2023.1 scripting can now be done on a remote computer, compiled, and thanks to the Grooper SDK, uploaded to the Grooper server.

Understanding the Environment

Before we dive into how things are setup, let's take a look at what parts make up the demonstration environment. Variables in your environment will obviously be slightly different, but this is a basic setup that should work as a reasonable template.

Grooper Server

This is the main server that is hosting everything Grooper, and as such will be referred to as "Grooper Server". The following components are installed on this machine.

  • Grooper Software
    • Grooper software is installed on this computer normally. For more information on installing Grooper please visit the Install and Setup article.
  • Grooper Web Server
    • The Grooper Web Client is installed on this "Grooper Server" (along with the requisite installation and appropriate configuration of IIS) to allow remote computers to access the Grooper environment remotely without having to have Grooper installed on their machines.
  • Grooper Repository
    • The infrastructure that establishes a repository of information that the Grooper application points to consists of the following piece that are also installed on this "Grooper Server":
      • Grooper Filestore
        • Files associated with objects in Grooper reside here. This is a file directory located on this "Grooper Server"
      • SQL Server
        • Objects and their configurations are stored in tables in a SQL database that make the backbone of a Grooper repository.

Remote Scripting Computer

This is a generic workstation used by a developer wanting to do scripting for Grooper that is on the same network the "Grooper Server" is on, but it is not itself the "Grooper Server". The following Components are installed on this machine.

  • Grooper Software
    • This is installed on the computer because of the need to access Grooper code for the developer when compiling. SQL server is not installed on this machine, neither is the Filestore for Grooper so it is pointed at the remote repository (the repository hosted on the "Grooper Server") via Grooper Config.
  • Grooper Web Client
    • The Grooper Web Client is installed on the developer's machine so that they can have a debug target when creating their scripts. This is not the main webpage users will interact with to access Grooper. IIS is installed on this machine to facilitate the appropriate installation of the Grooper Web Client, but IIS Express (which is side-loaded when the Grooper SDK is added to Visual Studio) will actually be leveraged upon testing and debugging of scripts.
  • Visual Studio - with Grooper SDK
    • Visual Studio 2019 is the supported version for developing with Grooper 2023.1. From Visual Studio you can download and install the Grooper SDK.




Understaing Both

So, we have the "Grooper Server" and we have the "Remote Scripting Computer" and their requisite components on each. As stated, the Grooper Software and the Grooper Web Client are installed on the "Remote Scripting Computer" but the Grooper Repository is established on the "Grooper Server". The "Remote Scripting Computer" is simply referencing the repository as it exists on the "Grooper Server".

How To

With an understanding of what is established in this defacto environment we will now walk through the setup of creating, compiling, and sending a script to Grooper from a remote computer.

Establishing a Connection to the "Grooper Server" from the "Remote Scripting Computer"

As discussed, the "Remote Scripting Computer" has Grooper 2023.1, the Grooper Web Client, and Visual Studio 2019 installed, but itself is not hosting a Grooper repository. We will configure this machine to point at the Grooper repository that is being hosed by the "Grooper Server".

Follow the instructions in the screenshots below.







Installing and Configuring the Grooper SDK

We now have the ability to connect to the Grooper Repository hosted by the "Grooper Server", but before we do any work in Grooper, let's jump into Visual Studio to install and configure the Grooper SDK.

Follow the instructions in the screenshots below.

















The default setting for the Grooper SDK as an extension in Visual Studio is to automatically update. It is suggested by the development team to disable this option.

The Grooper SDK will not get updated frequently, but if it does, you do not want to automatically download the update as it would facilitate installing a new sub-version of Grooper. If your environment is stable it is best practice to not introduce unknown variables that may interfere with your setup.




When debugging and testing your scripts the default page that will open in your browser will be the Grooper "Home" page. If you want to set this to a different page to save time, you can change the debug target to whichever page you prefer.

Creating an Object Library and Local Project Files

There are five objects in Grooper where you can apply a custom script:

  • Batch Process
  • Data Model
  • Data Table
  • Data Type
  • Object Library

In the following example an Object Library will be created and a C# script applied to it.

Follow the instructions in the screenshots below.