Difference between revisions of "ADE Server Class Reference"

(Marked this version for translation)
(Make ADE«ver» adapt to ver)
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
[[Category: Analytica Decision Engine]]
 
[[Category:ADE User Guide]]
 
[[Category:ADE User Guide]]
 +
{{ReleaseBar}}
 +
 
<languages />
 
<languages />
 
<translate>
 
<translate>
Line 6: Line 9:
  
 
<!--T:2-->
 
<!--T:2-->
The ADE server classes are [[CAEngine]], [[CAObject]], [[CATable]], [[CAIndex]],[[CARenderingStyle]], [[CALicense]], and [[IAdeUICallbacks]]. They are listed below in that order, with a short description each class.
+
These are the ADE server classes:
  
=CAEngine= <!--T:3-->
+
*[[CAEngine]] class contains methods and properties that allow you to open and close existing models, create new models, create new Analytica objects, and access Analytica objects contained in your model. Use of ADE really starts with the creation of a CAEngine object, from which all else flows.
See full article at [[CAEngine]].
+
*[[CAObject]] is ADE's wrapper for an Analytica object, such as a variable or module. It provides access the the object's attributes, including its definition and result. It often is used as a stepping stone for obtaining a variable's result table.
 +
*[[CATable]] provides the equivalent of an intelligent array. It is used to wrap an Edit Table, allowing your program to change cell values, or a result array, allowing you to access individual cells, slices, or even a graph image of the result.
 +
*[[CAIndex]] provides information about the index of a [[CATable]].
  
<!--T:4-->
+
*[[CARenderingStyle]] controls how atomic values are returned by ADE methods and properties. For example, you may want numbers returned numerically, or as formatted text. A [[CARenderingStyle]] is already present as a property on any [[CAObject]] or [[CATable]]. Separate default [[CARenderingStyle]] for both [[CAObject::DefTable|DefTables]] and [[CAObject::ResultTable|ResultTables]] are maintained on [[CAEngine::DefaultDefTableRenderingStyle]] and [[CAEngine::DefaultRenderingStyle]].  
[[CAEngine]] class contains methods and properties that allow you to open and close existing models, create new models, create new Analytica objects, and access Analytica objects contained in your model. Use of ADE really starts with the creation of a CAEngine object, from which all else flows.
+
  
=CAObject= <!--T:5-->
+
*[[CALicense]] provides a method for instantiating a [[CAEngine]], and provides details about why such an instantiation failed, which would otherwise not be available if you instantiate the [[CAEngine]] directly. It also provides some information about limitations in your license to use [[ADE]].
See full article at [[CAObject]].
+
  
<!--T:6-->
+
*[[CAPicture]] holds an in-memory image atom when a result, or the cell of a result, is an image.
A [[CAObject]] is ADE's wrapper for an Analytica object, such as a variable or module. It provides access the the object's attributes, including its definition and result. It often is used as a stepping stone for obtaining a variable's result table.
+
  
= CATable= <!--T:7-->
+
*[[CAGraphPivot]] provides information about the current pivot state of a graph, possible next pivots, and allows you to change the pivot of a graph.
See full article at [[CATable]].
+
*[[CAFiller]] represents a graphing dimension for [[CAGraphPivot]]'s graphing roles.
  
<!--T:8-->
+
*[[IAdeUICallbacks]] is an interface that allows you to implement callbacks that are called when Analytica functions requiring user input are evaluated. You can implement these callbacks to support these user interface interactions in your own application. In many cases, the name of each method corresponds fairly directly with the name of the Analytica function that produces the user interaction. When your application does not implement this interface, most of the functions requiring user interaction will do nothing when evaluated in ADE.
ADE's [[CATable]] class provides the equivalent of an intelligent array. It is used to wrap an Edit Table, allowing your program to change cell values, or a result array, allowing you to access individual cells, slices, or even a graph image of the result.
+
  
= CAIndex = <!--T:9-->
+
*[[IAdeUIWindowCallbacks]] is an interface which contains the ShowWindow() and CloseWindow() functions, and which is called when sending older typescript "Show windowType obj" and "Close windowType obj" commands. This allows the use of these commands in a more general fashion, including cases where scripts appear in conditionals, in functions, etc. When your application does not implement this interface, these newer functions will do nothing when evaluated in ADE, and the script commands will perform as in earlier releases.
See full article at [[CAIndex]].
+
<br/>
  
<!--T:10-->
+
The "IAde" prefix stands for "Interface ADE".  Your own code can define a class that subclasses this interface and implements its method, and then pass it to [[CAEngine::SetCallbackObject]].
The [[CAIndex]] class provides information about the index of a [[CATable]].
+
  
=CARenderingStyle= <!--T:11-->
 
See full article at [[CARenderingStyle]].
 
  
<!--T:12-->
 
A [[CARenderingStyle]] controls how atomic values are returned by ADE methods and properties. For example, you may want numbers returned numerically, or as formatted text. A [[CARenderingStyle]] is already present as a property on any [[CAObject]] or [[CATable]]. Separate default [[CARenderingStyle]] for both [[CAObject::DefTable|DefTables]] and [[CAObject::ResultTable|ResultTables]] are maintained on [[CAEngine::DefaultDefTableRenderingStyle]] and [[CAEngine::DefaultRenderingStyle]].
 
 
=CALicense= <!--T:13-->
 
See full article at [[CALicense]].
 
 
<!--T:14-->
 
