ArcFM Engine Developer Guide
Custom Layout XML Code Sample

Version: 10.2.1c and 10.2.1c SP3

Resource Center Home

Product Availability: ArcFM Viewer for ArcGIS Engine, Responder

This sample demonstrates the XML used to modify the user interface of ArcFM Solution applications such as ArcFM Viewer for ArcGIS Engine and Responder. Customizations to the user interface must be added to a Custom Layout XML file (e.g., ArcFMViewer.exe.custom.layout, Responder.exe.custom.layout). If the required tags don't exist, you may need to add them to the XML file using the example below. This file should be placed in the ArcFM Solution\Bin\Addons directory (ArcFM Viewer) or the ArcGIS\Bin\Responder\Addons directory (Responder). As long as this file remains in the appropriate Addon directory the customizations that are defined will remain in effect. If the file is ever deleted or moved the customizations will be lost. This is to ensure that the intended customizations are properly incorporated into the standard user interface.

Note: XML tags are case-sensitive.

  1. Within the <LayoutData> tag are attributes that can be used by the system administrator to indicate the most recent Custom Layout file to be used, as well as indicate that the user should be prevented from altering the standard user interface. If you are distributing only objects to be removed, this tag is still required.

    • layoutFormat: This value indicates the current format of the file. It should always be set to "2".

    • lockLayout: This optional attribute can be set to "true" if the system administrator wishes to prevent users from customizing the user interface using the "Customize" dialog box. This attribute should appear only in the ArcFMViewer.exe.custom.layout file.

  2. Use the <Extensions> and <Extension> tags to instantiate custom extensions. Enter an extension name and its progID or GUID (see example below).

  3. If you want ArcFM Viewer to access a specific ArcGIS license, use the <License> tag with the Name attribute to enter a value from the esriLicenseProductCode enumeration. This tag does not apply for Responder customizations.

  4. All additions to the user interface should be placed between the <MainWindow> tags. The attributes in the <MainWindow> tag determine the size and positioning of the application window. These settings are persisted automatically when the user adjusts the window size/position. If you are distributing only objects to be removed, this tag is still required.

  5. The <CommandManager> tag contains commands and commandbars as well as OptionSets.

  6. The <Commands> tag contains the commands which appear in the interface. Commands include buttons, menu items, and fly-out menu tools. The first commands in this list are the buttons and individual menu items. Note that the Key value for the command matches the key set in the code that created the command.

  7. The <CommandBars> section allows you to assign commands to toolbars and menus. In this example, two of the new commands (in the <Commands> tag) are added to the ArcFM Viewer toolbar. To find the CommandBar key values, you may look in the Application Layout XML file automatically created by the application (these files are discussed in the Remove Functionality section of the Implementing Customizations page). Use the "firstInGroup" attribute to indicate a new command group. A divider bar will be placed to the left of any commands where this attribute is set to "true."

  8. The <OptionSets> section lists commands that may be executed one at a time only. If the user activates a command in this list, all previously-activated commands are deactivated. For example, this prevents the user from activating an electric trace at the same time as a gas trace.

  9. The <DockManager> tag allows you to add custom dockable windows.

  10. The <MdiTabManager> tag allows you to add custom MDI windows.

  11. The <RemoveObjects> tag contains all of the objects you wish to remove from the user interface. ObjectType and Key values are required. Note: Attributes are case sensitive.

 

XML Snippet
Copy Code
<?xml version="1.0" encoding="us-ascii"?>
<LayoutData xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    layoutFormat="2" lockLayout="false">
<SystemData>
 <Extensions>
  <Extension name="ExtensionName" progIDorGUID="Enter ProgID or GUID"/>
 </Extensions>
 <Licenses>
  <License name="esriLicenseProductCodeEngine"/>
 </Licenses>
</SystemData>
 <MainWindow>
  <CommandManager>
   <Commands>
    <Command key="DevMapZoomControl" type="Miner.DeveloperSamples.Engine.MapZoomControl, ArcFMViewerEngineMapZoomControl"/>
    <Command key="DevMapRefreshCommand" type="Miner.DeveloperSamples.Engine.MapRefreshCommand, ArcFMViewerEngineMapRefresh" />
    <Command key="DevBookmarkCommand" type="Miner.DeveloperSamples.Engine.DevBookmarkCommand, ArcFMViewerEnginePopUpBookmarks" />
   </Commands>
   <CommandBars>
    <CommandBar key="ArcFMViewer" type="Miner.Windows.ArcGIS.CommandBarArcFmViewer, Miner.Windows.ArcGIS, 
    Version=9.1.0.0, Culture=neutral, PublicKeyToken=0bbf99e30d318f01" dockedRow="1" dockedColumn="1" dockedPosition="Top" 
    targetPosition="0" floatingLocationX="354" floatingLocationY="362" floatingWidth="233" floatingHeight="24">
     <CommandItems>
      <CommandItem key="DevMapZoomControl" firstInGroup="false" recentlyUsed="true" visible="true" />
      <CommandItem key="DevMapRefreshCommand" firstInGroup="true" recentlyUsed="true" visible="true" />
     </CommandItems>
    </CommandBar>   </CommandBars>
   <OptionSets>
    <OptionSet key="Tools" allowAllUp="true" selectedToolKey="">
     <OptionItems>
      <OptionItem key="MapPanTool" />
      <OptionItem key="MapZoomInTool" />
      <OptionItem key="MapZoomOutTool" />
      <OptionItem key="MapZoomPanTool" />
     </OptionItems>
    </OptionSet>
   </OptionSets>
  </CommandManager>
  <DockManager>
   <DockAreas>
    <DockArea width="336" height="352" childPaneStyle="TabGroup" selectedTab="1" 
    dockedLocation="DockedLeft" isVisible="true" floatingLocationX="182" floatingLocationY="421">
     <Panes>
      <Pane xsi:type="DockControlPaneLayout" width="248" height="620" key="Toc" isVisible="true" isPinned="true" flyoutSizeX="-1" flyoutSizeY="-1">
       <DockedControl type="Miner.Windows.ArcGIS.TOC, Miner.Windows.ArcGIS, Version=9.1.0.0, Culture=neutral, PublicKeyToken=0bbf99e30d318f01" />
      </Pane>
     </Panes>
    </DockArea>
   </DockAreas>
  </DockManager>
<MdiTabManager>
 <MdiTabGroups>
  <MdiTabGroup>
   <MdiTabs>
    <MdiTab key="DevMDIWindow">
     <MdiWindow type="Miner.DeveloperSamples.Engine.DevMDIWindow, ArcFMViewerEngineMDIWindow" >
       <CreateData>
        <Param type="System.String" value="DevMDIWindow" />
       </CreateData>
     </MdiWindow>
    </MdiTab>
   </MdiTabs>
  </MdiTabGroup>
 </MdiTabGroups>
 <HiddenTabs />
</MdiTabManager>
 </MainWindow>
 <RemoveObjects>
  <RemoveObject objectType="Command" key="FileSave" />
 </RemoveObjects>
</LayoutData>

 

 

 


Send Comment to ArcFMdocumentation@schneider-electric.com