Umbraco Community Project

Codename: Get everybody a “High Five” t-shirt

One of the big highlights of this years Codegarden was the speech by Cheif Happiness Officer Alexander Kjerulf about happiness at work. He really got everybody pumped for the conference (or festival) and it really set the mood for the remaining days. There was literally “High Fives” and people shouting “Your Rock!” throughout the venue (and now on twitter #h5yr).
I hope that the speech was taped, so everybody who was there gets a chance to relive this great start of Codegarden – and that all those who wasn’t able to attend this years Codegarden also gets a chance to experience the buzz.

Personally, I think that the “High Five, You Rock” term is a really great way of saying that various contributions are really appreciated. And it seems that people in the community keep using the term both on the forums and on twitter.
Not surprisingly, because the Umbraco community really does Rock!

So feeding of the buzz from Alexanders speech I thought it would be a good idea to come up with something to maintain the “high fives” and the “you rock!” among the people of the community. And is there a better way then putting it on a t-shirt? I don’t think so.. :-)

I pitched the idea to Warren Buckley, who then got me in contact with the designer behind the MVPs CG10 notebook. The designer, Matt Williams, did a really great job on the artwork for the notebooks and also did a really great job on designing artwork for an Umbraco community t-shirt.

I’m happy to present the “High Five, We Rock” Umbraco community t-shirt design:

The idea with the t-shirt design is that it is freely available for everybody to use – get it printed on a t-shirt, coffee mug, mousepad or whatever you like. But first and foremost I have reached out to different people who organizes Umbraco meet-ups to hear if they would be able to find a sponsor, who want to pay for the expenses in getting t-shirts for the attendees. This has already been very positive!

Adam Shallcross from Cogworks will sponsor High Five t-shirts for the next London meet-up.
Dirk De Grave (Umbraco MVP) from Promex will find a sponsor for the next Belgium meet-up.
I am in the process of finding a sponsor for the next Copenhagen meet-up, and Lee Kelleher (Umbraco MVP) is also trying to find a sponsor for the upcoming South West meet-up.

So get yourself to one of the upcoming meet-ups, and you might just get a cool “High Five, We Rock” Umbraco Community t-shirt.

If you arrange meet-ups or usergroups in your local region, please feel free to use the design to get yourself and your local community some “High Five, We Rock” t-shirts. If you work for a company that does Umbraco solutions nag your boss to get you and your colleagues some cool t-shirts ;-)

The most important thing is to spread the word that the Umbraco Community Rocks! (and great way of doing this is with a t-shirt and a message)

Download the design for Print in PDF or PNG. There is also a PDF with positioning that you can give the printing service.

I will add some wallpapers with the design shortly.

Categories: CG10, Umbraco

CG10: Transport and hotel guide

This post is a bit off-topic from my usual blog posts, but I thought I’d write up this post to help CG10-attendees who are coming to Denmark for the first time or those who have been here before and would like some insights into public transportation in CPH.
There has been a lot of buzz on twitter about which hotels to choose and where to stay, and while I have been living in CPH all my life I have never stayed at a hotel here so I won’t be able to tell you which hotels are really good, but I do know which areas of the City are nice and common prices.
I won’t go into to much detail about each hotel, but simply focus on which part of the City they are located in and how to get to the CodeGarden10-venue from there. I have selected the hotels that I have seen mentioned on twitter, so if you have been looking at a hotel which is not mentioned below feel free to add a comment and I can supply a couple of notes on how to get to CG10, which is the most important ;)

First off, when staying in Copenhagen you should take advantage of the public transportation which is pretty easy to come by. There is always a bus, train or metro going to where you wanna go (CG10).
Copenhagen is divided into zones, and when you buy a ticket you should buy for the number of zones you are traveling within (which can never be below two). The center of the City is Zone 1, and the other parts of (greater) Copenhagen is Zone 2 or Zone 3 (airport is Zone 4).
So this means that if you are staying in Copenhagen and going to the CG10 venue (which is located in the City of Frederiksberg – Frederiksberg is surrounded by Copenhagen) you should buy a ticket for 2 zones – Price DKK 23. If you want to take the metro, train or bus from the Airport (Kastrup / CPH Airport) to the center of the City or the other way around you should buy a ticket for 3 zones – Price DKK 34,50. Remember that when you buy a ticket you can use it for an hour in both the metro, train and bus – one ticket to rule them all.
You will probably be going by public transportation 2 times each day for maybe 3 days, so you might as well buy a 10-trip card (“Klippekort” in Danish). This card costs DKK 135, its blue and is for 2 zones and can be bought at train stations, in the bus or in some kiosks.
A taxi from the center of Copenhagen to the venue would probably run you around DKK 100.

