DNNDev.com Forums Minimize
Display Plug-In Sample
Last Post 15 Aug 2008 02:48 PM by Tim Rolands. 12 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
DNNDev Admin
Senior Member
Senior Member
Posts:6419
Avatar

--
03 Mar 2005 10:08 PM  
I just sent off this code to a customer as a starter sample for creating a display plugin. I wanted to post it here as well for your use. The attached file contains a .vb file that implements a simple plugin.

Attachment: 13382435971.zip

Power Your Website With XMod Pro
Buy XMod Pro Today
Paul Scholz
New Member
New Member
Posts:4
Avatar

--
11 Mar 2005 08:54 PM  
Is there any way you could take us through the life-cycle of a plug-in and explain how and where I should extract data from the passed arguments and exactly how I create, postition and display the output from the plug-in?

Many of us using XMod are compentent programmers, but are new to DNN, XMod, and maybe ASP.Net as well.

Also, could I use an implementation of IViewPlugin as "processor" of your data to accomplish interative tasks like updating specific data fields, while displaying only summary results rather than data for each record?

Paul



DNNDev Admin
Senior Member
Senior Member
Posts:6419
Avatar

--
11 Mar 2005 09:35 PM  
Well, here's the data from the help file. It's a good place to start. I can answer any questions you may have. XMod's Extensibility is in its first generation. So, I'm open to suggestions for changes/additions.

The interface consists of several methods that are called when certain events occur while XMod is processing the display. Each method must implemented, though you can choose to ignore any of the events.


--------------------------------
ViewInit(pmc as DotNetNuke.PortalModuleControl, PlugInSettings as System.Collections.Specialized.NameValueCollection,
ByRef DispSettings As Extensibility.PlugIns.DisplaySettings)
--------------------------------
Called on each page load. This is called right after the plugin is created and passes the plugin important information for interacting with XMod including a reference to the DNN module object, a collection of the attributes in the plugin tag, and a special class that passes additional XMod information which, among other things, allows you hide/show Action menu items, change their caption.


--------------------------------
ViewLoad(IsPostBack As Boolean)
--------------------------------
Called on each page load - after ViewInit. Passes a variable which identifies whether this event is occurring after a page postback.


--------------------------------
GridItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs)
--------------------------------
Called after a row has been created in a grid. Not called if the display is a list. At this point controls such as Edit/Approve/Delete links have been created, but they won't be fully processed until the DataBound event. You should not remove or change the links at this stage. Doing so may cause an error. XMod passes the DataGrid control in sender and additional information about the created item in e.


--------------------------------
GridItemDataBound(sender as Object, e as System.Web.UI.WebControls.DataGridItemEventArgs,
ByVal xmi As KnowBetter.XMod.InstanceData)
--------------------------------
Called after data has been bound to a row in a grid. Not called if the display is a list. XMod passes the DataGrid control in sender, data related to the item in the data grid being bound, and an InstanceData object that represents the values of the record.


--------------------------------
ListItemCreated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs)
--------------------------------
Called after a row has been created in a list. Not called if the display is a grid. At this point controls such as Edit/Approve/Delete links have been created, but they won't be fully processed until the DataBound event. You should not remove or change the links at this stage. Doing so may cause an error. XMod passes the DataList control
in sender and additional information about the created item in e.


--------------------------------
ListItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs,
ByVal xmi As KnowBetter.XMod.InstanceData)
--------------------------------
Called after data has been bound to a row in a list. Not called if the display is a grid. XMod passes the DataList control in sender, data related to the item in the data list being bound, and an InstanceData object that represents the values of the record.


--------------------------------
PageChanged(ByVal CurrentPage As Integer, ByVal PreviousPage As Integer, ByVal TotalPages
As Integer)
--------------------------------
Called when the Next or Previous page navigation links are clicked. By comparing CurrentPage and PreviousPage, you can determine if Next or Previous was clicked. If they are the same, you can tell if the navigation is at the beginning of the set (CurrentPage would be 1) or if you are at the end of the set (CurrentPage = TotalPages).
This event is not called when the data is first bound to the list/grid.


--------------------------------
ViewUnload()
--------------------------------
Called when the form is unloaded. This is the perfect time to release any resources, etc.


Power Your Website With XMod Pro
Buy XMod Pro Today
Bill Caterino
New Member
New Member
Posts:19
Avatar

--
20 Jul 2005 07:30 PM  
I've got a pretty basic question: How do you setup visual studio to create a plug-in? What dlls do you have to register (in addition to XMod)? That kind of basic tutorial would be great to have.


