I wasn't planning on writing a blog post now but... since Windows Explorer has given me a moment I decided to take this time to ask the question "Why?"
I've just uploaded a couple of files to a SharePoint site and I thought that I ought to organize the directory a bit by creating some folders and moving the documents into them. This of course would be a breeze on a local hard drive. On a network share not bad, but in SharePoint... a royal pain.
Consider what happens when you right click to bring up a context menu from a Windows Explorer window that is exploring a SharePoint site.
I understand - explorer just wants to show me what I'm allowed to do. However, in order to protect me from trying to do something I'm not allowed to do, it is willing to make me wait 20 or 30 seconds while it queries a remote server.
Let's think about this problem from an architectural and user experience point of view.
A user has requested a context menu by right clicking on a window that is displaying content from a remote system.
How do we provide the user with a context menu without putting the UI into a coma for so long that the user gives up?
As we consider an optimal solution the following principles should apply
If working on a high bandwidth, low latency connection build the menu on the first click
If you are on a low latency connection this will happen so fast it won't really matter to the user. The trick is deciding on just how good your connection is. If you are not sure then follow the next steps in this pattern.
When the app creates a connection to a remote resource, cache a "best guess" menu.
The commands allowed on the remote resource are fairly common. In the case of explorer they are the typical file handling commands. From the client point of view you know almost everything you need to know to display the menu with the exception of the current security authorization.
If you cache your "best guess" you could display a command that the user is not allowed to do. Is this optimal? No... but it is better than making the user wait. In the event that they try to do something that they are not allowed to do the request gets an error from the remote system. Is that bad? Sure, but we should point out that this can happen even if you check the authorization before you show the menu because the authorization can change at any moment.
When the app executes a remote command, add a request to enumerate the authorizations for future requests
Once you have decided to make the remote call, why not be a little proactive and add a batch of requests? Now you can have the server specifically enumerate the commands that the user is authorized to execute. Replace your "best guess" cached menu with a menu based on the server response.
Yes it makes the programming model a little more difficult but please don't put your app into a coma - keep it alive, alert and pumping messages by doing async IO. Show the user what you are doing with something like a status bar message and please add a way to cancel the async request.
Keep in mind that there really is no way to cancel an async request - this is just an illusion. What you are saying is that when a request is canceled you will simply ignore the result when it is returned.
I finally got the folder created by going back to the SharePoint Web UI and creating it there. Then I did drag/drop to move the files from Explorer. It worked but it took a very, very, long time and even the drag/drop operation resulted in explorer querying the remote server prior to changing the mouse pointer. The effect of this was that I had to do drag/drop by faith. No I did not see the mouse pointer change to indicate the operation, however since the Mouse Button Down and Mouse Button Up operations were in the message queue when explorer finally got around to processing them it did indeed work.
What a pain... we can do better my friends, you can do better, for the users, for the experience of great software.
Hi Ron,
Maybe you can use ProcessMonitor (www.sysinternals.com) to spy on Windows Explorer and get to the root cause of the slowdown.
There is a problem, but who's guilty? Windows Explorer or some Office component?
Nice post!
You can use Groove for fast and easy documentmanagement of Sharepoint libaries...
I wrote about this a few weeks ago.
"When you use Groove's functionality to synchronize workspaces with SharePoint libraries, you only have to: Right click "add folder", right click "add document", "double click open document"... and after you are finished editing, adding, etc... just click synchronize and your done. Works almost the same as your Windows Explorer..!
"
http://www.clemensreijnen.nl/post/2008/02/Use-Groove-for-easy-document-management-within-SharePoint.aspx
Greetings,
Clemens
I have been thinking is was our installation of Sharepoint or something was wrong with my computer. Thanks for sharing your similar experience. I hope that the SharePoint team can get this fixed in an service pack because it is very annoying.
Dean