Thursday, April 16, 2009

SharePoint Governance

We just had another great Kentucky SharePoint User Group meeting (KYSPUG) tonight.  Rob Bogue came all the way down from Indianapolis and spoke to the group about the topic of governance.  He did a wonderful job sharing with the group what governance is all about and how to get starting putting a plan in place so the business has a process to follow when it comes to SharePoint.  Here are some take-a-ways:

Quotas are a good thing.  A quota is a “governor” of sorts that can be set on SharePoint site collections which limits the overall content size.  Setting them relatively low helps keeps SLAs in-check because there are limits within SharePoint that can cause problems when exceeded.  For instance, you shouldn’t go beyond 100GB for a site collection’s size.  the size of the database becomes too unwieldy at that point when it comes to disaster/recovery scenarios, or even simple backup/restore scenarios for that matter.

In general governance is about the process, not so much a document.  However, when writing a document be very clear on what you mean.  Keep it concise.  Write just enough information and don’t fall into the trap of adding too much garbage that’s not really relevant. 

Getting “setup” properly, before you begin, is key.  If you don’t plan for things like training, you end up being in a reactionary state when you go to implement your governance plan/process.  Training is key, but often overlooked.  You don’t need to spend a lot of money however.  There are numerous reference materials online and plenty of books available.

Much thanks for Rob coming down to visit our group.

Wednesday, April 15, 2009

SharePoint Designer is FREE!

Yes.  It wasn’t an April fools joke as someone asked me :).  Microsoft actually made SharePoint Designer a free tool.  In case you don’t know about SharePoint Designer, it is the replacement product for FrontPage.  It’s a great tool that has all the capabilities of FrontPage, but clearly stands apart from that tool.  It’s meant to be a tool for power users and developers to modify pages within SharePoint sites.  It can be used to edit various HTML files in a stand-alone fashion, but SharePoint is really where it excels.

It’s a great thing that this tool is free.  You really can do a lot with it.  Enjoy:

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=baa3ad86-bfc1-4bd4-9812-d9e710d44f42

Tuesday, April 14, 2009

Using CKS:EBE 2.5

I finally carved out some time to look into the latest updates to the CKS:EBE (Community Kit for SharePoint: Enhanced Blog Edition).  I took the dive, got the latest build and ran with it.  I’ve come to like it, but it wasn’t without a few issues.  I implemented EBE 2.0 about a year ago and always had some minor issues.  Things like CAPTCHA not working and a crazy amount of spam.  So I couldn’t receive comments.  I blogged a little but was mainly frustrated.  So I went to CodePlex to see what the great EBE team put together with the latest bits from (4/12/09).  Although there doesn’t appear to be too much in the way of updated news or documentation, I have to say the team really did a great job.  There were a number of improvements that fixed the issues I had with the previous version (2.0).

Having said that, the SharePoint blog site has some oddities that make it different than other sites.  And the CKS:EBE on top of that adds another layer of complexity.  With that complexity, I have to admit that it crossed my mind several times to just abandon this whole thing and start using my Live Spaces account.  But after some tweaking, things seem to be working fine now.

Things are still “under construction” but here’s a list of the items changed so far:

  • added the tag cloud to the “Intense” theme
  • removed links to trackbacks and trackback counters
  • removed anonymous permissions to the trackbacks received list –  I have no use for trackbacks.  I just want a simple blog :)
  • enabled alerts for comments so I’ll be notified when a comment comes in

These changes included changes to the files in the theme directory and the root directory using SharePoint Designer.

I’m hopeful that this package will meet my needs for blogging going forward.  Thanks EBE team.

Sunday, April 12, 2009

Sharing Resources among WSPs is Dangerous

Did you know that if you create two different SharePoint solution packages (WSPs) that both share assemblies or even images, that retracting the one of the solutions will remove the resource and break the other WSP(s)?

Let’s say you have a shared utility library that has some common SharePoint routines in it that gets installed in the GAC.  Ideally, you would want your clients to only install one solution package for this functionality.  So you build a workflow, for instance, that uses your utility assembly and install it and everything is OK.  The way you’d do that is to modify the manifest.xml so that the WSP includes your assembly, installs it into the GAC and makes the appropriate Safe Control entry, if necessary.  Your manifest.xml might look something like this:

