Product Availability: ArcFM for Silverlight SDK
Customization Type: Client-Side
This sample implements batch plotting in an ArcFM Server web application. The sample consists of two solutions: PlottingSOE.sln and BatchPlotting.sln. PlottingSOE provides the interaction with the server-side SOE. It retrieves all classes with the MAPGRID model name assigned and holds them in a REST endpoint. When the user chooses to print a specific map sheet, the Batch Plotting functionality retrieves the correct class based on the map sheet name (field with the MAPSHEETNAME model name assigned) from the REST endpoint.
How to Implement - PlottingSOE
Use the following steps to implement the PlottingSOE solution. This provides the registration component for the BatchPlottingSOE extension as well as the required DLL for the batch plotting functionality.
- Open PlottingSOE.sln and compile. The solution contains build events that register the DLL in codebase.
- This results in the following two files:
- Copy the above files into the same directory.
- Place a copy of gacutil.exe in the same directory as RegisterSOE.exe and Miner.Server.PrintingSOE.dll.
- Use RegisterSOE.exe to add the BatchPrintingSOE extension to the list of available extensions on the map service (Capabilities tab). Open a command prompt and point to the directory that contains RegisterSOE.exe.
- Enter the following: RegisterSOE.exe -n LayoutSOE -i
- Press Enter.
- In ArcCatalog, create map service that includes a class with the MapGrid model name assigned. This class must also have a field with the MAPSHEETNAME field model name assigned. Make note of this map service name as you will need it when configuring BatchPlottingUI.
- When prompted to select an extension, select the checkboxes next to BatchPrintingSOE and ArcFMMapServer.
- Next, set up the printer on the server machine (Add a Device in the Control Panel). This is the same machine that runs the SOC. The ArcGISSOC user must have permissions to each printer.
Note: If you have multiple SOC machines, each one must have the same printers configured.
- Open Computer Management and restart ArcGIS Server Object Manager.
- Reset IIS.
How to Implement - BatchPlottingUI
Use the following steps to implement the BatchPlottingUI solution. This provides the user interface for batch plotting and the web application. Note that the sample uses the stored displays found in the geodatabase (mdb) used to create the map service.
- Open BatchPlotting.sln.
- In the solution, view BatchPlotting.config (in ClientBin directory). This is where you'll set up the map service created in the previous steps.
- Look for the <PlottingServices> tag, and add <PlottingService> tag for each map service.
- Next, look for the <Email> section. The Batch Plotting developer sample sends a notification email once the last plot has been sent to the printer.
- Set the <Smtp> tag to the IP address of the SMTP server. The "to" email is set in the Batch Plotting user interface.
<Subject>Batch Plotting Notification</Subject>
<Body>The batch-plotting task of map grids has been done, please fetch the printed files on your designated printer.</Body>
- Compile the project and follow the steps on the Set Up Custom Web Application page to create a web application.
How to Use
Use these steps to use the batch plotting developer sample.
- Select a map service from the Service field. This list includes all available map services that include a feature that has the MAPGRID model name assigned.
- Select a template from the Template field.
- Select a layer from the Layers field. This is a list of layers that appear in the selected map service and have the MAPGRID model name assigned.
- The Selection Filter field may be disabled. If it is, you can click Allow Selection to enable it. Use this field to search for a specific map sheet using the map sheet ID (or a value in a field to which the MAPSHEETNAME model name is assigned). When you enter a value in this field and press Enter on the keyboard (or Tab), the list below is filtered to show only the map sheet you indicated in the Selection Filter field and any adjacent map sheets. The map display will zoom to the filtered map sheet and highlight it in red.
Note: If you have an entry in the Selection Filter field and advance to another field before pressing Enter on the keyboard, returning to that field and pressing Enter will no longer work. You must re-enter the value and press Enter.
- If you have used the Allow Selection button to enable the Selection Filter field, then the list of map sheets will also be enabled. Here you can select one or more map sheets to be plotted.
- Use the Select All/Deselect All buttons to clear all checkboxes in the list.
- Use the Zoom to Full Extent button to zoom the map display to show the full extent of the selected map service. This also returns all map sheets to the list if there is no entry in the Selection Filter field. It does not, however, clear any selections.
- In the Printer field, select the printer to which the map sheets will be sent.
- Optionally, you can enter an email address. Once the plots are finished, the application will send an email to this address.
- Click Submit to start the batch plot.
All of the files shown below are required for the solution to compile successfully.
|Plotting SOE Solution|
|PlottingSOE.csproj||This project provides the DLL that retrieves any classes in the map service with the MAPGRID model name assigned.|
|RegisterPlottingSOE.csproj||This project provides an executable that registers the Server SOE as an extension. Once registered it is an option in the ArcCatalog list of extensions.|
|Batch Plotting Solution|
|BatchPlotting.csproj||This project provides the user interface for the web application and the batch plotting control.|
|PlotSelector.xaml||The XAML for the batch plotting control user interface.|
|PlotSelector.xaml.cs||The C# code for the batch plotting control user interface.|
|BatchPlotting.Web.csproj||This project provides the html and aspx pages for the web application.|
|BatchPlotting.config||The configuration file for the web application. Use this file to indicate the map service as well as the IP address for the SMTP server if you want to use the email functionality.|