Kevin Southworth

RSS
Aug 8

Tab “badge” requires an icon

Just a quick note to all you Titanium devs out there, the Tab “badge” only works if you have specified an icon for the Tab!

Installing rjb gem on Ubuntu 10.04 LTS

I’m using the rjb and pdf-merger gems for a rails app and it was easy to get working on my local MBP, but ran into a few snags when trying to cap deploy to our dev server running Ubuntu 10.04 LTS.  Here’s what I did to get it working:

  1. Install Java on Ubuntu (oddly it wasn’t installed by default)
  2. sudo apt-get install openjdk-6-jdk
  3. Add the “JAVA_HOME” environment variable to .bashrc
  4. export JAVA_HOME=/usr/lib/jvm/java-6-openjdk/
  5. Add a line to deploy.rb for capistrano (since it has trouble picking up the environment variable on its own for some reason)
  6. default_environment[‘JAVA_HOME’] = “/usr/lib/jvm/java-6-openjdk/”
  7. I also had to add a ‘SetEnv’ line to my Apache site config:
  8. SetEnv JAVA_HOME /usr/lib/jvm/java-6-openjdk/
  9. cap deploy

RT @WorldofIsaac: Stat of the day: Mark Dantonio has an many Big Ten wins in Ann Arbor as Rich Rodriguez (2)….Ouch

Oct 8

RT @tsdg: RT @OHnewsroom: Copy editor 1: “Can we do a cool graphic or something in Comic Sans?” Copy editor 2: “Or we can shit on the page.”

Oct 7

RT @oliverhine: replace the print module no skin functionality with a per-portal printer skin setting #dnnmeme #dotnetnuke #dnn

Oct 7

RT @TechBubble: Comprehensive grid of HTML5/CSS3 support across browsers http://www.findmebyip.com/litmus

Oct 7

RT @ryandoom: Sigh of relief, been working on a large iPad app for 4 months. Did our first live data push into their accounting system. …

Oct 5

Web Ascender is looking for interns! http://webascender.com/Contact/Careers.aspx #jobs #fb

Oct 5

Was great talking with everyone at #dodnn this weekend, lots of good discussion

Oct 5

RT @DayOfDNN: BLOG: A Recap of the Day of #DotNetNuke Chicago 2010! #DoDNN http://bit.ly/cyod0A Please RT

Oct 5

test for facebook #fb

May 7

The DotNetNuke ListController is Slooooow

In one of our custom DNN modules we are grabbing the list of Countries and Regions for each Country for the DotNetNuke Host List.  This is normally a good thing since we then have a standardized list of Countries/Regions, and it also allows the DNN Site Administrator to add new Countries and/or Regions to the list and have them show up automatically in our module.

The problem is that the DNN ListController API seems to be very slow when dealing with larger sets of Countries and Regions.  A customer of ours had customized their list to include many more countries, and many more regions for each country.  All of a sudden our module slowed to a crawl!

I ran the RedGate ANTS profiler on the code and found the “GetListEntryInfoCollection()” method on the “ListController” DNN class was taking almost 4 seconds to execute!!

I ended up writing my own helper method to retrieve the same list in under 0.5 seconds.  This may not be a best practice, since my function is calling straight SQL through ADO.Net, but it’s definitely faster to execute!

The relevant code snippets are below.

——————————————————————-

        internal static List GetCountryListAdoNet()
        {
            string sql = string.Format(@"
                SELECT
                country.Value as CountryCode
                ,country.[Text] as CountryName
                ,region.Value as RegionCode
                ,region.[Text] as RegionName
                FROM {0}Lists country
                LEFT JOIN {0}Lists region ON country.EntryID = region.ParentID
                WHERE country.ListName = 'Country'
                --ORDER BY country.[Text], region.[Text]
            ", GetDbObjectQualifier() ?? "");

            Dictionary countries = new Dictionary();

            using (IDataReader reader = DotNetNuke.Data.DataProvider.Instance().ExecuteSQL(sql))
            {
                while (reader.Read())
                {
                    string countryCode = reader.GetString(0);
                    string countryName = reader.GetString(1);

                    CountryInfo country;
                    if(!countries.TryGetValue(countryCode, out country))   
                    {
                        country = new CountryInfo() { CountryCode = countryCode, Name = countryName };
                        countries[countryCode] = country;
                    }

                    if (!reader.IsDBNull(2) && !reader.IsDBNull(3))
                    {
                        country.Regions.Add(reader.GetString(3), new RegionInfo() { RegionCode = reader.GetString(2), Name = reader.GetString(3) });
                        //country.Regions.Add(new RegionInfo() { RegionCode = reader.GetString(2), Name = reader.GetString(3) });
                    }
                }
            }

            var list = countries.Values.ToList();
            list.Sort((left, right) => left.Name.CompareTo(right.Name));

            return list;
        }

    internal class CountryInfo
    {
        public string CountryCode { get; set; }
        public string Name { get; set; }
        public SortedList Regions { get; set; }

        public CountryInfo()
        {
            Regions = new SortedList();
        }
    }

    internal class RegionInfo
    {
        public string RegionCode { get; set; }
        public string Name { get; set; }
    }


Installing DNN 5.3.1

Let’s see how this goes, excited to try the new taxonomy and user profile features

Why DNN object qualifiers are a pain in the butt!

Web Ascender launches Product Division: www.DNNspot.com

After a lot of hard work, we (Web Ascender) have launched a brand new Product Division: www.DNNspot.com !  DNNspot provides pre-packaged modules for the popular DotNetNuke content management system.  Some of our current modules that are available now:

  • Online Store and Shopping Cart
  • Content Rotator to display photo and content slide shows
  • Live Support / Live Agent Chat
  • Referral Tracker (see where your visitors came from)
  • Sitemap

We plan to add more modules in the future, but for now, congratulations to the team for all their hard work!