And now to the hotels:

Kong Arthur
As you might have heard this is where a majority of the hip Umbraco crowd is staying: HQ, Core Team and MVPs.
This hotel is located north of the center Copenhagen with a nice view of the lakes (the old entrance to Copenhagen – not sure if you would call it a ‘moat’).
If you are staying here you are only 400 meters from Nørreport metro, train and bus station. I would recommend you take the metro (direction: “Vanløse”) to the station called “Fasanvej”, which is only 3 stops after you got on at Nørreport. When you get off at “Fasanvej”-station you walk in the direction that the metro is leaving, and when you come up to the road you go right and walk about 4-5 min. to traffic light number two and then turn left. Walk a couple of minutes and you should start to feel the CG10 buzz :)
Prices: As far as I can tell the prices range from DKK 800-1300/night during CodeGarden 10. I’m not sure whether the discount that Niels tweeted about is still valid, but as far as I remember it was 10% off/night.
Check out the website: www.kongarthur.dk (website in english).
Airport: When arriving you can take the metro from the airport to Nørreport station.

Wakeup Copenhagen
This is a brand new hotel, and was I actually surprised to see how cheap it is. For a hotel in central Copenhagen you probably won’t find it cheaper (unless you don’t mind junkies in front of the hotel :-P ).
This hotel is located a few minutes from the center (the center being the Copenhagen town hall / city square), and also just a few minutes from Copenhagens Central Train station. If you are staying here you are about a 10 min walk from the central station and Tivoli Gardens. So this would also be a nice choice if you are bringing the family, as you are 3 min from an outdoor harbour swimming pool, 3 min from a shopping center with Cinemas and about 10 min from the City center and a serious shopping spree.
When going to the CG10 venue, I would recommend that you walk to the central station, go to track 9-10 and take any train to Nørreport station (thats the second stop after the central station). You get off at Nørreport and go down and take the metro to “Fasanvej”-station (direction: “Vanløse”) – same as above.
Prices: As far as I can tell from the website the prices starts at DKK 365, and I guess thats only for online booking. Go check it out: www.wakeupcopenhagen.com (website in english).
Airport: When arriving you can take the train or bus (250S) to the central station.

Hotel Cabinn
This is another cheap hotel. I don’t know much about it other then its considered to be cheap, and its a chain that has multiple hotels around the City. Two of them are located in Frederiksberg and are very close to a metro station, and actually located on the other side of the Copenhagen lakes then the Kong Arthur hotel although you probably won’t be able to see it from there. If you stay at one of the Cabinn hotels located in Frederiksberg you should be about 300 meters from the metro station called “Forum”, which is only two stops from “Fasanvej”-station. So I think you could get from the hotel to the CG10 venue in 15-20 min. Like with the other two hotels above the direction of the metro should say “Vanløse”, and the station you should get of at is “Fasanvej”.
Prices: Starts at DKK 485/night
Airport: You can simply take the metro from the Airport to “Forum”-station if you decide to stay in the City of Frederiksberg.
Locations: In the city of Frederiksberg you have two options: the one on Vodroffsvej 55 (which is closest to the city) or the one on Danasvej 32 (which is closest to the metro). In the city center you have the one on Mitchellsgade 14, which is right behind Tivoli Gardens and very close to Wakeup Copenhagen and the central station. Other then that its right next to the main offices of the Danish police, so I would be very surprised if you were robbed outside the hotel :-P
Check out the website: www.cabinn.com (in english).

Other things:
Yes, I wouldn’t really recommend the hotels that are on the opposite side of the central station from the Tivoli Gardens. The streets called Istedgade, Reventlowsgade, Colbjørnsensgade and Helgolandsgade are packed with hotels, but it isn’t really the nicest part of Copenhagen (to put it nicely). I have friends who have lived nearby, so its not because its a ghetto, crackhouse or anything like that. But I wouldn’t want to stay there myself, as its THE place to be if you are a junkie or prostitute.

Useful links:
Metro: www.m.dk
CPH Airport: www.cph.dk
Movia – bus information for tourist: www.movia.dk
Wonderful Copenhagen – tourist information: www.visitcopenhagen.dk

Lonely Planet Copenhagen City Guide for iPhone as tweeted by Bram Loquet

I think that was about it. Hope you find the information in this post useful.
If you want to see another hotel on the list, drop me a comment and I will add some transport information. Just remember that I really don’t know anything about the hotels, but rather how to get to the CG10 venue ;)

Categories: CG10 Tags: , ,

Umbraco meetup in CPH

April 13, 2010 Morten Christensen 1 comment

