Add Source Task


Purpose
This sample shows how to write a task to dynamically add data source in your Web ADF Java application.

How to use

See How to use ArcGIS samples for help on running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

Add Source Task
  1. This sample shows how to write a task to dynamically add data source in your Java ADF 10.0 application.
  2. There are two ways to build the sample. You can either use ArcGIS Ant or Eclipse plugin. To use Ant, at command line, browse to %AGSDEVKITJAVA%\java\samples\addSourceTask, type arcgisant build, follow the command prompt to finish the build. There will be a directory called build under the sample root folder, inside there will be a war file. Deploy the war file into Tomcat.
  3. The other way to build the sample is to use Eclipse. Open Eclipse, File - New Project - ESRI Templates - Web ADF Samples.
  4. Choose the Add Source Task
  5. Go through the wizard to finish building the sample.
  6. Run the sample web application on server.
  7. You can also export the application as war file and deploy to other supported application server.
  8. Click the "Add Source" link on the left.
  9. Select the data source you want to add, the data source managed bean must already in your faces-config.xml.
  10. select the corresponding server information.
  11. Click "Connect" to fetch the service list to be added.
  12. Select the map service.
  13. Click "Add to map"


Download the files for Java
map.jsp Contains Add Source Task component
JavaSource\com\esri\arcgis\sample\AddSourceSample\AddSourceTask.java Class which defines the Add Source Task logic
JavaSource\com\esri\arcgis\sample\AddSourceSample\AddSourceTaskInfo.java Class which defines Add Source Task's layout on the client side




Development licensing Deployment licensing
Server Server