Where are ArcGIS Pro DAML values such as esri_geodatabase_folderConnectionContainer documented?

1159
8
Jump to solution
02-27-2020 10:03 AM
AlanStewart
Occasional Contributor

I've been looking through various DAML references but can't seem to find esri_geodatabase_folderConnectionContainer and alternative values for placeswith  when defining a custom project item container in Config.DAML. I'm following the "ProConcepts Custom Items" document. I'm developing an add-in that needs to store private data in the project and am thinking a custom project item is the way to do it. If possible I'd prefer the project item not be visible to the use.

0 Kudos
1 Solution

Accepted Solutions
CharlesMacleod
Esri Regular Contributor

This Pro Guide might help: ProGuide-Custom-settings

Note that OnReadSettingsAsync is called only if you _have_ settings in a given aprx (and the module is already loaded). It is called when the project is opened. OnWriteSettingsAsync will be called on project save.

View solution in original post

0 Kudos
8 Replies
GKmieliauskas
Esri Regular Contributor

HI Alan,

You can use BackStage_PropertyPage ArcGIS Pro sample  to store private data in the project. More info here:

https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/BackStage_PropertyPag...

AlanStewart
Occasional Contributor

Thanks, Gintautas, I'd discovered that after posting this question. This approach seems to require creating a property sheet that is displayed in the backstage, which is undesirable in my case. It's also limited to string representations, not a big deal, but less than ideal. I really want to store complex data, preferably without it being visible to the user.

It looks like it might be possible to do a property page that displays only a minimal number of properties but actually store many more behind the scene. I'm implementing an experiment today.

In ArcObjects our application stored private custom data by storing a custom object as a PageLayoutExtension.

0 Kudos
GKmieliauskas
Esri Regular Contributor

Hi Alan,

You can use project settings without user interface. You can find implementation in module class. All complex settings you can serialize and store as strings

Get Outlook for Android<https://aka.ms/ghei36>

AlanStewart
Occasional Contributor

I tried that yesterday. The debugger shows that OnReadSettingsAsync() and OnWriteSettingsAsync() are never being called. That's why it appears to me a property page is necessary.

Unless it's possible to instantiate ModuleSettingsReader and ModuleSettingsWriter in my module and make those calls form within the module?

0 Kudos
UmaHarano
Esri Regular Contributor

Hi Alan, Is your Add-in set to autoload? (Config.daml "Autoload" attribute set to true)

Otherwise the add-in will only load when needed. 

Declaring Modules in DAML

Modules are declared within the root ArcGIS element but must be further enclosed within a module's container element. The autoLoad attribute is used to control whether the module is loaded just-in-time (JIT)—the default—or automatically when the application starts. In almost all cases, autoLoad should be set to false.

  <modules>     <insertModule id="acme_mainModule" caption="Acme"                    className="MainModule" autoLoad="false">       <!--Declare additional customizations here..-->    </insertModule>   </modules>

If declaring a new module, all constituent plug-in declarations contained within the insertModule element are implicitly inserts, so the insert prefix on element names can be omitted (for example, insertButton becomes simply button).

0 Kudos
AlanStewart
Occasional Contributor

Thank you, Uma, but that does not cause OnReadSettingsAsync() or OnWriteSettingsAsync() to be called, it only changes when my breakpoint in Initialize() is hit.

0 Kudos
CharlesMacleod
Esri Regular Contributor

This Pro Guide might help: ProGuide-Custom-settings

Note that OnReadSettingsAsync is called only if you _have_ settings in a given aprx (and the module is already loaded). It is called when the project is opened. OnWriteSettingsAsync will be called on project save.

0 Kudos
AlanStewart
Occasional Contributor

BINGO! Thanks...

0 Kudos