Date: Thu, 28 Mar 2024 16:07:49 -0500 (CDT) Message-ID: <577581065.1434.1711660069904@wiki.ncsa.illinois.edu> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_1433_938648963.1711660069902" ------=_Part_1433_938648963.1711660069902 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
An analysis itself can also be extended by use of the ncsa.analy= sis.analysisDefinitionExtension extension point. This extension point lets = plugins add additional analysis description xml which will be added at runt= ime to existing analyses. For this to be useful, the base analysis java cod= e must have been written to support extensibility. This analysisDefinitionE= xtension point provides no support for the anlalysis java code extensibilit= y -- it only provides a mechanism for these analysis extension plugins to c= ontribute to the base analysis' UI.
To use this, extend the analysisDefinitionExtension point, specifying th= e id of the base analysis, and pointing to a file that contains xml which w= ill be dynamically added to the analysis description of the base analysis.<= /p>
Often these extensions are used in a case where the user can select one = way of calculating something. The best way to handle this is to use a param= eter to select which of these extensions to use, and then make the UI param= eters for that extension only appear when that particular extension is sele= cted.
Because the base analysis has no way of knowing what parameters all the =
extensions will provide, it is best to use the as-map
attribut=
e in the parameters so that they will be passed in as extra mapped paramete=
rs, not requiring setter methods on the analysis task.
An example of how to use this mechanism is in ncsa.maeviz.hazard, the Sc= enario Earthquake analysis. The analysis can support multiple types of liqu= efaction, and defines an extension point and interface for new types of liq= uefaction to implement. In the UI, it provides a selector to choose one typ= e:
<pa= rameter group=3D"Liquefaction" optional=3D"true" phylum=3D"string" format= =3D"extension-point" key=3D"liquefaction-type" friendly-name=3D"Liquefactio= n type" default=3D"hazus-liquefaction" as-map=3D"true"> <description>Select method for computing liquefaction</descript= ion> <extension point=3D"ncsa.maeviz.hazard.liquefaction"/> <autofill/> </parameter>
For each type of liquefaction, the analysis description extension adds p=
arameter fields based on what is necessary for that liquefaction type. Note=
that they use the as-map
attribute, as well as specifying the=
ir visibility to only be shown when their own type of liquefaction has been=
selected:
For hazus-style liquefaction:
<analysis-description-extension> <parameter group=3D"Liquefaction" optional=3D"true" phylum=3D"datase= t" key=3D"hazus-liquefaction.groundwatermap" friendly-name=3D"Groundwater m= ap" as-map=3D"true"> <show-when parameter=3D"liquefaction-type" value=3D"hazus-liquef= action"/> <description>Ground water map for hazus liquefaction</desc= ription> <types> <type>groundWaterDepthMap</type> </types> </parameter> =20 <parameter group=3D"Liquefaction" optional=3D"true" phylum=3D"datase= t" key=3D"hazus-liquefaction.liquefactionSusceptibilityMap" friendly-name= =3D"Liquefaction Susceptibility Map" as-map=3D"true"> <show-when parameter=3D"liquefaction-type" value=3D"hazus-liquef= action"/> <types> <type>liqSusceptibility</type> </types> </parameter> =20 </analysis-description-extension>