Tag Archives: Eclipse
The ArcGIS Runtime SDK for Android provides a variety of samples to assist in understanding the fundamentals of our ArcGIS Android API’s and coding patterns. We package samples inside the SDK Eclipse plugin and allow you to import the sample code as an Eclipse project. Continue reading
With our recent release of the ArcGIS Runtime SDK for Android v10.1.1 we dropped support for Android 2.2 API level 8. This allowed us to move up our support level to Android 2.3.3 API level 10 which has almost half, 47.4%, of the Android platform distribution as of Jan. 3, 2013. This is causing projects built prior to v10.1.1 not to be recognized by our Eclipse feature tooling. Continue reading
Here we are already. It is already the middle of June, 2011. Another Esri User Conference is shimmering on the horizon again. ArcGIS 10 is making history and making a significant impact in and around the world, and yet at the same time, the buzz can already be heard surrounding prospects of a major, revolutionary release of the next ArcGIS System not so far down the road. Exciting times indeed!
So it seems as though it’s about time to pause now and take a realistic overview of where Esri’s Java Platform strategy is today and where it is trending. The intention of this post is to update you all, certainly. I would add, too, that an equally important goal of this post is to give confidence to you that Esri is committed to supporting your business needs with respect to the entire Java platform, from mobile to desktops to enterprise.
It’s been a while since we’ve collectively reviewed this Java state of the Union, so to speak. Let me clarify what I mean by “we”; I mean “you”, the Java users and developers as well as those of us at Esri that work to serve “you”. Together, I mean “us”. A community. I know, it sounds a bit “touchy-feely”, as Americans would say. I do mean that with all sincerity, but I’ll move on to the matter at hand.
Java continues to be an important platform for Esri’s GIS solutions and offerings going forward through versions 10.x and beyond.
Java also continues to be the world’s most widely used platform for building real, robust and secure enterprise systems. Industries such as finance, insurance, health care, government, national defense, all rely on the Java platform because of its proven reliability and versatility on many runtime platforms over the years. Esri recognizes the pervasiveness of Java throughout these industries where GIS is also critical.
Let’s take a closer look at how Esri is supporting the Java developer and user community today as well as what Esri’s plans are for the foreseeable future.
ArcGIS for Server
Typically, one thinks of Server as mapping to Java Enterprise Edition (Java EE); Web Services, Web Applications, and the various Java technologies surrounding these platforms. Historically, the showcase product here from Esri has been the Java Web ADF. This is a true JSF/MVC implementation for rapidly building GIS Web applications that consume services from ArcGIS Server and OGC standard servers.
With the WebADF, developers find a clearly defined Model/View/Controller (MVC) implementation, and the framework adheres to tried and true Java EE standards, i.e JSF, AJAX, SOAP/XML, and more. It is a beautiful stack, actually. The Java enterprise architect gets it. However, the pure GIS professional developer who is not familiar with these Java EE standards struggles with it. Is it finished and perfect? No. Is it successful, yes it is, or was, in many areas. In other spheres, though, it was quite complex. Users and developers found it difficult to scale and maintain, in the end.
At version 10.0 of ArcGIS, the Java Web ADF has been deprecated; the 10.1 version of ArcGIS will be the last release of the Web ADFs, both Java and .NET. Folks that are planning new projects having to do with ArcGIS Server are highly advised to eliminate the Web ADF from consideration.
Of course, the foundation for these APIs is REST. The ArcGIS REST API handlers define the basis of the “Controller” tier, if you will. The Model is core ArcGIS Server. This is key to Esri’s strong Services platform for Enterprise GIS. The ArcGIS REST API is a public specification, and is published as the open Geoservices API.
While the ADF has been deprecated, as previously mentioned, the ArcGIS Java Web Services API (AgsJWS), the underpinning API for the WebADF, has not. This is an important point to make. SOAP/XML is till the Web Services standard for SOA integration. Esri does not plan to deprecate this Web Services solution for ArcGIS Server. The AgsJWS is a pure Java Web Services API, based on JAXB, and is an excellent solution for building , connecting and integrating great geospatial analysis and visualization in your Java EE based solutions. Esri continues to cultivate and support its community today and into the future.
For the back-end Server, building Server Object Extensions (SOEs) with the ArcObjects SDK for Java has been and continues to be the leading solution for creating custom ArcGIS Server Web Services. There have been compelling success stories from users who to extend the Server with Java APIs, using the powerful Eclipse tooling to build and deploy them. A good example of a success story is ArcGIS for INSPIRE, a product that heavily relies on Java-based SOEs. SOEs can be exposed instantly as REST and SOAP, so if you develop with any of the RESTful Web APIs a front end to your system, your custom Java implementation and capabilities in the Server can immediately be realized in the View tier of MVC.
ArcGIS for the Desktop
ArcGIS Desktop is extensible using Java. Java developers can use the ArcObjects Java SDK Eclipse plug-ins to write, debug and extend ArcObjects and the Geoprocessing framework, and deploy their add-ins and extensions as jar files. ArcGIS Desktop is Java-enabled! ArcGIS Desktop ships with its own Java runtime. 5 or 6 years ago, could anyone have imagined that this would become possible? This came about in response to a lot of Java developers wanting to customize ArcGIS Desktop, ArcMap and ArcCatalog, using their chosen skill and expertise, and Esri listened and responded. The ArcObjects SDK for the Java platform continues to be the go-to developer kit for building custom, feature-rich desktop applications that leverage the powerful ArcGIS Engine runtime.
ArcGIS for Lightweight and Mobile Devices
At version 10.1 of ArcGIS, Esri will introduce a new suite of products under the platform strategy called “Lightweight GIS”. GIS is accessible and usable via mobile devices such as laptops, tablets and phones in connected, disconnected, and “sometimes”-connected environments. This lightweight GIS platform provides new developer APIs for Java desktop, mobile, and embedded device developers. There are two key products based on this platform that Java developers can take advantage of: The ArcGIS Runtime SDK for Java SE based GIS applications, and the ArcGIS for Android SDK for Android phones and tablets. These SDKs are founded upon the Web API and Smartphone API object models. They are pure Java APIs and both have strong Eclipse IDE
integration support, making development easy, quick and extremely intuitive.
ArcGIS versions 10 and 10.1 both support Java SE 6 and Java EE 5. Esri continues to monitor the progress of the Java EE 6 and Java SE 7 specifications to see if the features they offer will make sense for the ArcGIS product line.
To summarize, Esri’s ArcGIS and Java strategy is pervasive, in and through all of the key computing environments that Java is found in, from Mobility to the desktop and to the Enterprise. This makes Esri’s GIS and Java a perfect match for any Java-based implementation that requires the delivery of geospatial or location services and capabilities.
So until next time, please let us know your thoughts and feedback by sharing comments questions. This will help us in serving you better, the Java developer and user community. We hope to meet with you at the ESRI International User Conference in July!
The Java Web ADF internally manages how applications connect to the Server Object Manager and communicate to ArcGIS Server services. Local connections are established using ArcObjects and Internet connections are established using native Java Objects through web service endpoints via the ArcGIS Java Web Service (AgsJWS) API. This feature of the framework becomes increasingly important with the growing technology trend of using web services and is simple to migrate existing applications from local connections to internet connections.
These instructions assume you have set up your Eclipse Web ADF project with the JSF 1.2 Facet. For details on setting this up please refer to the following ArcGIS Java Technology blog post.
- Open faces-config.xml in Eclipse Faces Config Visual Editor and Select the Managed Bean tab.
- Under Managed Bean Elements, select ags1.
- This populates the Managed Bean section, under Managed Bean Class press the Browse button.
- Type AgsMapResource in the Select Entries text box and click OK
- Under Initialization delete the following managed-property settings using the Remove button:
- Replace with the following managed-property settings using the Add button filling in the appropriate values in brackets for your service :
- endPointURL – http://[SERVERURL][PORT]/arcgis/services/[FOLDER]/[SERVICE-NAME]/MapServer
- Your managed bean properties should resemble the following settings with values for your connection.
- Now you can run your application and all Web ADF objects will use the AgsJWS API instead of ArcObjects.
Finally, you can remove the arcobjects jar file from your application as you are know longer making use of it and doing so will significantly reduce your application footprint. For more information about Java Web ADF library dependencies read our previous post.
This process will work on any Java Web ADF Application which does not use the Editing Task or have any custom features using ArcObjects. If you are making use of custom ArcObjects in your Java Web ADF application you will need to migrate your custom features as a Server Object Extension (SOE) and expose it through SOAP, then replace your custom code with connection to your SOE making use of the client web service stubs provided by your SOE. Part 2 of this post will go into deeper detail of this pattern.
By default, the ArcGIS Web Project template that come with the ArcGIS Server plug-in for Eclipse IDE extends Eclipse Dynamic Web Project template. This provides the base for a Web Mapping Application which is a Java Server Faces (JSF) application. When you open the faces-config.xml file in the Eclipse editor, the source xml file opens up which may be difficult to navigate and edit for some. The Web Tools Platform (WTP) JSF tools have been provided with Eclipse Java EE bundles since the Ganymede release and to take advantage of the faces-config visual editor in your ArcGIS Web Project you need to do the following in your Eclipse Developer Environment:
- Before you start, rename your projects web.xml (e.g. web_orig.xml) as this process will create a new web.xml file and overwrite the projects web.xml. The Web ADF ArcGIS Web Project depends on the web.xml file that the Web ADF plug-in creates so we don’t want to overwrite it.
- Right click on your Project and select Properties.
- In the Properties dialog select ‘Project Facets’ from the left hand selection and check the ‘JavaServer Faces’ Project Facet.
- Click on the ‘Further configuration required’ link near the bottom of the dialog.
- Accept the ‘Server Supplied JSF Implementation’ in the JSF capabilities dialog and click OK.
- Now click the OK button in the Project Properties dialog.
- Finally, delete the web.xml file that was generated by the JSF Facets dialog and rename your original file you changed in step 1 back to web.xml.
When you double click on your faces-config.xml file, the Faces Configuration Introduction page should open and you are now ready to use the visual editor capabilities to edit your faces-config file. If this did not happen, simply right click on your faces-config.xml file and select ‘Open With’ to ensure that the ‘Faces Config Editor’ is the default editor.
Once your faces-config file is opened inside the visual editor you will notice different tab options at the bottom of the editor which allows you to visually edit different aspects of the faces-config file. For example, to edit the Managed Beans in your application, you can click on the ‘ManagedBean’ tab to open the editor, then add/remove beans or select a bean to edit.
While many of our Eclipse Plug-in tools take care of editing your projects faces-config editor, enabling the visual capabilities on your project simplifies situations when you need to do some manual edits to the file.
In this post we will discuss how to install and set up the ESRI Java Web ADF plug-in using Eclipse Ganymede. Once, we have the plug-in installed, we will set out to use the features by creating a Web Mapping Application (WMA) and extend our WMA with a Query Task functionality.
Setting Eclipse ArcGIS Preference
Before beginning any project, it can be useful to set up common preferences for the new project wizards. Click Window > Preferences from the main menu in Eclipse. Select ArcGIS > Server from the left panel of the dialog box. The connection information entered here will be used by the project wizards. You can specify information needed to connect to some of the more commonly used servers such as ArcGIS Server, ArcIMS, and ArcGIS Web services. Each time you are prompted to add a data source, it will be automatically pre-populated with these values.
You can also check the box to Show New Project Wizard Advanced Options. This will provide a couple of extra steps in the wizard for further customization if needed. By default this is unchecked.
Setting up an Eclipse Server Runtime with Tomcat
In order to test and publish web applications on your application server through Eclipse, you need to define one or more resources by installing the application server and installing the appropriate server runtime in Eclipse. Although you can set up any supported application server which supports Eclipse server runtimes, in this example we will publish our WMA to Apache Tomcat. Once installed, it is also important to make sure that Tomcat is set to use a 1.5.x or higher JDK. You should check by using the Configure Tomcat shortcut from the Tomcat install to display the properties dialog below. Click the Java tab and make sure the Java Virtual Machine is set to a jvm.dll located in a 1.5.x JDK.
More information about using Tomcat in Eclipse can be found on the Eclipse wiki.
To set up Tomcat server runtime in Eclipse, there are a few simple steps:
Click Windows > Preferences from the Eclipse toolbar. In the Preferences dialog box, expand the Server option and select Installed Runtimes. Click the Add button.
Navigate to the appropriate Apache Tomcat server and click Next.
Click the Browse button and locate the Tomcat installation directory on your file system. Click the Installed JREs button to add a JDK as the default JRE. Check an appropriate JDK or click Add and browse for a JDK. Click OK to close the Preferences dialog box.
The dialog box appears as follows. Click Finish. Your Tomcat Server runtime is ready to be used when creating new projects.
Install ArcGIS Server for Java Web ADF plug-in
This section contains instructions on how to install/update the plug-in from ESRI update center.
Select Help > Software Updates > from the Eclipse toolbar (1) if you have an ArcGIS Eclipse Plug-in installed and are upgrading. Click the Installed Software tab, find ArcGIS Core and ArcGIS Server entry, right click on each and choose Update. Eclipse will go to the pre-defined update site to get the latest plug-ins. (2) If this is your first time installing the ArcGIS Server for Java Eclipse plug-in, click the Available Software tab, and click the Add Site button on the right.
Next, click the Local button to browse to the plug-in location on disk, make sure to browse to the Server folder level in your ArcGIS Server for Java directory.
You should now see ArcGIS added to the available software list. Check ArcGIS Core and ArcGIS Server and click Install. Once installation is complete, click Finish and follow the prompt to restart Eclipse by clicking OK.
Create a new ArcGIS Web ADF project
This section contains instructions for creating a new Eclipse project based on ESRI Web Project Template.
Create a new project by clicking File > New > Project and choose ESRI Web Project under ESRI Templates. Click Next and give your project a name.
Make sure to choose a Target Runtime, for example, the Apache Tomcat server runtime we set up in previous steps.
In the New ArcGIS Web Project Window, double click Add GIS Server node.
Enter the server connection credentials and click OK. This should be pre-populated with the credentials set in the preferences dialog.
Choose a service from the list and add it to the webcontext. Click Finish to complete.
Right click the project name in the Project Explorer panel, Run As > Run on Server. Pick a server and hit Finish. To view the site in an external browser, go Window > Web Browser, choose anyone other than the Internal Web Browser.
At this point, you should have a WMA running with all the default features offered by the plug-in. In our next section, we will add a Query Task to the WMA and test it again.
Add a query task
This section contains instructions on how to add a query task to the web application.
In the right hand project file list, expand your project to open the mapviewer.jsp under WebContent. Once the source opens up, scroll down to the line where it says <a:task id=”searchAttributesTask” . . .> (this is typically around line 123).
Place your cursor in front of this line and right click ArcGIS > Add Task > Query Attributes …
Now configure the query task. Click the Settings tab, pick a Map Service and pick a layer. Next to Query Expression, click Add.
In the New Expression window, pick a Field to query against and either type in the value to query or select from a list of sample values. Click OK, and OK on the Add Query Task window.
Inspect your extended mapviewer.jsp source file. You should see the query task added and the query link added to the task menu bar.
Run the application again and test your query task.
You now have a WMA with an extended Query Task enabled all without writing a single line of code. The ESRI ArcGIS Server for Java plug-in hides the complexity of many features which enables you as the developer to quickly create production quality web mapping applications.
Contributing Author, Li Linn, ESRI Java Development Team
The ArcGIS Java WebServices (AgsJWS) libraries are included with the ArcGIS Java Web ADF. With version 9.3.1, the Web ADF libraries are located under ‘$ARCGISHOME/java/web/webcontrols/WEB-INF/lib’. The ESRI AgsJWS libaries include the following:
The dependency libraries are in the same location on disk and include the following:
You can create User Libraries in NetBeans and Eclipse to accelerate development with the AgsJWS API.
- From the tools menu, select Libraries to open the Library Manager.
- Click the ‘New Library…’ button to create a new Library and name it ‘AgsJWSv9.3.1′.
- Select a Library Type
- You should see your library added to the Library Type you selected in the previous step.
- With your new ‘AgsJWSv9.3.1′ library selected in the left hand Libraries pane, click the ‘Add JAR/Folder’ button.
- Navigate to the ‘$ARCGISHOME/java/web/webcontrols/WEB-INF/lib’ folder location.
- Select the ESRI AgsJWS libraries and dependency libraries described above and click ‘Add JAR/Folder’.
- Once you have all the libraries selected, click OK to close out of the dialog.
Now when you can add the library to an existing project by right clicking the project and selecting ‘Properties’. The Project Properties dialog opens where you can select Libraries from the list of Categories and click the ‘Add Library’ button to find the appropriate library to add.
Eclipse Ganymede (v3.4.x)
- From the Windows menu, select Preferences.
- Select Java > Build Path > User Libraries from the left hand pane.
- Click the ‘New’ button to create a new Library and name it ‘AgsJWSv9.3.1′.
- With your new library selected, click the ‘Add Jars’ button to open the Jar Selection dialog.
- Navigate to the ‘$ARCGISHOME/java/web/webcontrols/WEB-INF/lib’ folder location.
- Select the ESRI AgsJWS libraries and dependency libraries described above and click ‘Open’.
- You should now see all the libraries added with options to attach source and javadoc locations.
Now you can add the library to a new project or existing project by clicking the ‘Add Library’ in the New Project dialog and/or the Project Preferences dialog respectively. In Eclipse, your library is added to the ‘User Library’ category by default. Once you select User Library, you can add the appropriate library to your project.
For further reference please review the follow Help System topics:
Starting with 3.2 Eclipse began to use packages instead of version numbers for each major release:
3.2.x = Callisto
3.3.x = Europa
3.4.x = Ganymede
Generally speaking, our Eclipse plug-ins work with Callisto and above. The server plug-ins require Europa and above. But there are some exceptions. Eclipse’s update manager usually does a pretty good job so you will normally not be able to install plug-ins that aren’t supported by a particular instance of Eclipse. For example, trying to install ArcGIS server plug-in on a non-JavaEE version of Eclipse will result in an error.
It can be confusing to tell which version of Eclipse one has, follow these steps to confirm your version:
- Select ‘About’ in help
- Your Eclipse version will show up in the ‘About Eclipse Platform’ dialog.
- Further configuration details can be viewed by clicking the ‘Configuration Details’ button.
The most popular bundles appear to be Eclipse IDE for Java EE Developers and Eclipse IDE for Java Developers. Our server plug-in obviously requires the Eclipse IDE for Java EE Developers bundle. You can still start with the Eclipse Classic SDK bundle although our plug-ins will not work with the classic bundle of Eclipse. Specifically our core plug-ins depend on the org.apache.xerces plug-in which is not available in the SDK bundle, but is included in the Java EE and Java bundles. If you choose to use the Classic SDK bundle, you will be required to manage the dependency plug-ins manually starting with the xerces plug-in. Since 9.3, we introduced a new feature in the server plug-ins to support drag-and-drop style of web application design. This feature is only available in Europa and above. So the server plug-ins now cannot be installed in Callisto.
As of Eclipse 3.4/Ganymede M6, the Eclipse SDK contains a new provisioning system called Equinox/P2 which replaces the Update Manager as a mechanism for managing Eclipse, searching for updates, and installing new functionality through plug-ins. Experienced users will notice the new software update dialog which replaces the ‘Find and Install/Manage Configuration’ approach. The big change is the concept of ‘dropins’ folder which is a default ‘watched’ directory and scanned during start up. This allows for changes to be immediately applied to a running system. Plug-ins and features added to the dropins folder are properly installed into the system rather than being forced in by prior versions using the plug-ins folder concept. Plug-ins installed via dropins behave exactly like plug-ins installed via the user interface. Something to note is that updating plug-ins located under the dropins folder through the UI will result in updated plug-ins being saved under the main eclipse/plugins & eclipse/features folders and not under the dropins hierarchy as one might expect.
If you use multiple eclipse installations, you can configure a central shared dropins folder where you can put Eclipse plug-ins used by all your Eclipse installations which links back to your central location.
The Equinox p2 update UI supports drag and drop of an update site URL straight from your browser or from your OS file manager for local sites. If you choose to use the UI to install plug-ins they lose control of where Eclipse installs the plug-in as all plug-ins/features go to the default location, which can be a bit overwhelming.
Finally, you can also configure Eclipse 3.4 to use the legacy update manager which reverts Eclipse back to the ‘Find and Install/Manage Configuration’ approach from previous versions.
Eclipse Galileo arrives in 3 weeks on June 24, 2009.
The ArcGIS 9.3.1 release provides enhanced support for Java developers to develop extensions in the native Java environment using a simple develop and deploy workflow. Some of the supported extensions include:
- Custom geoprocessing tools
- Server object extensions (SOEs) and utility objects
- Class extensions for customized data behavior
- Custom renderers
Plug-in data sources
Also, the development team will be presenting in-depth sessions on developing and deploying ArcGIS Java Extensions at our upcoming Developer Summit in Palm Springs, CA. These sessions include ‘Extending ArcGIS with Java’ and ‘Extending ArcGIS Server with Java’. You can also listen to our podcast ‘2009 ESRI Developer Summit: Extending ArcGIS with Java’ for more information.
Contributed by the Java development team
The Help System in the Eclipse Developer IDE is designed like the rest of the environment and is built with a plug-in architecture. Packaging the Java Help System as a Developer IDE Plug-in can significantly increase memory size requirements and cause the development environment to hang on install. This article discusses taking advantage of the Java Help System InfoCenter as a stand-alone Help System to be integrated into your Eclipse Developer Environment. This can be done in 3 easy steps.
Step 1: To get started, you must first ensure that you have installed the ArcGIS SDK Java Help System. This is a separate installer from ArcGIS Engine and/or ArcGIS Server for Java. Once successfully installed, the help system runs in single user mode as stand-alone help system for the Java developers. To set up the Java Help System in InfoCenter mode you simply execute the Java Help Server scripts located at ‘%ARCGISHOME%java docs’. To start the Help System in InfoCenter mode, execute the ‘startJavaHelpServer.bat’ file:
The default port the Java Help System InfoCenter will run on if you do not set the port when you execute the script will be ‘2112’. Clients can now access the Java Help System from any machine inside your network by pointing your web browser to the following url:
Step 2: Now that you have successfully started the Java Help System in InfoCenter mode, you can easily integrate the Help System into your Eclipse Developer IDE.
Make sure you have the latest supported Eclipse developer IDE, version 3.3.x, and open the Preferences dialog by selecting ‘Window->Preferences’ from the tools menu. In the Preference dialog, navigate to ‘Help->Content’ as shown in an illustration to the right.
Step 3: The Eclipse Help System needs to know the address (host/IP) and port of the remote server to integrate with the local system. Select the ‘Include help content form a remote infocenter‘ checkbox and provide the following server information:
- Host: Put a valid Server Name or IP Address where the remote infocenter is located. In our example the server name is ‘javabuild’.
- Path: ‘/help’.
- Select the ‘Use Port’ radio box and put ’2112′ in the port text box. The dialog should resemble the image below with your server name replacing ‘javabuild’.
Click ‘OK’ to close the Preference dialog and open up the Eclipse Help System, ‘Help->Help Contents’, to see the ArcGIS Java Developer Help System integrated into your local Eclipse Help System.
The Java Help System InfoCenter is a stand-alone server and doesn’t require an additional Web Server. However, in a production environment, you may want to control important issues that are best handled by a Web Server. For example, you may want to redirect requests by setting up a proxy module in Apache. This is all possible for more advanced users of the java Help System InfoCenter.