| Integration How To Supply Custom Parameters |
|
Most integrations require some form of user input to alter runtime processing of a query.
This short document explains and demonstrates a popular example. This example shows you how to create a unix jsp page or aspx page that accepts user input for nextanalytics to modify the nextanalytics runtime processing. After this step is complete, you, the customer, can choose from a variety of open source techniques to display or store the results (this is the subject of a different entry). User InterfaceLet’s start by specifying a page that shows in a browser that has the following form. This will allow us to gather the user preferences of how they want a comparison made and which type of calculation to make.
When they click the Submit button, the user’s choices is supplied to the next browser page. The next snippet is code that’s embedded in the second browser page. It extracts the user’s preferences and modifies the query on the fly and submits it. First, it uses traditional java code to get the values:
Then it incorporates it into a three line nextanalytics script:
These three lines are submitted to the nextanalytics engine one at at time and nextanalytics processes each one in turn. The first line loads the data, the second line performs a FilterByValue command, and the third line assigns a self-explanatory title to the finished result for the end-user to see what they chose. Supply Custom Parameters to a SQL Command Before ExecutionMany people might have wanted to submit a SQL command instead of loading a CSV formatted file (as shown above. Here is the code snippet again, this time adding the data as a SQL Command:
Like the first example, it extracts some values that were entered by the user. But then it differs. It uses some of the user supplied values to define a SQL command "on-the-fly". What we mean by that it is that it supplies a user id and password and a value to use in a where clause. Being able to modify query results is a very common requirement in many integrations. Displaying the resultsnextanalytics offers several ways for the programmer to show the results to the end user. Explaining the different choices are out of the scope of this document. But, to give you something to think about, here is a list of things you might want to do:
If you search your download, you’ll find plenty of code to do this that you can modify. We also recommend you search our web site, particularly the forums (search the words shown above). You will find various explanations and examples on how to do all of the foregoing. |
| < Prev | Next > |
|---|