Schaeflein Dev409 Enterprise Branding Using Site Definitions

42
Enterprise Branding Using Site Definitions DEV409

Transcript of Schaeflein Dev409 Enterprise Branding Using Site Definitions

Page 1: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Enterprise Branding Using Site Definitions

DEV409

Page 2: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Mark FerrazSolutionsMark

Houston, TX

www.solutionsmark.com [email protected]

President, SolutionsMark. Mark is an Senior Information Architect and Developer specializing in Information Management, Collaboration Tools, and Knowledge Management systems for medium to large enterprises. Mark has over ten years of experience designing, managing, and implementing complex technology projects involving application implementation, supporting infrastructure, custom development, and integration. Most recently Mark has been working with the team at Chevron as the Technical Development Lead for one of the largest SharePoint deployments to date.

Page 3: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Paul Schaeflein, MCTS Mindsharp www.mindsharp.com [email protected] http://sharepoint.mindsharpblogs.com/Paul

Page 4: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Topics

Design Options Site Definition Basics Creating a Custom Site Definition Deploying Site Definitions Advanced Techniques Demo

Page 5: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Best Practice

Treat SharePoint Development just as you would any other software development project, by: Adopting well defined development processes

Ensuring proper representation of stakeholders

Deciding early on a systems development lifecycle (SDLC) and sticking to it

Implementing the necessary tools and procedures to assure the rules of engagement are followed

Page 6: Schaeflein Dev409 Enterprise Branding Using Site Definitions
Page 7: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Themes

Page 8: Schaeflein Dev409 Enterprise Branding Using Site Definitions

SharePoint Designer

Page 9: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Site Definitions

Page 10: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Site Definitions vs. Designer

Deployment considerations Deployed repeatedly Deployed across site collections

Maintainability Upgrade via Solution deployment

Advanced artifacts Content types Custom list views

Page 11: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Best Practice

Choose the design option that best suits your specific needs, while balancing upgrade risk and future anticipated flexibility needs?

Are you deploying SharePoint as a Service?

Have you determine architectural guidelines for your deployment?

Have you considered the upgradability of your customizations?

Page 12: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Site Definition Basics

Page 13: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Master Page Composition

Page 14: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Style (CSS)

Be aware of loading order of linked stylesheets You need to load after CORE.CSS

Where possible, use built-in class names for custom components Reduce the number of class names

Use Designer as a tool for exploring CSS attributes and determining the load order

Page 15: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Style (CSS)

Avoid inline style declarations

Keep styles out of the content database Maintenance becomes difficult Styles library Changes made in SharePoint Designer

(SPD)

Page 16: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Master and Layout Pages

Use the Minimal Master Page method of hiding unused controls rather than deleting them to avoid inconsistent errors

Use SharePoint Designer to validate design before deploying pages

Inline code is permissible in unghosted pages

Use CSS override methods for custom styles and beware CSS inheritance order

Page 17: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Presentation

Pages are comprised of base master page and linked layout page Default.aspx serves as layout page

WSS pages may only reference Default.Master or Custom.Master properties

Publishing (Portal) pages are more flexible – other master and layout pages may be used

Page 18: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Presentation

Master Page Changes Small tweaks

– Copy and edit

Large changes– Use a “Minimal Master”

• Heather Solomon (www.heathersolomon.com)

• MSDN

Page 19: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Application Pages

Uses separate master page from site pages Application.Master

DO inherit alternate style settings No “supported” method for modifying

application.master

Page 20: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Application Pages

Run-time methods: Page-level inline code Inline code within master page Server and user controls HttpModule to switch master page at run-

time (unsupported)

Page 21: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Site Galleries and Local Files Site Galleries are UI-specific libraries created during

site provisioning Contain uncustomized versions of source files

File system changes will be reflected in all uncustomized objects

Files are not customized until modified in SP Designer or via the web interface

All customizations made to files in site galleries are local – they do not apply to other sites (including subsites)

Page 22: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Best Practice

Only create and deploy custom site and list definitions when you need to create a new type of site, which aligns with a defined service definition.

Are you deploying SharePoint as a Service?

Do you really need a new site type?

Are there any other alternatives available besides a custom site or list definition?

Page 23: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Create a custom site definition

Page 24: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Key ElementsWSS MOSS

Features

