Appendix A: Trestle®/Dino Script® Integration
A: Commands
Each Dino Script™ can either be applicable to any record type, or to a specific record type. Here we are going to create a new script called "Dino Cookbook" (if you are working on a system where mult…
A: Table of Contents
Introduction. Commands. Creating/Running a Command. Command Arguments. Advanced Command Arguments. Files. Host and Target. Anatomy of a Script Event. Dynamic and DynamicProxy. System Logs. Direct Lin…
A: Dynamic and DynamicProxy
Dynamic Properties and the DynamicProxy Class. Dino Scripts™ are ideal for reporting. However, just returning a set of built-in objects is rarely enough to generate a report that will make sense to t…
A: Advanced Command Arguments
Parameter Declarations and the Trestle® Environment. We are going to be jumping ahead a bit here, so don't worry if you don't understand this next section of code completely. All the potential pitfal…
A: Introduction
Dino is not intended as a standalone language; rather it is a "script-integrated" system. This appendix will consider how Dino integrates into the Trestle framework. Trestle is an ORM (object-relatio…
A: Files
File Uploads in Commands. Commands can also provide controls for file uploads. The handling for files must be somewhat different than for simple strings and numbers, because uploading a file involves…
A: Direct Links - URLs and Downloads
A Dino command record can be marked as a link. This command should be connected to a command function that takes no arguments and returns a string that will be interpreted as a link. When this type o…
A: Running SQL Queries
Harmony provides Dino with extensions and convenience classes to execute arbitrary SQL queries and return dynamic objects. Using the techniques outlined in Parameter Declarations and the Trestle Envi…
A: NPOI and Excel, DocX and Word
Beyond simply using the host.excel() method, there are many ways to run queries or get lists of records and populate Excel files for download. The host.excel() method is great for a quick, single-she…
A: Embedded Apps with MS Access Files
Microsoft Access files can be uploaded then manipulated using OleDb , which is a database driver that can access various types of database engines. For all these examples, we'll be using this uploade…
A: Returning JSON Data
Dynamic objects, even hierarchies of dynamic objects, can be easily converted to JSON using the Newtonsoft JSON class library. Lists that are properties of the dynamic object will become arrays in th…
A: Host and Target
Storing the User's Previous Entries. There are times we would like to persist the user's last entries across invocations of the same command. Harmony extends Dino to allow setting user data that pers…
A: Command Arguments
Adding Arguments. Our first command does not require any input from the user other than pressing the Run button. Commands are usually more useful if we can collect some information from the user. Let…
A: Creating/Running a Command
Writing a Command Function. A command function in Harmony is simply a Dino function with a specific signature. The function name starts with the letters "cmd" (lowercase). It can be defined with any…