Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Specifying Scheduler SettingsSpecifying Scheduler Settings
Previous
 
Next
New Post
4/12/2009 9:34 PM
 

When writing a scheduler configuration control for your module, you could simply store PortalId as one of the key-value pairs in the ScheduleItemSettings table then retrieve it's value in your custom SchedulerClient. Since scheduled tasks are often Portal agnostic and may need to be applied to more than one portal anyway, you could (in your SchedulerClient) call the GetPortals instance method of the PortalController class to obtain an ArrayList of PortalInfo objects then iterate through the list performing the task on each portal which contains one or more instances of your module as determined by ModuleName, database table entries related to your module, physical folders/files related to your module, etc.

Keep in mind also that the lack of a valid HttpContext within ScheduleClient code impacts not only the non-availability of a PortalSettings object but any other information which would normally ride along on the current context and any DNN core methods which indirectly depend on PortalSettings.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
4/14/2009 9:26 AM
 

Now, in my case, I have a data centric module that is used to generate reports. The Report generation process is CPU intensive. So, I have delegated the Report generation process to a scheduler I have created that generates the reports in the background.

The first problem is that there is no easy & intuitive way to specify differential Scheduler settings for each Portal. Each Portal Admin might need to configure differently the duration of report generation process weighing the requirements of updated reports needed against CPU time involved. As the Schedulers created do not belong to a Portal, there is no easy way to configure this per portal.

Does anyone here agree with me that Schedulers should be allowed to be configured per portal?? For instance, the Host can specify Portals where a particular Scheduler Task is available for configuration by Portal Admins (on the line of modules, like the Host can specify which modules are avaiable on which Portals)??

Similarly, the Host can delegate selected Scheduler Tasks to Portals. If enough people agree with this, we can file this as an enhancement request.

 
New Post
4/14/2009 9:49 AM
 

Although I agree that per portal scheduler settings such as Time Lapse and Retry Frequency configurable by the portal admin might in some cases be helpful, I see many problems with both allowing and implementing that capability.

As for creating and using custom scheduler settings on a per portal or per module - for example sender e-mail address and whether the email body is to allow text only or html - I would think you could code your settings or admin configuration control to store custom scheduler settings in either the DNN ModuleSettings table or your own custom table (either keyed by ModuleId or PortalId) then access those custom settings from your scheduler task.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
4/14/2009 10:19 AM
 

Storing the Scheduler settings in ModuleSettings table is almost out of question. How would the scheduler guess the ModuleId (Remeber, there can be multiple instances of a module on a Portal. In a simple scenario, imagine a scheduler mailing daily digest of Forum threads. As same Portal can have multiple instances of Forum module, there is no way to guess the ModuleId).

I agree that we can create a custom table. However, I was suggesting a productive out-of-the-box settings facility for Schedulers like we have for Modules.

 
New Post
5/22/2009 8:32 AM
 

I use this method:

        private void ProcessTask(ref string auditTrail)
        {
            PortalController portalController = new PortalController();
            ArrayList portalInfos = portalController.GetPortals();
            PortalInfo portalInfo;

            for (int i = 0; i < portalInfos.Count; i++)
            {
                portalInfo = (PortalInfo)portalInfos[i];

                //"PortalID:SettingName"
                string roleIDFilterList = ScheduleHistoryItem.GetSetting(portalInfo.PortalID.ToString() + ":ProximityRoleIdList") == "" ? String.Empty : ScheduleHistoryItem.GetSetting(portalInfo.PortalID.ToString() + ":ProximityRoleIdList");
               
                //check if this portal is used (it does not return null if it does not exist - "")
                    UserProfileProximityUtils userProfileProximityUtils = new UserProfileProximityUtils();
                    userProfileProximityUtils.ProcessProximityMails(portalInfo, roleIDFilterList);
                }
            }
        }

 

I save the settings in the ModuleSettings page:

        public override void UpdateSettings()
        {
            if (Page.IsValid)
            {
                try
                {
                    //http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/111/threadid/228526/scope/posts/Default.aspx
                    SchedulingController schedulingController = new DotNetNuke.Services.Scheduling.DNNScheduling.SchedulingController();
                   
                    ScheduleItem proximtyMailerSchedule = schedulingController.GetSchedule("SmartThinker.DNN.Modules.UserProfile.UserProfileProximityMailerTask, SmartThinker.DNN.Modules.UserProfile", "");
                    schedulingController.AddScheduleItemSetting(proximtyMailerSchedule.ScheduleID, this.PortalId.ToString() + ":CountryProfilePropertyID", cmbCountryProfilePropertyID.SelectedValue);
                    schedulingController.AddScheduleItemSetting(proximtyMailerSchedule.ScheduleID, this.PortalId.ToString() + ":RegionProfilePropertyID", cmbRegionProfilePropertyID.SelectedValue);
                    schedulingController.AddScheduleItemSetting(proximtyMailerSchedule.ScheduleID, this.PortalId.ToString() + ":CityProfilePropertyID", cmbCityProfilePropertyID.SelectedValue);
 


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Specifying Scheduler SettingsSpecifying Scheduler Settings


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out