Schaeflein Dev409 Enterprise Branding Using Site Definitions
-
Upload
mferraz -
Category
Technology
-
view
739 -
download
1
Transcript of Schaeflein Dev409 Enterprise Branding Using Site Definitions
Enterprise Branding Using Site Definitions
DEV409
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.
Paul Schaeflein, MCTS Mindsharp www.mindsharp.com [email protected] http://sharepoint.mindsharpblogs.com/Paul
Topics
Design Options Site Definition Basics Creating a Custom Site Definition Deploying Site Definitions Advanced Techniques Demo
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
Themes
SharePoint Designer
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
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?
Site Definition Basics
Master Page Composition
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
Style (CSS)
Avoid inline style declarations
Keep styles out of the content database Maintenance becomes difficult Styles library Changes made in SharePoint Designer
(SPD)
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
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
Presentation
Master Page Changes Small tweaks
– Copy and edit
Large changes– Use a “Minimal Master”
• Heather Solomon (www.heathersolomon.com)
• MSDN
Application Pages
Uses separate master page from site pages Application.Master
DO inherit alternate style settings No “supported” method for modifying
application.master
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)
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)
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?
Create a custom site definition
Key ElementsWSS MOSS
Features
Master Page(s) ✔ ✔Layout Page(s) ✔Site Columns ✔Content Type(s) ✔Web Parts ✔ ✔Lists ✔ ✔Solution Package
Configuration Files ✔ ✔Styles ✔ ✔Images ✔ ✔
Prime Objective
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)
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
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)
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!
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
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
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?
DEMO
Creating a Custom MOSS Site Definition
Deploying Site Definitions
Key Artifacts
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.)
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
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
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.
DEMO
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
Thank you for attending!Please be sure to fill out your session
evaluation!
Post conference DVD with all slide decks
Sponsored bySponsored by