How to use
See How to run the Java Server ADF 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 Resource
- This sample shows how to add your own custom data source. This is done by implementing the functionalities that this new data source supports and integrate it to the faces-config.xml file.
- Create and start an ArcGIS map server object. You may use any data, map configuration file, and server object name. For example, create a server object named 'usa' from the map configuration file at %AGSDEVKITJAVA%\java\samples\data\mxds\usa.mxd.
- 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\customResource, 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.
- The other way to build the sample is to use Eclipse. Open Eclipse, File - New Project - ESRI Templates - Web ADF Samples.
- Choose the Add Source Task sample
- Go through the wizard to finish building the sample.
- Run the sample web application on server.
- You can also export the application as war file and deploy to other supported application server.
- After deployment access the sample by typing the URL (e.g. http://[host]:[port]/[samplename]) in a web browser.
- Check off the MyResource in the TOC, the grid layer and coordinate will be gone.
- Now check on the MyResource layer, the grid and coordinate show up.
Download the files for Java
map.jsp | Defines custom layout for html elements |
faces-config.xml | Add the custom resource to the web context resouce |
JavaSource\com\esri\adf\sample\resource\MyCustomResource.java | MyCustomResource bean implementation |
JavaSource\com\esri\adf\sample\resource\MyCustomMapFunctionality.java | MyCustomResource supports map functionality |
JavaSource\com\esri\adf\sample\resource\MyCustomOverviewFunctionality.java | MyCustomResource supports overview functionality |
JavaSource\com\esri\adf\sample\resource\MyCustomTocFunctionality.java | MyCustomResource supports TOC functionality |
JavaSource\com\esri\adf\sample\resource\ADFMyCustomException.java | Extends ADFCustomException |
JavaSource\com\esri\adf\sample\resource\util\MyCustomUtil.java | Draws extents and grids |
Development licensing | Deployment licensing |
---|---|
Server | Server |