Does anyone know if it’s possible to embed the explorer view for a document library in a page outside of the host SharePoint site? I’d like to surface this functionality within an ASPX application totally independently of SharePoint. I’m aware of the available web services, the question is about embedded the folder view functionality, not programmatically communicating with SharePoint.
I ended up deconstructing the the original explorer view and distilled it down to the following:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Shared Documents</TITLE>
<SCRIPT language=javascript src="http://[host]/_layouts/1033/init.js" type=text/javascript></SCRIPT>
<SCRIPT language=javascript src="http://[host]/_layouts/1033/core.js" defer type=text/javascript></SCRIPT>
</HEAD>
<BODY scroll=yes onload="NavigateHttpFolderIfSupported('http:\u002f\u002f[host]\u002fsites\u002f[site]\u002fShared Documents', 'expFrame');">
<FORM id=aspnetForm name=aspnetForm>
<IFRAME id=expFrame name=expFrame width=800 height=500></IFRAME>
</FORM>
</BODY></HTML>
It could probably be done a little neater but it certainly works.
While you might think it's some ActiveX control that needs special stuff from Sharepoint, Explorer View is kinda baked right into IE. As long as you've previously used it in SharePoint in a Windows session, as little as the following will net you an Explorer View frame:
<iframe src="\\path\to\sharepoint\webdav\folder">
You can do this with pretty well any valid Windows Explorer path as well, provided the page is hosted locally or on your intranet. Just try making a local test html file with something like:
<iframe src="c:\">
Mind you you'll run into some problems doing it like that, since authentication needs to be passed to SharePoint. The best way I've found is to copy core.js from Sharepoint, cut out everything in it but the navigation stuff and remove any calls in those methods to things not available, and then use NavigateHttpFolderIfSupported() to navigate to "http://path/to/sharepoint/webdav/folder".
The only problem I've had with this method is some incompatibilities with IE8, so watch out for that. I'm fairly certain it has to to with cross-site scripting protection and a call inside core.js but that whole file feels very rube-goldberg-esque and I don't want to mess with it.