How to locate Sharepoint document library source page on the server? - sharepoint

I am working with a Sharepoint document library and I'm trying to locate the source of the document library page. I'm working on the Sharepoint server. I just can't find it, where should it be stored?
Thank you!

SharePoint does not store the pages directly in the filesystem. The mechanism is a little less straightforward.
To understand this mechanism, You have to understand the concepts of Ghosting/Unghosting, and the ASP.NET Virtual Path Provider. The SharePoint stores the pages in the Database as BLOBS, and serves them up using the ASP.NET Virtual path provider.
The ASP.NET Virtual Path Provider provides an abstraction between ASP.NET and FileSystem. Instead of getting a System.IO.FileStream object directly from the filesystem, the provider uses MapPathBasedVirtualPathProvider and the MapPathBasedVirtualFile classes to get the FileStream object.
This abstraction allows ASP.NET to serve up pages from anywhere, without having to store the pages in an actual file system. This concept is used to implement Ghosting/Unghosting which basically means having a single copy of the page, and serving them up as different pages.
SharePoint leverages this new feature in ASP.NET 2.0, along with the improved BLOB storage functionality in SQL Server 2005 to serve up pages.

Your question is not very clear...
Are you refering to the "source" code of the document library pages?
It depends if you have edited them with SharePoint Designer or not. If not they should be located under 12 hive (c:\program files\common files\microsoft shared\web server extensions\12). If any modification were done using SPD2007 the files will be stored in the content database.
...or are you refering to the "source" where the files are stored?
All the files saved in document libraries are stored in the content database as blobs in the AllUserData table.

You the pages appear as 'aspx' pages, they are not stored on the server anywhere as aspx pages. All pages are either stored in the DB as a BLOB, or 'put together' at runtime from information stored in the DB. SharePoint is an odd monster :)
If you are going to edit the look, there are a few options:
SharePoint Designer (I hate this app)
Make another 'web part page' that includes the document library inside of it while changing the content around it (easiest and best approach IMO)
make a specialized web-part (most
difficult)
SharePoint takes a whilet o get the full grasp of... it is strange.

When you create a document library template files from the "12 hive" are ghosted into the SharePoint content database (SQL). The only proper way to edit those pages at that point is to use Microsoft SharePoint Designer.
Open SharePoint Designer and open the SharePoint web site in question and you will see your document library listed in the file explorer. Under your document library you will see a Forms folder, that Forms folder is what contains the source files that are rendered to the browser.
Here is a screen shot:

If I understand what Sacha and Naspinski are saying, when I am creating a new Document library, the look of the page is retrieved from the 12 hive and stored (ghosted?) into the DB. The page is no more stored into the 12 hive, as for each document library I will have a somehow "customized page". Is that true?

There are two types of pages in SharePoint2010.Application page and site page.SharePoint store application page directly in File system.For site pages , if the page is in a ghosted state , the page in stored in the file system.If the page has been customized,the file is then stored in the content database.

Related

How do I programmatically add pages to a wiki library in Sharepoint?

My first question on stackoverflow, I hope I am following the rules.
Anyhow, as the title suggests, I need to figure out how to programmatically add pages to a wiki library. I set up upwards of 30,000 rows in Excel, VBA'd them into txt files containing html that portray articles, and now they are sitting in a folder with nowhere to go. They need to go into a wiki library on SharePoint, where they will be referenced by users in their articles. Two parts:
On single-file upload, cannot upload aspx files. I upload as txt or html and it goes fine. Then I try to change them to aspx. Illegal.
Cannot upload more than one file at a time. Once I figure out #1, this will be an issue.
I assumed there must be a way to mimic whatever the "wikification" process is for files programmatically. Microsoft's how-to on file uploading requires a Sharepoint Project, which requires VS Professional and running SharePoint locally. Neither of these is practical.
Thank you and godspeed.
You could write a small Powershell Script or Commandline application for example in C# or VB. Copy your files to the server and execute your script/app on the SharePoint server. Connect to your SharePoint like the following:
using Microsoft.SharePoint;
...
SPSite site = new SPSite("mysiteurl");
SPWeb web = site.OpenWeb();
// your code goes here
web.dispose();
site.dispose();
...
Then get the directory programmatically where your files reside.
If this was successful, loop through all files in your folder and upload them programmatically to the WIKI Library.
Sound complex, but if you search for the single topics, you will find a lot of solutions/code out there.
You could also write a Console Application which can connect remotely to the SharePoint Server without the need to be executed on the SharePoint itself. In this case you would need to use the Client Object Model (CSOM).
The Office 365 Patterns and Practices site is a great reference. It has a comprehensive sample for creating wiki pages using CSOM here

Sharepoint 2010: Copy or add file to Document Library

