Monthly Archives: February 2010

Parameter Validation in the Task Framework

The Java Web ADF Task Framework provides a convenient way for developers to write simple, focused, functional units, known as Tasks, without having to deal with complexities of JSF or Javascirpt programming. The Task Framework shields you from low level programming like building UIs and wiring them up to server-side java objects through AJAX. Instead, the framework allows you to focus exclusively on the functionality you are trying to build.

For those of you not familiar with the Task Framework, this article provides a gentle introduction. Basically, a Task is made up of 3 fundamental units – Parameters, Actions, and Tools. Parameters represent input that needs to be captured from the user. This can be some text that the user needs to enter, or an option that the user needs to pick. Actions and Tools both allow the user to invoke the task after specifying the Parameter values. Tools differ from Actions such that they allow the user to interact with the map (like specifying a location or an area) before invoking the task. 

A Task is usually implemented by creating two java classes – a TaskInfo class, and a Task class. Parameters, Actions and Tools are declared via metadata (Descriptor objects) in a TaskInfo class. The Task class contains JavaBean style setter/getter mehods for Parameters. These methods are called by the framework to read and write Parameter values. The Task class also contains additional methods that are called by the framework when users invoke Actions and Tools on the Task. These methods implement the functionality of the Task. The framework is responsible for generating the HTML markup and Javascript required to render the UI for Task Parameters, Actions and Tools. You can find more information on how to write custom tasks here.

One of the most common feature requests we’ve received is the ability to validate Parameter values specified by a user. This is now possible in part due to the new and improved ADF JavaScript which is based on the dojo JavaScript library. To enable validation, a Task Parameter must be associated with a Validator object. Once this is done, the Task framework automatically generates the necessary JavaScript to apply the validation rules on the browser.

The ADF provides StringValidator, DateValidator, NumberValidator, and NumberSpinner java classes in the com.esri.adf.web.data.tasks.validator package which validate text, dates, and numbers respectively.

The following code snippet shows how to use a StringValidator to validate the text through a regular expression pattern.

TaskParamDescriptor paramDescriptor = ...; //Task Parameter
StringValidator validator = new StringValidator();
validator.setRegExp("[A-Za-z]*");
validator.setInvalidMessage("Please enter only letters.");
//Set Validator on Parameter
paramDescriptor.setValidator(validator);

When a Task Parameter is associated with a DateValidator, the Task UI automatically provdes a JavaScript calendar control to allow the user to specify a date. If the DateValidator is also configured to accept a time component, the UI provides an additional JavaScript control to capture the time.

TaskParamDescriptor paramDescriptor = ...; //Task Parameter
DateValidator validator = new DateValidator();
//Format for displaying Date & Time
validator.setDateFormat((SimpleDateFormat)DateFormat.getDateInstance(DateFormat.MEDIUM));
validator.setTimeFormat((SimpleDateFormat)DateFormat.getTimeInstance(DateFormat.SHORT));
//Set Validator on Parameter
paramDescriptor.setValidator(validator);

 

By default, Actions and Tools of a Task enforce validation on all Parameters of that Task. If any Parameter value fails validation, all Actions and Tools in the Task are automatically disabled so that the user cannot invoke the Task. You can override this behaviour for each individual Action or Tool by disabling validation or explicitly specifying which Parameters to validate.

TaskActionDescriptor actionDescriptor = ...; //Task Action

//skip validation
actionDescriptor.setParamsToValidate(TaskActionDescriptor.VALIDATE_NONE_PARAMS);

//or specify list of parameters to validate
List<TaskParamDescriptor> params = ...;
actionDescriptor.setParamsToValidate(params);

To summarize, the new Task Framework enhancements provide support for validating Task Parameter values entered by a user. The validation rules are specified using Java classes but the validation itself is done on the browser using javascript.

Content contributed by Divesh Goyal, Product Engineer, ArcGIS Java Team

Posted in Developer | Tagged | Leave a comment

