As explained in the “Adding Properties to SOEs” topic, properties allow modification of behavior of SOEs at runtime. You can modify values of these properties using ArcMap/ArcCatalog’s Service Editor dialog or ArcGIS Server Manager. This topic describes editing property values in Manager using a custom property page for Manager.
The provision of simple text boxes to accept new property values is the default behavior of Manager. This ensures that a simple out-of-the-box user experience is available for all SOEs that have properties. However, property values are not always textual in nature, and the use of text boxes alone as user interface media leaves ample scope for users to enter incorrect or vague values for properties that need accurate and precise values. In such scenarios, richer and more appropriate user interface elements such as drop-down boxes, lists, checkboxes, radio buttons, etc. are necessary to present the true nature of the properties and elicit accurate and precise values from the server administrator.
Type of layer the SOE needs to look for, from among a limited list such as feature, raster or all.
Maximum number of features the SOE can return.
Format in which information must be returned to the client app. Some acceptable formats are json, html and text.
Indicates if new features could be created and saved to the geodatabase via an SOE operation.
Since the layerType property corresponds to the type of layers in a map, possible values are limited to “feature”, “raster”, and “all” for the sake of this example. Thus, a radio button group or a drop-down list would be appropriate to convey existence of such a domain. Let’s choose a radio button group for this property.
A text box seems an appropriate user interface element for the maxNumFeatures property, since a numeric value is required.
The returnFormat property value is also restricted to three possibilities, namely html, json and text. Lets use a drop-down combo box user interface element.
The isEditable property is a flag that indicates if certain functionality (in this case, editing) should be enabled or not. A checkbox is the best user interface element to accept boolean information.
Thus, the customized property page would then look like the following:
How to create a custom property page
A custom property page can be created during SOE creation time. If using the Eclipse wizard to create an SOE, after creating properties and their default values on the “Properties” page of the wizard, check the “Customize property page for ArcGIS Server Manager” checkbox to indicate the desire to create a custom property page for Manager. Remember to uncheck the “Create a Java Swing class…” check box, since this topic does not discuss property pages for ArcGIS Manager. To learn more about creating custom property pages for Manager, see the “Creating Custom Property Pages for ArcMap” topic.
When you click “Finish”, ensure that a folder called “Resources” is created in your Eclipse project.
Components of a custom property page
- The Config.js file: The Config.js file is the entry point into the custom property page and thus must always be named “Config.js”. The setter and getter functions defined in this file use the dojoAttachPoint attribute to refer to appropriate DOM nodes in the html template, and are called by Manager to get and set property values when appropriate.
- The HTML file: This is named after the SOE and resides in the templates folder. This HTML file defines and lays out all Dojo and HTML user interface elements. In the above sample, this HTML file contains an HTML table, with each row in the table holding a separate Dojo element.
In order to accommodate custom property pages for multiple SOEs simultaneously, Manager imposes certain constraints on property page widgets. These are:
- The file that defines the Dojo widget must be named Config.js. Use of any other name would render the custom property page inaccessible to Manager during runtime.
- All such widgets must use “arcgis.soe.<fully qualified SOE name>” as their namespace.
The use of unique namespace for each SOE’s property page leaves you free to structure your custom property page implementations as you see fit, as long as the Config.js file is present. To develop your own custom property page, please refer to the one that’s part of the SimpleRESTSOEWithProperties ArcObject SDK sample.
Deploying and using a custom property page
The following is the workflow to deploy custom property page for SOEs in ArcGIS Manager:
- After you finish writing your SOE and its property page, open up the SOE Export wizard to select files to deploy with the SOE.
- Ensure that the “Resources” folder is selected.
- Click Finish to complete export.
- Log in to ArcGIS Server Manager.
- Deploy the .soe file to ArcGIS Server.
- Ensure that a map service is published.
- Edit the map service and click “Capabilities”.
- Click your SOE. Ensure that your custom property page is visible in the “Properties” section and is functional.
- Edit properties by interacting with the property page.
- Click “Save and Restart” to restart the map service.
- Consume the SOE to confirm your changes to property values.
|Development licensing||Deployment licensing|