I have a silverlight application inserted in a SharePoint page. The SilverLight application runs on a different server thatn that of SharePoint. From an event in the SilverLight, I generate a document on the server side from SQL Server. I can generate the doc on the server hosting the silverlight application and also copy it to the SharePoint server. I wanted to know if I can include this file in a sharepoint document library automatically. I was thinking if like emailing to a list allows us to copy the file into the library, can we configure the reverse, means copying the file make it part of the list.
Update:
I wanted to avoid uploading. For me uploading is sending the file from one location to the target location. But what I am saying is, if I copy the file into the folder where SharePoint keeps the file physically for the particular list, can it be added to the list automatically?
I am not sure, how well I am being able to describe the point. Please elaborate if required or I can answer your queries.
SharePoint stores the files in a database, not a folder.
WebDAV access may be what you're looking for - it's a backbone of the the Explorer View feature that allows a user to access a document library as if you were accessing a file system through a Windows Explorer window.
You can configure "incoming e-mail" properties for the document library, and assign an e-mail address.
After that, when you e-mail a document as attached to e-mail to this e-mail address, then attachment will be saved to that library by sharepoint automatically.

Defining Default Open Behavior in Sharepoint 2010 + Office Web Apps with Custom Webpart

I am running Sharepoint 2010 with Office Web Apps. By default, any document of type .doc, .ppt, etc... will open within the browser from the document library. This is fine, however I am using a web part that is pulling in an XML feed that displays a search engine result list that contains URL links to Word and PPT documents.
I would like to have these links behave the same way as they do in the document library (open in browser), however the user is prompted to download these files instead. Is it possible to dictate this behavior in Sharepoint?
Unfortunately I don't think this is possible unless the documents are hosted in SharePoint and the Office Web Applications feature is activated. The in-browser behaviour is made possible by this server-side feature. I assume that the search-engine derived links you are getting will not, in general, be SharePoint hosted documents.
It is possible to open documents in the browser, but this is a client setting and will depend on the client operating system. You say you want to control this from SharePoint, and I can't think of any way you can do this.

Are Sharepoint template files actually stored on the file system?

I'm new to Sharepoint and just starting to poke around with Sharepoint Designer. I'm curious about the file system I see in Sharepoint designer which doesn't seem to appear anywhere else.
When I open a Sharepoint site in Sharepoint Designer, and I see folders for all my lists, and the Web forms created within them -- am I actually looking at the Windows file system? Or are these virtual-ish files that don't actually exist on the file system?
Put another way, when I create a new List in Sharepoint, do a bunch of template files ("AllItems.aspx," "DispForm.aspx," etc.) get written to the file system somewhere? If so, where?
I ask because I searched and I can't find any of the files I see in Sharepoint Designer anywhere on the actual file system.
Deane,
In essence, you're looking at a hybrid view. When you open SharePoint Designer, you're actually looking at a combination of files that exist in two different places:
The local file system of the SharePoint web front-end (WFE) to which you're connected.
The content database (within SQL Server) that houses the site you have open.
Generally speaking, knowing where any given file resides is a function of whether or not the file is customized. Uncustomized files (such as those that are provisioned through site defintions and Features) do, in fact, live within the server file system. If these files should become customized through editing (e.g., through SharePoint Designer), the edited copy ends up in the content database within SQL Server and is tied to the site.
MSDN has a good article describing SharePoint's virtualized file system and the customization process I'm describing (I'm representing it without going into a lot of detail). I'd recommend checking out the article:
http://msdn.microsoft.com/en-us/library/cc406685.aspx
I hope this helps!
I think they are on [server]/wwwroot/wss/virtualdirectoryofyoursharepoint and the information about each list is saved in the database of Sharepoint content.

Accessing Sharepoint File Server Search Results Externally

We are currently implementing MOSS 2007 to replace an older portal system (Plumtree) and are currently looking at searching. We have 1000s of documents on a file server that we would like users to be able to search. This I can set up by adding a content source of "File Shares" and pointing it at the UNC of the file share. The issue is getting access to this data when you are not on the local network.
So, file share is \FileServer01\Files. This has a file called Wibble.txt containing the word Wibble.
When I search for Wibble it finds this document, BUT it points to file:\FileServer01\Files\Wibble.txt.
That is great if I am attached to the network, but what about when I am accessing Sharepoint via the Internet and I'm not on the LAN that knows about that server?
If I wrote something from scratch I would have a download page that I passed in the location of the file and it would stream it to my browser. Sharepoint does not seam to do anything like like.
Ideas? Suggestions? Have I missed something simple?
Create an HttpModule that intercepts requests to documents in this file share, and presents them through an HttpHandler to the user. Deploy the module and handler to the web application.
The only way to make that content accessible via HTTP would be to bring everything off the file server and into the SharePoint content database. You can then simply let SharePoint crawl that instead of the file server; and your users will be able to download content as well.
Edit: To make the migration task quicker and easier, you can ensure that the WebDav service is running on the sharepoint box, which will allow you to open a document library using the windows explorer interface.

Resources