2023.1:Grooper Scripting - CSS Utilities

From Grooper Wiki
Revision as of 15:36, 5 June 2024 by Randallkinard (talk | contribs) (first update including "About" and beginnings of "How To" // via Wikitext Extension for VSCode)

This article is about an older version of Grooper.

Information may be out of date and UI elements may have changed.

20252023.1

Gain familiarity with the Grooper object model by scripting real world examples and see how commonly used namespaces and their members are leveraged.

About

Before we begin, it is highly recommend to review the contents of the Remote Scripting Setup article. In this article you will learn how to configure your environment with the Grooper SDK so that you can leverage your web browser as a debug target for Grooper scripts. You will also see how the Grooper SDK is used to push the files of your local solution to the target object in Grooper so that it may be properly compiled within the application.

The purpose of this article is to walk you through an example of creating a simple object command that will set CSS styling in the Style Sheet property of "DataFieldContainer" objects. In so doing we will get exposure the powerful Object Library object and its useful solution template functionality. This solution will then be used in Visual Studio 2019 to write the necessary code to accomplish the desired task. This will reveal namespaces and their members that are commonly used to expand the capabilities of Grooper via scripting.

The script we create will be fairly simple, but it will give you a foundation upon which you could very easily expand to increase it's capabilities and usefulness. In so doing you can make a powerful and easy to use tool you may end up using in your regular Grooper designing.

How To

In this section we will walk step-by-step through all the necessary actions to create our useful script and begin forming and understanding of how to write .NET scripts for use in Grooper.

Import Project Files and Create Object Library

The system this work will be done on is configured appropriately to debug and push files to Grooper via the Grooper SDK. Given that, the following is true:

  1. Open a compatible web browser (in this case Google Chrome is being used)
  2. In the URL box type localhost/Grooper/Design
  3. Select the "Projects" folder in the node tree
  4. Click the "Upload" button
  5. In the "ZIP File Import" dialog box click the "Choose File" button
  6. Browse to where you downloaded the Grooper ZIP file provided for this article, select the file, and click "Open"
  7. Back in the "ZIP File Import" dialog box click the "Upload" button to complete the upload


A "completed" version of the work we'll be doing is provided. It contains a compiled version of the solution attached to the Object Library we will create. If you wanted to use this you could simply refresh the "GrooperAppPool" and the object command would be available. However, for the purposes of this walkthrough it will be removed.

  1. Expand the folder of the imported object
  2. Right-click the 'completed' Project and select "Delete"
  3. In the "Delete" dialog box click the "Execute" button