Search

Latest Community DotNetNuke Blog Posts

Onyak
08.27.08

Everest 7.0.8 Release Candidate is now available.  Everest is "the" tool for anyone using SigmaPro allowing you to quickly view and update tasks with DotNetNuke.  Designed as a Windows application, it's extremely fast compared to any web application since it requires less data and less calls to your web server as well as your back-end database server.  With SigmaPro Everest, you can work with off-line SigmaPro Project files or go online and work with data in real-time. Details on installing and using Everest is available on www.SigmaProDraconis.com.  Below is a direct link:

http://www.sigmaprodraconis.com/HowTo/InstallingandUsingSigmaProEverest/tabid/713/Default.aspx

tmunn
08.27.08

In addition to the algorithm being modified to return more relevant results, there are quite a few new settings and features in this release.

Active Modules
08.27.08

It might seem that Active Forums and Active Profile having been getting all of the attention lately.  This should be some good news for some customers.  Active Purchase 2.0 will be released late next week.  I just installed the latest build on our site.  I just want to run the reminders scheduled task for a couple days on our site before the release. List of new features, enhancements and bug fixes:

  • Subscriptions
    • Full support for Authorize.Net ARB
    • Ability to add users to multiple roles specific to the subscription package.
    • Automatic reminder and expiration email notifications
    • Multiple renewal processing options  
  • Products
    • New "Visible" setting allows you to hide a product from the main list but still keep it active.
    • Restrict access to products by roles.
    • Combined Groups and Products into one admin section
  • Discounts
    • Added search and sorting options in control panel.
    • Fixed issue with discounts dates for other cultures.
  • Orders
    • Added search and additional sorting options in control panel.
    • Added ability to re-process custom actions
  • Order Steps
    • Fixed issue which could prevent the ability to edit content
  • Miscellaneous
    • Added support for ordering free products or 100% discounts
    • Added customer account creation options
    • Added text labels to icons in control panel for better usability.

 

tmunn
08.27.08

There are many reasons one may want to dynamically change the module or page title in DotNetNuke. The modt common reason is for DNN search engine optimization. Here is a quick snippet of code for changing the titles in DotNetNuke. In this case, we have wrapped this ability with a module setting that enables or disables the functionality for a page or module:

 If CType(Settings("EnableTitleOverwrite"), String) = "1" Then
Me.ModuleConfiguration.ModuleTitle = Left(esIndex.IndexTitle, 255)
End If
If CType(Settings("EnableWindowTitleOverwrite"), String) = "1" Then
CType(Me.Page, CDefault).Title = Left(esIndex.IndexTitle, 255)
End If

 

DangIT
08.27.08
Last year, the entire gang at Engage Software took off two days at work and headed South to Tulsa to attend the annual Tulsa TechFest event. We all had a good time learning from many industry experts and met like-minded people around the country. I learned a few things and so did many of my colleagues. This year, Engage Software came back with the entire track of DotNetNuke. If you’re a DotNetNuke fan, be sure to come out to meet and learn a few more things or just plain exchanging ideas to help improving the community. If you’re new to DotNetNuke and would like to learn more about it, this is a great opportunity to attend a free conference (or paying $2 per day to donate to charity). Our training courses at Engage often starts at $599 per day so this is a great bargain.
Joe Brinkman
08.27.08

While catching up on blogs this morning I ran across a little PowerShell gem on Walking Dependencies in Powershell.  Chris outlines a problem that has popped up a few times in DotNetNuke.  Usually it revolves around CountryListBox or DotNetNuke.WebUtility.  Finding the offending assembly is always trial and error.  Chris’s solution should help resolve that issue.  I found a few minor bugs in Chris’s script which I have fixed.  The reflection call is a static method and is missing a “]::” and the Convert-Path is unneeded if you call ReflectionOnlyLoadFrom with $_.FullName (this will become important in a minute). 

Joe Brinkman
08.27.08

Over the last several years web developers have moved more and more code to the browser in an effort to improve the overall user experience.  This code is usually in the form of JavaScript libraries which provide advanced functionality and improved performance.  With the widespread adoption of AJAX developers are pushing our JavaScript skills to the limits.  Even with this increased reliance on JavaScript running in the browser, there is still a need for server side application code.  While the split in application logic has brought some improvements in our user experience, it has brought its own set of challenges as well.  Having application code in two locations often requires us to pass values from the server side to our client-side JavaScript and for the JavaScript to be able to pass those values back to the server.