Yes, it’s time for an Umbraco meet-up in CPH!
It seems that the Umbraco community is more on fire now then ever before, and the UK gang is setting the bar high for community meet-ups (one day I’ll have to stop by and drink a beer with you guys). The danish community is however a bit more quite or just too busy making excellent solutions for an ever growing install base. So now is the time for the danish Umbraco cell to become a bit more active :-)
I haven’t seen or heard of a meet-up in CPH aside from the feb 16. event and CG09 and the upcoming CG10, so here it is.

On May the 3rd we will meet up for a preliminary Umbraco meet-up. The agenda is still a work in progress, but I have been brainstorming with Jesper Ordrup and here is what we have come up with:

  • First order of business: What do you expect from an Umbraco meet-up, and what you like to see happen at future meet-ups
  • Umbraco interest group
  • The need for workshops – skills needed for Umbraco 5 or other things umbraco

Suggestions are more then welcome, so send me your thoughts via twitter or email: mc@sitereactor.dk

The meet-up will take place at Codehouse, which is located on Amerikavej 15b, 1.floor, 1756 Copenhagen V. from 16.00hs to whenever the last man leaves, which will probably be me since I have to lock up.

Codehouse will sponsor drinks and sandwiches, so please let me know if you are coming – sign-up on our.umbraco.org/events

I hope to see you there

Categories: Umbraco Tags:

Google Analytics for Umbraco (package update)

I thought it was about time to blog about the latest version of my Google Analytics package for Umbraco, here, a couple of weeks after it has been released on our.umbraco.org.

It seems I haven’t blogged since august 2009, so excuse me if I’m a bit rusty.

Let me take a stroll down memory lane to CodeGarde’09 when the package was first showcased and actually won the prize for best package, which I’m clearly very proud off. I have been getting very good feedback ever since, and this has really motivated me to make the package even greater.
First release included some basic reports that you would also find in Google Analytics when logging in and clicking the main sections (Dashboard, Visitors, Traffic Sources, Content and Goals), and the charts was made using the Google Chart API – so Google all the way :-) It covered a basic need to view basic statistics within Umbraco, but wasn’t really all that flexible.

After CodeGarden’09 I started the initial work to rewrite the package to make it more flexible and enable the ability to create custom reports, which had been a goal of mine since day one or two. Okay, maybe not from the first couple of days, as my first goal was to create a simple statistics section in Umbraco while learning how to create a custom section, which I had never done before. Version 1 of the package was very much a learning process for me. So after having gone through the learning process of version 1 I was ready to pursue my second goal: Create a killer Google Analytics package.

To fulfill my second goal I would have to implement the following features:

  • Custom Reports
  • Flash Charts
  • Umbraco DataType

These features seemed somewhat simple at the time, but turned out to be very time consuming to make.
Creating custom reports based on 47 predefined Metrics and 65 predefined Dimensions makes up for a s**t load of combinations, so I had to come up with a way to calculate the results as a single integer, an average, a percentage and time. I think I have tested something like 90% of the reports, which are available through Google Analytics by default and it seems that my model works (so far anyway – I dread multi-series reports).

Next feature was the Flash charts. Flash charts are simply more flashy then static images, so I chose to go with Fusion Charts Free for the implementation because 1.they are free and open source, 2.they are super nice and 3.there is an impressive amount of charts available to work with. So far I have only implemented the Single Line chart, 2D & 3D Pie chart and Bar chart, but hope to implement more. Luckily it will be easy to add more charts, as I have created a C# wrapper for the properties that make up the Flash object.
I have kept the Google Chart API implementation for the summary charts, but also implemented as objects in my model.

The Data Type was one of the most requested features in the package forums on our.umbraco.org, so clearly I wanted to implement this as well and it is a very cool feature to have. I would love to be able to add a statistics-tab to my Document Types and see how many pageviews, visits etc. my content got.

With the main features down the only hurdle to overcome was the time factor. I originally thought I would be able to post an update in August 2009, but didn’t have enough time so maybe October was more realistic, but no. I kept pushing the release because I didn’t have enough time to dedicate to the project, and only worked on it from time to time during weekends.
The new year came and I had got a lot of work done, and when the feb16 birthday event was announced it was great opportunity to prep a release. The implementation of the different charts was done, and ability to create custom reports was also ready. Only some small features was still needing some polish, and the Data Type.
I thought to myself that I must release this package (give the people what they want) very soon, so I set a deadline for February 26. for release of the reworked package.

For the feb16 birthday event I demoed the new and hugely improved package in Copenhagen, which seemed to go okay. The crowd was really really quite, but I’m hoping it was because they were speechless :-)
I announced that the package would be released on our.umbraco.org on feb 26. so the heat was on. The following 10 days I coded like a crazy to make my deadline, and I started creating teasers for the package to rise awareness and to further pressure myself.

