Friday, October 31, 2008

BlackBerry browser's table redering bug and mending

If you open a web page and there's a table which have rowspan or colspan in it.
You will find it's always can't display properly in the last row. It will miss handle rowspan or colspan in last column. That's basically happens on testified BlackBerry 8830 and 8700. It's also believable for others which include simulator and real device.
Whatever you use .NET GridView, Repeater, Datalist or others, it would happen definitely.

There are 2 method to fix this bug.

1. Add a new same structure blank row in the end of the table. Here is an example
It actually add a new <tr></tr> in the end.

<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td valign="middle" rowspan="2">HW</td>
<td>HW</td>
<td>HW</td>
<td valign="middle" rowspan="2">HW</td>
</tr>
<tr>
<td>HW</td>
<td>HW</td>
</tr>
<tr>
<td valign="middle" rowspan="2">HW</td>
<td>HW</td>
<td>HW</td>
<td valign="middle" rowspan="2">HW</td>
</tr>
<tr>
<td>HW</td>
<td>HW</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>

2. Add a new same structure blank column in the end of the table. Here's an example.
It actually add a new <td></td> in each </tr>.

<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td valign="middle" rowspan="2">HW</td>
<td>HW</td>
<td>HW</td>
<td valign="middle" rowspan="2">HW</td>
<td></td>
</tr>
<tr>
<td>HW</td>
<td>HW</td>
<td></td>
</tr>
<tr>
<td valign="middle" rowspan="2">HW</td>
<td>HW</td>
<td>HW</td>
<td valign="middle" rowspan="2">HW</td>
<td></td>
</tr>
<tr>
<td>HW</td>
<td>HW</td>
<td></td>
</tr>
</table>

Tuesday, October 28, 2008

A batch file with datatime attribute for backup Alternate Access Mappings

Here show you a batch script for backing up AAM

c:
cd\
cls
@echo Backup Alternate Access Mappings
@for /f "tokens=2" %%i in ('date /t') do
@set thedate=%%i
@set mm=%thedate:~0,2%
@set dd=%thedate:~3,2%
@set yyyy=%thedate:~6,4%
stsadm -o enumalternatedomains >>
E:\data\Backup\AAM\AlternateAccessMappings_%mm%%dd%%yyyy%.txt
@echo Done

Friday, October 24, 2008

A DateTime Picker control designed for smartphone browser.