3D Vector Analysis

High-quality 3D data visualization is mainstream now thanks to Google Earth and Bing Maps (Virtual Earth). Users expect to see geospatial data in 3D. However 3D GIS users are now beginning to move beyond just visualization and need to do true 3D analyses, solving problems that can’t be solved in 2D.

ArcGIS 3D Analyst offers a range of 3D vector analysis tools enabling users to solve these 3D problems. New functionality includes the following:

  • A suite of 3D set operators, including Intersect 3D, Union 3D, Inside 3D, Is Closed 3D and Difference 3D, perform geoprocessing tasks using closed multipatches and 3D features.
  • Geoprocessing tools that expose 3D vector analysis specifically for virtual city workflows, such as Skyline and Skyline Barrier.
  • Enhancement of existing geoprocessing tools to work better with 3D. For example, the Select by Location dialog box uses 3D distances, and multipatch objects can participate in the Line of Sight tool.
  • Network datasets with full 3D connectivity.
  • Interactively measure in 3D using the Measure tool to display distance along a surface, height of 3D object, distance between two points in 3D, distance from observer (that is, how far away is an object?).

Benefits of 3D vector analysis
3D Vector Analysis3D vector analysis allows city planners to analyze their 3D city model and determine impact of newly proposed projects on the city environment.

   
Skyline and Buildable volume          Volumetric Shadows                Line of sight

Geoscientist can create cross-sections and fence diagrams using the new Intersect3D tool.

  
Cross-sections                                    Fence diagrams

Facilities managers can analyze 3D transportation networks to find the best route between locations.

   
Best route allowing use of elevators       Best route with stairs only

Mission planners can analyze flight paths / routes through hostile territory with regards to threat levels.

  
Initial analysis of threat levels                More accurate result using 3D vector tools
within range of AA gun            

Gert van Maren
3D Product Manager

Posted in 3D GIS | Leave a comment

ArcGIS JavaScript API version 1.6 released

Version 1.6 of the ArcGIS JavaScript API is now available. To use the new version, update your applications to point to version 1.6, like this:

<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1.6" type="text/javascript">

You will also need to update the style sheet to point to version 1.6:

<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/1.6/js/dojo/dijit/themes/tundra/tundra.css">

Here is a brief overview of the features added at version 1.6:

  • Support for Dojo 1.4.1
  • Ability to rename Dojo namespaces
  • Support for the Web Mercator Auxiliary Sphere (102100) as an overlay spatial reference for caches created in the Google Maps/Bing Maps tiling scheme. You can alternatively continue to use Web Mercator (102113) as an overlay spatial reference.
  • Several bug fixes

For a complete list of enhancements and bug fixes, view the ‘What’s new in Version 1.6′ document.

The ArcGIS JavaScript Extension for the Google Maps API was updated to add Web Mercator Auxiliary Sphere (102100) as a supported overlay spatial reference for Google Maps. You can alternatively continue to use Web Mercator (102113) as an overlay spatial reference.

The ArcGIS JavaScript Extension for Bing Maps has not been updated.

Posted in Services | Tagged | 2 Comments

Planning your DevSummit: Web APIs

This is the first post in the Planning your DevSummit series aimed at helping you make the most of your time at the 2010 Developer Summit. We’re really excited by the technical sessions, user presentations, demo theaters and seminars we’ve got lined up for you and there is certainly a lot to take in. Hopefully we can help make planning your days at the DevSummit that little bit easier.

The Technical Sessions

Server developers have a rich set of sessions available this year so I’ve split them into three Planning your DevSummit posts covering Web APIs, Working with Services, and Administering ArcGIS Server.

This first post covers sessions related to our JavaScript, Flex and Silverlight/WPF APIs. Whether you’re already using them, or want to find out how to get started, we have a lot of sessions that will help you.


Day 0: Presummit Seminars

