Need an account? Click to Register
Home arrow Learn arrow Tutorials arrow All about scripts - OpenAuthorMode.aspx
All about scripts - OpenAuthorMode.aspx

In this first lesson, we start with an explanation of nextanalytics scripting. It is fundamental to understanding the core advantages of using nextanalytics with your BI tools, charting packages and spreadsheets.

Scripts commands tell the analytic engine what to do but, more importantly, the scripts execute one line at a time such the results from one command automatically becomes the input to the next command. This simple approach to sequential data processing has tremendous advantages over query and formula based products. Since the script commands act on the current page, regardless of where it came from, they tend to be highly portable and easily be re-used with other sets of data.

Running a Project Script

When you launch OpenChooseProject.aspx, the list of files is obtained from the projects directory as configured in your nextanalytics installation. When you select a project file name from the list, the project's script is run, and the resulting 'pages' are shown. To invoke OpenAuthorMode.aspx, all that you need to do is click the Edit button.

Once in Author mode, you can see the most recent page from the script (we call this the "Selected Page" in our scripting terminology). It also has a Dropdown list of other pages, in case you want to select a different page.

Creation of Scripts - OpenAuthorMode.aspx

Project script files are simple text files, and can be editted with any text editor. In most solutions, scripts can be recorded using the user interface program, OpenAuthorMode.aspx (.Net version). The benefit of this approach is that Author mode has a wide range of user friendly dialog boxes which thoroughly explain the parameters for each command. When you make a change, the data is processed and you can see the new script entries in the script window below the Run/Save button. The script window lets you see the script that was generated by menu selections.

(Click the image to zoom)

You can change the script directly in the script window and click the Run/Save button to run it. As you get more comfortable with the product, you may find that you tend to work more and more in the script window. The dialog boxes become useful for experimenting with parameters to see the effect and to learn what the syntax was for a particular script command. After you have saved a project file, you will be able to see the project file name from within OpenChooseProject.aspx.

Since the product is running in a web environment, the 'undo' function is simply your browser's Back button. Click Back until you see the state desired, then click the Run/Save button to update your project file.

Deploying a List of Projects 

If you are planning a deployment to a user base, it might not be your preference to deploy OpenChooseProject.aspx. 

The architecture lends itself to a great deal of flexibility. All that you need to do, is arrange a programmer to supply the script as text or reference a project file name to the analytic engine. When you do this, the data processing automatically occurs and the resulting data is available for a wide variety of uses. Since our product is open source, the output can easily be customized to suit your needs.

Our open source user interfaces can be customized by a programmer. We have separate tutorials on how to do this, as well as a forum for FAQ and Q+A.  This is also a place where you can introduce yourself as a programmer or meet programmers to form business relationships. The nextanalytics architecture and scripts mean that you can safely rely on someone to contribute to your projects and user interfaces without having to share your confidential data.

Planning Your First Project

While reading the topics in this tutorial, you might be tempted to work with your own CSV file.  This section will explain our recommendation on how you would do that.   The first step will be to open an existing project, make changes to it, and save it under a new filename.  That's the easiest way to start.  Here is an overview of the best way to do that.

Be sure to press the Save/Run button to save the project to a file name that you will recognize.  After that, you can come back to it in future sessions.  If you experiment with the dialog boxes, you will see the effects of your actions appearing in the script text box. Those changes are not saved until you press Run / Save button. 

The reason that we require you to press the Save/Run button is so that you can press your browser's Back button to undo the changes made from a dialog box. This makes it easy for you to experiment and learn.

How to Handle Mistakes in a Script

If you have edited the script directly and then pressed the Save/Run, it is inevitable that you will make a typing mistake that causes a script error. The following describes how you should handle that.  When an error occurs, it will look like the following screen:

All that you need to do to fix the error is fix your typing mistake and then press the Save/Run button:

If you can't recover this way, you can always edit the text file directly with a program that can read and write text files. 

Conclusion 

Now let's go learn some script commands. We're going to start with the basics and build. There are over a hundred functions or operations you could learn about. We've decide to group that into about thirty to forty topics. They're not dependent, so you can skim or skip areas that you're not interested in.

You can search the site (as well as the entire internet) for one of our topics.  Chances are that a reference topic exists, as well multiple examples will likely show up in the search.
 
< Prev   Next >