Based on Visual Studio .Net 2008 (with C#), I wrote a datetime picker for smartphone web, especially for BlackBerry.

The first version is actually a DatePicker named BBDatePicker for BlackBerry. I use it on WebPart and show for BlackBerry browser.

I will share with whose commenter here.
Send email to me (teddyyu@live.com) if you want get one.

Thursday, October 23, 2008

How to join custom reference DLL file in when deploy WebPart by STSDEV

Three steps for refer custermized dll such as custom control.
  1. Refer the dll of custom project in.
  2. Sign a key assembly in the custom dll souce project.
  3. Drag the dll into windows assembly and deployment corresponding wss virual directory.

Tuesday, October 21, 2008

STSDEV Debugging for WebPart, Site Definition or workflow.

After deploy the app (webpart etc) into SharePoint site, you want to debug your app as below steps:

  1. Enable debug in project properties.

    Right click project and click properties, click [Build] in left panel.
    Select the method in Configuration which is the deploy method you just done.
    Click to select both "Define DEBUG constant" and "Define TRACE constant".
    Click right-bottom "Advanced.." button and change [Debug Info:] to "full".
    Click [OK] and save all.
  2. Set breakpoint in debug area of your program
  3. Run "iisapp" in command line to choose which SharePoint run time "w3wp.exe" you should pick up. You can pick it by your running sharepoint site name.
  4. Click menu [Debug] - [Attach to Process...], and click the picked "w3wp.exe" and click [Attach] button, go on click [Attach] button on pop up warning window.
  5. Back to the page which host your app (webpart) and refresh or redeploy.

You will see the debug yellow bar pausing on your code for now. You can now use same debugging method by F11/F10 of VS.

Error handle while try to remove SSP

"The snapshot directory does not exist or is not properly configured."

Occasionally, it happened when I tried to delete SSP in SharePoint farm for verify a disaster/recovery procedure. The SSP can not be deleted successfully and not any changes even delete more times.

I then searched from microsoft and internet but get nothing back. What's the snapshot directory ? The error description looks weird and unreachable by internet.

By checking 12 hive logs, get "Delete site operation cancelled by user. Check the log files for additional details. " Hence I tried to delete the SSP host web application manually first and then go on delete the SSP. It worked then.

Friday, October 17, 2008

Where to change PWA administrator account ?

When you do a PWA migration to another environment, you will find the PWA can't be access by account of new environment. Once you want to change it from SharePoint central administration, you will find the PWA owner place is gray which is not able to be changed.

Actually, the PWA account control is not belongs to SharePoint management, it is still within Project control area. I have ever tried to find the owner information from the SharePoint Project content db and Config db but failed, I also spend couple minutes to search it from those 4 Project DB (Draft, Achieve, Published and Reporting) but still can't. If you know where it is specific table to hold, please put comment to let me know. I would appreciate of you.

Here is the steps:
  1. You will have to open http://yoursite/PWA by the previous administrator account which was created by project server procedure. If you can see the [Site Action] in the page left upper corner, that means you have rights to handle.
  2. You want to click [Server Settings] in left quick launch panel, click [Manage Users] under Security panel. You will find the administrator account in new opened page and you may create a new user with assign administrators Security Group for maximum the user rights.

Now by sign in a different user, you will have all the rights to control new PWA site collection.

The usage of Microsoft IT Site Delete Capture Feature 1.1

When try to recover a sub-site by the method of the instruction of document which is "stsadm -o store". I received the error message "Your backup is from a different version of Windows Sharepoint Services and cannot be restored to a server running the current version." I almost gave it up.
I got back to test it again for draft my mutiple levels recovery precedure. It looks the microsoft existing solution just missing the part of site and site collection recovery which is what MS IT Site Delete Capture do.
There's just one difference on it, i.e. Site-collection and Sub-site.


  1. For Site-collection which was created by central administration. Use the command:
    "stsadm -o restore -url http://www.yoursite.com/sites/deletedsitecollectionname -filename deletedsitecollectionname"
  2. For Sub-site which was created by user site action. Use the command:
    "stsadm -o import -url http://www.yoursite.com/deletedsubsitename -filename deletedsubsitename

For PWA workspaces or other same level site, you want to use the same operation with sub-site.

For lower level such as document library, list and items, the 2 level recycle bin take over the recovery.

For higher level such as web application, farm. you probably need operate the sharepoint central administration with database tools together.

Monday, October 13, 2008

WSS Resources parsing

How to get the value from <%$Resources:wss, mobile_field_separator%> ?
You just need to open 12 hive\CONFIG\Resources\wss.resx to find the name "mobile_field_separator", likewise, if the Resources:wss is something else, just need to find the file name of that.

How to get ListTypeID from current created site and list library.

For customizing a BlackBerry smartphone site page, you probably need to set your RendingTemplate for your mobile web app hosting place, generally, I will put it in a list library such as document library or custom list. This way, you will need to find the specific ListTypeID to define your RendingTemplate ID name as "Mobile_ListTypeID_View_Contents".

Here is the quickest method to find it.
  1. If these TypeId were customized in this new site definition Onet.xml file, you will have to find it from Onet.xml file within %12 hive%\TEMPLATE\SITETEMPLATES\Site_Type\xml\
  2. Normally, you will find it from where you created it. You want to find this create.aspx first, such as http://sharepointsite/_layouts/create.aspx. You need back to this create page and move the mouse to each library or type and see the bottom status bar, there should be a link such "http://mysharepoint/_layouts/new.aspx?FeatureId={00bfea71-e717-4e80-aa17-d0c71b360101}&ListTemplate=101" . You got, the last number is what you just need. (101 in this case)

Hope these will helpful.
Please post comment to discuss if you have any question.

Friday, October 10, 2008

A standard datareader to object sample web service

In one of my BlackBerry application, the requirements need to use MDS studio with background Oracle database, To push a table based query result present in blackberry smartphone screen.

Considering the MDS studio doen't support XML based dataset parsing and serializing. I have to think about other solution.

The MDS mainstream developing model is that invoke web service to generate a WSDL reference interface and then by MDS Data definitions and Message inbound/outbound mechanism to generate application.

Here is an example to get Oracle table to push up an object based data structure for MDS refer to. I feels like this is best solutino currently.

Originally, LINQ plus Generic solution is a good solution. But currently the Oracle still doesn't support LINQ without third part middleware supportings. Hope Microsoft can push out an solution with LINQ using on Oracle.

using System;using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Data.OracleClient;
using System.Collections.Generic;

namespace HourlySalesByObject
{
///
/// Summary description for GetHourlySalesByStoreObject
/// [WebService(Namespace = "http://services/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class
GetHourlySalesByStoreObject : System.Web.Services.WebService
{
[WebMethod] public List GetHourlySalesByStore_Sunday(int store_num)
{
List hourlySales = new List();
using (OracleConnection conn = new OracleConnection("Data Source=RTKTEST;Persist Security Info=True;User ID=korgiej;Password=korgiej;Unicode=True"))
{
OracleCommand cmd = conn.CreateCommand();
try
{
conn.Open();
cmd.CommandText =
"select * from (select STORE, EOW_DATE, HOUR, SUNDAY_TRANSACTIONS,
SUNDAY_AV_DOLLARS, SUNDAY_TOTAL_DOLLARS from PAM_HOURLY_SALES where STORE =" + store_num + " order by EOW_DATE desc) where rownum <= 50";

cmd.CommandType = CommandType.Text;

OracleDataAdapter da = new OracleDataAdapter(cmd);

//DataSet ds = new DataSet();
//ds.Clear();
//da.Fill(ds);
//conn.Close();

using (OracleDataReader odr = cmd.ExecuteReader())
{
while
(odr.Read())
{
HourlySale hourlySale = new HourlySale();
hourlySale.store = odr["STORE"].ToString();
hourlySale.eow_date = Convert.ToDateTime(odr["EOW_DATE"]);
hourlySale.hour = Convert.ToInt16(odr["HOUR"]);
hourlySale.transactions = Convert.ToDecimal(odr["SUNDAY_TRANSACTIONS"]);
hourlySale.av_dollars = Convert.ToDecimal(odr["SUNDAY_AV_DOLLARS"]);
hourlySale.total_dollars = Convert.ToDecimal(odr["SUNDAY_TOTAL_DOLLARS"]);
hourlySales.Add(hourlySale);
}
//List hourlySales = new List();
//foreach (DataRow row in ds.Tables[0].Rows)
//{
//hourlySale.store = row["STORE"].ToString();
//hourlySale.eow_date = Convert.ToDateTime(row["EOW_DATE"]);
//hourlySale.hour = Convert.ToInt16(row["HOUR"]);
//hourlySale.transactions = Convert.ToDecimal(row["SUNDAY_TRANSACTIONS"].ToString());
//hourlySale.av_dollars = Convert.ToDecimal(row["SUNDAY_AV_DOLLARS"].ToString());
//hourlySale.total_dollars = Convert.ToDecimal(row["SUNDAY_TOTAL_DOLLARS"].ToString());
// }
}
}
catch (Exception e)
{ hourlySales = null; }
}
return hourlySales;
}
}

public class HourlySale
{
public
HourlySale() {}
public string store { get; set; }
public DateTime eow_date { get; set; }
public Int16 hour { get; set; }
public Decimal transactions { get; set; }
public Decimal av_dollars { get; set; }
public Decimal total_dollars { get; set; }
}
}

