Tuesday, July 29, 2008

Books Of Interest

When developing with a platform such as SharePoint, there is a need to understand other pieces, such as Excel Calculation Services, InfoPath Forms Services, etc. Some good resources I have found for these items include:

Excel Services




















Microsoft Office SharePoint Server 2007






















Labels: , ,

Wednesday, July 23, 2008

Infrastructure Updates to SharePoint

Everyone has been posting lately about the Infrastructure updates to MOSS and WSS 3.0, so you may have seen some of these similar posts. If you have feel free to skip this, if not you will definitely want to read this as the update adds some very nice functionality to SharePoint.



The updates add the new Enterprise Search features to MOSS 2007 that were included in Search Server 2008 Express and Search Server 2008. A couple of these features are federated search and unified administration dashboard.



There are also content deployment updates included in these packages.



For more detailed information about the updates and deployment and installation instructions check out the Microsoft SharePoint Team Blog.

Labels: ,

Monday, July 21, 2008

Inspired by....

I was tagged by Mark Gilbert for an “inspiration” meme started by Josh Holmes:

Who has inspired you?
What have they inspired you to do?
Who else have they inspired?

Although there are many people that inspired me in various stages and ways of my life, I will try to keep this parsed down to those people that have inspired me in my role as a developer and more specifically a SharePoint developer.

The first person would have to be Dr. Alan Rea, of Western Michigan University. He pushed me to be what I am today and to exceed normal college expectations. He also guided me into Web consulting through non-profit experience and pushed me to pursue undergraduate research in web usability standards. I am sure he has inspired many other students to achieve loftier goals than they originally set.

The second person would have to Mark Gilbert. He shared with me many important lessons in programming that you can't always get from a book and also proved to me the value of a good working relationship with your clients. I believe that ability to have a good working relationship is what got me where I am today. I don't know how many times I have been able to pass on such meaningful bits of programming wisdom (such as using a StringBuilder instead of concatenating strings) to other developers. Mark's passion for programming has also inspired me to continue to learn and not treat programming as an 8 to 5 job that isn't fun. Programming can be fun, if it is something you like to do. Mark has inspired many other programmers through his role as president of MDSM.

The third person would have to be Jeff, a Principal Consultant at BlueGranite. He helped to foster a desire for SharePoint consulting that I don't think I would have gained on my own. He has the experience to see what a platform like SharePoint can accomplish and is not afraid to tell a client that SharePoint can't do everything (despite what some people claim). He has been an excellent mentor and a source of unending knowledge and experience. I know that he has inspired many other employees of BlueGranite and numerous other people that he has met throughout the years.

Like I said there are numberous other people that have inspired me throughout the course of my life and made me the person I am today and I am thankful to all of them.

Labels:

Wednesday, July 16, 2008

Changing a master page during runtime

Since SharePoint is built on the ASP.Net 2.0 framework, you can take advantage of the same code that you would use in an ASP.Net application. One of these that is useful in SharePoint is the ability to change the master page programmatically at run time.



This is easily enough accomplished through the use of the Page.MasterPageFile property. It is important to note that you need to use this property in the Page_PreInit method as this is the earliest point that you can access the Page lifecycle. It is also the only point that you can affect both the master and content page before they are combined into a single instance.



You can use this property to change the master page for a single page inside a site since with SharePoint you can only change the master pages for an entire site through the SharePoint UI.

Labels: ,

Monday, July 14, 2008

Permissions when Accessing SPFiles

A couple of weeks ago I needed to build some functionality into a SharePoint site to force PDF files to prompt the user to open or download instead of automatically opening in the browser. I built all the functionality and used SPWeb.Folders.File to access the document and then used a Response.Write to output the file as an attachment. I tested it both logged in (and I thought as an anonymous user) and everything seemed to be working well.



When it comes to an anonymous SharePoint site it is sometimes hard to build custom code on top of the platform because you need to include RunWithElevatedPrivileges when you need to update or add files to lists or libraries.



The client contacted me the other day to say that users hitting the Web site were being prompted for a username and password when they tried to download the PDF file. So being the diligent SP dev that I am, I started looking at the code and commenting out lines until I found where the issue lied. The entire time in the back of my mind I was thinking it had to be an issue where I will need to run the code as elevated.



What I finally found was that the SPWeb.Folders.Files call was the one that was prompting users to log in. To remedy this I thought about another method call that I had used before, SPWeb.GetFile() and couldn't think why I had used the Folders.Files method this time. So I tried SPWeb.GetFile() and the code worked perfectly. No login prompts when hitting the call from an anonymous user. Apparently the method call has enough permissions to open files but accessing the Files property of the SPFolder object does not have enough permissions.



Just another thing to look out for when building a custom SP solution.

Labels: , ,

Tuesday, July 8, 2008

Using Code Behind Files In WSS and MOSS

Andrew Connell did an excellent post on using code behind files in Windows SharePoint Services and Microsoft Office SharePoint Server. This is an important topic for anyone interested in SharePoint development.

http://www.andrewconnell.com/blog/articles/UsingCodeBehindFilesInSharePointSites.aspx

Labels: , ,

Wednesday, July 2, 2008

To Extend or Not to Extend - That is the Question

At one point or another in every SharePoint administrator's career there comes the point where they have to take an Intranet SharePoint deployment and allow Extranet or Internet access to it for other stakeholders of the organization. This is a simple enough process, the only trick is whether to use the built-in functionality to extend a web application or to simply add some alternate access mappings.



If you choose to use the Extend Web Application feature in SharePoint, which is located in Central Administration under Application Management -> SharePoint Web Application Management. Choose the Extend an existing Web application option. It will then ask you to choose a Web application to extend and then the same settings that are available when you create a Web application - the name of the IIS site, port, hostheader, path, authentication provider, allow anonymous, and whether to use SSL. Under the load balanced URL section there is a new item that says zone. This correlates to the IE zones and also to the alternate access mapping that SharePoint will create. The options are default, Intranet, Internet, Custom, and Extranet. When you click the ok button SharePoint will create the IIS site and will create the alternate access mapping automatically.



The second option is to go into the alternate access mappings yourself and add them. AAM is located in Central Administration ->Operations -> Global Configuration -> Alternate Access Mappings. You would simply select the Alternate Access Mapping Collection from the drop down and then click on the Edit Public URLs link. You then have the option of adding the URLs for each of the 5 zones. Then just click save and the alternate access mappings are added.



Either way will allow alternate access to your SharePoint site. The choice is yours.

Labels: , , ,

Tuesday, July 1, 2008

When Anonymous is Not Enough

A couple of weeks ago I was re-installing SharePoint at a client's and posted about problems with incoming email. Today I found a new interesting thing in SharePoint. I got an email from the client that when they tried to click on the Sign In link for one of the sites, they were getting a '401 Unauthorized' error and not getting prompted to login like they should. So I took a look and they were right, no prompt, just an error.

So I looked into the IIS web application settings and made sure that anonymous access was checked. Everything looked ok to me so I started searching on the web for information but really couldn't find anyone that was having the same type of problem. I decided to look at the settings on another SharePoint install that was anonymous but allowed users to log into the site if they needed to. When I looked at the settings for that Web application, I noticed that the anonymous and authenticated checkboxes were both checked, so I tried that on the clients site. BAM! The site was now prompting for user logins and passwords when you click on the sign in link.

I was surprised that the settings for this Web application were not correct because I used SharePoint to turn on anonymous access. Just another thing to add to the list of things you may need to check when something is a little flaky in SharePoint.

Labels: ,