IDE integration  

Getting started with the ArcGIS Creator plug-in


This document was written using Sun Java Studio Creator 2 Update 1.

Sections:

Sun Application Server configuration
Installing ArcGIS Web Controls
Building a simple Web application
Using the Sample Map Viewer template
Advanced: Configuring the context control for failover or round-robin
Debugging tips
Uninstalling

 

Sun Application Server configuration

A couple of simple steps are necessary to configure the Sun Application Server to work with the ArcGIS Web Controls. 

1. Navigate to your Creator2 installation directory. Locate the server.policy file in the SunAppServer8\domains\creator\config folder and open it in a text editor. Scroll to the very bottom of the file and paste this text:

 

//The Permission of ARCGIS_Java_ADF
grant {
permission java.util.logging.LoggingPermission "control", "";
permission java.lang.RuntimePermission "*","read";
permission java.util.PropertyPermission "PEOBJEDITHOME", "read,write";
permission java.util.PropertyPermission "ARCGIS_RELEASEALL_SHUTDOWN_HOOK", "read,write";
permission java.util.PropertyPermission "ARCGIS_IUNKNOWN_VARIANT_OBJECTS", "read,write";
};

 

2. Save the file and close it. 

 

Installing ArcGIS Web Controls

Before beginning these steps, familiarize yourself with the Creator 2 interface if you have not already done so. This will make it easier to follow along. 

 

 

1. Click Tools>Update Center to load the ArcGIS plug-in.

2. Select the option to Install Manually Downloaded Modules (.nbm Files) and click Next.

 

 

3. Click the Add button to add the local .nbm file. Navigate to the ArcGIS\java\tools\creator_plugin directory and select the .nbm file there. It will appear in the Modules to Install list. Click Next.

 

 

4. Confirm the modules are displayed in the Include in Install list and click Next.

 

 

5. Accept the NetBeans license agreement if it appears and click Next when the Modules have finished downloading.

6. Check the Include box under Modules to Install, accept ESRI's digital certificate, and click Finish

 

You have successfully installed the ArcGIS modules and can now begin building a web application.

 

Building a simple Web application

Now that you have successfully installed the Web Controls, you can quickly build a simple web page using the Controls.   

1. Choose File>New Project and select the Default project from the ESRI Templates category.

 

 

The Default project will provide a blank design interface to build a new web page. Click Next to modify the project settings.

2. Change the project name to ArcGISProject and set a project location. Click Finish.

3. A blank design canvas is displayed. To modify the layout or other properties, click Tools>Options menu. Scroll down and select the Visual Designer option.  Change both the Grid Width and Grid Height values to 4. This will make it easier when dragging and resizing the controls on the canvas. 

 

 

4. You can now start using the ESRI Web Controls. Scroll down in the Palette and expand the ESRI Web Controls list.

 

5. Select the Map control and then drag a rectangle on the design canvas. A map1 tag should appear in the upper left of the rectangle and the Add GIS Resources dialog box should pop up. This is where you select the data source to display in the map.

 

6. Choose a Resource Type and a Server Host and then click the Connect button. Enter the appropriate information and click OK.

 

 

7. The Server Objects drop-down list is populated. Choose an Object and click OK to finish. The Advanced button allows you to choose Failover or Round-Robin servers. To add this capability, refer to the Advanced section below or leave it empty.

 

 

You can modify the GIS Resource at any time. In the Outline view, expand SessionBean1 and click context1AGSLocalMapRes1. The Properties panel will show the current properties. Click the (...) button to the right of serverObjectName to display the dialog box that you can choose a new resource with. The following sequence of screenshots shows the order.

>> >>

 

9. The map and its resources have been configured. You should now finish designing the page. Repeat the steps by using the Table of Contents, Overview Map and Toolbar controls to design a page as follows:

 

 

The components are automatically configured to work with the map context and resource you configured previously. If added more than one map or toolbar, however, you would need to manage the context control for each of them individually. 

 

10. Next you need to add items to the toolbar control. Right-click toolbar1 on the design frame and select Add Toolbar Items.

 

 

11. Various categories of tools are displayed on the left, with the individual items on the right. Select the Map Navigation category and double-click several of the items to add them to the toolbar. Click OK.

 

 

12. The items you chose will appear on the toolbar on the design page:

 

 

13. You are now ready to run the project and see the web page. Click the Run Main Project button from the toolbar.

 

If your default web browser is not open, Creator may display a warning.

 

 

14. The results appear as follows:

 

Using the Sample Map Viewer template

1. Create a new project and choose Sample Map Viewer from the ESRI Templates category.

2. The entire project is already set up with background images and a common look and feel for all the components. If the page is not displaying correctly, right-click on the Mapviewer.jsp page and choose Refresh.

If the template is still not showing properly, close the project and re-open it. Upon re-opening, the ESRI Controls and design page should show correctly. The context1 control will now work if the context1WebContextBean appears in the Outline>SessionBean1 list.

3. The only other necessary step is to create a data source. From the Outline panel, navigate to the page1\html1\head1 context1 file and right-click to choose Add GIS Resource.

 

 

4. Enter appropriate information for a service and then run the project. 

5. The output will appear as follows:

 

 

Advanced: Configuring the context control for failover or round-robin


The ArcGIS ADF for the Java Platform has the capability to deal with an ArcGIS Server failure and serve up another working server object. The failure can be managed in a round-robin or failover manner and easily configured by using the context control in Creator. When adding a GIS Resource to the context control, you can click on the Advanced button and display more options. Follow these steps to use this feature.

 

1. After clicking the Advanced button, the dialog will expand. Click the small computer icon to add the original resource to the list:

 

 

2. The Server Object pull down list is locked when the advanced feature is enabled. The panel is readyto receive another host name serving the same the server object. Enter Server Host information. If the host does not serve the same server object, a message dialog box will appear:

 

The same server object must be present for the failover or round-robin to work. If you do not see the message dialog box, the small computer icon should be active. Click it to add the new server:

 

 

3. You can add more sources as necessary and continue to expand the list. The final step is to choose Failover or Round-robin type for the context and then click OK to finish setting up the resource.

 

Debugging tips


When developing applications in Creator, there are several places to investigate if you are getting errors. There could be issues with the Creator IDE, the Sun Application Server or the ArcGIS Web ADF code. The following locations are where to begin debugging each:

 

Creator IDE—Click the Tools menu and click Java Studio Creator Log File.

Sun Application Server—View the server log file in the Creator2\SunAppServer8\domains\creator\logs directory.

Web ADF—In the Files view (usually on the right side), navigate in the project to the web\WEB-INF folder and open the web.xml file. In this page, open the Context Parameters.

 

 

Uninstalling


There are a few simple steps to remove the ArcGIS integration components:

 

To remove the Component Library, click Tools>Component Library Manager and select ESRI Web Controls from the list. Click the Remove button.

 

To delete the plug-ins, navigate to the Creator default system settings directory:

In the 2_0/config/modules folder, delete the com-esri-adf-web-creator-templates-bundled.xml file.

In the 2_0/modules folder, delete the com-esri-adf-web-creator-templates-bundled jar file.

In the 2_0/complibs folder, delete the arcgis_webcontrols-9.2 folder.