1,741 articles and 13,411 comments as of Wednesday, October 27th, 2010

Wednesday, August 11, 2010

Using the Free Version of SharePoint to Run Your Website

Guest Author: Christian V. Dalsgaard
intra.fo
The reason for this post was based on a twitter message I sent out some time ago. It said something like “Working with a free CMS system for SharePoint 2010” and Mark Miller twitted back wanting to know what that was all about.
Well, I have implemented some public SharePoint sites in the past. Most of them started out as MOSS sites with the anatomy of publishing sites that I find a bit hard to learn. The sites always took longer than regular ASP.NET sites, but the pain was implementing last minute changes to the design.
I later found out that working with WSS was sometimes faster because I just needed some content from a list or a web service. So clients bought MOSS and I was only using basic WSS functionality. Once we did a 5000+ intranet almost entirely with web services and jQuery. The pro was that we could make changes really fast but we started to lose some of the SharePoint consultants. It just had way too much JavaScript and not enough visual studio based solutions for them to understand the overall solution. The end user was happy though sinc changes could be made within minutes!
Ok, I’m making a bold claim here, but it seems that you should really know a lot about both the SharePoint architecture and your HTML and juggle a bit with PhotoShop and be able to talk to the project manager, to make a good website. These requirements really bring down the pool of skilled people you can choose from.
I recently read a study from AIIM: SharePoint – Strategies and Experiences. The survey rates the independent consultant as the best integrator for SharePoint. It makes sense – SharePoint consultants are really just tailors!
It’s a fact that for us to make a public facing SharePoint website, we first need an experienced tailor and some licenses for MOSS which makes it just for larger companies and organizations.
It’s a pity to see smaller companies not being able to join the SharePoint fest.

WSS is free, but will it do CMS?

I then received a client request “Is there a free CMS system for SharePoint” and I had no idea. I knew how to enable anonymous in Windows SharePoint Services and start up SharePoint Designer. With WSS we could make up a respectable simple site. But we would always run into problems when we needed to do a hierarchical menu structure. Or even when we were almost done and the client would say “Great can you put a contact form on the site too?” which you can do in WSS with anonymous although it’s a time killer to implement. But again if you say no, are you not the tailor that refuses your client longer sleeves? I can bore you for a long time with the cons of using WSS for public facing sites. I hate designing and doing websites because I love to use my time helping business owners grow their business.

License

If you want to expose WSS as a pure public website you will need an External Connector (EC) license for the server OS. This license will also allow you to authenticate external users if you should choose to use your WSS as an extranet. The external license is about $2000 USD – however it is not required if your server is a Windows Web Server or Windows Foundation Server.

Back to design.

In an ideal world we would hand off the design of the site to some designer. I run into quite a lot of PHP programmers that hate SharePoint – and with good reason – they will never be SharePoint programmers. It hurts me because they really understand XML, json and jQuery which would be so powerful combined with SharePoint knowledge. However, the php guys are often really good at what they do – they make beautiful websites!
So how cool would it be if we could hand off some of the design work to the designer: “Here is your html pages, JavaScript files, images and web service – do ya thang”.

Missing links

There are three things I feel are missing in WSS to make it work just fine as a CMS system you will find in MOSS.
  1. A descent HTML editor
  2. A multi-level menu in some folder-like structure
  3. A simple way of submitting a form
We started to write a solution that we could deploy as a wsp file to the SharePoint server. That solution would deploy some content types, a delegate control, some JavaScript files and a web service.
We were unable to deploy a rich text field in the content type so we got jQuery to highjack the regular and boring multiline text area and make that into a HTML editor.
Teat area before featured was activated
And after when the JavaScript has replaced it with an HTML editor

Site structure

The structure of the site is done in folders in a regular document library. The library just uses the content types we deployed.

The content types to build the site structure. First a Language folder, then below Root folders and last Content folders under content folders and so on.

The default Document in the library will derive from the web part page content type. So when that’s selected we can make regular web part pages in the structure of the site.
The web service will provide us with the data from the folders, so we can make a menu. A menu could be a language selection we would do on the first page users come to or just have a selection of small flags on top of the site, making it easy to switch to another language. To do this you would use the web method called getLanguages and that will return the available language folders. My favorite way is to call the web methods via jQuery – then you can go crazy with AJAX.
Now I really love to use Firefox and Firebug, that’s the fasted way to test web methods without compiling over and over again which is what I used to do.
Code to get the languages back as an array:
function getLanguages(){
	var q = "\
	\
	  \
	    \
	      Pages\
	      \
	    \
	  \
	";
	var result = {count:-1, items:new Array()};
	jQuery.ajax({
		async:false,
		type:"POST",
		url:"/_layouts/CMSant/webservice.asmx",
		contentType:"text/xml; charset=utf-8",
		processData:false,
		data:q.toString(),
		dataType:"xml",
		beforeSend:function(xhr){
			xhr.setRequestHeader('SOAPAction', 'http://spguy.com/CMSant/getLanguages');
		},
		success:function(data){
            	jQuery('LanguageFolder',data).each(function(idx, itemData){
            	result.count++;
                result.items.push(generateItem(itemData,['ID','Title','Name','Description','Body','Rel','Body']));
            });
        }
	});
    return result;
}
//returns items to array
function generateItem(itemData, viewFields){
	var result = {};
	jQuery.each(viewFields, function(idx, field){
		var value = jQuery(itemData).find(field).text();
		if(value == undefined) value = null;
		if(field.indexOf(":") != -1){
			field = field.replace(/:.*/g,"");
		}
		result[field] = value;
	});
	return result;
}
getLanguages();
This will return an array with the content from the language folders and a count of 1. In JavaScript that would mean two since we start with -1 if nothing is returned and 0 if we have one item.
The second web method you would call would be getMenuByLanguage which will return the content of the menu and the child-folders.