A 3 hour seminar on Monday entitled Getting Started with the ArcGIS Web Mapping APIs (8:30am) discusses the 3 APIs and typical workflows for building your own applications. Attend this session if you are interested in learning about what’s common between these APIs and how to build applications (using the JavaScript API for the examples).


Day 1

If you’re new to Server development and are looking for an in-depth introduction, A Developer’s Guide to ArcGIS Server (1:00pm) will provide an overview of ArcGIS Server’s capabilities and this might help you decide which other sessions you might want to attend.

There are then three overview sessions for the Web APIs in case you didn’t attend the Presummit Seminar mentioned above:

These beginner-level sessions introduce you to each respective API, discuss how to get started with it, how to best use the developer resources, and go through creating your first application. You won’t need to know any Flex, Silverlight or JavaScript for these sessions.

Using and Extending the ArcGIS WebMap for Flex (4:30pm) introduces the new out-of-the-box web mapping application built on the ArcGIS API for Flex. Be sure to catch this one if you are interested in RIA Flex mapping solutions.  Again, you won’t need to know any Flex for this.


Day 2

Three Web API specific sessions are available on day two which assume a little more experience with the Web APIs. They go over the new features available in ArcGIS Server 10 and how to make use of them.

These sessions will be repeated at the end of Day 3.

If you’re using (or planning on using) the Web APIs to work with ArcGIS Online Enhancing your Applications with ArcGIS Online (1:00pm) is worth considering.


Day 3

The last day offers three sessions on Patterns and Best Practices (again, one for each Web API):

These sessions look at common problems during design and development and talk about how to overcome them to provide the best user experience built on top of solid, maintainable code.

In case you missed them, the very last session at 1:30pm repeats the Working with the ArcGIS API sessions from Day 2 (see above) for Microsoft Silverlight/WPF, JavaScript and Flex.

Lastly, I should also mention the Developer-to-Developer: The ESRI Development Process (8:30am) session, as it will be useful and of interest to any developer.


More Details

You can download the complete Web API Sessions Overview as a PDF document to print out and bring with you to the DevSummit as a convenient reference.

In the run-up to the DevSummit we’ll be posting more of these guides to help you pick out the sessions you’ll likely want to attend, and we’ll also be discussing the User Presentations. These are the guides you can look forward to:

If you’ve got suggestions for what you’d like to see in these guides, let us know.

- Nick

 

Posted in Developer | Tagged , , , , , , , | Leave a comment

Geodatabase Team

Make sure and visit the Geodatabase blog as there are some new post on one-way replication using archiving and the new topology rules with version 10.

Rank the posts and give the team some feedback so they know what type of information you want to see on the blog.

 

Posted in Uncategorized | Tagged , , , , | Leave a comment

Cure our Winter Blues with Your Template Stories

So you may or may not know that some of our Water Utility Resource Center Team is located in Philadelphia.

Yes, Philadelphia, the City that was hit by Snowpocalypse 1.0 and Snowpocalypse the Redux a few days later.  Well we dug out from both of those storms and have resumed making templates only to have yet another major  snow storm that is hitting us as we write this blog.   

So, needless to say we are tired of winter and need some cheering up.

The one thing that would make us all very happy (aside from temperatures in the 70s) is to hear from ArcGIS users that have implemented the templates.  Specifically we’d love for you to answer these questions and send us a screen shot or 2 of how you’ve implemented the templates:

  • Who is your organization
  • What template or templates did you implement
  • Why did you implement the template
  • How easy was it for you to implement
  • What did you like or dislike about the template

Since we appreciate you taking the time to provide us this information and cheer us up, the first 3 examples we get for each of the templates will receive a free virtual campus course as a token of our gratitude.  You can email your template stories at arcgisteamwater@esri.com

Thanks and don’t forget your mittens…

Posted in Water Utilities | Tagged , , , , , , , | Leave a comment

Updating Location Description Information

