in

Amar Galla's Weblog

The weblog of Amar Galla.

Amar Galla's Weblog

February 2006 - Posts

  • Configuring WordPress - Templates, Plugins, Themes, Services - Part 4

    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.

    Posted Feb 23 2006, 11:25 AM by amar with no comments
    Filed under:
  • How to brand a SharePoint Portal or Site for best results - Part 1

    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.

    Posted Feb 23 2006, 10:16 AM by amar with 2 comment(s)
    Filed under:
  • Configuring WordPress - Templates, Plugins, Themes, Services - Part 3

    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 :

    Posted Feb 21 2006, 01:02 PM by amar with no comments
    Filed under:
  • Archives

    Do not edit this page
  • removeAlerts is undefined

    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.

    Posted Feb 20 2006, 12:53 PM by amar with 2 comment(s)
    Filed under:
  • Get a list of all Top Level Sites in WSS

    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.

    Posted Feb 20 2006, 12:52 PM by amar with 4 comment(s)
    Filed under:
  • Manually sign interop assemblies

    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!

    Posted Feb 20 2006, 12:51 PM by amar with 1 comment(s)
    Filed under:
  • Virtual PC Guest OS Performance

    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

    Posted Feb 20 2006, 12:50 PM by amar with no comments
    Filed under:
  • Extending SharePoint Pages

    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.

    Posted Feb 20 2006, 12:48 PM by amar with no comments
    Filed under:
  • Introduction to Portals and SharePoint 2003

    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 :)

    Posted Feb 20 2006, 12:47 PM by amar with no comments
    Filed under:
  • "Cannot complete this action" in SPRequestInternalClass.RenderListProperty for document library templates

    If you come across an error saying "Cannot complete this action" when trying to modify the document library template pages, with an exception trace showing a crash in SPRequestInternalClass.RenderListProperty, you have hit an issue similar to KB 901259.

    I had a webpart which built a navigation tree by querying the subsites and document library subfolders under any site. As soon as I put them on the allitems.aspx page under the c:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033\STS\LISTS\DOCLIB folder, I started receiving this error. Strangely when I placed the control at the end of the existing page it worked.

    My code was as follows :

    SPWeb currentWeb = SPControl.GetContextWeb(Context);

    string currentSiteUrl = currentWeb.Url;

    SPListCollection splstcol;
    currentWeb.Lists.IncludeRootFolder = true;
    splstcol = currentWeb.Lists;

    If I placed my control before any calls to the or any such control which queried list properties, I was getting the above error.

    The reason from what I figured out, is that SharePoint gives the reference to the current object when obtained from the GetContextWeb method. When I tried to set the IncludeRootFolder = true, I ended up modifying the properties of the current web object, and this somehow caused an internal crash whenever sharepoint tried to query list properties via calls to controls such as on the page. So when I placed my control at the end of the page, after all such controls it worked, but when any such ListProperty was queried after my control ran, it crashed.

    The solution to overcome this problem was very simple. Do not get the existing object references, but create your own instance of the objects. So after modifying the code as follows, everything started working as it should be.

    SPSite mySite = new SPSite(SPControl.GetContextWeb(Context).Url);
    SPWeb currentWeb = mySite.OpenWeb();

    string currentSiteUrl = currentWeb.Url;
    SPListCollection splstcol;
    currentWeb.Lists.IncludeRootFolder = true;
    splstcol = currentWeb.Lists;

    I haven't checked to see if this happens on other such template pages, but in case it does, I guess the solution should be quite straightforward.

    Posted Feb 20 2006, 12:43 PM by amar with 5 comment(s)
    Filed under:
  • SQL2005 and Windows Installer Clashes

    I recently came across a problem while installing SQL Server 2005 with Windows Installer 3.1. I tried with Windows Installer 3.1 and v2 of 3.1. But it always kept failing. I resolved the problem by uninstalling Windows Installer 3.1 ( it will give a protest message that almost all the major services on my machine will fail, but just ignore it ). After uninstalling 3.1, I downloaded Windows Installer 3.0 and installed it. Rebooted my machine, and tried to install SQL Server 2005, and it succeeded !!!

    There have been many reported problems with Windows Installer 3.1 failing silently in some cases. I for one, will be staying away from 3.1 till a proper next version is rolled out :)

    Posted Feb 20 2006, 12:41 PM by amar with no comments
    Filed under:
  • [Virtual Server] could not be started because there is not enough physical memory or system resources available

    I recently came across a very strange problem. Tried it with both Virtual PC and Virtual Server. It just refused to start a second VM saying that could not be started because there is not enough physical memory or system resources available. I had over 10GB disk space free, and over 1.4 GB ram free. So I was sure resources was not a problem.

    After fiddling with it a bit, a quick net search did the trick. If you have InCD software installed ( comes with Nero ) then it somehow causes this problem. If you dont want to uninstall your Nero installation, just go to Control Panel -> Administrative Tools -> Services and stop the InCD Helper service and set it to manual start instead of automatic. This instantly solved my problem and all 3 Windows 2003 VM's booted up perfectly.

    Thanks to Angus Logan's Blog and Benjamin Day's Blog for the help.

  • SharePoint Active Directory User Creation Mode

    Been playing around with SPS AD Creation Mode and was disappointed to find that it has a lot of limitations. Not sure if I am completely right on this. Might be something that I missed. Just spent a few hours on it. Correct me if I am wrong.

    1. Could not see any sign of AD Creation Mode on SPS. Seems like it is a WSS only feature.
    2. Once I installed WSS using AD Creation Mode, I was unable to create top level sites, or new users from the GUI or Central Admin. Have to use STSADM for creating them using command line.

    Was very excited to see if I can use AD Creation Mode to give access to the SPS Portal for internet users to register and create their own accounts. But I guess it is not possible. Have to implement this using custom code using the DirectoryServices classes of .NET.

    Correct me if I am wrong on this, and if it is possible to use AD Creation Mode with SPS and let authorised users create user accounts in the ADS using the Central Admin GUI.

    Posted Feb 20 2006, 12:39 PM by amar with no comments
    Filed under:
  • Excel import gives NULL rows with DTS

    Sometimes, when the excel column contains numeric and text data, and you try to import the excel data using say DTS, it will give you either the text values or the numeric values and return NULLs for the other. This is a known problem in excel as it scans rows ( based on the set count, which can be 1 ), and determines the datatype for that column. Any row which does not adhere to that guessed datatype, gets imported as NULL for that column.

    A solution to this problem as shown by the knowledge base is to add the option IMEX=1; in the connection string. If you use something like DAO to open the excel data, then you can write as according to the MS knowledge article ID 194124 :


    Set Db = OpenDatabase("C:\Temp\Book1.xls", _
                False, True, "Excel 8.0; HDR=NO; IMEX=1;")

    But the problem is that if we are using DTS, and the excel connection object is opening the connection. So there is no code present as shown above in the package. But fortunately, there is a place where we can modify it. In the excel connections properties ( visible either thru disconnected edit, or a dynamic property task or thru the API functions ), there is a key called OLE DB Properties -> Extended Properties. Add the setting IMEX=1; to the existing value and your problem should be solved. You will be able to import the entire excel sheet data thru DTS without worrying about missed values. This setting puts the mode of excel as import, and retreives all values as text instead of doing a data type guessing.

    Posted Feb 20 2006, 12:38 PM by amar with 5 comment(s)
    Filed under:
More Posts Next page »
Powered by Community Server (Non-Commercial Edition), by Telligent Systems