There are four steps required to add an Analysis to the Analysis Framework.
First, one must create a new Analysis Description file for the Analysis. This will require knowledge of the parameters, outputs, and runtime requirements of the Analysis to be implemented.
Second, one must implement the Analysis as a Task. Pick the appropriate base class and implement the required methods. Remember that the keys given to the parameters in the Analysis Description must match the set
methods in this class.
ncsa.analysis.newAnalyses
extension pointThird, register this extension. Remember that the id here must match the id given in the Analysis Description and the tag must match the tag in the ncsa.tools.ogrescript.ogreTasks
extension point.
ncsa.tools.ogrescript.ogreTasks
extension point.Lastly, register the Task with this extension point. Remember that the tag here must match the tag given in the ncsa.analysis.newAnalyses
extension point above.
The Analysis Description file provides detailed information about the various sections of an Analysis.
<analysis-description>
NAME |
DEFAULT VALUE |
DESCRIPTION |
---|---|---|
id |
(required) |
This id MUST match the id given to the Analysis in the |
NAME |
REQUIRED |
CARDINALITY |
DESCRIPTION |
---|---|---|---|
<analysis-type> |
(required) |
1 |
|
<custom-script> |
(optional) |
0-1 |
|
<groups> |
(required) |
1 |
|
<parameter> |
(optional) |
0-many |
|
<output> |
(optional) |
0-many |
This element has no text.
<analysis-type>
NAME |
DEFAULT VALUE |
DESCRIPTION |
---|---|---|
type |
(required) |
Defines how this analysis is to be executed, currently supports |
NAME |
REQUIRED |
CARDINALITY |
DESCRIPTION |
---|---|---|---|
<property> |
(optional) |
0-many |
a |
This element has no text.
<analysis-type type="simpleIteration"> <property name="iteratingDatasetKey" value="bridgeDamage" /> </analysis-type> |
<custom-script>
This element has no attributes.
This element has no children.
Defines a location for a custom OgreScript to use instead of auto-generating one. The format for this script will be defined on a separate page. This location is relative to the bundle in which the analysis is shipped.
<custom-script>scripts/ogrescript-bridgeFunc.xml</custom-script> |
<groups>
Groups are used to associate like <parameter>
elements together. There are two <group-name>
elements which have special meaning to the framework.
Required
Advanced
- Any <parameters>
elements which are associated with the Advanced
group will not be shown by default.This element has no attributes.
NAME |
REQUIRED |
CARDINALITY |
DESCRIPTION |
---|---|---|---|
<group-name> |
(required) |
1-many |
Group to which the parameters can be associated. |
This element has no text.
<groups> <group-name>Required</group-name> </groups> |
<parameter>
NAME |
DEFAULT VALUE |
DESCRIPTION |
---|---|---|
group |
(required) |
a string which must match a member of |
format |
(required) |
the type of the parameter, currently supports |
cardinality |
(required) |
how many of this type, currently supports |
key |
(required) |
name of property for which value should be added |
friendly-name |
{required) |
name of property for which value should be added |
NAME |
REQUIRED |
CARDINALITY |
DESCRIPTION |
---|---|---|---|
<types> |
(optional) |
0-many |
A list of types that are accepted by this |
This element has no text.
<parameter group="Required" format="dataset" cardinality="single" key="functionalityTable" friendly-name="Functionality Table"> <types> <type>bridgeFunctionality</type> </types> </parameter> |
<output>
An <output>
of type dataset
requires two <property>
elements.
base-dataset-key
- The key of the <parameter>
which is the base for this new Datasetschema
- The id of the schema that this Dataset implements.NAME |
DEFAULT VALUE |
DESCRIPTION |
---|---|---|
format |
(required) |
the type of the parameter, currently supports |
key |
(required) |
name of property for which value should be added. No spaces allowed. |
friendly-name |
{required) |
name of property for which value should be added |
NAME |
REQUIRED |
CARDINALITY |
DESCRIPTION |
---|---|---|---|
<property> |
(optional) |
0-many |
a |
This element has no text.
<output friendly-name="Bridge Functionality" key="bridgeFunctionality" format="dataset"> <property name="base-dataset-key" value="bridgeDamage" /> <property name="schema" value="ncsa.maeviz.schemas.bridgeFunctionalityResults.v1.0" /> </output> |
Each Analysis MUST implement a class which extends ncsa.analysis.maeviz.ogrescript.tasks.core.SimpleFeatureTask.
In the future a choice of base class based on the specific implementation required will be available.
There are two required abstract methods.
protected abstract void preProcess() throws ScriptExecutionException; protected abstract void handleFeature( IProgressMonitor monitor ) throws ScriptExecutionException; |
For each <parameter>
there must be a corresponding set
method which corresponds to the key
attribute in the <parameter>
.
Example:
<parameter group="Required" format="dataset" cardinality="single" key="functionalityTable" friendly-name="Functionality Table" /> public void setFunctionalityTable( Dataset d ); |
The handleFeature
method is responsible for two things. First is computing the values that are to be added to the new Feature. Second is to populate the resultMap
.
Example:
resultMap.put( COL_LS_SLIGHT, dmg[0] ); resultMap.put( COL_LS_MODERATE, dmg[1] ); |
As a best practice, add public final static
constants for each column in the Feature.
ncsa.analysis.newAnalyses
extension pointEach Analysis must register an extension with the ncsa.analysis.newAnalyses
extension point. This registration allows the Analysis Framework to find all Analyses automatically.
NAME |
DEFAULT VALUE |
DESCRIPTION |
---|---|---|
id |
(required) |
This id MUST match the id given in the |
name |
(required) |
This is the "friendly name" of the Analysis and should be i18n |
tag |
(required) |
The tag MUST match the tag in the |
descriptor |
(required) |
This points to the descriptor file. |
ncsa.tools.ogrescript.ogreTasks
extension pointEach Analysis must register its implementing class with the ncsa.tools.ogrescript.ogreTasks
extension point.
NAME |
DEFAULT VALUE |
DESCRIPTION |
---|---|---|
id |
(required) |
This id SHOULD match the fully qualified class name of the task |
name |
(required) |
This is the "friendly name" of the Task and should be i18n |
tag |
(required) |
The tag MUST match the tag in the |
class |
(required) |
This points to implementing class. |