Tuesday, October 7, 2008

Error while compile MDS or JDE project after remove JDK and JRE

You will probably get following errors after remove the JAVA env.

"The rapc compiler failed to run." and "Error Generating Launcher COD"

That caused by the JAVA_HOME or Path which lead jave env to a different place after you removed JAVA. As long as you change this to a proper one, it will work.

The RIM Code Signing

Once you get everything done and try to launch your custom app into your blackberry handheld. You will find you need to pay $20 for a code signing. Or you will get the error "blackberry Error starting Module attempts to access a secure API."

That's really cheeky. Feels like a trap. I finially decide to give up BlackBerry JDE development platform and back to MDS.

That certainly will result in the restrict of developing of BlackBerry application.
People will stand off BB dev gradually. Don't know how the hell they think about it.

Thursday, October 2, 2008

Create a minimum master page site definition by STSDEV

Working on BlackBerry & SharePoint site buildings. It's indispensability to build a SharePoint smartphone site. Integrated this site with the existing mobile pages (12 hive\TEMPLATE\LAYOUTS\MOBILE) together. It can commercially provide valuable web applications. Here show you how to implement it.

  1. Refer the previous post named "Create Site Definition by STSDEV " to create a default site definition.
  2. Refer the previous post named "Creating and Deploying a Custom Master Page with STSDEV" to merge Heather base master page.
  3. Replace the master page by following content and keep the same name "SharePointersDemoCustom.master" then redeploy by VS 2008.