The [[CALicense]] provides a method for instantiating a [[CAEngine]], and provides details about why such an instantiation failed, which would otherwise not be available if you instantiate the [[CAEngine]] directly. It also provides some information about limitations in your license to use [[ADE]].
 
 
=IAdeUICallbacks= <!--T:15-->
 
See full article at [[IAdeUICallbacks]].
 
 
<!--T:16-->
 
 
''New to [[Analytica 4.6|ADE 4.6]]''
 
''New to [[Analytica 4.6|ADE 4.6]]''
  
<!--T:17-->
+
== Examples == <!--T:20-->
This interface allows you to implement callbacks that are called when Analytica functions requiring user input are evaluated. You can implement these callbacks to support these user interface interactions in your own application. In many cases, the name of each method corresponds fairly directly with the name of the Analytica function that produces the user interaction.
+
 
+
<!--T:18-->
+
When your application does not implement this interface, most of the functions requiring user interaction will do nothing when evaluated in ADE.
+
 
+
<!--T:19-->
+
The "IAde" prefix stands for "Interface ADE".  Your own code can define a class that subclasses this interface and implements its method, and then pass it to [[CAEngine::SetCallbackObject]].
+
 
+
= Examples = <!--T:20-->
+
  
== PHP == <!--T:21-->
+
<!--T:21-->
 
The attached PHP script:
 
The attached PHP script:
 
#Creates an instance of ADE.
 
#Creates an instance of ADE.
Line 72: Line 48:
  
 
  <!--T:22-->
 
  <!--T:22-->
<?php
+
<?php
 
     $currentPath = getcwd()."\\";
 
     $currentPath = getcwd()."\\";
     $ade = new COM("ADE4.CAEngine") or die("Unable to instantiate ADE");
+
     $ade = new COM("ADE{{#svarget:anamajor|6}}.CAEngine") or die("Unable to instantiate ADE");
 
     echo "ADE successfully loaded.\n";
 
     echo "ADE successfully loaded.\n";
 
     $modelCreated = $ade->CreateModel("MyNewModel");
 
     $modelCreated = $ade->CreateModel("MyNewModel");

Latest revision as of 23:22, 26 January 2021



Release:

4.6  •  5.0  •  5.1  •  5.2  •  5.3  •  5.4  •  6.0


Other languages:
English • ‎中文

ADE User Guide >

These are the ADE server classes:

  • CAEngine class contains methods and properties that allow you to open and close existing models, create new models, create new Analytica objects, and access Analytica objects contained in your model. Use of ADE really starts with the creation of a CAEngine object, from which all else flows.
  • CAObject is ADE's wrapper for an Analytica object, such as a variable or module. It provides access the the object's attributes, including its definition and result. It often is used as a stepping stone for obtaining a variable's result table.
  • CATable provides the equivalent of an intelligent array. It is used to wrap an Edit Table, allowing your program to change cell values, or a result array, allowing you to access individual cells, slices, or even a graph image of the result.
  • CAIndex provides information about the index of a CATable.
  • CALicense provides a method for instantiating a CAEngine, and provides details about why such an instantiation failed, which would otherwise not be available if you instantiate the CAEngine directly. It also provides some information about limitations in your license to use ADE.
  • CAPicture holds an in-memory image atom when a result, or the cell of a result, is an image.
  • CAGraphPivot provides information about the current pivot state of a graph, possible next pivots, and allows you to change the pivot of a graph.
  • CAFiller represents a graphing dimension for CAGraphPivot's graphing roles.
  • IAdeUICallbacks is an interface that allows you to implement callbacks that are called when Analytica functions requiring user input are evaluated. You can implement these callbacks to support these user interface interactions in your own application. In many cases, the name of each method corresponds fairly directly with the name of the Analytica function that produces the user interaction. When your application does not implement this interface, most of the functions requiring user interaction will do nothing when evaluated in ADE.
  • IAdeUIWindowCallbacks is an interface which contains the ShowWindow() and CloseWindow() functions, and which is called when sending older typescript "Show windowType obj" and "Close windowType obj" commands. This allows the use of these commands in a more general fashion, including cases where scripts appear in conditionals, in functions, etc. When your application does not implement this interface, these newer functions will do nothing when evaluated in ADE, and the script commands will perform as in earlier releases.


The "IAde" prefix stands for "Interface ADE". Your own code can define a class that subclasses this interface and implements its method, and then pass it to CAEngine::SetCallbackObject.


New to ADE 4.6

Examples

The attached PHP script:

  1. Creates an instance of ADE.
  2. Creates a new model.
  3. Creates a Variable Object.
  4. Modifies the definition of the created Variable to '4+1*7'.
  5. Get the result back from the created object and prints it out.
  6. Saves the created model to a file 'TestModel.ana' in the current directory.
  7. Closes the model.
 <?php
    $currentPath = getcwd()."\\";
    $ade = new COM("ADE5.CAEngine") or die("Unable to instantiate ADE");
    echo "ADE successfully loaded.\n";
    $modelCreated = $ade->CreateModel("MyNewModel");
    if($modelCreated == true){
        echo "Model successfully created.\n";

        $newObject = $ade->CreateObject("MyVariable", "Variable");
        $newObject->SetAttribute("Definition", "4+1*7");

        $result = $newObject->Result();
        echo "The new object's result is: ". $result .".\n";

        $ade->SaveModel($currentPath."TestModel.ana");
        $ade->CloseModel();
        echo "Model succussfully closed.\n\n";
    }
    else{
        echo "Model creation failed.\n\n";
    }
?>

See Also

Working with Models, Modules, and Files in ADE <- ADE Server Class Reference -> CAEngine
Comments


You are not allowed to post comments.