Version 1.0.6 was released on feb.26th. and was very well received. The installer was updated a couple of days later, so current version is 1.0.7.

Current features include:

  • 32 Standard Reports
  • Custom Reports
  • Data Type (choose any report)
  • Switch between multiple profiles for accounts available through credentials (google account)
  • Flash Charts based on Fusion Chart Free (Single line-, 2D & 3D Pie- and Bar charts)
  • Static Charts for summary views (based on Google Charts API)
  • Tables for viewing things like Content by Visits, Browser types, version etc.
  • Sorting of reports (Umbraco tree)
  • Sorting of charts within a report
  • Editing of existing charts within a report
  • Delete charts from a report
  • Delete reports
  • Change icons for reports in tree

Here are links to the 10 teasers, which I created during the last 10 days of development:

Installing the Package: http://screenr.com/EHh
Accounts & Profiles: http://screenr.com/3jx
Editing Reports: http://screenr.com/q3x and http://screenr.com/Mix
Data Type: http://screenr.com/gbx and http://screenr.com/8vx
Sorting Reports: http://screenr.com/Szx
Changing Icons: http://screenr.com/4cx
Custom Reports: http://screenr.com/k4x

I hope you find this package useful! I really enjoyed making it, and thanks for all the wonderful feedback!
If you have any suggestions for updates or additions, please feel free to add a request on the forums. Please also feel free to share your custom reports, as I would love to see which reports others use.

Google Analytics for Umbraco version 1.0.7

Categories: Umbraco Tags: , ,

Do you feel obligated to open source your Umbraco package?

I have been thinking about this subject for some time now, but todays tweets got me thinking and I thought I’d write up a post to hopefully stir up some discussion.

Maybe I should start off by saying that i’m not a money hungry developer, but I think that we can all agree that even though we are working with an open source CMS, we have to make money some how some way. Of course we get paid when developing a customer solution, but it seems to me that things are a bit different when developing addons, plugins, packages, datatypes and everything else that has been developed by and for the Umbraco community.

Currently there are two packages available for purchase in the Umbraco store, and I counted 68 packages on our.umbraco.org today.
Don’t get me wrong, I love the fact that so many people are contributing with a lot of great stuff that is free to install and use. I personally used Warren‘s CWS package to get up to speed on Umbraco v.4 after not having used Umbraco since v.3.0.3. I think it is a great resource, but I probably wouldn’t have bought it if it was only available for purchase in the Umbraco store. No offense Warren ;-)

I myself started a pretty big project (at least for a spare time project) by developing Google Analytics for Umbraco, which is open sourced and thus free for all :) I thought about different models for getting a bit of return on creating a fairly large project, but ultimately decided that it should be open sourced. Partly because Google Analytics is already free to use, so it seem to be the best incentive to make the Umbraco package free as well – even though it might have greater value for some. Another part of the decision has to do with installbase and getting the package out there – won’t go into details, but sometimes its just nice to share your shit.
Axendo, who have also created an Analytics plugin for Umbraco, have chosen to make a limited free version and a paid version, which I think is a cleaver thing to do. I hope the good guys at Axendo are not pissed of by me making my package open source and free, but hopefully they’ll still be able to sell their package, and they could actually use my source in their product should they want to do so in the future.
I would personally find it cool if someone would want to adopt my Google Analytics for Umbraco package, and I would encourage all Solution Providers and Developers to make some money on implementing the Google Analytics section in customer solutions. In my latest offer to a new client I included a couple of packages from our.umbraco.org, which I think will be a win win situation for all: the client will get some very useful tools (free) and we (the solution provider) got some extra hours in on implementation.

Making a package free, open source or paid is ultimately up to the developer. One might think that because the CMS is free so should the addons. Well, not necessarily! Take a great addon like uCommerce which will definatly not be free, this product has a clear incentive for customers to buy it. I won’t go into details about uCommerce but I would love to hear Søren‘s thoughts on selling an addon for an open source CMS :)

Over the next six month I will be developing a couple of addons for Umbraco (got the ideas, just need the time), which will all be open source and made in my spare time. The main reason for these addons being open source is that the counter part or the part that will be integrated with Umbraco is also open source. I’m also hoping that the fact that the addons are free to install will help them spread and thus create a greater installbase. This could of course also be done with a limited free version and a paid full version, but I’m somehow not entirely sure that would work for the addons in question.
So how do I get paid for spending a lot of spare time creating great addons? Should I get paid? Isn’t the gift of giving enough? :P
Well, a sponsor-an-umbraco-dev program would be great but I don’t know who would actually sponsor my work, so maybe selling support/upgrades/feature request implementations would be a better solution?