A simple way of submitting a form

The web method that is called addContact will, with elevated rights, submit the information into a list based on the type of Contacts. Elevated rights are used to protect the anonymous user from getting access to our list.
This list could be useful if you sync it with Outlook – hey! it could be the start of your lead generation system and growing your business.
Again we would just go with jQuery.ajax and submit to the web method:
The result from the call would be Success, Failure or AccessDenied which you can present nicely to the end user.
Below are 3 videos of the activation and how to set it up after your administrator runs the stsadm comands on the server to add the wsp to the site solution.
  1. The site collection activation, the site feature activation and the build of the site structure
  2. Using the web service via jQuery
  3. A demo of a client WSS based site using 100% AJAX calls
So can Windows SharePoint Services be used as your public website? Yes, and even small businesses can go further and just use the ONE SharePoint server as their internet, intranet and extranet.
If you would like to play with the solution just send me an email at [email protected] and I’ll send you the wsp file.
Guest Author: Christian V. Dalsgaard
intra.fo
Christian V. Dalsgaard is a Senior SharePoint Consultant at intra.fo and has been working with SharePoint for the last five years. He is now starting putting SharePoint 2010 combined with Exchange 2010 into the Cloud for small business. Christian lives in the Faroe Islands near Iceland where he enjoys offshore fishing. You can follow him at @SPGuyCom or on LinkedIn at http://www.linkedin.com/in/faroeislands.
 

Please Join the Discussion

8 Responses to “Using the Free Version of SharePoint to Run Your Website”
  1. Jeff Jones says:

    100% agreed. Excellent write up Christian. Often our eyes are bigger than our stomach when it comes to technology purchase. We buy everything for all the bells and whistles.

    Simpler systems are faster to create, less work to maintain, and easier to modify. I really like your emphasis on core HTML and JavaScript skills. With an open mind to all technologies and a little creativity we truly can give customers better solutions with a lower cost in a faster time.

    I was pondering if WSS could be injected to ASP.Net hosting (much cheaper) but the registry keys, windows services, and components outside of IIS make that impossible. I’m sure FPWeb.net and others will lower prices in the future, especially with SP2010’s improve multi-tenancy options.

  2. Kevin says:

    Great article and I agree. Have you or has anyone heard whether or not there will be a similar WSS like, free version for 2010?

  3. Kevin – It’s called “Foundation” in 2010, changed from “WSS” in 2007. — Mark

  4. Richard Warren says:

    Great article Christian. I have only recently come to work with SharePoint as a solution provider and have been looking at ways of making WSS (and now SPF) work for smaller clients. There seems to be a tendency towards OOTB modules to meet the business requirements, which may be fine in the corporate world, but the associated increase in cost pushes the solution out of the range of your average small to medium company. So the alternative is find another solution (if such a thing exists) or find smarter ways of providing the required functionality with the tools we have – your article is a great example of this. Thanks!

  5. Lisa Davis says:

    Hi. I just have a quick question. I started using SharePoint 2007 a few months ago when I started my new job. I had no experience with SharePoint whatsoever, although I did have experience with html, css and a tiny bit of beginner programming. I am now using javascript and jquery to brighten up our SP sites (we have a corporate template so extra color is always good) and working on some new SP sites. I would like to start learning SP 2010 at home in my spare time (knowing that eventually they will upgrade) and I would also like to improve my skills and try new things (without worrying about breaking something. lol) What would be your best suggestion as to what to download /buy. I am hoping for a free or low cost solution, if possible. I have Windows 7, 64 bit. computer.
    Thanks
    Lisa

    • Hi Lisa
      >>without worrying about breaking something. lol
      That would be the Virtual Labs with full SharePoint 2010 enviroments setup up for you
      http://technet.microsoft.com/en-us/virtuallabs/bb512933.aspx

      Otherwice, if you are more to playing with SharePoint Designer 2010 I would say buy a hosted SharePoint 2010 at my friends @ FPweb.net – they are great!

      There you can play away with jQuery and SharePoint Designer 2010…..

      Setting the whole thing on you pc with virtual servers and all that – not go that way – wast of time

      ==================================

      To everyone:

      Thanks for the nice comments and the emails.

      -chris

Trackbacks

Check out what others are saying about this post...
  1. Take Bamboo’s Survey to Win an iPad ; Will Microsoft’s Business Collapse?; Azure One Year Later…

    How would you like a chance to win a Bamboo T-shirt, an iPod Nano or maybe even an iPad? Please help…




Notify me of comments to this article:


Speak and you will be heard.

We check comments hourly.
If you want a pic to show with your comment, go get a gravatar!