Custom Task


Purpose
This sample shows a Geo RSS viewer implemented as a custom task. This sample demonstrates writing a custom task, providing metadata for a task with task info, handling task results, and providing action item for the task results. The sample builds on top of the web mapping application. The task reads a Geo RSS url and draws the points as web graphics on top of the map. By default the sample uses the  http://earthquake.usgs.gov/recenteqsww/catalogs/eqs7day-M2.5.xml. This url returns recent earthquake locations around the world for the past seven days with magnitude greater than 2.5. The attribute information of the earthquake locations can be accessed by selecting them using the select tool. Click on one of the result item to see the details in the results details panel. Highlight a location from the context menu by right clicking on the result item and selecting highlight. Create and deploy the sample by following the steps below.

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.

Custom Task
  1. 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\custom_task, 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.
  2. The second way to build the sample is to use Eclipse. Open Eclipse, File - New Project - ESRI Templates - Web ADF Samples.
  3. Choose the Custom Task
  4. Go through the wizard to finish building the sample.
  5. Run the sample web application on server.
  6. You can also export the application as war file and deploy to other supported application server.
  7. After deployment access the sample by typing the URL (e.g. http://[host]:[port]/[samplename]) in a web browser. The default name for the sample is "georssviewer".


Download the files for Java
mapviewer.jsp The main page with the map and task
JavaSource\demo\GeorssTask.java Java class for the task
JavaSource\demo\GeorssTaskInfo.java Java class for the task metadata
JavaSource\demo\GeorssTaskResults.java Java class for the task results with action methods
faces-config.xml Configuration file that describes the resources and functionalities for the application




Development licensing Deployment licensing
Server Server