I personally think that when the good guys at Umbraco start selling the Forms module, it will make it easier for other developers to sell their packages, addons, plugins or whatever. Would also love to hear Niels‘ thoughts on this – do you think that Umbraco Corp. in a sense will lead the pack and in some way encourage customers/users to pay for addons?
When a customer sees what great stuff he can get for a reasonable amount of money he probably won’t have a problem paying for it even though he “bought” an open source CMS in the first place, right?

So what do you think? Do you feel obligated to open source your Umbraco package or simply make it available for free? Are all the packages on our.umbraco.org not worth paying for? Are you hoping that all packages for Umbraco will always be free to install and use?

Please share your thoughts, as I would love to hear what others think about this subject.

Darren Ferguson, you are one of the few people with packages in the store. What are your thoughts?

Tommy Poulsen, you are making a great addon with the PDF creator. Do you intend to sell this addon or contribute it as a free to use package on our.umbraco.org and why?

Other package developers: Do you ultimately feel it depends on the content/usability of the package whether it should be free or paid?

I hope I didn’t make this post too much about money, but rather what makes developers or solution providers choose to make an Umbraco package free, paid or open source and how they get compensated for their work (via implementation for example?).

Google Analytics for Umbraco – First Beta

I’m happy to announce the first beta release of my Google Analytics plugin/section for Umbraco.
The development took a bit longer then first anticipated, but I think it turned out really well. There are still a few bugs, so I don’t recommend that you install it in a customer solution just yet. This first release is a beta release, so first off you should just try it out and please feel free to report any bugs you might find.
When I have had a chance to clean up the source code, and documenting it I will release the code as open source.

Currently known bugs are:
When submitting a new date range the first click on the button doesn’t raise the click event of the button, so you have to make your selection again and click the button to refresh the view with your new date range (default date range si one month).
I’m currently using Googles Chart API to display the charts, so the amount of data that can be displayed is limited.

At the bottom of this post you will find a link to download the files necessary to install the google analytics plugin. This is not a “normal” umbraco package that you can install from within the client, so need to unpack the files within the root directory of you umbraco installation.
These files are included in the package:
web.config
umbracoAppInserts.sql
umbracoAppTreeUpdate.sql (only needed if you have downloaded the package before – contains sql fix).
bin\Google.GData.Analytics.dll
bin\Google.GData.Client.dll
bin\Sitereactor.GoogleAnalytics.dll
config\Analytics\Analytics.config
config\Analytics\AnalyticsChartProperties.config
umbraco\config\lang\*.xml
umbraco\statistics\StatContent.aspx

So, there are a couple of things that you have to be aware of when installing/unpacking these files.
First off, the web.config file is just a standard umbraco web.config so be sure not to overwrite you own. This file is simply included to shown you how and where to configure the google analytics account that you want displayed within Umbraco.
Under <appSettings> you have to add the following to your web.config file:
<add key=”GoogleAnalytics.Email” value=”email@gmail.com”/>
<add key=”GoogleAnalytics.Passwd” value=”password”/>
<add key=”GoogleAnalytics.ProfileId” value=”ga:profileid”/>

These three entries are your Google Analytics credentials. If you are unsure of what your profileid number is, then login to analytics, click on the account you want shown within umbraco, click view report and the id value of the querystring is your profileid :)

The umbracoAppInserts.sql file is a sql script that creates three entries in your umbraco database, which will make the Statistics section appear within umbraco. Before you run this script, open it up and replace [umbracodatabasename] with [your db name].

Finally, in “umbraco\config\lang\” I have included the newest language files (from the 4.0.2.1 release) as all of these files include a translation for “Statistics” (the name of the section). You only need to extract these to your umbraco\config\lang directory if the section name looks like this: [stats]

I have included the latest release build of the Google Analytics .NET API, which is needed to get access to and retrieve data from the service.

The Sitereactor.GoogleAnalytics assembly contains all my wonderfull code :) -> Connecting to and retrieving analytics data feeds, manipulating the data and forming URLs for retrieving Google Charts (check out the API here). If you have a suggestion for another Chart implementation then googles, please let me know (should be open source).
All of this code will become open source very soon.

StatContent.aspx handles the analytics views within umbraco.

