Saturday, May 3, 2008

WebDAV, Finder, and Terminal

NOTE: If the portion of an image that is displayed gets the point across for you, then that's great.  If something seems missing, then it's getting truncated by the browser against our wishes - click it to view.

Question:  How do I get Explorer View working on a Mac?

Answer: Mount the Document Library in finder over WebDAV.  Downloads and deletions will function fine, but uploads need to be done via cp or curl from a command prompt.

If that made sense to you, then read no further.  If you have no idea what I'm talking about but would still like to get multiple files at once from sharepoint to your mac (or if you need to upload large files and it keeps timing out on you), then read on for a detailed walkthrough.

STEP 1

Navigate to your library in Safari, and copy the URL of the actual library to your clipboard.  My example is on a machine called spbase.

Photobucket

STEP 2

Go back to Finder, and Connect to the Server.

Connect to Server in Finder

Connect to Server 2

STEP 3

Ignore the domain field, as for some reason I can't make it work correctly (I blame either Apple or Microsoft on this one, not sure who screwed it up), and specify your domain and username on the next line as follows.  Give your password as well.

WebDAV Prompt

STEP 4

The Library should open in Finder as shown below.  If you try to drag and drop (finder copy) a file out of it it will work correctly.  It will also allow you to delete things that you have checked out.  What will not work (as is also shown in the picture below) is a copy TO the location.  It is likely a character set issue.


Finder Broken Copy to

STEP 5

If you want to copy a file TO the library from your macintosh, open up Terminal and navigate to where the library was mounted on your file system.  Mine was called Docs, so it was found under /Volumes/Docs.  The first image illustrates that you can drag a file to the Terminal window and the path will be inserted for you at the prompt.  The second shows the full syntax and results for a cp copy as well as one using curl.

Copy with CP
Copy with Curl

Notes: The error after running the cp command is irrelevant, as losing the extended attributes will mean nothing to Windows users that you were collaborating with.  Curl will show you progress, and also has the ability to pick up where a "download" left off.  In our case we're using it for an upload, but trickery is part of the game when you're trying to get Apples to play nicely with Windows.

Check back here for updated information or utilities to make this sort of thing even easier.

Wednesday, April 16, 2008

ReportViewer?

So after tinkering with Visual Studio 2008 Express on a SharePoint development machine, I made the obvious eventual move of uninstalling Express Edition and replacing it with Visual Studio 2008.

Surprisingly, SharePoint stopped working.

Checking the Event Viewer revealed an issue in ASP.net rearing it's head on line 110 of a web.config file.  I first tried to comment out the entire offending block of xml, just to see if I could get something to load at all, and was confronted with a SharePoint custom error page (better than before).

This led me to believe that that was indeed where the problem was, so I uncommented the block in question and investigated the GAC.  Everything looked fine, aside from the version numbers now reading 9.0.0.0 instead of the desired 8.0.0.0.  I went back to the web.config file and modified the assembly reference to point to the new dll, and everything was back up and running.

Below is what the error looked like in the event viewer, so you can see what I did.  I bolded the most useful piece of this error message.

Event code: 3008 
Event message: A configuration error has occurred. 
Event time: 4/16/2008 7:25:43 AM 
Event time (UTC): 4/16/2008 2:25:43 PM 
Event ID: 0779893478a24b24a2ad40d3ec8f7869 
Event sequence: 4 
Event occurrence: 1 
Event detail code: 0 
 
Application information: 
    Application domain: /LM/W3SVC/1427747289/Root-1-128528295098437500 
    Trust level: WSS_Minimal 
    Application Virtual Path: / 
    Application Path: C:\Inetpub\wwwroot\wss\VirtualDirectories\80\ 
    Machine name: SPBASE 
 
Process information: 
    Process ID: 3340 
    Process name: w3wp.exe 
    Account name: SPBASE\Administrator 
 
Exception information: 
    Exception type: ConfigurationErrorsException 
    Exception message: Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. (C:\Inetpub\wwwroot\wss\VirtualDirectories\80\web.config line 110) 
 
Request information: 
    Request URL: http://spbase/_layouts/error.aspx 
    Request path: /_layouts/error.aspx 
    User host address: 127.0.0.1 
    User: SPBASE\Administrator 
    Is authenticated: True 
    Authentication Type: NTLM 
    Thread account name: SPBASE\Administrator 
 
Thread information: 
    Thread ID: 8 
    Thread account name: SPBASE\Administrator 
    Is impersonating: True 
    Stack trace:    at System.Web.Configuration.ConfigUtil.GetType(String typeName, String propertyName, ConfigurationElement configElement, XmlNode node, Boolean checkAptcaBit, Boolean ignoreCase)
   at System.Web.Configuration.HttpHandlerAction.InitValidateInternal()
   at System.Web.Configuration.HttpHandlersSection.ValidateHandlers()
   at System.Web.Configuration.HttpHandlersSection.FindMapping(String verb, VirtualPath path)
   at System.Web.HttpApplication.GetHandlerMapping(HttpContext context, String requestType, VirtualPath path)
   at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
   at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Welcome!

We thought it would make sense to share some solutions to random problems that we have thus far run into during the myriad of SharePoint implementations that we have been a part of.

So, here it is, and welcome!  Hopefully there is some overlap between our random solutions and your random issues.