|
||||||||||||
|
Plug-in Framework Outside developers are able to maintain their own dll's. They can publish them, sell them, or keep them private. Plug-ins are an extension of the Program Links framework, so a button can be placed at the top of any module. Hooks Database Security Limitations Example - Simple Installation 1. Download this file: 2. In the Main Menu, Setup, Program Links, add a new program link and fill it out as shown below
3. Restart Open Dental. Example - Complex Installation 1: Download the PluginExample solution (https://70.90.133.65:23793/svn/opendental/PluginExample/) using Tortoise. Put the PluginExample folder in a folder next to the head folder, just like it is in our Subversion folder organization. 2: Open the solution (.sln file). You may get errors about some projects not being found. 3: To fix the errors, remove both the OpenDental project and the OpenDentBusiness project by right clicking on them in the VS Solution explorer. Then, right click on the solution and add existing projects. Browse to ...head\OpenDental\OpenDental.csproj, and add it. Also, browse to ...head\OpenDentBusiness\OpenDentBusiness.csproj, and add it. 4: In Solution explorer, expand the PluginExample project, References folder. Verify that the references to OpenDental and OpenDentBusiness do not have red exclamations beside them indicating that they would be broken. If the references are broken, remove them and add back references to those two projects. 5: In Solution explorer, right click on the project, Edit Properties. Go to the Build Events tab, and edit the post-build event command line. Carefully fix the absolute path to the batch file that is included with the example. 6: Find the batch file using Windows explorer, and carefully fix the absolute paths contained within it. 7: Try to build. If no errors, PluginExample.dll will now be found in the debug folder of OpenDental. 8. Set the Open Dental project to be the startup project (right click). Test the new features. Features in the Example 1. Patient edit window replaced with an alternate. It's an obvious switch. The new one has only one field in it, but that field is fully editable. 2. In Account module, hover over the "Ins Left" label at the upper right to see a floating pane with an insurance breakdown in it. 3. A database table will be created and plug-in version managed. 4. Pushing the toolbar button for the plug-in launchs a form. Hints for Programmers 1. To access the private controls on an existing form from outside the form, look through the public Controls property as shown in the posted example. 2. Your new classes will have static methods that get called from the plug in. One option for implementing the other necessary members of the class that don't get called directly from the plugin is to use the singleton pattern. As in the example, a static instance of the class is stored within itself. All the non-static members in the class can then be accessed through that instance. Pay attention to static vs. non-static if you do this. It's a little trickier than in the main program. 3. More of your methods and variables will probably be public. 4. If managing your own database tables, remember that the plug-in may be turned off and then turned back on a few versions later. So you can't depend on the same pref that tracks database version. You will have to store your own database version pref. If you add rows to the preference table, be sure that they are very very unique. Make sure to prefix them with a string that would be impossible for us to accidentally duplicate, as we did in the example.
|
||||||||||||
Open Dental Software 1-866-239-0469
|