You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

The following describes the syntax of the View Definition (view.xml) file as part of the View Package.

<view>

The <view> element is the enclosing element in the Definition File. The following table describes the elements you can include in the <view> element:

ElementRequiredDescription
nameYesThe unique name of the view. See <name> for more information.
labelYesThe label of the view. See <label> for more information.
versionYesThe version of the view. See <version> for more information.
parameterNoDefines a configuration parameter that is used to when creating a view instance. See <parameter> for more information.
resourceNoDefines a resource that is exposed by the view. See <resource> for more information.

<name>

The unique name of the view. Example:

<name>MY_COOL_VIEW</name>

<label>

The label of the view. Example:

<label>My Cool View</label>

<version>

The version of the view. Example:

<version>0.1.0</version>

<parameter>

ElementRequiredDescription
nameYesThe name of the parameter.
descriptionYesThe description of the parameter.
requiredYesIf true, the parameter is required in order to create a view instance.
<parameter>
    <name>someParameter</name>
    <description>Some parameter this is used to configure an instance of this view</description>
    <required>false</required>
</parameter>

<resource>

ElementRequiredDescription
nameYesThe name of the parameter. See <parameter><name> for more information.
service-classNo 
provider-classNo 
resource-classNo 
<resource>
  <name>calculator</name>
  <service-class>org.apache.ambari.view.proxy.CalculatorResource</service-class>
</resource>

See the Calculator View Example to see a REST service endpoint view implementation.

 

<resource>
  <name>city</name>
  <plural-name>cities</plural-name>
  <id-property>id</id-property>
  <resource-class>org.apache.ambari.view.weather.CityResource</resource-class>
  <provider-class>org.apache.ambari.view.weather.CityResourceProvider</provider-class>
  <service-class>org.apache.ambari.view.weather.CityService</service-class>
</resource>

See the Weather View Example to see an Ambari-Managed ResourceProvider view implementation..

 

  • No labels