Monday, June 30, 2008

Access denied when trying to open a site when on the server

I just wasted half a day trying to figure out why some feature code was not working.
The feature code used HTTPRequest to get a file from the layouts folder- and kept failing with “Access Denied”.
It also turned out that when I logged on to the server I couldnt browse to the site - it asked me for credentials all the time.
After wasting a long time debugging and troubleshooting, this support article saved the day - a little registry change and everything works.

Wednesday, June 11, 2008

Showing "my links" on a web page

You know how users can have a list of links known as "my links" in MOSS? (not WSS) It has a nice web interface for managing favorites and storing them in the user's "my site", and even group them by groups, and display them in every page on the top as a drop down menu:

Well, what if you want to show the list on a page? easy - they exist as web parts, but ones that do not exist in your web part gallery by default.

  1. Open Site actions>Site Settings

  2. Click on "Web Parts"

  3. Click on "New"

  4. Scroll down in the list to find "QuickLinksMicroView" and select it

  5. Click on "populate gallery" and go to the page where you want the web part.

  6. Add the web part to the page

The web part has only two properties to customize it:

And at the end it looks like this:

Monday, June 02, 2008

Things to think about when planning a SharePoint solution

Here is a list of things that people seem to forget when planning a sharepoint solution:

  1. There will be many users using the solution at the same time. Make sure your solution is able to deal with that.
  2. When developing a web part or a custom field control, always remember that more than one instance of it may be on the same page. Lack of testing of what happens if you put two web parts side by side on the same page may cause scripts to clash if you didn't plan right.
  3. Most (all) sharepoint implementations have more than one front end server. Plan for your solution to be able to spread across multiple servers, and make sure that when it does, it load-balances!.
  4. Dont forget logging of errors in this case should make it easy for the admin (or yourself) to find where the error was- regardless of the server that was serving the client when the error occured.
  5. Performance! users do not like to wait more than 3 seconds for a page to load - and if your web parts are not performing well, you will ruin the browsing experience in the site. Use caching techniques to improve page loads.
  6. Remember when caching that some things should be cached on a user level, and some can be on the application level.
  7. In web controls - remember error trapping. This may be obvious to anyone who ever developed anything, but this happens so often that I have to just say - I don't care what you do with your errors - but don't crash my page! Make sure everything is nicely wrapped up in try-catch, and never throw an error to a page. Remember that other people (controls) are using it as well - it is not yours.
  8. Develop for deployment. Make sure you plan a WSP package, and document well the list of all the things that will be required that cannot be deployed using a WSP package (changes to the web.config aside from safecontrols for example)
  9. CAS!