brian piccolo
New Member
New Member
Posts:15
Avatar

--
10 Aug 2005 03:09 PM  
Hello,

I'm also having trouble setting up a project in VS.NET to create an XMod Plug-in. I've set up a reference to the Knowbetter.Xmod DLL but I'm still getting build errors. I've attached my sample code. Keep in mind it doesn't really do anything at the moment. I'm just trying to get it to build before actually adding the functionality that I need.

Any help would be greatly appreciated!

Thanks
Brian

Attachment: 181092054671.txt

DNNDev Admin
Senior Member
Senior Member
Posts:6419
Avatar

--
10 Aug 2005 07:28 PM  
What build errors are you receiving?

Kelly


Power Your Website With XMod Pro
Buy XMod Pro Today
Renata Bertelli
New Member
New Member
Posts:6
Avatar

--
11 Aug 2005 05:23 PM  
I created a class called MOCLibraryPlugin under project KnowBetter.XMod.Plugins which is deriving IViewPlugin.
I am getting a compile error saying that my class doesn't implement the interface members that are part of IViewPlugin.

This is one ot the errors:

KnowBetter.XMod.Plugins.MOCLibraryPlugin does not implement interface member KnowBetter.XMod.Extensibility.Plugins.IViewPlugin.ViewInit(...

I am getting the same error for each of the IViewPlugin methods.

Thanks in advance for any help!!!

Attached is my class in c#

Attachment: 1811234079671.zip

DNNDev Admin
Senior Member
Senior Member
Posts:6419
Avatar

--
11 Aug 2005 05:27 PM  
IViewPlugin is an interface. It cannot be inherited. You must implement the interface. That is the cause of the build error you mention.

Best,
Kelly


Power Your Website With XMod Pro
Buy XMod Pro Today
Renata Bertelli
New Member
New Member
Posts:6
Avatar

--
15 Aug 2005 05:05 PM  
Hello,

I am trying to upload a plug-in to a xmod template and I am getting the following error:

Unable to load plugin 'MOC.XMod.Plugins.MOCLibraryPlugin' in file 'moc.xmod.plugins'. Please ensure the plugin is properly declared in the template and that the necessary files have been installed. The error encountered was:
Specified cast is not valid.

This is the tag I included in my template to allow the plugin
<xmod:plugin assembly="moc.xmod.plugins" class="MOC.XMod.Plugins.MOCLibraryPlugin" />
<h3>This is a plugin</h3>

Any idea of where this error is coming from?

Thanks,

Renata


inge kristiansen
New Member
New Member
Posts:3
Avatar

--
05 Sep 2005 05:48 AM  
Hi

Struggeling with vs2003.....

In my project, I have added reference to Knowbetter.XMod, but i am only able to reference KnowBetter.XMod.Plugins, not KnowBetter.XMod.Exstensibility.Plugins.IViewPlugin... What am I doing wrong here?

Regds
Inge


DNNDev Admin
Senior Member
Senior Member
Posts:6419
Avatar

--
06 Sep 2005 06:33 PM  
Hi Inge,

1) Add a reference to KnowBetter.XMod.dll for your project
2) Ensure you have blanked out the default Namespace for project (in Project properties).
3) Create a class that implements IViewPlugin in your own namespace

Namespace YourCompany.XMod.Plugins
Public Class MyPlugin
Implements KnowBetter.XMod.Extensibility.Plugins.IViewPlugin

... the remainder of your class ...
End Class
End Namespace


Best,
Kelly


Power Your Website With XMod Pro
Buy XMod Pro Today
Tim Rolands
New Member
New Member
Posts:21
Avatar

--
23 Jul 2008 08:45 PM  
How can I get the display plug-in to actually populate the list (or grid) with data? Shouldn't that be happening as part of the databinding?

Following the sample, I can response.write data to the page, but I cannot get anything to display within the module.

Tim


Tim Rolands
New Member
New Member
Posts:21
Avatar

--
15 Aug 2008 02:48 PM  
Had to turn my attention to some other projects, but I'm back to this now.

Seriously, what am I missing?

I created my custom display plugin and a list template with my custom plugin. I can response.write to the page, but the display in the module is blank.

I'm sure I'm missing something small here, but I just don't see what. Any ideas out there? ANyone actually develop a custom display plugin?

Tim


You are not authorized to post a reply.

Active Forums 4.1
spacer
dummy