Guidance for Plugin Settings (.config, Prefs, etc...)

This forum is for programmers who have questions about the source code.
Post Reply
tholmes
Posts: 16
Joined: Fri Feb 16, 2018 10:39 am

Guidance for Plugin Settings (.config, Prefs, etc...)

Post by tholmes » Wed Mar 14, 2018 8:56 pm

What's the guidance for persisting plugin specific settings (e.g. connection strings to remote resources)? And how would one keep these updated?

User avatar
cmcgehee
Posts: 711
Joined: Tue Aug 25, 2015 5:06 pm
Location: Salem, Oregon

Re: Guidance for Plugin Settings (.config, Prefs, etc...)

Post by cmcgehee » Thu Mar 15, 2018 8:14 am

The recommended way is to create your own database table(s) within the Open Dental database. You can then use the class OpenDentBusiness.DataCore to read and write to these tables. Be sure to name your table something highly unique such as tholmes_connectionsettings.
Chris McGehee
Open Dental Software
http://www.opendental.com

tholmes
Posts: 16
Joined: Fri Feb 16, 2018 10:39 am

Re: Guidance for Plugin Settings (.config, Prefs, etc...)

Post by tholmes » Fri Mar 23, 2018 4:38 pm

Thanks Chris, we're using a PluginAssemblyName.dll.config file right now housed in the OpenDental bin folder.

We'll look into migrating this into the OD database.

User avatar
jsalmon
Posts: 1551
Joined: Tue Nov 30, 2010 12:33 pm
Contact:

Re: Guidance for Plugin Settings (.config, Prefs, etc...)

Post by jsalmon » Fri Mar 23, 2018 4:52 pm

If those settings are computer specific then that might suffice. However, if those settings are supposed to affect the whole office I'm not sure that will work. Putting the settings in the database (via your own table or a custom preference entry in our preference table) is the way you can guarantee that every workstation connected to that database can get access to your plug-in settings. We have examples of how to do such things in our PluginExample project:
See the "Example - Complex Installation" section for more details:
http://www.opendental.com/manual/plugins.html
The best thing about a boolean is even if you are wrong, you are only off by a bit.

Jason Salmon
Open Dental Software
http://www.opendental.com

Post Reply