How To: Implementing Metrix Sync
Download
Download the latest version:
Installation
- Get an API Key from Metrix -> My Profile -> API Keys
- Login to SQL Server Management Studio
- Create an assets_cache database
- Nominate a SQL Server user that Metrix Sync will use. Ensure that it has read/write/admin/owner permissions to the assets_cache database. If this user is a domain (AD) user, then Task Scheduler will need to Run As this user.
- Unzip and put on customer network. e.g. \\SERVER_GIS_DIR\Application\Metrix\Metrix_Sync
- Open the Config.ini in a Text Editor
- Configure the Database Connection Details
- Configure the Debug Mode: debug_mode=true
- Configure the Encryption Mode: mode=encrypt
- Configure the Apikey: apikey_unencrypted=APIKEY
- Configure optional parameters
- api_url=https://api.metrixassets.com/api/v1
Only useful if the api url changes by the Metrix team. - api_attributes=attribute1,attribute2
A comma delimited list of attributes to download. Refer to Metrix API. - search_attributes=attribute1,attribute2
A comma delimited list of attributes that should be populated in the dbo.cache_lookup_for_search for search reasons. If unset, the ids and description will be searchable. - update_mode=true
Set this to false if there are proxy or IT limitations that prevent the self-updater from functioning.
- api_url=https://api.metrixassets.com/api/v1
- Run Metrix_Sync.exe
- Copy the encrypted apikey
Note that if you cannot copy the apikey, right click the top of the cmd window, click Edit and click Mark. You should then be able to interact with the window and highlight the text. Click the ENTER key to copy. - Open the Config.ini in a Text Editor
- Configure the Apikey: apikey=ENCRYPTED_APIKEY
- Delete the Unencypted APIKey line: apikey_unencrypted=APIKEY
- Delete the Encryption Mode line: mode=encrypt
- Run Metrix Sync
- Check for any errors in the log files
- Configure the Debug Mode: debug_mode=false
- Open Task Scheduler
- Create a new scheduled task to run nightly (or weekly) using the user defined above or a service account.
Implementation into Intramaps (Optional)
- In Intramaps MapManager, create a map file called Assets (preferably) or if such exists, call it Infrastructure
- Setup 3 live SQL Server layers to the assets_cache.dbo.*_vw views in MM
Note: Ensure all three are setup. If you get errors due to empty views, set them up in the MM text - Call the layers:
Metrix Point
Metrix Line
Metrix Polygon - Setup classes per layer that are based on the theme_name (if it exists) or classification.
Note: You can get a distinct list of required themes via:
- Setup an Other class per layer.
- Setup 3 Tables in the Spatial tab of Intramaps ConfigManager pointing to the 3 component views
- Setup 3 Selection Layers in the Spatial tab whose mapkey is the component_record_id and whose names are:
Metrix Polygon SQL
Metrix Line SQL
Metrix Point SQL - Setup the following Info1 whose name is Info in all 3 Selection Layers. Ensure you change the URL!
- For IM 9.10 and onwards, remove the following: +’|Click here'
- Setup a new Database in the Databases tab called SQL (Assets MultiLayer) pointing to one of the 3 selection layers
- Setup a new Auto-Complete Combobox query named Assets Descr AUTO
- Setup a Multi-layer search named Metrix Asset with 1 field whose name is @keyword and whose Label is Asset with a width of 50 pointing to the above combobox
- Setup an Application Link pointing to Metrix. Ensure you update the URL!
Name: Metrix
URL: https://SITENAME.metrixassets.net
Icon: https://SITENAME.metrixassets.net/favicon-new.ico
How to Purge Metrix Sync Data
- Rename the cache_metadata to cache_metadata_backup
- Rename the cache_metadata_backup PK from PK_cache_metadata to PK_cache_metadata_backup
- Rename the cache_metadata_backup constraint from DF_cache_metadata_last_processed to DF_cache_metadata_backup_last_processed
- Run Metrix Sync
- Restore the backed up cache_metadata by deleting the newly created cache_metadata, renaming the backed up one and renaming it’s PK back to PK_cache_metadata and constraint back to DF_cache_metadata_last_processed