Master Page(s) ✔ ✔Layout Page(s) ✔Site Columns ✔Content Type(s) ✔Web Parts ✔ ✔Lists ✔ ✔Solution Package

Configuration Files ✔ ✔Styles ✔ ✔Images ✔ ✔

Page 25: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Prime Objective

Page 26: Schaeflein Dev409 Enterprise Branding Using Site Definitions

ONET.XML and CAML ONET.XML defines how a site is provisioned, what lists

it contains, what features are enabled, and what content is included

ONET.XML is the ‘blueprint’ of a site definition

ONET.XML syntax is based on Collaborative Application Markup Language (CAML)

ONET.XML modifications only apply to site-provisioning (no post deployment modifications)

Page 27: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Features Site definition functionality is determined

by the Features associated with the Site Def Lists Master Pages Subwebs

Features may be stapled to a Site Def or specified in ONET.XML

The entire Site Def is deployed as a Solution Package – no manual file edits

Page 28: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Global Customizations Global customizations impact all sites which share

same source files Default.Master BlueBand.Master Default.aspg DefaultLayout.aspx

Styles in /_layouts/1033/Styles and Images in /_layouts/Images are global

Changes to application pages are shared by all sites Files deployed via features are also global (for each site

which uses specific feature)

Page 29: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Content Types

Related Site Columns and Content Types may be combined into a single Feature for portability

Insure consistency between layout page and column reference names

To { } or not to { }? Remember to bind content types to target

libraries!

Page 30: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Supporting Files

WEBTEMP, ControlTemplates and other config/supporting files cannot be featurized; deploy manually in solution package

Local (site specific) images and CSS should be deployed as Features; global files should be deployed manually in solution package

Page 31: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Feature Stapling

Use to append Feature “packages” Be aware of feature activation order

Validate dependencies

Some customization elements (content types, list views) cannot be stapled and must be declared in ONET.XML unless you are using event handler code to perform the roll-down operations

Page 32: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Best Practice

Always arrange dependent functionality and resources together into logical features which can be expressed as SharePoint Features, which can be enabled within target sites.

Feature dependencies?

Feature visibility?

Feature deactivation cleanup code, while respecting user settings changes?

Page 33: Schaeflein Dev409 Enterprise Branding Using Site Definitions

DEMO

Creating a Custom MOSS Site Definition

Page 34: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Deploying Site Definitions

Page 35: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Key Artifacts

Page 36: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Deployment

Package entire definition into single Solution Package for ease of maintenance

Use FeatureReceivers for post-provisioning programming tasks (settings, etc. – always cleanup after yourself with appropriate Deactivation events)

Check dependencies (web parts, workflows, etc.)

Page 37: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Maintenance Once a site is provisioned from a custom

definition, removal of the source Solution Package may fail

Use the UpgradeSolution command for iterative deployments ONET changes will not be applied to existing

sites Some Feature with resources in use may not

upgrade in existing site definitions– Use code to update declarative elements that may be

in use or for which the update may not be supported

Page 38: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Advanced Techniques

Use a DelegateControl or Self-Hiding CustomAction menu item to configure sites or lists using code

Allows for you to avoid the upgrade pitfalls of custom site and list definitions

Can perform any action through code and control when the action occurs

Allows for the management of change over time within existing sites or lists

Page 39: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Best Practice

Always deploy developed functionality using a SharePoint Solution, which manages the deployment of code and resources to all WFEs.

Internalize qualities of service.

Use Source Control.

Use advanced techniques such a delegate controls and composite controls to manage change over time.

Page 40: Schaeflein Dev409 Enterprise Branding Using Site Definitions

DEMO

Page 41: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Resources Site Definition Articles

Site Definitions and Configurations [MSDN] Creating a Custom WSS Site Definition [Eric Shupps] Creating a Custom Site Definition in WSS v3 / MOSS [Todd Baginski] SharePoint Designer vs. Custom Site Definitions [Eric Shupps] Site Definitions – The Good, The Bad and The Ugly [Eric Shupps] Managing Code When Customizing SharePoint [Rob Bogue] How to Use Site Definitions in SharePoint [Rob Bogue] http://www.mindsharpblogs.com/markf/archive/2008/03/12/4440.aspx

Page 42: Schaeflein Dev409 Enterprise Branding Using Site Definitions

Thank you for attending!Please be sure to fill out your session

evaluation!

Post conference DVD with all slide decks

Sponsored bySponsored by