Date: 
Wednesday, July 16, 2008
Title: Remove Login box when anonymous users download office document from SharePoint Site
When developing Extranet/Internet site in SharePoint you often want to allow anonymous access and this works fairly well.
But there is one are where the out of the box experience fails regarding anonymous access and that is when you allow the users to download Microsoft Office documents. In that case IE/Office pops up a couple of Login dialogs, if the user cancels out of these the document opens as expected, but you really don't want the user to have to cancel a couple of dialogs to open your documents
The problem is that office tries to be intelligent and issues a Microsoft Office Protocol Discovery request to see how much the user is allowed to do, but SharePoint responds with access denied until the users logs in.
The solution I've found is to implement a HttpModule which rejects the Microsoft Office Protocol Discovery request if the user isn't logged in and this gets rid of the Login boxes
The essential code is fairly simple:
|
Date: 
Monday, July 14, 2008
Title: FeatureReceiver To Cleanup WebPart Files
Many web-part developers are surprised to see that their web-parts are listed as available even though they have deactivated the feature which contains them
And the users are equally surprised when they then try to add the web-part only to see it fail because the code (and safe-control entry) has been removed.
The problem comes from the fact that deactivating a Feature doesn't remove files provisioned using Module and File entries
|
Title: Features inside a Solution isn't deactivated when the Solution is retracted
Features and Solutions are two of the best features in WSS 3.0 (except for their names, which makes it very hard to write and speak about them):
* Features because they make it very easy (at least compared to WSS 2.0) to add functionality to a SharePoint site
* Solutions because they take care of much of the hassle about getting the features out on all the servers in the farm
One of the great strengths of Features is the ability to have code executed when the Feature is activated and again when it's deactivated. This is very handy for doing any kind of setup and teardown. Especially as there is quiet a few of the declarative features of Features which only works on the first activation (e.g. existing files/content types isn't updated) and some of the declarative features which is left when deactivating. In the last category is the one that surprises web-part developers most.
They've learnt to install .webpart files into the WebPart gallery using Module/File elements and are quiet surprised when they later deactivate their feature and finds that the WebParts is still listed as being available because the .webpart files are left in the WebPart gallery, but when users then try to add the webpart it fails because the code has been removed. See this post on how to fix that.
The possibility to execute code on install/uninstall of a feature isn't normally that interesting until you notice the bug in the Feature/Solution cooperation:
Features inside a Solution isn't deactivated when the Solution is retracted
Instead the solution just uninstalls the feature while it's still activated, this means that the e.g web parts is removed but that the FeatureDeactivating code isn't run with all kinds of nasty error as a result.
|
Date: 
Wednesday, July 09, 2008
Title: Registered for PDC2008
Even though it seems that there isn't going to be any SharePoint stuff a PDC this year, I still regard it as the Microsoft event of the year, it's our chance to see the direction in which Microsoft is heading:
* Oslo
* Windows 7
* Silverlight
* SQL server 2008
* F#
* ...
I'm going to be there (just finished the registration) and am looking forward to meet a lot of fellow developers.
Join the show and lets have some SharePoint discussions in the Open Space
|
Date: 
Thursday, July 03, 2008
Title: Implementing a simple Cascading Dropdown in a usercontrol
A user wanted some guidance on how to implement a cascading dropdown in SharePoint. The following will show a simple example of how to implement that as a user control which has properties for selecting a list, a choice field in that list for the first dropdown and a field for which all appropriate values are shown in the second dropdown
|
Date: 
Friday, June 27, 2008
Title: How to use a publishing page as display form
A client wanted to place a SharePoint calendar on a publishing page and have it configured such that when you clicked an event the full details showed up at the top of the page, and searching for calendar items should also put you at this page.
Sounds easy just put the calendar view on the page and set the calendars display form to be that page. But setting the display form to be the publishing page puts the ID of the calendar item in the URL of the publishing page which then confuses SharePoint as it thinks it has to lookup that id in the Pages list.
The solution is to introduce a page as display form which the redirects back but with the ID of the calendar item as a querystring parameter with another name than ID.
|
Title: Look up instance of potentially recurring calendar event
In my last post I described how to redirect to a publishing page in order to use it as display form for a calendar.
It caused the problem of having to look up the right instance of the calendar event (in case of recurrence) ourselves. If we just implement an ordinary display form SPContext does the lookup for us.
I poked around in the SDK to find a method which could look up an item from a list based on the RecurrenceID, but without any luck. I knew SPContext did this so I fired up Reflector to see how SPContext did this and found GetInstanceItem which did what I wanted, but tightly coupled to the SPContext's current List and then it was also a private method.
Despite the DRY principle I had to reimplement the same function.
|
Date: 
Wednesday, June 25, 2008
Title: How to change Checkin comment after save
If your company has very strict requirements on version numbering and want the comments to each of these versions to be correct, then you may run into a problem if you store the documents in SharePoint.
The version comment is determined when you check in your document, and after the checkin there is no supported way to change these comments.
If you really need to change the comments of a document and are willing to go the unsupported way of changing the content database directly then this little program can do the work for you:
|
Date: 
Tuesday, June 24, 2008
Title: About Me
Hi, my name is Per Jakobsen
I'm currently working as Senior Consultant specializing in ASP.NET and SharePoint for Kraftvaerk which is a small danish consultancy firm specializing in web technologies.
I also have a part time job as Instructor for DevelopMentor where I'm teaching the Essential SharePoint for Developers course.
My background goes all the way back to the stone age of computer programming.
- I started as a COBOL programmer on a mainframe computer
- Entered the new age with 4th generation languages (ADABAS/NATURAL) which was supposed to save the world
- Got into PC programming in Pascal, C++, Paradox and dBASE
- Further along to client/server programming using Paradox and PowerBuilder against Oracle and Sybase
- Took the deep dive into Embedded ANSI C programming
- And finally as a natural progressing ended in my current position with .Net programming with a focus on SharePoint
On the personal plane I'm married to Sussie and am stepdad to Nicklas, who in turn is stepdad to Bella Nova, which then makes me stepgrandstepdad.
In my spare time I'm playing Bridge when I'm not sitting in front of the computer or reading computer related books on my REB1200 ebook.
|
Disclaimer: The opinions expressed herein are my own personal opinions and do not represent
my employer's view in any way. And all information or programs are without warranty. Use at your own risk
© Copyright 2008 
Per Jakobsen
|
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|
| 29 | 30 | 1 | 2 | 3 | 4 | 5 |
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | 31 | 1 | 2 |
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
Navigation
Categories
Blogroll