<%-- Identifies this page as a .master page written in Microsoft Visual C# and registers tag prefixes, namespaces, assemblies, and controls. --%>
<%@ Master language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register Tagprefix="SPSWC" Namespace="Microsoft.SharePoint.Portal.WebControls" Assembly="Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="DesignModeConsole" src="~/_controltemplates/DesignModeConsole.ascx" %>
<%@ Register TagPrefix="PublishingVariations" TagName="VariationsLabelMenu" src="~/_controltemplates/VariationsLabelMenu.ascx" %>
<%@ Register Tagprefix="PublishingConsole" TagName="Console" src="~/_controltemplates/PublishingConsole.ascx" %>
<%@ Register TagPrefix="PublishingSiteAction" TagName="SiteActionMenu" src="~/_controltemplates/PublishingActionMenu.ascx" %>
<%-- Uses the Microsoft Office namespace and schema. --%>
<html>
<WebPartPages:SPWebPartManager runat="server"/>
<SharePoint:RobotsMetaTag runat="server"/>

<%-- The head section includes a content placeholder for the page title and links to CSS and ECMAScript (JScript, JavaScript) files that run on the server. --%>
<head runat="server">
<asp:ContentPlaceHolder runat="server" id="head">
<title>
<asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server" />
</title>
</asp:ContentPlaceHolder>
<Sharepoint:CssLink runat="server"/>
<asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server" />
</head>

<%-- When loading the body of the .master page, SharePoint Server 2007 also loads the SpBodyOnLoadWrapper class. This class handles .js calls for the master page. --%>
<body onload="javascript:_spBodyOnLoadWrapper();">
<%-- The SPWebPartManager manages all of the Web part controls, functionality, and events that occur on a Web page. --%>
<form runat="server" onsubmit="return _spFormOnSubmitWrapper();">
<wssuc:Welcome id="explitLogout" runat="server"/>
<PublishingSiteAction:SiteActionMenu runat="server"/>
<PublishingWebControls:AuthoringContainer id="authoringcontrols" runat="server">
<PublishingConsole:Console runat="server" />
</PublishingWebControls:AuthoringContainer>
<%-- The PlaceHolderMain content placeholder defines where to place the page content for all the content from the page layout. The page layout can overwrite any content placeholder from the master page. Example: The PlaceHolderLeftNavBar can overwrite the left navigation bar. --%>
<asp:ContentPlaceHolder id="PlaceHolderMain" runat="server" />
<asp:Panel visible="false" runat="server">
<%-- These ContentPlaceHolders ensure all default SharePoint Server pages render with this master page. If the system master page is set to any default master page, the only content placeholders required are those that are overridden by your page layouts. --%>
<asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server"/>
<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server"/>
<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server"/>
<asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server"/>
<asp:ContentPlaceHolder ID="PlaceHolderPageImage" runat="server"/>
<asp:ContentPlaceHolder ID="PlaceHolderBodyLeftBorder" runat="server"/>
<asp:ContentPlaceHolder ID="PlaceHolderNavSpacer" runat="server"/>
<asp:ContentPlaceHolder ID="PlaceHolderTitleLeftBorder" runat="server"/>
<asp:ContentPlaceHolder ID="PlaceHolderTitleAreaSeparator" runat="server"/>
<asp:ContentPlaceHolder ID="PlaceHolderMiniConsole" runat="server"/>
<asp:ContentPlaceHolder id="PlaceHolderCalendarNavigator" runat ="server" />
<asp:ContentPlaceHolder id="PlaceHolderLeftActions" runat ="server"/>
<asp:ContentPlaceHolder id="PlaceHolderPageDescription" runat ="server"/>
<asp:ContentPlaceHolder id="PlaceHolderBodyAreaClass" runat ="server"/>
<asp:ContentPlaceHolder id="PlaceHolderTitleAreaClass" runat ="server"/>
<asp:ContentPlaceHolder id="PlaceHolderBodyRightMargin" runat="server" />
</asp:Panel>
</form>
</body>
</html>

