Deploying Custom Tasks with Supporting Files

(Submitted by Rob Dunfey, ArcGIS Explorer SDK Team)

I’ve just uploaded a custom task to the resource center that queries Flickr, the photo sharing website.  You can use the task to search for geo-tagged photos that have been ‘tagged’ with descriptions.

The most obvious path to incorporating geo-tagged photos in ArcGIS Explorer would be to use one of the two XML feeds; Flickr serve, GeoRSS or KML.  I opted to use the Flickr web services API instead, giving me far greater control of the photos returned by Flickr.  The ArcGIS Explorer custom task framework is ideal for working with such API’s, as the custom task executes on a background thread, so the application remains responsive whilst the Flickr database is queried for photos.

Working in Visual Studio, I chose to query the API via the Flickr.NET wrapper developed by Sam Judson – it’s proved to be a really reliable wrapper and congratulate and thank Sam on his work.  I went for the .NET wrapper as I figured it would make for rapid development, in comparison to making web requests against the native Flickr REST API with the .NET base classes.

Developing a custom task that relies on additional files does prompt some head scratching when it comes to deploying custom tasks.  When designing the custom task framework we wanted a simple deployment model that didn’t require developers to generate batch scripts or MSI files to deploy their custom tasks.  We did this with use of NMF file, allowing the developer to use the NMF file to specify the download location of their task assembly.

<E2TaskUIDescriptions xsi:type=’esri:ArrayOfE2TaskUIDescription’>
<E2TaskUIDescription xsi:type=’esri:E2CustomTaskUI’>
<Assembly>MyCompany.MyProduct.MyTask, Culture=neutral, PublickKeyToken=null, Version=1.0.0.0</Assembly>
<Class>MyCompany.MyProduct.MyTask.customTaskUI</Class>
<DisplayName>My Task</DisplayName>
<DownloadLocation>
http://www.myserver.conm/MyComapny.MyProduct.MyTask neutral null 1.0.0.0.dll
</DownloadLocation>
</E2TaskUIDescription>
</E2TaskUIDescriptions>

This works fine, unless your custom task relies on more than a single file, as is the case with the Flickr task using the Flickr.NET API wrapper.  Fortunately we’ve accounted for this by making use of compressed folders (zip files).  You can zip your task assembly, along with any other required files, and use the download location element of the NMF file to point at the zip file; ArcGIS explorer recognizes the zip file and extracts the content.

<E2TaskUIDescriptions xsi:type=’esri:ArrayOfE2TaskUIDescription’>
<E2TaskUIDescription xsi:type=’esri:E2CustomTaskUI’>
<Assembly>MyCompany.MyProduct.MyTask, Culture=neutral, PublickKeyToken=null, Version=1.0.0.0</Assembly>
<Class>MyCompany.MyProduct.MyTask.customTaskUI</Class>
<DisplayName>My Task</DisplayName>
<DownloadLocation>
http://www.myserver.conm/MyComapny.MyProduct.MyTask neutral null 1.0.0.0.zip
</DownloadLocation>
</E2TaskUIDescription>
</E2TaskUIDescriptions>

This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

Leave a Reply