<?xml version="1.0" encoding="utf-8"?>
<Solution SolutionId="8d231d46-e165-4e39-8c69-dfd0d1b1d0de" ResetWebServer="True"
xmlns="http://schemas.microsoft.com/sharepoint/"
>
<!--Feature Manifest files-->
<
FeatureManifests
>
<
FeatureManifest Location="SuperWebPart\feature.xml"
/>
</
FeatureManifests
>
<!--Assembly files
-->
<
Assemblies
>
<
Assembly Location="SuperWebPart.dll" DeploymentTarget="GlobalAssemblyCache"
>
<
SafeControls
>
<
SafeControl Assembly="SuperWebPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=de41bace3a102f2c"
Namespace="SuperWebPart" TypeName="*" Safe="True"
/>
</
SafeControls
>
</
Assembly
>
<
Assembly Location="MySuperUtilities.dll" DeploymentTarget="GlobalAssemblyCache"
>
<
SafeControls
>
<
SafeControl Assembly="MySuperUtilities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=21bf3856ad364e35"
Namespace="MySuperUtilities" TypeName="*" Safe="True"
/>
</
SafeControls
>
</
Assembly
>
</Assemblies
>
</
Solution>

You can see how the instructions above will place the utility library (MySuperUtilities.dll) in the GAC.


Next, you build another web part (or some other SharePoint thing: workflow, web page…) that needs to use the same utility library.  You also want clients to only have to install this one WSP.  It’s just simpler for them to have to install one WSP as opposed to multiple.  And this new web part may be installed on a farm that doesn’t have the first on installed.  So you, being a well-intentioned developer, make sure your manifest.xml includes the utility assembly.  Your second web part might look something like this:

<?xml version="1.0" encoding="utf-8"?>
<!--
Manifest created STSDEV utility at 2/10/2009 1:37:08 PM
-->
<
Solution SolutionId="83224d36-a135-4bb9-cd39-dfdfddddfb23" ResetWebServer="True"
xmlns="http://schemas.microsoft.com/sharepoint/"
>
<!--
Feature Manifest files
-->
<
FeatureManifests
>
<
FeatureManifest Location="SuperDuperWebPart\feature.xml"
/>
</
FeatureManifests
>
<!--Assembly files
-->
<
Assemblies
>
<
Assembly Location="SuperDuperWebPart.dll" DeploymentTarget="GlobalAssemblyCache"
>
<
SafeControls
>
<
SafeControl Assembly="SuperDuperWebPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b3adf5ce3a132f33"
Namespace="SuperDuperWebPart" TypeName="*" Safe="True"
/>
</
SafeControls
>
</
Assembly
>
<Assembly Location="MySuperUtilities.dll" DeploymentTarget="GlobalAssemblyCache"
>
<SafeControls>
<
SafeControl Assembly="MySuperUtilities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=21bf3856ad364e35"
Namespace="MySuperUtilities" TypeName="*" Safe="True"
/>
</
SafeControls
>
</
Assembly
>
</Assemblies>
</
Solution>

So you can see how your two web parts will each install (and retract) the utility assembly (MySuperUtilities.dll).  Nice.  What happens when you want to install both web part packages on the same server.  No problem.  They both install and both work great.


Ok.  What’s the catch?  There’s always a catch :)  So the client decides that they don’t use the first web part.  They’ve decided to completely stop using it and want to retract the package using central admin or STSADM.  Unfortunately, as soon as they do that MySuperUtilities.dll is removed from the GAC, along with all the other files for this package.  Then the second web part will obviously break.



Note:


When talking about web parts and some other SharePoint coding concepts, you do have the option to use CAS (Code Access Security), which allows you to drop your DLLs in the /bin folder of your web application.  Using the bin avoids the complication of shared assemblies that may be removed.  The scenario that I’m describing here deals with a more common approach and that is adding assemblies in the GAC.  There’s a much larger discussion on CAS verses GAC, which I won’t go into here.


So how do we solve this dilemma?  Unfortunately, we have to install those shared resources manually or through a separate WSP.  I recommend a separate WSP, because it will assist you in deployment/retraction across an entire farm of servers.  So this WSP exists only to install DLLs or other shared resources.  This whole issue is a complex one to solve, but one I hope the SharePoint team addresses at some point.  It sure would be nice that before SharePoint retracted something in a farm, it would look at a complete list of farm resources in use by other packages to see if it can be retracted.  All that information is “known” by SharePoint in the configuration database anyway.  Then maybe it would prompt/warn users about these shared resources.