Creating and Deploying a Custom Master Page with STSDev (Refer to SharePointers)

(Continue from last one: Create Site Definition by STSDEV)

Step 1: Add the base master page to the project

If you haven't already done so, download and unzip the base master page from Heather Solomon's site.

  1. Right click on your 'RootFiles\TEMPLATE\SiteTemplates\YourSiteTemplateName' directory and choose 'Add Existing Item'
  2. Select the base master page from your file system and click 'Add'
  3. Rename the file 'SharePointersDemoCustom.master'.

Step 2: Editing the Default.aspx file

  1. Open the default.aspx file
  2. At the top of the page, change the 'Page' directives 'MasterPageFile' attribute to '~masterurl/custom.master' (note that this value can only be 'default.master' or 'custom.master' but you can name your file whatever you like because the onet.xml file's element contains the reference to the actual file)
  3. Save the file

Step 3: Editing the onet.xml file

  1. Open the onet.xml file
  2. In the <listtemplates> node add the following child node:


    <ListTemplate Name="mplib" DisplayName="$Resources:MasterPageGallery;"
    Description="$Resources:global_onet_mplib_desc;"
    SetupPath="global\lists\mplib" Type="116"
    BaseType="1" Path="GLOBAL" Hidden="TRUE"
    HiddenList="TRUE" NoCrawl="TRUE" Unique="TRUE"
    Catalog="TRUE" OnQuickLaunch="FALSE" SecurityBits="11"
    AllowDeletion="False" AllowEveryoneViewItems="TRUE"
    Image="/_layouts/images/itdl.gif" AlwaysIncludeContent="TRUE"
    DocumentTemplate="100" />

  3. Find the <configuration> node the 'ID' attribute of 0 (zero)
  4. Add the 'MasterUrl' attribute to the <configuration> node like so:

    <Configuration ID="0" Name="Blank" MasterUrl="_catalogs/masterpage/SharePointersDemoCustom.master">

  5. The <configuration> node you just modified should have a <modules> child element. Add the following <modules> tag as a child of this node

    <Module Name="CustomMasterPage" />


  6. Now go to the outer <Modules> tag that is a child of the main <Project> node and add the following child <Module> node

    <Module Name="CustomMasterPage" List="116" Url="_catalogs/masterpage" RootWebOnly="FALSE">
    <File Url="SharePointersDemoCustom.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" />
    </Module>



Step 4: Deploy the project

  1. Again, STSDEV makes this a breeze. If this is the first time you've deployed this solution change your build configuration to DebugDeploy and do a build, otherwise do a DebugRedeploy.
  2. Now create a new site based on your site definition and see if your masterpage is working correctly. (Note, it should look pretty ugly since we haven't modified the UI yet.

Step 5: Start tweaking that master page!

Here's a bunch of really good resources for customizing your master pages all in one place. Heather Solomon really is the expert when it comes to SharePoint branding:

Create Site Definition by STSDEV (Refer to SharePointers)

This is a refer for a record to deposit.

Part 1: Generate the STSDEV solution
  1. Open Visual Studio and run STSDEV (should be an option on your tools menu if you ran through the tutorials, see above link)
  2. Choose to create an empty solution with C# assembly
  3. Click 'Create the Solution'
  4. After you create the solution, you'll need to open it from the file system. STSDEV does not automatically open it for you in Visual Studio.

Part 2: Set up the project structure

Even the most basic site definition needs at least 3 files: a webtemp.xml file, an onet.xml file, and a default.aspx file. So let's create these files in the appropriate places.
  1. right click on the 'RootFiles' folder and add a new folder called 'TEMPLATE'
  2. Under the 'TEMPLATE' folder you created add a new folder called '1033'
  3. Under the '1033' folder you created create a new folder called 'XML'
  4. In the 'TEMPLATE/1033/XML' folder add a new XML file called 'webtemp.YourSiteName.xml', where your site name is what you want to call your site.
    Under the 'TEMPLATE' folder you created add a new folder called 'SiteTemplates'
    Under the 'SiteTemplates' folder create a folder called 'Your Site Name', with the name of the site you'd like to use.
  5. In the 'Your Site Name' folder, create a folder called 'xml'Following those steps should set up your directory structure.

Part 3: The webtemp*.xml file

According to the MSDN documentation: 'The WebTemp*.xml files contain the site definition configurations that are available on the Template Selection section of the New SharePoint Site page'. So the details of this file determine how your site definition information will show up on the 'Create New Site' page.
  1. Go to the WebTemp.xml documentation page and copy the xml code into your webtemp*.xml file.
  2. Delete all the <template> nodes except for the first one
  3. In the only remaining <template> node, delete all the <configuration> nodes except the first one
  4. Enter a name for the <template> node 'Name' attribute (ensure this is the same name as your directory name in the SiteTemplates folder)
  5. Enter an id for the <template> node 'ID' attribute (if you've never done this before, start with 11001, this is because certain ID ranges are reserved. You'll notice that most of the out of the box templates are in the 10000 range, so hopefully anything in the 11000 range will be ok).
  6. Give the <configuration> node ID attribute a value of '0' (zero)
  7. Give the <configuration> node Title attribute a title of your choosing.
  8. Give the <configuration> node Description attribute a description of your choosing.
  9. Give the <configuration> node DisplayCategory attribute a category of your choosing (choosing 'Development' is a good idea, this will be the name of the tab on the 'Create Site' page that your site definition appears under)

Part 4a: Copying the onet.xml and default.aspx pages.

Since I will only be talking about the minimum needed to get your simple site definition working,
after you complete this (or before) you might want to read up on the documentation for onet.xml

Because the onet.xml and default.aspx files are fairly long I won't post it here. What I do is use the version that is generated from VSeWSS. If you don't have this, download it because it is pretty useful, and generates solutions for you as well. I actually used this all the time before STSDEV came out and I decided that STSDEV generated what I considered to be cleaner and more well structured solutions. I have a template directory that contains most of the files that I use that I just copy into my solutions as I create them. I'll give the instructions on how to get the onet.xml and default.aspx file into your solution if you have VSeWSS v1.1 installed.
  1. Right click on your solution node for your STSDev Project and choose Add > New Project
  2. Choose 'Blank Site Definition' and create it
  3. In the project expand the 'Site Definition' folder and you'll see an onet.xml file, copy this to the 'TEMPLATE/SiteTemplates/Your Site Name/xml' folder in your STSDEV project
  4. In the same 'Site Definition' folder you found the onet.xml file in, you'll see a default.aspx file, copy this to the 'TEMPLATE/SiteTemplates/Your Site Name'.

Part 4b: Modifying the onet.xml fileThere are only a few changes you need to make to the onet.xml file.
  1. Set the <project>node's 'Title' attribute to whatever you like.
  2. Set the <project>node's 'Revision' attribute to '1'.
  3. Set the <configuration>node's (under <project>) 'ID' attribute to '0' (zero).

Part 5: Deploy your solution

This is where STSDEV really shines, you basically don't need to do anything to get your site deployed other than select the 'DebugDeploy' configuration and do a build. If you did everything correctly you should be able to test your deployment by going to your site collection's home page and choosing Site Settings > Create and create a new site using your template.