Thursday, March 27, 2008

Access to a sharepoint publishing site

Access Permissions to a sharepoint publiching site are different from the Team site.

Irrespective of whatever site access persmissions given to a publishing site, user can not see the pages until he/she are given at least 'read' permission to the 'masterpage' gallery.

So, even a full control user to the whole site, if not added to the 'master page' gallery, gets access denied error.

Adding a user to the master page gallery:
Site Actions -> Manage Content and Structure -> mouse hover on the masterpage gallery -> context menu -> Edit -> Properties -> Permissions for this gallery -> New.

If the user is a visitor, allow read permissions on the masterpage gallery.
IF the user can create the publishing pages, allow the 'Designer' access.
If the user can delete the gallery items, allow full control.

Monday, March 10, 2008

Can not create page from the list controls

Deployment of content types via feature is bit tricky. Publishing content types for WCM are different in their way. They are special coz lots of publishing elements, such as "Pages" doc lib and page layouts.
When I deployed the content types using the features, I was redirected to "UploadPage.aspx" page, not to "CreatePage.aspx".Coz, I did not mention the "CreatePage.aspx" template pages explicitly. So, you loose the create page functionality when invoked from the list tool bar menu. Any how, CreatePage.aspx will work if created from the 'Actions' menu.
Below is the code to add the reference to "CreatePage.aspx" template explicitly :
<ContentType
ID="0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900<GUID>" Name="my Publishing Content Type" Group="my Publishing Content Type" Description="Content Type inherited from Publishing Page" >
<FieldRefs>
<FieldRef ID="{<GUID>}" DisplayName="Title" Name="Title" Sealed="TRUE" />
<FieldRef ID="{<GUID>}" DisplayName="Description" Name="Comments" />
</FieldRefs>
<DocumentTemplate TargetName ="/_layouts/CreatePage.aspx"/>

</ContentType>

If you would like to enable this content type to be available only for the specified doc libraries/lists, add the below:
<ContentTypeBinding    
ContentTypeId="LIST TO ENABLE " ListUrl="URL"
/>

This Page has been modified since you opened it. You must open the page again

You get the error, when you place custom .aspx pages in the "Pages" Doc Library of a publishing site.
MOSS Publishing feature has special meaning for "Pages" doc lib. If you intend to change it from the out of the box by writting a code in the .aspx pages in the "Pages" doc lib. Even if you place a simple Content Editor Webpart, it tries to change the "Microsoft.SharePoint.Publishing.PublishingLayoutPage" name space to "Microsoft.SharePoint.Publishing.PublishingLayoutPage". The error message says this change in a brief!

To avoid this, follow the workarounds specified below.
If you are confused or naive to Sharepoint Designer, simply copy the .aspx custom developed pages from the "Pages" doc lib to the area directly under the site folder. Good Luck!

While trying to edit the pages created in the publishing sites, you get this error.
When you use publishing in Sharepoint, you have a pages library with pages that have a page layout. These page layouts need to inherit from Microsoft.SharePoint.Publishing.PublishingLayoutPage and not from Microsoft.Sharepoint.Pages.WebpartPages.
You need to insert the pages in the pages library with a Page Layout.

The generic ONET.XML looks like this:

" Module Path="" Url="$Resources:cmscore,List_Pages_UrlName;" Name="DefaultBlank
File Url="default.aspx" Level="Approved" Type="GhostableInLibrary
Property Name="Title" Value="Default
Property Name="ContentType" Value="$Resources:cmscore,contenttype
"

You have to add a property to the page you are adding. That property is called ‘PublishingPageLayout’ and should have the page layout you want to use as the value.
The page layout that you want to use should inherit from Microsoft.SharePoint.Publishing.PublishingLayoutPage, and most reside in the masterpages gallery of your site collection.

ONET.XML, after modifying:

"
Module Path="" Url="$Resources:cmscore,List_Pages_UrlName;" Name="DefaultBlank
File Url="default.aspx" Level="Approved" Type="GhostableInLibrary

Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/WelcomeLinks.aspx, ~SiteCollection/_catalogs/masterpage/Contact.aspx
Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;">


"

If you have the page display problem after installing SP1, follow the instructions below:

Replace

Page language="C#" Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage, Microsoft.SharePoint.Publishing,Version=12.0.0.0, Culture=neutral,PublicKeyToken=71e9bce111e9429c" metarogid="SharePoint.WebPartPage.Document" meta:webpartpageexpansion="full"
with

Page language="C#" Inherits="Microsoft.SharePoint.Publishing.TemplateRedirectionPage, Microsoft.SharePoint.Publishing, Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" metarogid="SharePoint.WebPartPage.Document" meta:webpartpageexpansion="full"






Wednesday, March 5, 2008

Create a site template from a publishing site

Publishing sites never allow you to save the site as template to be used in the sub site creation.
to allow this, you need to switch the publishing feature off -> save the teplate -> swtch on oagain!

or else you can append the following URL to force the publishing site to get the site template property.

http://your publishing site name/_Layouts/AreaTemplateSettings.aspx.

Some times the templates created by following the above logic will go weird! Even if you save the template from SharePoint Designer it will go wild and do strange things!
Then you should create site definitions (..\web server extensions\12\template\SiteTemplates) .