Automate DataLink Process Using APIs

6.63K viewsGeneral Discussion
0

Hello

I have Quantrix Modeler 2.002.4X. I want to automate the process of DataLink. I have following questions.

Q1> I Loaded My Access Data Base Table in Quantrix But how can I can I save my record back to database after updating in Quantrix.

Q2>Can I create new fields in database table from Quantrix.

Q3>Can I update my existing database from Quantrix to Database and vise versa.

Q4>How to use APIs, any Hello world toturial?

If any one please provide me the starting point I will be thankfull.
Thanks in Advance

Abrar

0

My collegue, Peter Murray, has answered your post <a href=”http://www.quantrix.com/forums/showthread.php?threadid=177″><strong> in this thread</strong></a>. Thank you for your interest in Quantrix.

-Mike

0

Hello Quantrix QA & lerzegov

First of all thank you very much for all the favors. With your help I am able to make a simple plugin application “Hello World”.

Now I want to shift my track that leads to my goal. Actually I want to use Quantrix in my application. I want to populate quantrix from my database application.

My first step is to Automate Data Link process. From my database application I will select the SQL Server Data base table and I want to see this table in Quantrix as we do in DataLink.
It means my database application will populate the quantrix.

Can I have any good suggestions before start.
Can I call some pre-written functions that quantrix calls in DataLink Process.
Can some one guid me?

Thanks
Abrar

0

I think I had this problem when I was trying this out. I found that if I copied and pasted from the PDF to eclipse the VM Arguments line (–Xss2M…) the paste put something in the line it didn’t like. The line looked OK but Quantrix would not run in Eclipse.

I just ended up clearing the vmarguments line and just retyping the arguments from the keyboard & then Quantrix loaded OK from Eclipse.

-Mike

0

Hello

Thanks for the excellent help provide by Mike and Lerzegov.

I have downloaded PDF from

[url:30m4zdfg]http://www.quantrix.com/download.php[/url:30m4zdfg]

I have followed all the steps written in PDF but when i Run the programme
(Run| Run | New_Configuration). It gives me error as follows

Can not find the main class
java.lang.NoClassDefFoundError: –Xss2M
Exception in thread “main”

But if I export the project to Quantrix Plugins (C:Program FilesQuantrix Modeler – in my case) and then launch Quantrix seprately then I can see my plugin is installed and working.

Can you guess which mistake i am doing.
Thanks
Abrar

0

Thanks for your excellent suggestion Luca. CTRL-SHIFT-O is an Eclipse keyboard shortcut to add the appropriate import statements to the java file. I have updated the PDF and posted to the download page of the website.

-Mike

0

Thanks for the note on “Building a sample plugin”.
It guides you clearly through the steps needed to have your first action plugin running.
Just a minor suggestion in order to make it even more helpful for absolute Java beginners: I would add a step telling to insert

import javax.swing.*;
import.java.awt.*;

in the .java file.

For people like me, used to visual basic, the java GUI is the real obstacle, and even the most obvious import directives are not to be taken for granted.

0

Thanks Luca and Abrar for your posts. To aid initial QAPI users, we have just published a “Hello World’ QAPI starter document on our download page.

[url:28sufedf]http://www.quantrix.com/download.php[/url:28sufedf]

This should help get folks started with the Quantrix QAPI.

-Mike

0

GreatAbrar:
you should have Quantrix 2.0 professional installed
Bye

0

Hi GreatAbrar,
good to know that you are an experienced Java programmer. I am not, and had to step over several stumbling blocks before having QAPI working. The main source of problems was my attempt to “tweak” eclipse configuration adding references to Quantrix jars manually. If QAPI plugin development is properly configured, you don’t have to touch anything in Project Properties in order to use QAPI. You have to add jars to java build path only if you use external libraries (eg, in another plugin I did it in order to use dom4j).
Eclipse 3.1.1 is the same version I use.

The steps for importing the simple project I enclosed to the previous message into Eclipse are the following:

0a. Configure Eclipse to build Quantrix Plugins via QAPI as from Pete Murray’s note (I enclosed it in the QAPIstart.zip attachment to my previous message);

0b. unzip file “it.unitn.luca.function.zip” (also in QAPIstart.zip) in a temporary directory

1. In Eclipse, create a new Java project:
– File | New | Project
– select “Java Project” from the dialog, then click Next
– assign to the project the name “it.unitn.luca.function” (any other name should be OK)
– an empty project is enough, so leave other choices to their default values and click Finish

2. Import existing source into eclipse
– File | Import
– select “File system” from the dialog, then click Next
– in the “from directory” text box , select the directory “it.unitn.luca.function” browsing to the temp dir where you unzipped it
– in the directory tree immediately below, on the left, check “it.unitn.luca.function”
– click Finish

3. Run Quantrix in debug mode from Eclipse
– Run | Debug
– in the “Configuration” tree at the left, select the configuration that should have been created in step 0a
– click Debug (it should launch an empty model in Quantrix)

4. test add14() function in Quantrix
– add two column items (A2 and A3)
– input any two numbers in A1 and A2
– create the formula: “A3 = add14(A1,A2)
it should return A1 + A2 + 14

Hope this helps. If you have it running, than you should import and have a look at the more significant plugins that are available from Quantrix site. You are familiar with Java event programming and Swing, so you will be much more proficient than I am with QAPI actions.

Cheers

0

Hello Lerzegov

Thank you very much for your great help. But unfortunately I could not run Hello World Programme till now. I have Eclipse 3.1.1 and Quantrix 2.0 Trial Version. I have tried to run your code but I could not. I am a biggner for Eclipse though I am a good java programmer – mostly I use JBuilder.

Can you please send me step by step toturial to make hello world plugin for Quantrix 2.0 using Eclipse or JBuilder.
I would really appriciate you help.

Thanks
Abrar

0

Here’s my contribution to Q4.
I have done some experiments with QAPI. The programming interface has a clever design and is powerful. However, it has a steep learning curve. actually there is not a QAPI user guide, but Quantrix support (Pete Murray in person) has provided excellent assistance compensating for that. QAPI is not sort of a macro language, it is an API for using Quantrix objects from a Java program and for integrating 3rd party Java libraries into Quantrix: a basic knowledge of Java, and of the Eclipse development environment, is a prerequisite.

How to start using QAPI? Here is what I learnt from my personal experience:
a) print and browse through the QAPI documentation, just to have an idea of the classes corresponding to the main Quantrix objects and their capabilities (e.g. Model, TableView, Range, Node)
b) start having a look at the example QAPI plugins downloadable from Quantrix site (not the marketdata plugin, that’s too complex!), the calculator plug-in downloadable at [url:3ds7gil5]http://www.quantrix.com/r-doc-3-33-68[/url:3ds7gil5] is a good starting point;

c) configure Eclipse for programming and debugging Quantrix plugins; when I did my first experiments the published “Configuring Eclipse to access the Quantrix API” was specific to 1.2 release. Quantrix support sent me a document describing how to configure Eclipse for use with 2.x. I enclose that note to this post.

d) create and test your first plugin; you can add your own user defined functions to Quantrix or automate tasks with actions; functions are simpler, because you do not have to manage user interface events. I enclose the project for my first one, add14(), which simply adds a constant value of 14 to its argument.

e) action are more difficult, especially if you want to add GUI behavior such as screen updating, dialogs, message boxes, etc. For your case (updating an external DB from Quantrix, not the easiest point to start from, actually) actions are what is needed. I have programmed “procedural” actions, reading a xml file, preprocessing its content, importing it into a matrix with datalink, adding formulas, performing recalculations, formatting ranges, etc. I don’t have a ready “Hello world” example for actions, but it could be done easily if you need one.

Please note that in order to have your functions and actions visible and running properly in Quantrix, you have to configure their properties in the plugin.xml file for your plugin. It is an intuitive procedure.

Hope this helps, maybe someone else has more specific clues.

Attachments

qapistart.zip