Analytics.config and AnalyticsChartProperties.config are used to configure the five views within the statistics section (Dashboard, Visitors, Traffic Sources, Content and Goals). These views are exactly what you find on the Google Analytics site with the only difference that it is currently not possible to click the statistics and get a detailed view (this will be included in a future release).
The usage of <section name=”Dashboard”> and <report name=”Pageviews” chartType=”" chartData=”" aggregateType=”"> within the Analytics.config-file is currently strongly typed, so you shouldn’t mess to much with this file – if you change the name attribute something will break or not shown up :)
The AnalyticsChartProperties.config-file you can go crazy with :) Values/InnerText only, though. Here, the size and color of small and large charts are specified. For example, a large SingleLineChart has a width of 500px and height of 125px, so if you want to increase that or maybe just change the color of the line, be my guest.

I think that was pretty much it. Let me know if you have any problems installing the section or experience bugs or differences in the datasets, please let me know (after you have double checked ;) ). All feedback is appriciated.

Here are some screens of what to expect – file at the bottom.

Download the package from our.umbraco.org.

UPDATE: Package updated with sql insert and update script.
Previous package had a typo in the umbracoAppInserts.sql script (the column “treeHandlerType” in the “umbracoAppTree” table had “loadStatTree” – should be “LoadStatTree”). Caused the five nodes not loading.

PS: This release was only been tested with umbraco v4.0.1. If you have trouble installing it with v3, please let me know and I’ll look into it.

UPDATE (07/07-09): This blog post is a bit our of date with regards to the installation of the add-in for umbraco. Please look to the project page on our.umbraco.org for the latest package.
Current package is GoogleAnalytics_1.0.2-fixed.zip.
Google Analytics for Umbraco Project page

Google Analytics for Umbraco – First installment

This is the first installment in a series about implementing google analytics (with the new data export api) in Umbraco, so you can get your sites statistics in your CMS (where it should be). This post only deals with getting the section up and running, so everything is prepared for the next installment, which will deal with the actual statistics.

As you can see in my previous post I have been giving a shot at porting the analytics api to the .NET client library. Having the availability of analytics in Googles .NET client library would make the code and usage much prettier :-) …. and it would probably make the implementation in a sysmtem like Umbraco much easier.

Well back to the topic. When I first saw the announcement of the analytics api I touhgt that an ideal implementation would be a CMS like Umbraco (or Sitecore for that matter), and when Niels Hartvig twitted about the challenge to create an analytics plugin for Umbraco I knew it was my calling. Okay, not a calling in a biblical sense, but an obvious excuse to get started.

So how do one get started… I thought the best solution would be to create a statistics section and keep the style of the Umbraco sections. Lucky for me there is predefined css classes and icon for a statistics section, so I can concentrate on how to implement the functionality.
I haven’t actually created a new section before, so I started off by browsing the Umbraco forums for tips and inspiration, which I found in a two piece article on simm.dk – Part one & two. The article shows which tables in the database needs to be updated with info on the new section, which was a great help to get started.

I started by creating a new entry for my statistics app in the umbracoApp table:

umbracoApp table view

umbracoApp table view

The fields was filled with the following data:

  • sortOrder: 9
  • appAlias: stats
  • appIcon: .traystats
  • appName: Statistics
  • appInitWithTreeAlias: NULL

You can find a description of the diffirent fields in the article on simm.dk, so I won’t go too much into detail about the above. The important thing here is to note the ‘appAlias’, which is used to reference the application in the next two tables that also has to be updated with some data about the application. The classname ‘.traystats’ is already present in the css, so we don’t need to change or anything special here – lucky me/us.

Next table that has to be changed in order for the statistics section to show in Umbraco is umbracoAppTree:

umbracoAppTree table view

umbracoAppTree table view

The fields was filled with the following data:

  • treeSilent: False
  • TreeInitialize: True
  • treeSortOrder: 0
  • appAlias: stats
  • treeAlias: stats
  • treeTitle: Statistics
  • treeIconClosed: folder.gif
  • treeIconOpen: folder_o.gif
  • treeHandlerAssembly: Sitereactor.GoogleAnalytics
  • treeHandlerType: LoadStatTree
  • action: NULL

Again you’ll find a very nice description of the different fields in the article on simm.dk. The most important part here is probably the treeHandlerAssembly and treeHandlerType, which I have set to my custom assembly that will make up the Google Analytics section and the class which will load the tree (treeHandlerType) is set to LoadStatTree.
The Open and Closed tree icons are is standard, as I don’t want to do anything special on this part as of now.

I want to make a special note on the appAlias, one thing that I missed in the articles on simm.dk. You might want to add a key of the appAlias to the language xmls, which are located in /umbraco/config/lang/ (en.xml for the english language), otherwise the title on the treelist could end up being just [stat] (which isn’t very pretty). Look for the following area tag:
<area alias="sections"> and add the following key <key alias="stats">Statistics</key>