I was talking to a utility the other day about hydrants and sharing the location of out of service hydrants. The problem they had was that the hydrants had really bad location descriptions. They have coordinates, points, but the peopling wanting the data just want to see a list of the hydrants and information about where they are located. I thought about this for a while and it dawned on me, what a great use of reverse geocoding. You can easily reverse geocode all the hydrants and apply the addresses found to the location description field. If you need to apply location descriptions, give it a shot. Here is a link to a function to batch reverse geocode. Would I think would be cool if you could change this function so it would not only get an address, but if the hydrant was within a certain distance from an intersection, it would use the intersection not the address information for the description field. Maybe this is something ArcGIS Team water can work on. Let us know if you think this would help you.

http://resources.esri.com/help/9.3/ArcGISDesktop/dotnet/5e76c6e5-abf7-4690-8525-a69f96cef7e9.htm

 ArcGIS Team Water

Posted in Water Utilities | Tagged , , , , , , , , , | Leave a comment

2010 ESRI Developer Summit – Geodatabase Related Demo Theaters

Aside from the tech workshops that we mentioned in the last blog post, the geodatabase team also hosts demo theaters at the Dev Summit which are a shorter more hands-on, demo style of presentation.

Geometric Networks for Developers – Learn how to take advantage of the Geometric Network through code with examples on how to create, update and edit network features with examples of how to perform Trace Tasks; including the placement and use of Flags and Barriers.

Introduction to the Mosaic Dataset – The Mosaic Dataset is the data model for managing ortho images as well as basic level products from various sensor platforms. This session will briefly demonstrate techniques used in processing sensor data and focus on the key developer concepts of raster types and raster functions in managing sensor data in ArcGIS.

Introduction to Query Layers – Learn about the new ArcGIS 10 functionality that allows geographic information in databases to be quickly and easily integrated into GIS projects. Query Layers will allow developers to incorporate spatial and non-spatial data directly from a database removing the need to import this information into a geodatabase before it can be used by ArcGIS. This session will introduce developers to the query layers API and discuss some of the uses for this new data source.

A list and schedule of all the demo theaters can be found here.  If you aren’t going to be in Palm Springs for the Developer Summit this year you will still be able to access this content. After the Developer Summit we will follow up with a post that links to all the tech workshops and demo theaters.

Posted in Geodata | Tagged , | Leave a comment

Business Analyst workflow videos

by Jeff Hincy

The Business Analyst suite of products offer a vast variety of tools and reports that allow you dig deep into your current business model and better understand the potential of your business.  Since Business Analyst is designed to appeal to large audience of clients sometimes the sheer number of tools and how they interconnect can be intimidating to some users.  In order to help you better understand what our products can do for you we are going to be producing a series of videos targeting specific workflows.  These workflows are just examples of some standard approaches that have been utilized with our products.

The data and names in the videos are all fictional and do not represent any real life businesses.  Each of these workflows can be easily modified to fit your needs.

The first video is called Determine My Store(s) Trade Area.   This video examines a single approach on how to analyze a stores potential by examining various trade areas.  This analysis shows how with only store location data an analyst can quickly and easily determine the viability of a store.   

The second video is called Determine the Lifestyles of My Customer.  This video shows how to use Business Analyst to learn more about customers even when a customer list is not available. See how this fictitious hardware store learns what items to promote and how to promote them.

You can access these videos from the ArcGIS Resource Center and be sure to check back as we intend on adding new videos on topics such as Determine my Best and Worst Performing Store and Determine Market Penetration.  These workflows are designed to be used with the current version of Business Analyst desktop and we will be updating them later this year when the newest version of Business Analyst is released.

Enjoy and I hope they become a valuable resource for you.

Jeff

Posted in Location Analytics | Tagged , | Leave a comment

Error Reporting

Good summary and reminder from the Support blog about Error Reporting.  Please make it a habit to always send the report if you experience a crash with ArcGIS Desktop.  We take those reports seriously as we know the pain of a software crash.

 

Posted in Uncategorized | Tagged , , , | 2 Comments