Tuesday, June 23, 2009

Using Today field in SharePoint list views

One of the coolest things about SharePoint lists is that you can filter the items in a list to such values as [Today] and [Me]. There are many posts out there of people trying to display items from this week or this month. You can do this by using the Today field in a calculated column. This blog details how to do that. The issue that you will run into is that the Today value does not update unless you edit the list item.



I worked around this by creating a simple console application that is set up as a scheduled task on the SharePoint server. The application opens up the list and loops through the list items and calls item.Update() on each one. This causes the date modified date to update and it updates the Today reference.



I have successfully used this to maintain current month views on a list. If anyone knows of another way to keep the today value updated without running a separate application, let me know.

Labels: ,

Thursday, June 18, 2009

SP2 and should you install itt?

I came across the SP2 for MOSS and WSS and was interested in installing it on our corporate Intranet installation of WSS. I upgraded the test environment without any issues (other than an authentication issue, but that is my fault). I was then thinking about installing it on the Internet-facing installation of MOSS.



Good thing I didn't.



I came across a bunch off blog posts over the last few weeks and the Microsoft KB article saying that installing the service pack will reactivate the trial expiration date on MOSS and after 180 days MOSS will not be available to end-users.



I have to step back here for a minute and wonder if anyone in the Office realm of Microsoft tests any of the items they push out as Service Packs? It seems to me that you would test the code that you are going to send out to your clients to install in production environments. I realize this would not pop up until after 180 days passed, but I would hope that some testing goes into these things.



If you want to proceed with installing Service Pack 2 and "beta testing" for Microsoft, you will want to follow the procedure outlined in this KB article to make sure you don't lose functionality after 180 days.

Labels: ,

Thursday, June 11, 2009

Search Results not Security Trimmed

Recently, our new corporate Intranet went live and I happened to be performing a search while logged in as a limited user to verify that security-trimming was working. I was surprised to find that this user was getting back results that they did not have access to. I could tell this since there were items in the results that when clicked on took me to the access denied page.



I began looking for some answers but was unable to find anyone else out there that was having the same issue. This led me to believe that it must have been something that I did custom to our site that was causing the issue. I remembered that I was having trouble with the imppersonation piece when I was testing some custom code before and that I had went into the web.config file and set impersonation to false. So I thought it a wise decision to go back in there and set it back to what it normally is (true). I saved the change and ran a search and found that I was only getting back items I was allowed to see. I was relieved that at least SharePoint search was working the way it is suppose to.



Now I just had to figure out what to do in my code so that I could leave impersonation on. Impersonation allows the SharePoint application to impersonate other users and this allows a user to perform a search and SharePoint checks that users permissions to see which files they are allowed to see. It then returns only those items in the search result. By turning impersonation off I was running all of this as the System Account, which had access to all items in the site.



I was finally able to find a way in my code to perform the functions I needed to while allowing impersonation to continue. Let this be a lesson to me: Don't go changing items in web.config without fully understanding the implications.

Labels:

Thursday, June 4, 2009

Portal Site Connection - What is it?

I was poking around in the Site Collection Settings and came across the link to Portal site connection. I always wondered what that did so I clicked on the link and was taken to a page where I could connect to a portal site and enter the Web address and name for the portal site. This didn't really help me figure out what it does if I put a site in there, so I did some searching and cam across Gavin's SharePoint Blog. He has a post that talks about the portal site connection and it made a lot of sense to me.



Basically it adds a link to the top level breadcrumb trail that can point back to a top-level site collection. This might not be handy in most instances of SharePoint development but if you create a new site collection for projects or areas of the company, it makes it nice to be able to have a link back to a 'home' portal.

Labels: ,