The next table is easy :-) Its just mapping the user(s) to the app/section – in this case I only have a single admin user who I want to give access.

umbracoUser2App table view

umbracoUser2App table view

The default admin user id is zero, so just add that and the appAlias and the table editing is done.

Now on to the coding.

I started off by trying the code example in the last of the two articles on simm.dk, but couldn’t actually get it to work so I browsed through the Umbraco source code to see how the User and Member sections are built. The way these two classes (loadUsers and loadMembers) are built is fairly simple and you can find them plus all the other classes, which loads treelists in Umbraco in the following folder: umbraco 4.0.1 source\umbraco\presentation\umbraco\Trees.
So to setup the code that loads the tree menu I created a class, which implements BaseTree – an abstract class that implements the ITree interface.
Example: public class LoadStatTree : BaseTree

This implementation implies that the following three clases are implemented in the LoadStatTree class:

  • protected override void CreateRootNode(ref XmlTreeNode rootNode)
  • public override void RenderJS(ref StringBuilder Javascript)
  • public override void Render(ref XmlTree tree)

CreateRootNode simply does what the name implies – creates the root node for the current section. This can be implemented as follows:
rootNode.Icon = FolderIcon; //Standard icon for a folder
rootNode.OpenIcon = FolderIconOpen; //Standard icon for an open folder
rootNode.NodeType = TreeAlias; //Alias of the current tree
rootNode.NodeID = "-1"; //Start node should be set to minus in order to not interfer with the normal structure/nodetree.

