Wrox Programmer Forums
|
BOOK: Professional DotNetNuke Module Programming ISBN: 978-0-470-17116-5
This is the forum to discuss the Wrox book Professional DotNetNuke Module Programming by Mitchel Sellers and Shaun Walker - Wrox DotNetNuke Series Editor; ISBN: 978-0-470-17116-5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional DotNetNuke Module Programming ISBN: 978-0-470-17116-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 3rd, 2010, 02:14 PM
Authorized User
 
Join Date: Jan 2010
Posts: 29
Thanks: 0
Thanked 1 Time in 1 Post
Default dnn scheduled tasks

Assumptions:

1. Theoretically, I'm creating a module that allows users to post items that will only be shown between a user-defined StartTime and EndTime.
2. The module has a setting for #Days of past the EndTime to keep old posts.
3. The old posts get deleted automatically by a dnn scheduled task that runs daily


What methods are available to the module programmer to get this scheduled task added to the module installation? When the user installs my module, the scheduled task is built for them - that's the goal.
 
Old March 3rd, 2010, 02:31 PM
Wrox Author
 
Join Date: Jul 2008
Posts: 74
Thanks: 1
Thanked 8 Times in 8 Posts
Send a message via MSN to msellers
Default

You can do it a number of ways, more than likely implementing the IUpgradable interface will be the best bet. If installing version X of the module, add the scheduled task via the API methods.
__________________
Mitchel Sellers
Microsoft C# MVP, MCITP
Director of Development
IowaComputerGurus Inc.

My blog for .NET and DotNetNuke info

Author of "Professional DotNetNuke Module Programming"

Tech Editor on "Visual Studio 2010 six-in-one" and "Pro C# 4.0"
 
Old March 3rd, 2010, 03:11 PM
Authorized User
 
Join Date: Jan 2010
Posts: 29
Thanks: 0
Thanked 1 Time in 1 Post
Default

Excellent, thanks! I understand your reply.

I have written an announcements module and it has two tables: [Announcements] and [AnnouncementCategories]. Therefore I have two *info classes and two *controller classes. I'm implementing the iPortable and iSearchable interfaces in both controller classes and have the iUpgradable interfaces strapped in as well (but not doing anything yet).

So both of these controller classes are BusinessControllerClasses(?).

In my dnn file, do I add two xml <businessControllerClass> elements, or do I put both of values inside a single element and delimit with a char of some type?

Finally, I'm guessing it doesn't matter which controller class's iUpgradable section that I use to code the API calls to get the scheduled task created and configured. And realistically, I would only need to implement this specific interface in just one of the two controller classes.
 
Old March 3rd, 2010, 03:13 PM
Wrox Author
 
Join Date: Jul 2008
Posts: 74
Thanks: 1
Thanked 8 Times in 8 Posts
Send a message via MSN to msellers
Default

As far as I know, DNN still only supports a single business controller class, therefore implementing IPortable and ISearchable on both is not going to get you any benefit. There should be a single class for that type of activity.
__________________
Mitchel Sellers
Microsoft C# MVP, MCITP
Director of Development
IowaComputerGurus Inc.

My blog for .NET and DotNetNuke info

Author of "Professional DotNetNuke Module Programming"

Tech Editor on "Visual Studio 2010 six-in-one" and "Pro C# 4.0"
 
Old March 3rd, 2010, 03:25 PM
Authorized User
 
Join Date: Jan 2010
Posts: 29
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanks again.

Going to revise my module and would like to verify a few more things:
  1. It's ok to have multiple info classes (one for each table/object - like Announcement and AnnouncementCategory).
  2. The module should have a single controller class, and in the controller class, add the update, select, insert, and delete functions for every info object.
  3. In the controller, down in the iPortable and iSearchable procedures, basically write out the code to handle each of your info classes? For instance, if I want to be able to search by announcement or category, I will have 2 For/Next loops in which I build my searchItems.
 
Old March 3rd, 2010, 03:34 PM
Wrox Author
 
Join Date: Jul 2008
Posts: 74
Thanks: 1
Thanked 8 Times in 8 Posts
Send a message via MSN to msellers
Default

