Hook requests - OpenDental.FormLogOn & FormSecurity

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
Ardavan
Posts: 106
Joined: Sat May 15, 2010 9:10 am

Hook requests - OpenDental.FormLogOn & FormSecurity

Post by Ardavan » Thu Oct 23, 2014 7:08 am

Hello OpenDental team and community,

I would like to request two hooks to be added to two forms. Both are of the type HookAddCode, and both are for the same plugin (Directory Services Authentication). The reason this plugin requires two hooks is that I would like to piggy back on the existing security framework to ensure only users with the security admin permission may access the settings of the plugin. I have compiled OD with the following hooks and tested to confirm everything is working as per design.

Within OpenDental.FormLogOn:

public FormLogOn()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
Plugins.HookAddCode(this, "FormLogOn.InitializeComponent_end");
Lan.F(this);
}

And within OpenDental.FormSecurity:

public FormSecurity()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
Plugins.HookAddCode(this, "FormSecurity.InitializeComponent_end");
Lan.F(this);
}

Thank you for an awesome product and solid community, I would have never imagined when I started using open dental four years ago that I would ever develop a plugin for it, now I'm hooked and can't stop brainstorming ideas!

allends
Posts: 235
Joined: Fri Aug 23, 2013 11:29 am

Re: Hook requests - OpenDental.FormLogOn & FormSecurity

Post by allends » Mon Oct 27, 2014 6:50 am

Hooks have been added to 14.3.15 and will be available in the next release.
Allen
Open Dental Software
http://www.opendental.com

User avatar
Ardavan
Posts: 106
Joined: Sat May 15, 2010 9:10 am

Re: Hook requests - OpenDental.FormLogOn & FormSecurity

Post by Ardavan » Thu Nov 20, 2014 6:36 am

Sorry for bumping an old post but I just realized I never thanked you for adding the hooks I requested. Thank you Allen for the reply and adding the hooks.

Also, I recall reading somewhere that you do not add hooks to OpenDentBusiness, then some time later I may have read that starting 14.x this may be allowed (don't remember the x).

I have no experience with ASP (except of course following the instructions to run OD as a web service), am I correct to assume adding plugins to the web service layer is no different than adding them to the main program?

Thanks again.
There are 10 types of people in this world, those who will laugh at this joke, and those who won't. ~Annonymous Bug Writer

allends
Posts: 235
Joined: Fri Aug 23, 2013 11:29 am

Re: Hook requests - OpenDental.FormLogOn & FormSecurity

Post by allends » Thu Nov 20, 2014 8:27 am

No problem! Hooks are easy to add and you followed our naming convention quite well.

As for hooks in OpenDentBusiness, we have recently changed our policy to be more accepting of hooks. Generally, hooks in OpenDentBusiness will query the main opendental database directly. This is ok, but should be done with caution since any changes to our database schema could easily invalidate that code. A better option would be to install a database alongside opendental when users install your plugin. This would allow you to version your own database and call it at will throughout the program.

I am not sure what you mean about adding plugins to a webservice. Our webservice layer doesn't support plugins because adding hooks to our own hosted webservices would be redundant. If you are talking about having OD run plugins when it's running through the Middle Tier then I believe that we were recently making that a possibility, but I am unsure if that has been finished.
Allen
Open Dental Software
http://www.opendental.com

User avatar
Ardavan
Posts: 106
Joined: Sat May 15, 2010 9:10 am

Re: Hook requests - OpenDental.FormLogOn & FormSecurity

Post by Ardavan » Thu Nov 20, 2014 9:51 am

Thank you Allen, and I apologize for being unclear, I was confusing OpenDentBusiness, middle tier, and webservices as all being the same thing but your explanation (along with a review of http://www.opendental.com/manual/middletier.html) was very helpful in clearing things up for me.
I believe what I wish to accomplish may not be possible using a plugin at this point, I'd have to learn more about the middle tier and ASP in general before I take up more of your time.
But in case you do have a suggestion off the top of your head, here is what I'm looking to accomplish:
Authenticate users connecting through the middle tier against active directory. I already have a proof of concept plugin which achieves this goal when using a direct connection, but perhaps adding said functionality to the middle tier wouldn't be as trivial as adding hooks to the 'business layer'.
Thanks again, much obliged.
There are 10 types of people in this world, those who will laugh at this joke, and those who won't. ~Annonymous Bug Writer

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

Re: Hook requests - OpenDental.FormLogOn & FormSecurity

Post by jsalmon » Thu Nov 20, 2014 9:52 am

Ardavan wrote:Also, I recall reading somewhere that you do not add hooks to OpenDentBusiness, then some time later I may have read that starting 14.x this may be allowed (don't remember the x).

I have no experience with ASP (except of course following the instructions to run OD as a web service), am I correct to assume adding plugins to the web service layer is no different than adding them to the main program?
I think you are referring to v14.3 where we enhanced our middle tier (Open Dental running through a web service): "Plug-ins now supported in Middle Tier."
http://www.opendental.com/manual/version14_3.html

You are correct in assuming that (as of v14.3) all plugins should work as you would expect whether Open Dental is running via a local server connection or via the middle tier.
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

User avatar
Ardavan
Posts: 106
Joined: Sat May 15, 2010 9:10 am

Re: Hook requests - OpenDental.FormLogOn & FormSecurity

Post by Ardavan » Thu Nov 20, 2014 10:07 am

Thank you Jason, I will experiment with the beta. Do you know if I should be developing on a windows server if I wish to compile and run the middle tier?
There are 10 types of people in this world, those who will laugh at this joke, and those who won't. ~Annonymous Bug Writer

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

Re: Hook requests - OpenDental.FormLogOn & FormSecurity

Post by jsalmon » Thu Nov 20, 2014 12:04 pm

You can debug the middle tier with any OS (to my understanding). I debug it all the time using Windows 7 (and now 8 ). Just make sure to set your solution to start up multiple projects at once. Then the settings in the OpenDentalServerConfig.xml file will be used located in the OpenDentalServer folder. It is important that you point it to the correct database.
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