RenderJS is used to render Javascript output to the browser, which (from the actually section in Umbraco) is used to open the webform with the dashboard/TabView (right side of the screen). Here is an example:
Javascript.Append(
@"
function openStats(id) {
parent.right.document.location.href = stats/statsDashboard.aspx?id=' + id;
}
");

In the sample code, which you will find at the end of this post the webform that is opened simply shows a Hello World text. In order for the dashboard to look correct and in keeping with the look and feel of Umbraco it would be a good idea to implement the TabView control. In the next post I’ll show you how it can be done and how I have used it.

The last method Render is used to programmatically create the tree menu using the XmlTree. For this example I have simply created four items in the menu using the XmlTreeNode like this:
XmlTreeNode xNode = XmlTreeNode.Create(this);
xNode.NodeID = "0";
xNode.Text = "Menu Item 1"; //Name
xNode.Action = "javascript:openStats(0);";
xNode.Icon = "folder.gif";
xNode.OpenIcon = "folder_o.gif";
tree.Add(xNode);

Okay, so now the tree menu is in place and we can concentrate on the content and how and what of the analytics statistics to show on the dashboard.
While we wait for a finished version of the analytics data export api implemented in the .NET client library, this article is a good place to start for using the available api in C#: Introducing Google Analytics API with asp.net / C#. It could of course be implemented using javascript, but not sure how well it would fit into the existing context of Umbraco. I have yet to try it out, but I fear that it will interfer with some of the existing javascript used by the Umbraco client and that the login functionality won’t be too smooth. But maybe initializing the login with some jQuery appended to the browser might do the trick. Anyway, I will look into both possibilities untill the next post where there will be an actual implementation of the google analytics data api.

Here is the code sample, which implements the above examples (and which will also be expanded with an implementation of google analytics).
And here is a screenshot of the results of the examples and code given in this post:

Umbraco Statics Section

Umbraco Statics Section

Categories: Umbraco Tags: , , , , ,

Google Data APIs and Analytics

Updated May 7th 2009 – see here.
I was real happy to see the annoucement of the Google Analytics API and anxious to get started.
As-is the API is available through the JavaScript and Java programming languages, as well as open to protocol interactions using raw XML and HTTP. This is all great, but i’m a .NET developer and would of course have liked to see the analytics API implemented in the Google Data APIs .NET Client Library, as was done with the Java (1.31.1) version of the library.

Since the full source for the Java version is available I thought I would have a look and maybe give a shot at porting it to C#. So I gave myself and the code 4 hours to see how far I could get implementing the analytics api in the .NET client library. Two hours in it was clear that my Java skills  aren’t as good as they used to be… I don’t think I have actually touched Java since 2003. But I continued anyway, as the code spawned.
I created the Service class, which uses AccountFeed and DataFeed that uses AccountQuery and DataQuery respectively. And then there is the Entry class(es)… this is there I started to see double – wish I had a better recollection of Java even though it is very similar to C#. I compared alot of the Java and C# implementations of the Feed and Query classes of google calendar and contact, but two hours in my head started spinning…

Before I have a chance to have someone a bit more skilled in Java then me, I will proably not do to much more work on porting the analytics api. But if anyone should be interested in helping out, please give me a buzz. If you wanna review the current code and give me an indication of the direction, please feel free to do so.

Also, if you want to contribute please drop a comment.
I will be happy to do some more coding when I get back on track with how the structure should be in the C# version.

Here is a zip-file of the project (VS2005) – the source code that come with the Google .NET client library.

I will write another post within the next couple of dayes, which goes a bit more into details about the code. AND hopefully have time to make some unit tests…

Updated May 7th 2009: Please download the new zip with the complete project – VS2005 client library including analytics.
The previous file (and project) was very much a work in progress. I have continued the work by studying the other implementations and the existing Java implementation to build a .NET version of the analytics api, which is now complete.
It currently lacks unit tests, so if anyone wants to join in please feel free to do so. I probably won’t have to to do unit testing for the next 3 weeks, but I do plan to write a follow-up post on how to use the api using .NET. Also, in the Java implementation the dxp:aggregates node is implementated so you can access it as an object – this is currently not implemented. Please let me know if you need it.

Categories: Google API Tags: , ,

Did you remember too….

Developers often forget to check-up on some of the simple things when delivering a solution – especially if no review is in place. I myself try to have a checklist with certain things that should be double checked before a solution is handed over to the customer.

Here are some of the small/big things that I find we or other developers have forgotten about when delivering a Sitecore solution.

Admin Folder
The admin folder under the Sitecore folder often holds some scripts, which could make s solution vulnerable like reading the web.config file, dbbrowser (which offcourse is password protected, but still). When reading this you should ask yourself if you remembered to delete the folder, disallow anonymous access or protect it in some other way.

Sitecore 5.3 Audrey user
This one is my favourite! The audrey user in Sitecore 5.3 solutions. I can’t remember how many solutions I have had to delete or disable this user, because someone else forgot to. And thus leaving the solution wide open, because audrey has a blank password.
And I could mention about 5-10 sitecore solutions that I have stumbled upon online with either the audrey, webmaster or developer user enabled. It is unfortunate that so many developers forget about these “shadow” user accounts.

Sitecore 5.2 Webmaster and Developer user
My second favourite! Probably because there aren’t so many 5.2 versions out there any more, but I have taken over a bunch (well, maybe 3-4) of 5.2-solutions, which had the webmaster and developer user enabled. Although the solution had been runing for 1-2 years!

Although these user accounts may give limited access, the “hacker” would still be able to see everything in your Sitecore client. And if you have modules like the mailinglist installed, well then you are exposing the email-address of all your subscribers, right?

Categories: Sitecore Tags: ,

Sitecore 4.3.2 tips and tricks

I expect that a majority of the Sitecore installations out there are upgraded to version 5.3 or 6.0, but a select few are still running version 4.3.1. I’am “fortunate” to work with a few solutions running this version, during which I have encountered a lack of references. Offcourse http://sdn4.sitecore.net is still online, but solutions for questions and issues that you would normally send to Sitecore support is hard to come by.

So my contribution this way around is some small tips and tricks that I have found usefull or as the common cause for problems in and around Sitecore v.4.3.1.

SQLDatabaseOwner:
<setting name=”SQLDatabaseOwner” value=”[dbo]” />
When moving a solution from one host to another, this little setting might cause some serious pain if the DB owner changes. I have recently encountered this issue because the host that the customer was moving from used the username/login as the dbowener, whereas the new host simply used dbo. The database was backed-up by the old host and restored by the new host and everything seemed fine untill we tried to login or enter the sites of the solution.
It took me a day to figure out that there was a SQLDatabaseOwner-setting in the web.config and that the dbowner was now different from the one on the old host … doh!

Not able to create folders in the media library?
I can’t remember how often I have talked with a customer who have had problems creating folders in the media library, either directly in Sitecore or through extranet. In 95-99% of the cases it helps adding the current site to IE’s list of trusted sites – and allow the site to open pop-ups.
Would be nice to have some kind of macro that the clients could run on their computer to help setup the necessary settings in IE. Especially if they run/edit multiple sites.

Strange Google Toolbar issue
While talking to a client about why the content editor wasn’t working correctly, I discovered that disabling the google toolbar that the client had installed help enable the functions of the content editor. More specifically editing tables and using the left menu of the content editor was a problem. There most be some kind of javascript issue between the sitecore content editor and the installed toolbar. I haven’t done any further testing on this issue, because I like to keep my development machine as clean as possible. But everytime I encounter a support issues involving strange behaviour in the content editor I tell the client to turn off any toolbars that they might have installed.

Maybe this will work for you too.

Categories: Sitecore Tags: , ,