Junos Space SDK > Developer Guides > Junos Space Application Developer Guide > Programming with the Junos Space SDK > Using the Junos Space SDK Plug-in

Defining Application Settings with the App-Settings.xml Editor

Application settings (or App-settings) are the configurable settings for an application developed using the Junos Space SDK plug-in. These application settings are defined by an App-settings.xml file. When the application is deployed, the settings can be viewed and managed by the Junos Space UI. At a programmatic level, these settings can be retrieved and set by the /api/space/application-management/applications/{id}/settings-config APIs.

The Junos Space SDK plug-in provides an Eclipse-based App-settings.xml editor to edit the App-settings.xml file for your Junos Space SDK application. The App-settings.xml editor view opens in two tabs:

Note: It is not mandatory to have application settings defined for a Junos Space application.

Creating and Editing App-settings

  1. Select Junos Space > Create/Edit App-settings.xml from the Eclipse menu bar.

  2. The App-settings.xml Editor screen is displayed. If an App-settings.xml file does not already exist in the workspace, the editor opens a default App-settings.xml file in Create mode. Otherwise, the editor opens the existing App-settings.xml file for the workspace in Edit mode.

Note: The path of the App-settings.xml is <EAR-Project>/EarContent/META-INF/app-settings/App-settings.xml, where <EAR-Project> is the name of EAR Project. When you build and deploy your application, an XML Schema Definition file app-settings.xsd file is generated automatically.

Alternatively you can generate the app-settings.xsd file for your app-settings.xml without deploying the application by using the "Generate App-settings Schema" menu option. To generate <APP-NAME>-settings.xsd file for your app-setting.xml:

  1. Select File > Junos Space > Generate App-settings Schema.

Note: This option can be used if you have written your own script to deploy the Junos Space application.

Application Settings on Junos Space

While building an application, App-settings.xml is used to generate the <APP-NAME>-settings.xsd file, where <APP-NAME> is the name of the application. Once the application is deployed in Junos Space SDK, the contents of the App-settings.xml file are displayed using following steps:

  1. Browse to mainui, and navigate to Administration > Manage Applications.
  2. Select the application, and click Actions to open the slider.


  3. Click Modify Application Settings to view the settings configured in App-settings.xml.


Applying "Application Settings" using App-settings.xml Editor

In App-settings.xml, the root tag is "configuration". The following table lists the components, their descriptions, and their supported attributes. Only these types of components can be added in App-settings.xml.

Component Description Attributes
Mainui Parent component Child component(s) Example Name Type Description
panel panel is added panel or configuration checkbox, slider, combobox, grid, integer, text or panel If the name of the panel is helloworld then the panel will be created and the name will be displayed on the left hand side in "Modify application settings" option in mainui. name Mandatory Name of the panel
integer integer is added as a text box allowing only integer values panel or grid-column None If the label is Access Count, with default value as 30, max-value as 100 and min-value as 10, then a text box with label Access Count is added on the panel with default value as 30. You can enter values within a range of 10-100 in the text box. label Mandatory Name of the integer
default Optional Default value of the integer
min-value Optional Minimum value of the integer
max-value Optional Maximum value of the integer
checkbox checkbox is added as a check box panel or grid-column None If the label is Allow Access and default value is true, then a check box with label Allow Access is added on the panel and is selected by default. label Mandatory Name of the checkbox
default Optional Default value of the checkbox which can be true or false
text text is added as a text box panel or grid-column None If the label is Configured Field and default value is Country, then a text box with label Configured Field is added on the panel with a default value as Country. label Mandatory Name of the text
default Optional Default value of the text
combobox combobox is added as a drop-down list panel or grid-column item (mandatory) If label of the combobox is Country and there are two items in the combobox, US and India and the default value is US. The combobox is displayed as drop-down list in the panel. The label is displayed as Country and options in the drop-down list as US and India with default value as US. label Mandatory Name of the combo box
default Optional Default item selected in the combo box
item item is added as a options in drop-down list combobox None If item of the Country combobox is US, then Country displayed as drop-down list having US as one option in the list. NA NA NA
grid grid is added as a grid panel or grid-column grid-column (mandatory) If label of the grid is Country and there are two grid-columns in the grid, then a grid will be created with title as Country. You can add/edit/delete rows in a grid. label Mandatory Name of the grid
grid-column element added in grid-column is added as a column of grid grid checkbox, slider, combobox, grid, integer or text If checkbox is added as grid-column in grid, then it will be added as column in grid which only allows boolean values. When you add a row in grid, it will be displayed as check box. NA NA NA
slider slider is added as a slider panel or grid-column slider-marker (optional) If label of the slider is Timeout with min-value as 0 and max-value as 100 and default as 10, then a slider from 0-100 with default value as 10 will be displayed in mainui label Mandatory Name of the slider
default Optional Default value of the slider
min-value Mandatory Minimum value of the slider
max-value Mandatory Maximum value of the slider
slider-marker It marks the slider either at start of the slider or at the end of it, depending on the location attribute in mainui. slider None If slider-marker is added in slider with location at start and label as Never, then marker Never will be displayed at min-value of slider. location Mandatory Location of the slider-marker, which can be either start or end
label Mandatory Label displayed at specified location in slider

Note: The name or label of any component should start with an alphabetic character, and it can contain alphanumeric, space( ), or underscore(_) characters.

Using the App-settings.xml Editor

  1. You can add elements in any component using App-settings.xml editor. To add elements, right-click the <component>, select Add Child, and then select the desired <element>.


  2. You can add attributes in added elements. Right-click on element > Add Attribute > Select the appropriate attribute.

Recommendations

Limitations