Sample - Batch Plotting

Version 2

    Versions: 2.2

    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.

    1. Open PlottingSOE.sln and compile. The solution contains build events that register the DLL in codebase.
    2. This results in the following two files:       
      • BatchPlotting\PlottingSOE\RegisterPlottingSOE\bin\Debug\RegisterSOE.exe
      • BatchPlotting\PlottingSOE\PlottingSOE\bin\Debug\Miner.Server.PrintingSOE.dll
    3. Copy the above files into the same directory.
    4. Place a copy of gacutil.exe in the same directory as RegisterSOE.exe and Miner.Server.PrintingSOE.dll.
    5. 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.
          BatchPrintingSOE.png
    6. Enter the following: RegisterSOE.exe -n LayoutSOE -i 
        RegisterSOEexe.png
    7. Press Enter.
    8. 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.
    9. When prompted to select an extension, select the checkboxes next to BatchPrintingSOE and ArcFMMapServer.
    10. 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.              
    11. Open Computer Management and restart ArcGIS Server Object Manager.
    12. 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.

    1. Open BatchPlotting.sln.
    2. In the solution, view BatchPlotting.config (in ClientBin directory). This is where you'll set up the map service created in the previous steps.
    3. Look for the <PlottingServices> tag, and add <PlottingService> tag for each map service.

    <PlottingServices>

       <PlottingService Name="Plotting"
      Type
    ="ArcGISDynamicMapServiceLayer"
      Url
    ="http://vm-amidocs/ArcGIS/rest/services/BatchPlotting/MapServer"
      ProxyUrl
    =""
      
    />

      </PlottingServices>

    1. 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.
    2. Set the <Smtp> tag to the IP address of the SMTP server. The "to" email is set in the Batch Plotting user interface.      

    <Email>

       <Subject>Batch Plotting Notification</Subject>

       <From>batch_plotting@telvent.com</From>

       <Body>The batch-plotting task of map grids has been done, please fetch the printed files on your designated printer.</Body>

       <Smtp>172.11.224.22</Smtp>

      </Email>

    1. 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.

    1. 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.
    2. Select a template from the Template field.
    3. 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.
    4. 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.

    1. 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.
    2. Use the Select All/Deselect All buttons to clear all checkboxes in the list.
    3. 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.
    4. In the Printer field, select the printer to which the map sheets will be sent.
    5. Optionally, you can enter an email address. Once the plots are finished, the application will send an email to this address.
    6. Click Submit to start the batch plot.

     

    Requires:

    All of the files shown below are required for the solution to compile successfully.

     

    FileDescription
    Plotting SOE Solution
    PlottingSOE Project
    PlottingSOE.csprojThis project provides the DLL that retrieves any classes in the map service with the MAPGRID model name assigned.
    RegisterPlottingSOE Project
    RegisterPlottingSOE.csprojThis 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 Project
    BatchPlotting.csprojThis project provides the user interface for the web application and the batch plotting control.
    PlotSelector.xamlThe XAML for the batch plotting control user interface.
    PlotSelector.xaml.csThe C# code for the batch plotting control user interface.
    BatchPlotting.Web Project
    BatchPlotting.Web.csprojThis project provides the html and aspx pages for the web application.
    BatchPlotting.configThe 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.