24
Technical Workshops | Esri International User Conference San Diego, California Building Add-ins for ArcGIS Desktop in .NET Russell Louks and Steve Van Esch July 26, 2012

Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

Technical Workshops |

Esri International User Conference San Diego, California

Building Add-ins for ArcGIS Desktop in .NET

Russell Louks and Steve Van Esch

July 26, 2012

Page 2: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

ArcGIS Desktop Add-Ins

A better way to customize and extend ArcGIS Desktop applications.

- Easier to build - Easy to share - More secure - C#, VB.NET, Java, and Python

Page 3: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

Add-In Types supported at ArcGIS 10.1

• Buttons • Tools • Combo Boxes • Multi-Items • Menus • Context Menus • Toolbars • Tool Palettes

• Dockable Windows • Application Extensions • Editor Extensions • Editor Construction

Tools • SOE (Server)

Page 4: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

Supported Development Environments

• Visual Studio 2010

• Visual Basic 2010 Express Edition

• Visual C# 2010 Express Edition

• Eclipse IDE for Java Developers

• .NET 3.5, .NET 4.0

Page 5: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

New at ArcGIS 10.1

• IDE and Authoring Improvements

• Extended Help Capabilities - CHM, WEB help, PDF, etc.

• New Types

- Editor Construction Tools - Sever Object Extensions (SOEs)

• Python Add-Ins

Page 6: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

Add-In File Anatomy

Assemblies/JARs/PYDs Resources

AddIn File (zipped folder) .*.esriAddIn

XML Metadata

Page 7: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

Anatomy – Resources & Localization

Page 8: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

Anatomy - Declarative Aspects

• ID • Target • Author • Version • Company • Website • Descriptions • Captions

• Images • Category • Toolbars content • Menu content • Docking state • Docking position • Tooltips • Help

<ESRI.Configuration xmlns=http://schemas.esri.com/Desktop/AddIns xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Name>CASE Tools</Name> <AddInID>{f390c49d-a7a9-4b9f-a627-20f1ee3d5ca6}</AddInID> <Description>Case Tools</Description> <Version>1.0</Version> <Image>Images\CaseTools.png</Image> <Author>ESRI</Author> <Company>ESRI</Company> <Date>04/23/2010</Date> <Targets> <Target name="Desktop" version="10.0" /> </Targets>

<AddIn language="CLR" library="ESRI.ArcGIS.SchemaGenerationWizard.dll" namespace="CaseUI.SchemaGenerationWizard"> <ArcCatalog> <Commands> <Button id="SchemaGenerationWizard_SchemaGenerationWizard" class="SchemaGenerationWizard" tip="Use the Schema Generation Wizard..." message="Schema Generation Wizard" caption="Schema Generation Wizard" category="CASE Tools" image="Images\SchemaGenerationWizard.png" /> </Commands> </ArcCatalog> </AddIn>

<DockableWindows> <DockableWindow id="ESRI_Example_DockableWindow" class="ExampleDockableWindowClass" caption="Example Dockable Window"> <InitialPlacement height="300" width="300" state="pinned" position="right" neighbor="esriArcMapUI.TOCDockableWindow" /> </DockableWindow> </DockableWindows> </DockableWindows>

Page 9: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

Anatomy - Programmatic Aspect

• Add-In Behavior coded using - Visual Studio / Eclipse wizards and templates - Base classes for each Add-In type - Full ArcObjects API + programming environment (.NET/Java)

public class SimpleButton : Button { protected override void OnClick() { MessageBox.Show("Hello World"); } }

Page 10: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

Anatomy - Classic (managed) COM Button comparison

Page 11: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

Add-In File Discovery & Sharing

• Add-In files are automatically discovered in well known local folders and incorporated into the Desktop applications at runtime.

• Folders are per user and per ArcGIS version Under Windows Vista & Windows 7: C:\Users\<username>\Documents\ArcGIS\AddIns\Desktop10.1

Under Windows XP: C:\Documents and Settings\<username>\My Documents\ArcGIS\AddIns\Desktop10.1

Internet

Page 12: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

Add-In File Discovery & Sharing

• Administered network shares

• Simplifies Updates

Intranet

Page 13: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

Managing Add-Ins - Installation Utility

• Double-click “Install”

• Customize - Add From File

• XCOPY

Page 14: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

Add-In Versioning Policy

Backward compatibility within a major version • ArcGIS 10.1 can consume 10.0 Add-Ins • ArcGIS 10.0 cannot consume 10.1 Add-Ins

Page 15: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

Managing Add-Ins – Add-In Manager Dialog

• Shows detailed information on all installed Add-Ins

• Mine vs. Shared

• Deleting Add-Ins

Page 16: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

Managing Add-Ins – Sharing & Security

• Custom search folders

• Security Settings

Page 17: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

Managing Add-Ins - Additional Security Settings

• Admin Controls • Esri Only

• Load from administrator folders only

• Admin security level lock

Page 18: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

Managing Add-Ins Demo

Page 19: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

Digitally Signing Add-Ins

• IETF/WC3 XML-DSig standard (within OPC archive)

• Trust - Source Traceability - Tampering

• ESRISignAddin Utility

Page 20: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

Moving to Add-Ins

• Porting guidelines - http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index

.html#/How_to_migrate_from_COM_components_to_add_ins/0001000003z6000000

• Do not rely on: - COM Components requiring registration - Assemblies requiring registration in the GAC - Pre-existing dependencies

• Public API exposure - IDispatch for external access

• Most business logic should not need to be changed

// Finding the extension... COM style. protected override void OnClick() { // Find the custom COM interface.. IApplication app = this.Hook as IApplication; ICustExt ext = app.FindExtensionByName("ACME.SampleExt") as ICustExt; // Call custom method.. ext.Foo(); }

// Finding the extension... Add-In style. protected override void OnClick() { // Call custom method.. SampleExt.Me.Foo(); }

internal static SampleExt _me; public SampleExt() { _me = this; } internal static SampleExt Me { get { UID id = ThisAddIn.IDs.SampleExt.ToUID(); ArcMap.Application.FindExtensionByCLSID(id); return _me; } } public void Foo() { }

Page 21: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

Authoring an Add-In Demo

Page 22: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

Questions

Page 23: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,

External Links

• ArcGIS Desktop Add-Ins - http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Building_add_ins_for_ArcGIS_D

esktop/0001000000w2000000

• WC3 XML Digital Signatures - http://www.w3.org/Signature/

• ISO/IEC 29500-2:2008 Open Packaging Conventions - http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=51459

• ITU X.509 Certificates - http://www.itu.int/rec/T-REC-X.509/en

• ISO Language Codes - http://www.loc.gov/standards/iso639-2/php/code_list.php

Page 24: Building Add-ins for ArcGIS Desktop inArcGIS Desktop Add -Ins . A better way to customize and extend . ArcGIS Desktop applications. -Easier to build -Easy to share -More secure -C#,