Simple REST SOE With properties sample

The purpose of this sample is to show use of a REST Server Object Extension that has one sub-resource and several properties. This sample also includes custom property pages for ArcMap and ArcGIS Manager. 
The sub-resource, called "layers" is a list of all layers accessible through the associated map service. The SOE has several properties that affect its behavior at runtime, such as "layerType", which dictates the types of layers the "layers" subresource will return. Other properties exist to showcase use of a property page inside ArcMap and ArcGIS Manager.

How to use

See How to use ArcGIS samples for help on running the sample.

How to use this sample?
  1. Deploy the lib/JavaSimpleRESTSOEWithProperties.soe file to Server. For instructions on how to deploy an SOE to ArcGIS 10.1 Server, please see the "Developing Extensions" -> "Server Object Extensions" -> "Deploying and Un-deploying SOEs" topic in the ArcGIS Java Developer Help.
  2. Enable the SOE on map service of your choice. For instructions on how to enable SOE on a map service, please see the "Developing Extensions" -> "Server Object Extensions" -> "Enabling and Disabling SOEs" topic in the ArcGIS Java Developer Help. Please ensure that the map service has at least 1 feature layer and 1 raster layer.
  3. After the map service has started with SOE enabled on it, open up Services Directory and access the http://<server name>:6080/arcgis/rest/services page
  4. Click the map service you enabled your SOE on.
  5. Scroll down and click JavaSimpleRESTSOEWithProperties listed in "Supported Extensions" section
  6. The JavaSimpleRESTSOEWithProperties web page displays the root resource details such as name and description, along with the "Child Resources" and "Supported Operations" sections.
  7. Click “layers” subresource. It displays information about all features layers in JSON format.
  8. Click "properties" subresource. It displays all properties and their values.

Modify property values in custom property page for ArcGIS Manager
  1. Modify value of the layerType property so that the "layers" subresource returns only raster layers. Log in to ArcGIS Manager and edit the map service you enabled the SOE on. On the map service's editing page, click Capabilities and then click "Java Simple REST SOE With Properties". A section called "Properties" will appear below the SOE.
  2. Ensure that this section includes user interface similar to the screen shot below. This is a custom property page created for ArcGIS Manager.
  3. Modify other property values and click Save and Restart.
  4. Access the "layers" subresource and verify that only raster layers are being returned.
  5. Access the "properties" subresource and verify the recently modified properties are displayed.

  6. Custom property page for ArcGIS Manager

Modify property values in custom property page for ArcMap
  1. Deploy the Java Swing Property Page to ArcGIS Desktop. Copy the lib/JavaSimpleRESTSOEPropertyPage.jar to <ArcGIS Desktop Home>/java/lib/ext folder and start ArcMap.
  2. Connect to your ArcGIS Server in the ArcCatalog window of ArcMap. Open service properties of this map service you enabled SOE on.
  3. Click on the JavaSimpleRESTSOEWithProperties extension. The "layerType" and other properties will be displayed in a Java Swing dialog in the Map Service Editor.
  4. Modify this property value by choosing one of the layer types. Click OK.
  5. After the service has restarted, check the layers subresource. It will display layers on the type you chose in ArcMap's Map Service Editor dialog.

  6. Custom property page for ArcMap

If you installed the samples feature, you will find the files associated with this sample in <Your Developer Kit install location>\DeveloperKit10.4\Java\Samples\ArcObjects.

soe/ The REST SOE Java Server Object Extension class.
soe/pp/ The property page class
soe/pp/ Class supporting the property page class
lib/JavaSimpleRESTSOEWithProperties.soe The .soe file that contains this Server Object Extension
lib/JavaSimpleRESTSOEPropertyPage.jar The jar file containing a property page for ArcMap.
Resources/arcgissamples/soe/JavaSimpleRESTSOEWithProperties/Config.js The Dojo widget that defines custom property page for ArcGIS Manager.
Resources/arcgissamples/soe/JavaSimpleRESTSOEWithProperties/templates/JavaSimpleRESTSOEWithProperties.html The html file that declares dojo/html user interface elements.

Development licensing Deployment licensing
Server Server