Onyak
08.26.08
Need a professional looking DotNetNuke module to allow people to ask you questions or send you feedback without providing your email address to SPAMMERS? The Feedback-It module by OnyakTech gives you this ability with a professional classy touch. Just add it to your page, set the email address and your all set. Easy to use and a module you can't live without.

Features:

displays a pop-up (can't be blocked by pop-up blockers)
disables the parent page for a professional appearance
collects name, email address and comments
easy to use and install - just set your email address
unlimited support
30 day money back guarantee

Try It! - Click Here For Demo

Onyak
08.26.08
Need a DotNetNuke module to allow people to inform you of invalid links on your site? Or to report abuse by other users in your web community? The Report-It module by OnyakTech gives you this ability with a professional classy touch. Just add it to your page, set the email address to send the reports to and your all set. Easy to use and a module you can't live without.

Features:

displays a pop-up (can't be blocked by pop-up blockers)
disables the parent page for a professional appearance
easy to use and install - just set your email address
unlimited support
30 day money back guarantee

Try It! - Click Here For Demo

tmunn
08.26.08

The only change in this release is a "Default to Add" option in the module settings.  Enabling this will make the main view of Seamus a form for adding a RSS Feed or Site URL.

Charles Nurse
08.26.08

In the previous article in this blog series on creating testable modules, I created a simple MVP based application.  In this article I  will add a Test project to the solution and some tests.  Figure 1 shows the Test project as it looks in Visual Studio’s Solution Explorer. 

Figure 1 – The Test Project

HelloWorldMVPTests

In this example project there are three classes, the Test class itself (HellowWorldMVPTests.cs) a Mock class (MockView.cs) and a utility class (Constants.cs).

There are many testing frameworks we could use.  For convenience, I will be using MSTest, which is the default Unit Test Framework in Visual Studio.  When you create a new Test project in Visual Studio, a single class file is added which is already set up ready for writing tests. In  MSTest a test class is identified by the class-level attribute “TestClass” (see Listing 1).

Listing 1 – The Test Class before adding tests
   1:  [TestClass]
   2:  public class HeloWorldMVPTests
   3:  {
   4:   
   5:  }

 

Writing our First Test

So now we have a Test Project, lets write the first test.  If we go back to our specifications in the previous article, we will see that one of the specifications was “On initially browsing to the page the label will give the user instructions”, so lets start by writing a test to simulate that specification.

The tests I will be writing are designed to demonstrate that the Presenter is correctly setting the properties of the View.  As the real View is a User Control it is not easily instantiated outside of a WebForm, so first, I will create a Mock View class to simulate the behavior of a View and allow us to test the Presenter (see Listing 1).

Listing 1 - the MockView class
   1:  class MockView : IView
   2:  {
   3:      private string text;
   4:      private string label;
   5:   
   6:      public MockView()
   7:      {
   8:      }
   9:   
  10:      public MockView(string text)
  11:      {
  12:          this.text = text;
  13:      }
  14:   
  15:      public string GetLabelContent()
  16:      {
  17:          return label;
  18:      }
  19:   
  20:      public string Label
  21:      {
  22:          set { label = value; }
  23:      }
  24:   
  25:      public string Text
  26:      {
  27:          get { return text; }
  28:      }
  29:  }

The MockView class implements the same IView interface as the HelloWorldView class - a write-only string property - Label, and a read-only string property - Text.  The MockView has two constructors - the reason for this will become apparent later, and a helper method that returns the value of the private member label - this method enables our test class to determine if the value of the label was set properly, as the Label property is write-only.

Our initial test is shown in Listing 2.  Note that as with the class, the method is decorated with an attribute "TestMethod" which tells the Visual Studio Unit Test Framework that this method is a Test.

Listing 2 – The first Test
   1:  [TestMethod]
   2:  public void View_Should_Display_IntroText_When_First_Loaded()
   3:  {
   4:      MockView view = new MockView();
   5:      Presenter presenter = new Presenter(view);
   6:   
   7:      //Call the presenters OnViewLoaded method to simulate the 
   8:      //Page Load (isPostBack = false)
   9:      presenter.OnViewLoaded(false);
  10:   
  11:      //Assert that the View displays the IntroText
  12:      Assert.AreEqual(Constants.IntroText, view.GetLabelContent());
  13:  }

I have named the test method View_Should_Display_IntroText_When_First_Loaded.  This is purely a convention, but this name makes it clear what passed and what failed when the test results are listed.  This test is designed to verify that the View will display the introductory text when the page is first loaded.

In line 4 of the test the MockView is created.  As the default constructor is used, the View's text property starts off empty, as the HelloWorldView user control does when it is first displayed.  Line 5 creates a Presenter, passing the  MockView as a parameter of its constructor.  Remember the Presenter’s constructor takes an IView, so any concrete implementation is accepatable. 

On line 9 we call the Presenter's OnViewLoaded method, which simulates the View being loaded into the WebForm.

Finally on line 12 we get the guts of the test - we use the Test Framework's Assert class to determine if the View's label is correctly set to the introductory text which is defined in the Constants class (see Listing 3).

Listing 3 - The Constants class
   1:  class Constants
   2:  {
   3:      internal const string IntroText =
   4:          "Enter your name and click the Submit Button";
   5:      internal const string HelloText =
   6:          "World";
   7:  }

So that's the first test.  If the project is compiled and the test run we should see one green check-mark.

Figure 2 - The results of the First Test

HelloWorldMVPTestResults1

Yes - our test passed, now we can celebrate!

The Remaining Tests

Its always great to see those check marks, but this is just one test.  Figure 3 shows the code coverage results for this test.

Figure 3 - Code Coverage for the First Test

HelloWorldMVPCodeCoverage1

This one test covers a little less than 60% of the code in the Presenter class.  In order to cover 100% of the Presenter class we need to add some more tests. 

Two possible tests stand out from the initial specifications - "When the user clicks the Submit button, the label is updated to display ‘Hello ‘ plus the text the user enters in the text box" and "When the user clicks the Reset button, the label is reset to display the initial instructions". 

The tests for these two specifications are shown implemented in two new test methods (see Listing 4)

Listing 4 - The Remaining Tests
   1:  [TestMethod]
   2:  public void View_Should_Display_HelloText_When_Submit_Button_Is_Clicked()
   3:  {
   4:      MockView view = new MockView(Constants.HelloText);
   5:      Presenter presenter = new Presenter(view);
   6:   
   7:      //Call presenter's Update method to simulate the Submit button
   8:      presenter.Update();
   9:   
  10:      //Assert that the View displays the HelloText
  11:      Assert.AreEqual("Hello - " + Constants.HelloText, view.GetLabelContent());
  12:  }
  13:   
  14:  [TestMethod]
  15:  public void View_Should_Display_IntroText_When_Reset_Button_Is_Clicked()
  16:  {
  17:      MockView view = new MockView(Constants.HelloText);
  18:      Presenter presenter = new Presenter(view);
  19:   
  20:      //Call presenter's Reset method to simulate the Reset button
  21:      presenter.Reset();
  22:   
  23:      //Assert that the View displays the IntroText
  24:      Assert.AreEqual(Constants.IntroText, view.GetLabelContent());
  25:  }

The first test View_Should_Display_HelloText_When_Submit_Button_Is_Clicked verifies that when the submit button is clicked the label will be updated to display "Hello " plus whatever the user entered in the text box.  The second test verifies that when the reset button is clicked the label displays the introductory text, even if there is text in the text box - View_Should_Display_IntroText_When_Reset_Button_Is_Clicked

These two tests demonstrate the use of the extra overload on the MockView.  As the IView interface only exposes the Text property as read-only, we have no mechanism to set the value - to simulate the user entering text.  We therefore use the constructor overload to set the value.

Figures 4 and 5 show the test results and code coverage for the test project with all three tests.  All three tests passed and we now have 100% code coverage for our Presenter class.  This gives us a high degree of confidence that the code is correct.

Figure 4 - Test Results for all Three Tests

HelloWorldMVPTestResults2

Figure 5 - Code Coverage for all Three Tests

HelloWorldMVPCodeCoverage2

Note: We do not have 100% code coverage of the whole HelloWorldMVP project, but the difference with this approach, compared with the more conventional WebForm design, is that most of our logic has been removed from the UserControl’s code behind and placed in a separate class – the Presenter – which we can test with 100% code coverage.  Our UserControl – the View – now consists of simple properties and event handlers.

This is just a simple example - but I hope it demonstrates most of the principles we will use as we build our Testable DotNetNuke Module.

Mitchel Sellers
08.25.08

I am very proud to announce that this evening my business