SharePoint Dragons

Nikander & Margriet on SharePoint

Monthly Archives: July 2012

SharePoint Online or not Online: that’s the question

We liked this blog post that discusses pros and cons of Office 365 vs SharePoint on premises: http://cloudcomputingtopics.com/2012/05/office-365-or-on-premise-which-one-is-right-for-me/

Advertisements

Send me my password

In the forums, a user asked why SharePoint didn’t send the user name and password via e-mail. For a moment, our immediate was: SharePoint doesn’t send out user names and passwords, now does it? After looking it up it turns out that only SharePoint Foundation 2010 in Active Directory Account Creation Mode does: http://dishasharepointworld.blogspot.in/2011/04/active-directory-account-creation-mode.html and http://tristanwatkins.com/index.php/active-directory-account-creation-mode-sharepoint-2010/

Brownfield Application Development in .NET

Whenever we’re technical reviewers of a book, we feel some responsibility for it. Therefore, we feel it’s a good idea to devote some attention to the BrownField Application Development in .NET book.

The first question that came to our mind was: what is brownfield application development? Well, the author puts it like this:

“An industrial brownfield is a commercial site contaminated by hazardous waste that has the potential to be reused once it’s cleaned up.”

So, this idea applied to software, is called brownfield application development. This book discusses techniques for cleaning up such software messes, namely:

  • Continuous Integration
  • Automated Testing
  • Software metrics and Code Analysis
  • Defect Management
  • Better OO practices
  • Relayering applications
  • Loosening dependencies
  • Cleaning up the UI (discussing MVC and MVP)
  • Refactoring Data Access
  • Managing external system dependencies

Interested? Check out http://www.amazon.com/Brownfield-Application-Development-Donald-Belcham/dp/1933988711/ref=sr_1_1?ie=UTF8&qid=1338535200&sr=8-1

Update to performance tips page for SharePoint 2010

Uploading a file using the SharePoint client object model

bitUploading a file using the SharePoint client object model is easy, once you have loaded a reference to the SharePoint list you want to upload the file to. One strange thing though, via the Files collection of the List RootFolder, you can directly upload the file to any subfolder you like. It goes like this:

// FileInfo in System.IO namespace
var fileCreationInformation = new FileCreationInformation();

byte[] bytefile = System.IO.File.ReadAllBytes(“c:\\test\Test2.txt”);
fileCreationInformation.Content = bytefile;
fileCreationInformation.Overwrite = true;
fileCreationInformation.Url = “http://astro/MyLibrary/MyFolder/Test2.txt”;

// CurrentList is a client OM List object
CurrentList.RootFolder.Files.Add(fileCreationInformation);
Context.ExecuteQuery();

 

The great thing about it is that you can use it to upload files in batches. But, that’s not the end of the story. If you do this, you must realize that the SharePoint client OM will use Base64 Encoding. According to WikiPedia (http://en.wikipedia.org/wiki/Base64), the final size of Base64-encoded binary data is equal to 1.37 times the original data size + 814 bytes (for headers). By the way, this is not our experience at all. In our testing, we’ve consistently found the message size to be considerably lower than the equivalent file size on the file system.

Things become more interesting… Check http://support.microsoft.com/kb/2529243 , it describes how to uploading of files larger than 3 MB fails (we did notice that), returning a WebException containing a response property that gives a (400) Bad Request error. This is caused by default internal restrictions on file sizes and timeout settings. Further more, the article says that,unless your files are really huge (like 1 GB) you can catch and ignore it and will notice that the files are uploaded just the same. The last thing doesn’t happen for us, it just fails to upload files larger than 3 MB.

But wait… There seems to be a solution. Article http://blogs.msdn.com/b/sridhara/archive/2010/03/12/uploading-files-using-client-object-model-in-sharepoint-2010.aspx explains how to increase the allowed message batch size using the managed client object model. It does use the server object model to accomplish this though, so be aware of this fact if you’re building a client tool that uploads files using the client OM (and please make sure to target it at x64, otherwise SPWebService.ContentService will return null). See http://msdn.microsoft.com/en-us/library/ff599489.aspx for more info. According to our testing, the SharePoint limit applies to the original file system size, not to the size of the file after Base64 Encoding it. Both articles fail to mention that you need to perform an IISRESET before changes take effect, but after doing so things will be alright.

If you’re interested in seeing this in action, check out the Migration Dragon for SharePoint 2010 at http://gallery.technet.microsoft.com/The-Migration-Dragon-for-628acae0 . It uses the SharePoint client object model to upload file and folder structures from the file system to SharePoint 2010 in batches using techniques discussed here.

Direct access to SharePoint Server 2013 Preview

In addition to the previous links, if you go here: http://technet.microsoft.com/en-US/evalcenter/hh973397 you’ll get to the sps 2013 preview.

Can I leave the lights on?

Somebody wanted to know what would happen if:

  1. You add a user to an AD group
  2. You give SharePoint site access to each member of this group
  3. The end user accesses the SharePoint site
  4. You remove a user from a group
  5. The end user doesn’t log off from his desktop and maintains the token he got from AD
  6. The next day, the end user tries to access the SharePoint site again.

As you would expect, the end user won’t be able to access the SharePoint site. In Windows authentication mode, every time an end user is validated a session cookie is set containing an MSCSAuth ticket ( http://msdn.microsoft.com/en-us/library/ee796739(v=cs.20).aspx ). No explicit expiration data is set for this cookie, and the cookie will be deleted automatically after the session expires. This happens after a period of inactivity. This time out period is 20 minutes by default and is set in the TimeOut property of the SessionStateSection class ( http://msdn.microsoft.com/en-us/library/ms691403(v=vs.90).aspx ).

Microsoft SharePoint 13 and Office 13

SharePoint 2013 and Office 2013 are now officially available as public beta, you can download the products here:
http://www.microsoft.com/en-us/download/search.aspx?q=SharePoint+2013

Microsoft announces SharePoint 2013 and Office 2013, watch this: http://www.microsoft.com/en-us/news/presskits/office/liveevent.aspx

Check out the Microsoft Office 2013 Preview here: http://www.microsoft.com/office/preview/en and here http://www.engadget.com/2012/07/16/microsoft-office-15-preview/

Blog highlight: SharePoint and Yammer

If you want to learn more about Yammer and future SharePoint integration, check out the very nice blog post at http://www.akruratechnologies.com/2012/07/08/sharepoint-and-yammer-features-integrationtoolstips-and-more/

SharePoint 2010 Best Practices

It’s Friday the 13th. Now is as good as any day to update your SharePoint best practices knowledge, because the TN Wiki SharePoint 2010 Best Practices page is updated again. Check out the latest version at http://social.technet.microsoft.com/wiki/contents/articles/8666.sharepoint-2010-best-practices-en-us.aspx