Saturday, February 11, 2006

SharePoint webpartpages -

I have been doing a project in which we started to customise the webpartpages you can add to a SharePoint site or area, which allows you to enhance your SharePoint solutions. You can select from 8 templates and the webpartpages are stored in a document library which allows you to build a basic CMS system. When browsing some SharePoint newsgroups - I came across this interesting newsgroup posting from Todd Bleeker. I have to say it is definitely a worthwile read for everybody. I do have to add that although the webpartpages are ghoested when you add them through the SharePoint web UI, they immediately become unghosted when you change the metadata for the webpartpages stored in the document library.

Newsgroup posting:
The following MSDN article is very similar to what you are after:
http://tinyurl.com/6tv69

Unfortunately, the article results in UNGHOSTED pages. I advise against
unnecessary unghosting. The article is good food for thought and allows for
an unlimited number of templates. I have a friend that has even tweaked this
solution to use an unlimited number of page templates from a Document
Library. Very cool.

However, I have pursued the same URL Protocol approach that the spcf.aspx
page uses making RPC calls to SharePoint via the owssvr.dll. This solution
has a hardcoded limited of eight template pages. But the resulting pages ARE
GHOSTED. Based on my extensive work with Microsoft Content Management Server
(I wrote a good portion of the technical content in the Addison Wesley book,
ISBN: 0321194446) and on my own personal experience; eight templates are
typically enough for most Web sites. At least they have been for mine. I'm
going to limp-along using this approach to content management in SharePoint
until we get full-blown access to Master Pages.

You can find limited documentation for the /_vti_bin/owssvr.dll?CS=109
command using in the spcf.aspx page in the WSS SDK under "Windows SharePoint
Services RPC Methods", specifically the NewWebPage Method. The parameters of
this method are posted to the dll using mostly hidden form fields defined
throughout the spcf.aspx page.

<Method ID="Text">
<SetList Scope="Request">GUID</SetList>
<SetVar Name="Cmd">NewWebPage</SetVar>
<SetVar Name="ID">New</SetVar>
<SetVar Name="Type">[WebPartPage|BasicPage]</SetVar>
<SetVar Name="WebPartPageTemplate">[1-8<<SetVar Name="Overwrite">[true|false]&tl;/SetVar>
<SetVar Name="Title">Text</SetVar>
</Method>

This command will create a new Web Part Page or a new basic page in the
Document Library specified by the GUID. These new pages ARE GHOSTED, that
is, the content column in the Docs table in the database is Null. This is
mandatory in our environment. Changes to the underlying series of SMARTPGS
templates (spstd[1-8].aspx) will reflect in the pages generated using these
templates. I don't understand why but changes to these pages show
immediately, without an iisreset. This makes me think that these pages are
not really ghosted (cached in IIS memory) like typical direct mode pages but
read directly from the file system every time they are called. I haven't
tested this idea further but it is curious. Other ideas are welcome.

The eight templates can be used to create an unlimited number of pages. BTW,
the CS in the URL stands for the FrontPage character set to use and the 109
stands for the character set UTF-8. One last really odd bit of trivia, the
_vti in the URL stands for "Vermeer Technologies Inc.", the company that
Microsoft acquired to get the first version of FrontPage way back in early
1996. Read about it here:
http://www.microsoft.com/presspass/...96/vrmeerpr.asp

HTH,

<Todd />


1 comment:

  1. Anonymous7:51 AM

    I'll be speaking in detail at the SharePoint Advisor Live converence in April about how to do Content Management Lite using ghosted Windows SharePoint Services 2003 Smart Pages. ; )

    <Todd />

    ReplyDelete