Date: Thu, 28 Mar 2024 20:38:53 -0500 (CDT) Message-ID: <1566504472.30192.1711676333350@PUBEDFIPRDWEB5.public.local> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_30191_733594968.1711676333349" ------=_Part_30191_733594968.1711676333349 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
This documentation provides detailed information abo= ut the creation of plugins for the Ed-Fi Dashboards, including how plugins = interact with data, services, and views, plus the overall plugin architectu= re and major conventions. This documentation also includes sample plugin im= plementations. The information provided should enable an accomplished = developer to successfully leverage sample plugins, and to create new plugin= s for their Ed-Fi Dashboard projects.
The Ed-Fi platform architecture uses a collection of design patterns, ar= chitectural best-practices, conventions, and databases. In order to underst= and the code base and write a plugin it is important to understand these pa= tterns and techniques (covered in the Architecture Detail section of this= documentation). It is recommended that a developer intending to implement = a plugin have knowledge and a reasonably solid understanding of the dashboa= rd=E2=80=99s extension mechanisms.
There are a few fundamental guidelines that are important and should be = followed when developing a plugin:
By following these basic guidelines, you can develop extended features f= or the Ed-Fi Dashboards with a minimum of coding.
The plugin architecture hooks into the existing dashboards by leveraging= the CastleWindsor Inversion of Control (IoC) container. When the= container is created (during Application_Start), it looks in the ~/Plugins= directory for appropriately named DLLs. If it finds any plugins, it t= hen uses reflection to create instances of classes that implement the = IWindsorInstaller interface. The IWindsorInstaller classes are respons= ible for wiring up the dependency injection for the plugin.
Once the IoC container has been initialized, the dashboard initializes t= he MVC framework. During this initialization, the dashboard will again= look in the ~/Plugins directory for appropriately named DLLs. If it f= inds any plugins, it then registers all of the custom routes, controll= ers, and views. If the plugin has embedded JavaScript or CSS files, it= creates the Cassette bundles for those embedded resources.
At this point, the plugin is available to be consumed.
Plugin walk-through samples:
Error message: You do not have access to: [Resource].= p>
Resolution: Make sure the methods on your controller an= d service have the required parameters in the signature. For example, if wr= iting a plugin at the StudentSchool Level, make sure you have the SchoolId = and the StudenUSI. You should also ensure that your service method is attri= buted with CanBeAuthorizedBy and the required claims:
[CanBeAut= horizedBy(EdFiClaimTypes.ViewAllStudents, EdFiClaimTypes.ViewMyStudents)]= pre>
Error message: System.InvalidOperationException: The vi= ew =E2=80=9CGet=E2=80=9D or its master was not found or no view engine supp= orts the searched locations. The following locations were searched: [Locati= ons]
Resolution: Make sure the namespaces are correct. EdFi.= Dashboards.Plugins.[PluginName].Web.Areas.[area].Views.[controllerName].Get= . Also make sure that you have enabled Razor Generator on the view.
Error message: ControlType returns null while open= ing the sample plugin page in Admin login.
Resolution: Check the PluginHelper.GetPluginInstallers(=
) which is called by InversionOfControlContainerFactory.GetInstallers() to =
ensure that the Plugin's installers are getting passed to the call to Castl=
e.Windsor.Install(params IWindsorInstaller[] installers). This triggers Cas=
tle Windsor to call
EdFi.Dashboards.Plugins.HelloWorld.Web.Utilities.CastleWindsor.Installer.I=
nstall which will call
EdFi.Dashboards.Presentation.Core.Plugins.Utilities.CastleWindsor.WebDefau=
ltConventionInstaller<Marker_EdFi_Dashboards_Plugins_HelloWorld_Web>.=
Install(IWindsorContainer container, IConfigurationStore store) which will =
call
Castle.Windsor.WindsorContainer.Install(params IWindsorInstaller[] install=
ers) passing in the
EdFi.Dashboards.Presentation.Architecture.CastleWindsor.ControllerInstalle=
r<Marker_EdFi_Dashboards_Plugins_HelloWorld_Web> which will trigger C=
astle Windsor to call
EdFi.Dashboards.Presentation.Architecture.CastleWindsor..ControllerInstall=
er<Marker_EdFi_Dashboards_Plugins_HelloWorld_Web>.Install which uses =
reflection to find and register the Plugin Controller Types with Castle Win=
dsor.
Error message: Unable to load one or more of the requested types. Retrieve the LoaderEx= ceptions property for more information.
Resolution: In Visual Studio, right-click on the soluti= on and select "Manage NuGet Packages for Solution...". In the consolidate t= ab, ensure that there are no items that need to be consolidated. If so, upg= rade packages so that all projects have the same version of the package in = question. Once you have done that, re-run the solution.
Read more about the UI Developers' Guide: