Archive for February, 2006

Configuring WordPress – Templates, Plugins, Themes, Services – Part 4

Thursday, February 23rd, 2006

A quick post about configuring K2. I found this excellent resource by Paul Stamatiou on customizing your K2 template.


Customizing K2 : Part 1
Customizing K2 : Part 2
Customizing K2 : Part 3


Lots of good stuff here about how to customize your K2 installation. One of the things I am looking to achieve, is to add few buttons after each post for publishing the post to digg and other such services.

How to brand a SharePoint Portal or Site for best results – Part 1

Thursday, February 23rd, 2006

Recently I have been involved in many projects on branding and customizing SharePoint. Hence I decided that combining everything I have learnt from it would make a good topic for a series of posts. I find very less tutorials on how to effectively brand SharePoint. By effectively, I mean, giving the maximum amount of flexibility which not necessarily is the easiest thing to do.


Let’s try to see in how many ways can you brand sharepoint.



  1. Style sheet branding. This is a quick and easy way to brand your SharePoint site, but all you can achieve with it, is change the color, text and html element styling etc. You are stuck with the page layout, webpart zones and available web parts in your page or template.

  2. Themes. Similar to the above, but in reality I tend to stay away form them.

  3. Templates. The most cumbersome but effective way to brand SharePoint. In my experience I have found this to be the only reliable way to effectively achieve all your branding needs ( coupled with style sheets ).

  4. Onet.xml. This is the only way to customize a site definition. On the branding side it does not help much, except define an alternate header and css files. It is also used to pre-populate webpart zones with webparts on site creation.

I do not recommend any of our clients to use frontpage with SharePoint and hence tend to steer clear with anything that has to do with Frontpage. Will post more on my recommendations on how best to effectively brand your portal / site in coming articles.

Configuring WordPress – Templates, Plugins, Themes, Services – Part 3

Tuesday, February 21st, 2006

I have migrated most of my important posts from my DotNetJunkies blog to this one. Wanted to do something about the look and feel of this blog, and also add some good plugins. I was interested in getting a plugin to display latest posts and comments. Also something to replace Ultimate Tag Warrior as it does not seem to work here.


What I came up with was K2. This is an excellent theme for Wordpress. Not excellent looking, but technically excellent, as it adds support for a lot of plugins which I was interested in and also provides a nice extensible way of customising my blog. I liked the style concent of K2, where I can override several of the CSS styles with my custom defnitions.


On the K2 site, I found a page with all features and plugins supported by K2. Best thing was that these plugins have been already inserted in K2, and hence it will spare me the effort to work on modifying my templates. This was attractive to me, as I did not want to mess around with php ( its been quite a while ), and I am also a bit new to the Wordpress codebase.


The plugins I installed were :


Archives

Tuesday, February 21st, 2006

Do not edit this page

removeAlerts is undefined

Monday, February 20th, 2006

While working with SharePoint templates, if you come across a javascript error, saying “removeAlerts is undefined”, then you have accidently knocked off <SPSWC:AlertsSecurityCheck runat=”server”></SPSWC:AlertsSecurityCheck> from the template page. Put that back in to make life easy :)


Edit: Somehow my code got lost when wordpress autoformatted this post when I migrated from DotNetJunkies. It is corrected now.

Get a list of all Top Level Sites in WSS

Monday, February 20th, 2006

If you have a WSS site with SelfServiceSiteCreation turned on, or you are creating sites programatically using SelfServiceSiteCreation process, it does not create subsites under the root WSS site. Instead it creates top level sites under the Virtual Server under which your root site exists. If you want a list of all such top level sites existing under a WSS Virtual Server, you can use the command line stsadm.exe -o enumsites -url http://WssSiteUrl


But… what if you want to get this list programatically. You cannot get this info from enumerating the subsites or subwebs of the root WSS site. In order to get it, you will need the help of the SPGlobalAdmin class. This piece of code might come handy. The code is in VB, but can easily be ported to C#

Private Sub ListTopLevelSites(ByVal RootUrl As String)

   Dim
globalAdmin As SPGlobalAdmin
   globalAdmin =
New SPGlobalAdmin

   Dim
virtualServer As SPVirtualServer
   virtualServer = globalAdmin.OpenVirtualServer(
New Uri(RootUrl))   Console.WriteLine(“Found ” & virtualServer.Sites.Count & ” sites”)   For Each site As SPSite In virtualServer.Sites
      Console.WriteLine(site.Url.ToString())
   Next

End Sub


For SPS it will not list the sites under the Site Directory ( which can be obtained using the Topology Manager ). Instead it will list the MySites created on the portal.

Manually sign interop assemblies

Monday, February 20th, 2006

I was asked how to import a COM dll into a .NET project and sign it using a key. e.g. ActiveDS.dll. This is not signed and hence if added by the Visual Studio UI into a project which was signed, it will refuse to compile saying that ActiveDS.dll is not signed. Made me realize that many developers are so much dependent on the Visual Studio way of adding references that they were not aware of the manual way of generating a dll interop from a tlb.


Start by opening the Visual Studio command prompt. We use the tool called tlbimp to generate the interop assembly. When generating the assembly you can specify a keyfile to sign the newly generated assembly with.


tlbimp YourFile.tlb /out:YourFile.dll /keyfile:your_keyfile.snk


Add this newly generated dll into your Visual Studio project references manually and problem solved!

Virtual PC Guest OS Performance

Monday, February 20th, 2006

Matt Hester has a nice set of tips for optimising your Virtual PC’s to get the best performance out of the base system. Check them out. They are definitely worth a look.


Matt Hester’s WebLog : Virtual PC Guest OS Performance Tips Part 1 of 3

Extending SharePoint Pages

Monday, February 20th, 2006

Just wanted to make a quick blog post. Will try to post a detailed walkthru later on. I just successfully extended some of the pages from the _layouots directory by overriding some of the default methods of the SharePoint dll’s. Had never done this before and so was not sure if it can be done or not. But now I can write confirmed that it can be done. I managed to add additional functionality to some of the aspx pages from the _layouts directory while retaining the existing functionality and also altering the way the existing functionality worked. Both these ways are possible. As long as the assembly is not obfuscated, ( which most of the application page assemblies are not ), then it’s easy to achieve this.

Introduction to Portals and SharePoint 2003

Monday, February 20th, 2006

My latest SharePoint article is up on www.asptoday.com . It focusses on Introducing Sharepoint to .NET developers. However, non developers will also find the article informative. So if you want to know what SharePoint is and what features good or bad exist, then head over to http://www.asptoday.com/Content.aspx?id=2372 .


As always, comments are always welcome. Any suggestions and constructive criticism is welcome :)