Transform 10.x XML to XI JSON

To use favorites from your 10.x database, you can use the Import/Export Favorites and Graphics tool in the ArcFM System Favorites Manager to export them. In the ArcFM System Favorites Manager window > Features tab, select Fiber.

Once the file is exported, you must use Python scripting or an equivalent data migration tool to convert that file from 10.x to XI.

 Each favorites folder in the XI JSON is organized in folders and must have the following structure:

{ 
    "GUID":"3aec8e53-3835-4434-af48-fca90f6adfb6", 
    "Children":[] 
    "Attributes":[], 
    "LayerId":"0", 
    "ColumnCount":0, 
    "Type":4, 
    "IsTopLevel":false, 
    "IsDataTableSource":false, 
    "AssetGroupId":0, 
    "Alias":"FavoritesUpdate2", 
    "IsSelected":false 
}

Use the following table as guidance when populating the folders in the JSON file:

GUID

You must generate a unique GUID in the JSON format for every structure, favorite or folder.

Children

An array of JSON objects. These objects can be folders, favorites, or both.

Attributes

An array of the attributes used for Favorites. For folders this is always empty.

LayerId

For folders this is always 0.

ColumnCount

For folders this is always 0.

Type

For folders this is always 4.

IsTopLevel

For folders always false.

IsDataTableSource

For folders always false.

AssetGroupId

For folders always 0.

Alias

This is the display name of the folder.

IsSelected

for folders always false.

Each individual favorite in the resulting JSON must have the following structure. Here is an example.

{ 
"GUID":"35a93bf9-dcda-4dd3-98df-11c1bef86333", 
"ParentGUID":"271c39b1-2995-4411-aec2-c4821402e977", 
"Children":[], 
"Attributes":[], 
"LayerId":"1", 
"ColumnCount":0, 
"TableName":"MinervilleFiberV5_2_16_23.ARCFM_FXI.Splice", 
"Type":0, 
"IsTopLevel":true, 
"IsDataTableSource":false, 
"AssetGroupId":0, 
"Alias":"Splice", 
"ThisFiberClassModelName":"SPLICEPOINT", 
"DisplayName":"Coyote Dome 919B", 
"FiberColor":"", 
"IsSelected":true 
}

Use the following table as guidance when populating favorites in the JSON: 

GUID

You must generate a unique guid in the JSON format for every structure, favorite or folder.

ParentGUID

This must be the GUID of the item that this favorite is a child of, even if that item is a folder you must still use its GUID as the parent GUID.

Children

An array of objects that can be folders if the parent is a folder. If the parent is an actual fiber object then all of its children must be fiber objects. Folders cannot be put inside a fiber object as a child.

Attributes

An array of the structures that adds detailed descriptions to the fiber objects.

LayerId

The value of the layer number in the published webmap that this favorite will be used with. 

ColumnCount

Unused at this time, must be 0. 

TableName

This value must be in the following format for stand-alone tables only:

<schema name.<database table name>

The value for features must be:

<schema name.<published alias name>

Type

Always zero for individual favorite, not folders.

IsTopLevel

If it is a geographic feature then this is always true. If it is a stand alone table, then this value is always false. 

IsDataTableSource

See the Fiber Manager XI documentation for what is and is not a data table source and put true or false appropriately for this favorite as this member’s value.

AssetGroupId

If this is a geographic feature, then this is its asset type number. If it is a stand alone table then this is always 0. 

Alias

The published alias name of this feature or table and it must match the name in the database and the published service.

ThisFiberClassModelName

The name used in the Solution Center fiber configuration for this table or feature class. 

DisplayName

The name you want this favorite displayed within Fiber Builder.

FiberColor

The color of the fiber object. 

IsSelected

True for all favorites, false for all folders

Each favorite attribute in the resulting JSON must have the following structure: 

{ 
    "Value":"Some Value", 
    "Index":1, 
    "Name":"Attr name", 
    "Alias":"Attr Alias Name", 
    "ModelNames":[] 
} 

Use the following table as guidance when populating each favorite attribute in the JSON:

Value

Whatever value you want that attribute to have when the favorite is placed. If the attribute is for a GUID field type, it must have the value "00000000-0000-0000-0000-000000000000" in it or it will cause the favorite to fail on placement.

Index

The field index in the given table of this attribute.

Name

The name of this field in the database.

Alias

The alias name of this field in the published web service.

ModelNames

An array of strings of the field model names that are on this field in the database/solution center.

Here is an example of the pseudo code for processing the XML into the JSON: 

Once the file is converted, go to the Fiber Builder tool and import the transformed JSON file. See Export and Import Favorites for details. 

QR Code is a registered trademark of DENSO WAVE INCORPORATED in Japan and other countries.

Was this helpful?