Export Server Object Extension and Export Task Install guide. (V1.1) Author: Domenico Ciavarella ( http://www.studioat.it ) The Export shapefile Task brings the relevant functionality into your web applications. This document was written for developers who want to use this task in Visual Studio and users who want to install the utility in a distributed ArcGIS Server environment. In this task, you will see the names of the layers (feature classes and/or tables) selected from ArcCatalog. You can export all the layer without filter or give a spatial filter and/or a condition about attributes. This condition needs the real name of the field and not an alias (however you embed this feature if customize this task). If you select a table, the spatial condition will be ignored. If you use a spatial condition, once exported its features will be highlighted on the map. In presence of domains or subtype or subtype with domains in the layers, they will be resolved in exportation with their description, not with their value. Known issues: - the layers on the map must have the same projection as the map.
Components: All solutions are compiled with a SP4 installed. Please carefully read this section to understand where the different components need to be installed and what their function is. The Export Server Object Extension: Runs on every SOC (Server Object Container) and is the component in charge of creating the shapefile for export. This COM component will be installed on every SOC. The Export Server Object Extension Interfaces assembly stores interface definitions implemented by the server object extension, therefore it must be registered on all Server Object Container machines (ArcSOC.exe) where a server object may enable and use the server object extension. As a COM client, the ArcSOC.exe process can work with the server object extension classes and interfaces as COM objects and types. In addition, the Export Server Object Extension Interfaces must be registered on any application client machine that will consume the server object extension. As a result, the Microsoft.NET Framework used to build the assembly must be installed on the client machine. The Export Server Object Extension Interfaces contains the interfaces a client application will use to access server object extension objects remotely (just like working with ArcObjects remotely via ArcGIS Server). No business logic is distributed with the Export Server Object Extension Interfaces. The Export Server Object Extension Property Page: Runs on the desktop machine from which you administer your ArcGIS Server. This is just a property page in ArcCatalog that allows you to enable or disable the extension on your AGS Local map services. Additionally, you can use this property page to select the layers (feature classes and tables) and fields you want to export from your map service. This COM component will be installed on every machine from which you want to administer ArcGIS Server with ArcCatalog. The Export Task: This is the user interface that the users of your web application will use. You can use it on your custom web applications. The Export Task.net assembly will be installed on the web server machine.
Installing the Export Server Extension Interface (SOC and application client): 1. Copy Studioat.ARCGIS.SOE.ExportSOEInterface.dll into the machine 2. Register with regasm Studioat.ARCGIS.SOE.ExportSOEInterface.dll /tlb:studioat.arcgis.soe.exportsoeinterface.dll.tlb (Details about this see About registering assemblies in this document) 3. Add the assembly to the GAC with gacutil i Studioat.ARCGIS.SOE. ExportSOEInterface.dll (Details about this see About registering assemblies in this document) Uninstall: 1. To unregister the assembly and type library, use the following command: regasm /u Studioat.ARCGIS.SOE.ExportSOEInterface.dll /tlb:studioat.arcgis.soe.exportsoeinterface.dll.tlb 2. Uninstalls from thegac, use the following command: gacutil -u Studioat.ARCGIS.SOE. ExportSOEInterface.dll Installing the Export Server Extension (SOC): 3. Copy Studioat.ARCGIS.SOE.ExportSOE.dll into the machine 4. Register with regasm Studioat.ARCGIS.SOE.ExportSOE.dll (Details about this see About registering assemblies in this document) 5. Add the assembly to the GAC with gacutil i Studioat.ARCGIS.SOE.ExportSOE.dll (Details about this see About registering assemblies in this document) Uninstall: 6. To unregister the assembly and type library, use the following command: regasm /u Studioat.ARCGIS.SOE.ExportSOE.dll 7. Uninstalls from thegac, use the following command: gacutil -u Studioat.ARCGIS.SOE.ExportSOE.dll Installing the Export Server Extension Property Page (Desktop admin): 8. Close ArcCatalog and any ArcGIS Desktop machine 9. Make sure ArcGIS Server is up and running. 10. Make sure you are logged as an ArcGIS Server admin. 11. Copy Studioat.ARCGIS.SOE.ExportSOEPropPage.dll into the machine 12. Register with regasm Studioat.ARCGIS.SOE.ExportSOEPropPage.dll (Details about this see About registering assemblies in this document) 13. Add the assembly to the GAC with: gacutil i Studioat.ARCGIS.SOE.ExportSOEPropPage.dll 14. Run RegisterSOE.exe and click Enter to continue. Pass True to install (RegisterSOE True) and False to uninstall (RegisterSOE False). You ll need to run this executable from a DOS window. 15. Restart ArcGIS Server. Note for installation Export Server Extension Property Page: 1) Check if you have the.net Support module installed for ArcGIS Desktop 2) Make sure that the user account running ArcCatalog has read/execute access on the directory that contains the registered assembly Run..\ArcGIS\bin\categories.exe and check if you have registered correctly Export Server Extension Property Page. If so, the AGS extension parameter page will show as in the picture below.
Installing the Export Task (application client): 1. Copy Studioat.ARCGIS.ADF.Tasks.ExportSOETask.dll in the web Server. 2. Add the assembly to the GAC with gacutil i Studioat.ARCGIS.ADF.Tasks.ExportSOETask.dll 3. Restart IIS: iisreset If you change the custom task, you will need to update the GAC using the -if option with gacutil.exe. Another option is to automate reinstalling the custom task assembly to the GAC by modifying the pre and post build events in Visual Studio. Use the following steps to configure this option: 1) In Visual Studio, open the property page for the custom task project. 2) Add the following in the pre-build event command line textbox. The first line initializes the command line environment for the.net Framework tools. The second line uninstalls the existing custom task assembly from the GAC: - call "%VS80COMNTOOLS%vsvars32.bat" - gacutil -u $(TargetName) - Add the following in the post-build event command line textbox. Again, the first line initializes the command line environment for the.net Framework tools. The second line installs the existing custom task assembly into the GAC. The last line restarts IIS and is optional. It assumes that task development and runtime testing occur on the same machine. IIS must be restarted because ASP.NET Web applications may work with a cached copy of an assembly in the GAC (e.g. custom task control), otherwise the most recent task modifications may not be accessible during runtime testing: - call "%VS80COMNTOOLS%vsvars32.bat" - gacutil -i $(TargetPath) - iisreset
Getting started: Adding the task to custom web applications (web server): 16. Create a new webapp with Manager and add the mapservice that has the ExportSOE extension enabled. Make sure that the mapservice as added via an AGS Local Connection. 17. Add the ArcGIS Identity to the webapp. 18. Open default.aspx in design mode with visual studio. 19. Add the task assembly (Studioat.ARCGIS.ADF.Tasks.ExportSOETask.dll) to the toolbox by right clicking the toolbox; selecting choose items and browsing to the assembly (ExportSOETask). The next image shows the ExportSOETask once added to the toolbox in Visual Studio. 20. Drag the task from the toolbox into the taskmanager control.
21. Set the Task Results Panel property (a dialog will show up automatically) 22. Push F4 with the ExportSOETask control selected to open it s properties. Make sure that the properties dialog is opened for the ExportSOETask control, and not the TaskManager control. 23. In the Properties dialog, go to the ExportSOETask category and set the Map control ID (the map), then set the Map resource name to the service added. If this list is empty make sure that you have added an AGS Map Service with the ExportSOE capability enabled, AND that this map service is AGS Local Resource.
24. Also change the visible property to false. Otherwise the task will always be visible by default without even opening it. If, in the task, you want the same style you chose for template creating the web application you should open the Default.skin and add it by copying:
About selecting layers (feature class and table) and fields to the Export Server Object Extension: The Export SOE needs to be enabled and layers (feature class and table) and fields must be selected for the custom task (webclient) to display the layers in the dropdown list. If you run the webapp and get an error like (map service not found or something like that, go back to visual studio and add the ArcGIS Identity to the webapp). Here you can see the extensions listed within the capability. You should check the extension ExportSOE in order to allow your service to use the task. About registering assemblies: Regasm registration (In machine 64bit you use Command Prompt 32bit) Go to Start-All Programs- Microsoft.Net Framework 2.0 SDK Command Prompt Type: regasm full_path_to_the_assembly For example Regasm c:temp\test.dll Gacutil registration Type: gacutil i full_path_to_the_assembly
Once the extension is checked, you can select layers and fields available for export. Each of them has got an icon representing its content.
If you want, you can change the name of every field. In fact, in export names risk being truncated if too long (e.g. shapefile 10 characters). If you click the right button of your mouse, you will see a context menu which allows you to undo an alias field.
You can see in ArcGIS Server Manager s log if there are any troubles in this extension.