Sun Application Server Startup Command: /opt/SUNWappserver/bin/asadmin start-domain --domaindir /opt/SUNWappserver/domains --user admin

Thursday, May 17, 2007

SharePoint: Add custom Master Page in Site definition

1. Go To C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL
Copy Default.master to another one name myMaster.master.
Edit some layout if needed.

2. Create your own Site Definition. See http://itsmesunny.blogspot.com/2007/05/creating-custom-site-definition-in-mos

3. Edit ONET.xml under C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\[Your Site Template]\xml
...
<Configurations>
<Configuration ID="-1" Name="NewWeb" />

<Configuration ID="0" Name="Default"
CustomMasterUrl="_catalogs/masterpage/myMaster.master">
...
<Configuration ID="1" Name="Blank">
...
</Configuration>
</Configurations>

<Modules>

<Module Name="CustomMasterPage" List="116" Url="_catalogs/masterpage" RootWebOnly="FALSE" SetupPath="global">

<File Url="myMaster.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" />

</Module>

4.Edit Default.aspx under C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\[Your Site Template]\xml

<%@ Page language="C#" MasterPageFile="~masterurl/custom.master"
(Note: Don't change the name custom.master to your file name. It doesn't mean that)

Creating a custom Site Definition in MOSS 2007

1. Go to: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates, Then copy the sts directory and paste it in the same directory. Rename the Copy of sts directory to CustomSite

2. Go to: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033
Copy the sts directory and paste it to the same directory.
Rename the Copy of STS directory to
CustomSite

3. Under C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML
Create a file called WEBTEMPSAMPLE.XML in the following directory:

Put the following XML into the WEBTEMPCustomSite.XML file:

<?xml version="1.0" encoding="utf-8" ?>

<!-- _lcid="1033" _version="12.0.4017" _dal="1" -->

<!-- _LocalBinding -->

<Templates xmlns:ows="Microsoft SharePoint">

<Template Name="PSIWeb" ID="10002">

<Configuration ID="0" Title="Custom Site" Hidden="FALSE" ImageUrl="/_layouts/images/stsprev.png" Description="This sample template creates a site for teams to create, organize, and share information quickly and easily. It includes a Document Library, and basic lists such as Announcements, Calendar, Contacts, and Quick Links." DisplayCategory="CustomSite Definitions" > </Configuration>

<!-- <Configuration ID="1" Title="Custom Blank Site" Hidden="FALSE" ImageUrl="/_layouts/images/stsprev.png" Description="This sample template creates a Windows SharePoint Services-enabled Web site with a blank home page. You can use a Windows SharePoint Services-compatible Web page editor to add interactive lists or any other Windows SharePoint Services features." DisplayCategory="Custom Site Definitions" > </Configuration>

<Configuration ID="2" Title="Custom Document Workspace" Hidden="FALSE" ImageUrl="/_layouts/images/dwsprev.png" Description="This sample template creates a site for colleagues to work together on documents. It provides a document library for storing the primary document and supporting files, a Task list for assigning to-do items, and a Links list for resources related to the document." DisplayCategory="Custom Site Definitions" > </Configuration> -->

</Template>

</Templates>

4. Restart IIS:
Start/Run/cmd ENTER
Run this command iisreset