Select to view content in your preferred language

How do I repair a broken data source using a custom plugin datasource?

118
1
Jump to solution
Wednesday
Kbperri
New Contributor II

I have a custom plugin datasource and I want the user to be able to update and repair the data source on their tables using my custom plugin datasource. Unfortunately, since ArcGIS Pro doesn't know how to read my datasource file, nothing shows up in the data source selection window. In the screenshot below, you can see the current data source is the .bsc file plus the views.3 but when I click "Set Data Source..." and navigate to the bsc file in the window, the container is empty. Is it possible to write code that will read my custom bsc file to allow the user to select their data source?

Kbperri_0-1718821337532.png

 

0 Kudos
1 Solution

Accepted Solutions
UmaHarano
Esri Regular Contributor

The Set Data Source button on the Layer PropertySheet page can’t be used to browse to your custom bsc file (plugin data).

Instead, you will have to make a custom property page that you can insert into Pro’s Layer Property Sheet. (The daml id for this is esri_mapping_featureLayerPropertySheet)

<propertySheets>
  <updateSheet refID="esri_mapping_featureLayerPropertySheet">
    <insertPage id="DAML_LayersPropertySheet_LayersPropertySheet" caption="My custom layer properties" className="DAML.LayersPropertySheet.LayersPropertySheetViewModel" placeWith="esri_mapping_layerSourcePropertyPage" insert="after" >
    <content className="DAML.LayersPropertySheet.LayersPropertySheetView" />
   </insertPage>
</updateSheet>

On this custom page, you can have a button that displays a OpenItemDialog. Set the filter in this dialog to open your bsc files.

UmaHarano_0-1718921477828.png

Then, you can fix the data source on your layer to the selected bsc file by accessing its data connection via the CIM.

 

 

View solution in original post

0 Kudos
1 Reply
UmaHarano
Esri Regular Contributor

The Set Data Source button on the Layer PropertySheet page can’t be used to browse to your custom bsc file (plugin data).

Instead, you will have to make a custom property page that you can insert into Pro’s Layer Property Sheet. (The daml id for this is esri_mapping_featureLayerPropertySheet)

<propertySheets>
  <updateSheet refID="esri_mapping_featureLayerPropertySheet">
    <insertPage id="DAML_LayersPropertySheet_LayersPropertySheet" caption="My custom layer properties" className="DAML.LayersPropertySheet.LayersPropertySheetViewModel" placeWith="esri_mapping_layerSourcePropertyPage" insert="after" >
    <content className="DAML.LayersPropertySheet.LayersPropertySheetView" />
   </insertPage>
</updateSheet>

On this custom page, you can have a button that displays a OpenItemDialog. Set the filter in this dialog to open your bsc files.

UmaHarano_0-1718921477828.png

Then, you can fix the data source on your layer to the selected bsc file by accessing its data connection via the CIM.

 

 

0 Kudos