Updating Control


Purpose
This sample shows the usage of the download and uploads framework build into Web ADF Java. In the download JSP page, there is a tool button to add points, click few points on the map, and then click the “Download Points” button to save the points as a text file. In the upload JSP page, there is an “Upload Points” button, click on it to browse to the saved text file. The previously added points will be brought up.
 
This sample uses the EsriUploadUtil (esri_upload.js) and custom managed bean to store and retrieves data via a text file. It changes the default download.jsp page so that the downloaded file extension is text. The upload and download utility classes are used in conjunction with the Upload and Download Servlets. When downloading, the download bean iterates through the points in the web graphics of the web context, and then generates a comma separated file. When uploading, the upload bean parses the points stored in the uploaded file and add them to the web graphics.

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.

Updating Control
  1. This sample shows the usage of the download and uploads framework build into Web ADF Java 10.0. In the download JSP page, there is a tool button to add points, click few points on the map, and then click the “Download Points” button to save the points as a text file. In the upload JSP page, there is an “Upload Points” button, click on it to browse to the saved text file. The previously added points will be brought up. This sample uses the EsriUploadUtil (esri_upload.js) and custom managed bean to store and retrieves data via a text file. It changes the default download.jsp page so that the downloaded file extension is text. The upload and download utility classes are used in conjunction with the Upload and Download Servlets. When downloading, the download bean iterates through the points in the web graphics of the web context, and then generates a comma separated file. When uploading, the upload bean parses the points stored in the uploaded file and add them to the web graphics.
  2. Create and start an ArcGIS map server object. You may use any data, map configuration file, and server object name. If you wish to match the Web application in the Developer Help, create a server object named 'usa' from the map configuration file at %AGSDEVKITJAVA%\java\samples\data\mxds\usa.mxd. (This difference is seen in the faces-config.xml file and the map's appearance.)
  3. 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\updatingControls, 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.
  4. The other way to build the sample is to use Eclipse. Open Eclipse, File - New Project - ESRI Templates - Web ADF Samples.
  5. Choose the Updating Control
  6. Go through the wizard to finish building the sample.
  7. Run the sample web application on server.
  8. You can also export the application as war file and deploy to other supported application server.
  9. Open http://<host>:<port>/<appname>/map.jsf
  10. Use the drop down to zoom in/out of the map


Download the files for Java
mapZoom.jsp This page lays out the controls and drop down on the page. On changing the value in the drop down, sends asynchronous request to server to update map's extent. Delegates the asynchronous xml processing to the EsriControls.processPostBack function.
fc-mapzoom.xml Declares the phase listener as part of the JSF lifecycle
JavaSource\com\esri\arcgis\sample\mapzoom\MapZoomPhaseListener.java Processes the asynchronous request to update the map's extent. Uses the AJAXResponseRenderer object to render the xml response




Development licensing Deployment licensing
Server Server