1.) Yes, it is perfectly fine, and it is the standard process for development
2.) No, it should have a single "businessControllerClass" to handle implementation of ISearchable, IPortable, and IUpgradable but otherwise you can have multiple controllers without issues.
3.) It depends on how you want the users to get there. Typically, you would have 1 entry for each item, and just include item and category information in the content. You don't want to insert duplicate content entries.
__________________
Mitchel Sellers
Microsoft C# MVP, MCITP
Director of Development
IowaComputerGurus Inc.

My blog for .NET and DotNetNuke info

Author of "Professional DotNetNuke Module Programming"

Tech Editor on "Visual Studio 2010 six-in-one" and "Pro C# 4.0"
 
Old March 3rd, 2010, 03:53 PM
Authorized User
 
Join Date: Jan 2010
Posts: 29
Thanks: 0
Thanked 1 Time in 1 Post
Default

iPortable will have to handle importing and exporting both Announcements and AnnouncementCategories. (And now that I think about it - I have to be careful in which order I import them as to not break any db table constraints).

Assuming my module has 2 controller classes, do I as the programmer simply decide which of the 2 will implement the interfaces and tuck everything in there?

Or is it more 'professional' to create a seperate class who's sole purpose is to be the BuisinessControllerClass?
 
Old March 3rd, 2010, 04:02 PM
Wrox Author
 
Join Date: Jul 2008
Posts: 74
Thanks: 1
Thanked 8 Times in 8 Posts
Send a message via MSN to msellers
Default

You are right on the money!

As for the "right" way, you can look at this one of two ways.

1.) Put the interfaces on the 'Announcements' as this is the primary data structure, it has categories that provide extra data.

2.) To allow for expandable growth you could create an "IntegrationController" that has the interfaces implemented separate...

Neither of these is better than the other, at least not with your current needs.
__________________
Mitchel Sellers
Microsoft C# MVP, MCITP
Director of Development
IowaComputerGurus Inc.

My blog for .NET and DotNetNuke info

Author of "Professional DotNetNuke Module Programming"

Tech Editor on "Visual Studio 2010 six-in-one" and "Pro C# 4.0"
 
Old March 3rd, 2010, 04:12 PM
Authorized User
 
Join Date: Jan 2010
Posts: 29
Thanks: 0
Thanked 1 Time in 1 Post
Default

Excellent!

I'm almost set -

The book instructs us to use the fully qualified namespace along with the class name. I'm disecting some module source code that I downloaded off the forge. I've looked at several manifests and I'm finding extra 'stuff' in the BusinessControllerClass's value. Can you elaborate just a bit more on how we set this value?

Here is an example from the FormAndList_05.00.03 module source code's *.dnn file.

<businessControllerClass>DotNetNuke.Modules.UserDefinedTable.BusinessContro ller, DotNetNuke.Modules.UserDefinedTable</businessControllerClass>
 
Old March 3rd, 2010, 04:13 PM
Wrox Author
 
Join Date: Jul 2008
Posts: 74
Thanks: 1
Thanked 8 Times in 8 Posts
Send a message via MSN to msellers
Default

For some reason that module is specifying the class name, which is the first part, and the assembly name which is the second part.
__________________
Mitchel Sellers
Microsoft C# MVP, MCITP
Director of Development
IowaComputerGurus Inc.

My blog for .NET and DotNetNuke info

Author of "Professional DotNetNuke Module Programming"

Tech Editor on "Visual Studio 2010 six-in-one" and "Pro C# 4.0"





Similar Threads
Thread Thread Starter Forum Replies Last Post
Guestbook DNN Manifest n7zfi BOOK: Professional DotNetNuke Module Programming ISBN: 978-0-470-17116-5 4 August 26th, 2010 08:45 AM
Adapting Guestbook for DNN 4.x? [email protected] BOOK: Professional DotNetNuke Module Programming ISBN: 978-0-470-17116-5 6 May 12th, 2009 06:41 AM
Locking of SharePoint Workflow Tasks/Making Tasks Read-Only GAUTAM SharePoint Development 0 March 28th, 2009 02:59 PM
Too many client tasks pbyers Classic ASP Databases 0 May 3rd, 2005 01:04 AM
Creating Scheduled Tasks from VB ckrystal VB How-To 0 December 31st, 2004 03:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.