Page 1

Developing MOSS 2007 Experience Sharing

敦群數位科技股份有限公司 技術總監 游家德 JadeYu

Customization Segments for MOSS2007

SharePoint Designer 2007

HTML / CSS Javascript XML/XSLT

Generic Browser

VS.NET 2005

User Interfaces Page Layout Master Page Web Broswing

Web Arhitecture Web Content Field/View

.NET Programming

Functionalities Extension 3rd Party Integration

Web Part .NET Class

Complexity of Customization Change Site Logo, Format, Parts Change Colors, Backgrounds, Fonts Edit CSS files

SharePoint Designer

Change Page Layout and Content

Edit Master Pages Edit Page Templates (MOSS only)

SPD + Visual Studio

Share Your Customization with Others Build Themes and Site Definitions



Look-and-Feel Issues

New/Edit/Display Form Customization Value Assignment / Value Validation AJAX Javascript Call using SPD2007 (緯創專案) Customized Field Type: email validation (GroupWorks範本) How to hide/display Field in Form • Javascript Style modification using SPD2007(緯創) •

Field Attribution Management (敦群模組)

Customizing SharePoint CSS Modifying a SharePoint stylesheet (in SPD) creates a local copy in the current site Similar to “unghosting” of template pages Local copy is used until deleted

Typical SharePoint Master Pages Either /_layouts/{LocaleId}/styles/core.css or /_styles/core.css + an additional MOSS “portal.css” + an additional “AlternateCssUrl” MOSS User Interface

Customizing SharePoint CSS(聯發科專案) Normal _layouts (on disk) core.css

Customized _layouts (on disk) _styles (in web) core.css






Top Navigation Areas ms-SPLink



ms-globalleft ms-globallinks

ms-sitetitle ms-siteaction



ms-topNavContainer ms-banner ms-bannerframe ms-bannerContainer

ms-topnav + ms-topNavSelected ms-topnav

Body Structure ms-titlearealeft




ms-titlearearight ms-titleareaframe

ms-leftareacell ms-navframe ms-pagemargin

ms-pagebottommargin ms-pagebottommarginleft

ms-pagebottommarginright ms-bodyareapagemargin

ms-pagemargin ms-rightareacell

Default.master Placeholders

Default.master contains ~30 placeholders, ~22 of them in the page body All of them must be defined in a replacement master

Master Page Customization Two techniques for customizing layout: 1.

Start with a copy of default.master Remove markup around placeholder Rebuild in place


Start with a blank master Build from ground up Copy placeholders from default.master

Customization about Look-and-Feel

Extension and Coding Issues

SharePoint Developer Guidelines Learn the Product 盡可能了解產品定位及能耐 Plan for success 動手之前充分規劃 Know the Object Model 熟悉物件操作模型 Log Application Events 紀錄所有事件訊息 Code Only as a Last Resort 寫程式是下下策 Lists Rule 遵循Lists的應用與優勢 Don’t Fear the Database 資料庫是你的最後防線 Source :

SharePoint Object Model

SPControl SPSite SPWebCollection

Microsoft.SharePoint.dll Microsoft.SharePoint.Search.dll Microsoft.Office.Server.dll Microsoft.Office.Server.Search.dll …


SPListCollection SPList SPListItemCollecti on SPListItem SPAttachmentCollection

SPFile SPFieldCollection SPField

圖例 Class /



SPUserCollection SPUser

WebPart or not WebPart? It’s a Question.

易於版面佈署 易於授權管理者設定 易於佈署再利用

介面設計較複雜 開發設定門檻較高


Alternative solution for WebPart QuickPart / SmartPart Solution Developer implement the require as “User Control”and embeded the contorls by QuickPart/ SmartPart Web Part SharePoint DelegatedControl Developer implement the require as “User Control”and deploy the contorls to be as “Features” and use SharePoint:delegatedControl to embeded the user control on Master Page vanGene HtmUrlRetrieve WebPart Developer implement the require as “WebForm”and embeded the HTML responsed code by HtmUrlRetrieve Web Part

Performance Issues

Performance Test Profile Host Machine Profile 2 gigahertz (GHz) dual-core processor 2 GB of RAM.

The virtual server image Profile Office SharePoint Server 2007 Enterprise Edition 1 gigabyte (GB) of allocated RAM.

SharePoint Performance Guideline

SharePoint Performance Guideline

SharePoint Performance Guideline

SharePoint Performance Guideline

Limitations for SharePoint

SharePoint 開發經驗分享