moss tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto aku heikkerö, vesa juvonen...

49

Upload: steven-griffith

Post on 14-Dec-2015

221 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)
Page 2: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto

Aku Heikkerö, Vesa JuvonenMicrosoft Consulting Services (MCS)

Page 3: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

AgendaAgenda• Rakenteiden luonti

– Features, Site definitions, content types etc.

• Ylläpito ja päivitys tuotannossa

• Kuinka olla devistara ylläpitäjän silmissä

Page 4: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Who are we?Who are we?

• Aku Heikkerö– Software Development Consultant, BPIO Service Line, Enterprise Services,

Microsoft Finland– Email: [email protected]

• Vesa Juvonen– Software Development Consultant, BPIO Service Line, Enterprise Services,

Microsoft Finland– In Microsoft since 2006, started IT studies 1996 (graduation took a while).

Companies before Microsoft – ICL, Fujitsu, BasWare working as Software Architect, Lead Software Development Engineer etc.

– Email: [email protected]– Blog: http://blogs.msdn.com/vesku

Page 5: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Feature FrameworkFeature Framework

Page 6: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

The Features FrameworkThe Features Framework

• Innovation to enhance modular provisioning– Group logical elements into scenario-driven “features”– Features can be add to and reused across site definitions– New features can be activated in existing site to add functionality– Features scoped at web, site, web application, farm

Page 7: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Windows SharePoint Windows SharePoint Services v3 FeaturesServices v3 FeaturesAdminLinks AnnouncementsList BasicWebParts ContactsList ContentLightup ContentTypeSettings ctypes CustomList DataSourceLibrary DiscussionsList DocumentLibrary EventsList fields GanttTasksList GridList IssuesList

IssueTrackingWorkflow LinksList MobilityRedirect NoCodeWorkflowLibrary PictureLibrary SiteSettings SPSearchFeature SurveysList TasksList TeamCollab UpgradeLinks WebPageLibrary WikiWelcome WorkflowHistoryList WorkflowProcessList XmlFormLibrary

Page 8: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Microsoft Office SharePoint Microsoft Office SharePoint Services 2007 FeaturesServices 2007 Features

AddDashboard Analytics AnalyticsLinks BaseSite BaseSiteStapling BaseWeb BaseWebApplication BDCAdminUILinks BDR BizAppsCTypes BizAppsFields BizAppsListTemplates BizAppsSiteTemplates BulkWorkflow BulkWorkflowTimerJob DataConnectionLibrary DataConnectionLibraryStapling DeploymentLinks DMContentTypeSettings EawfSite EawfWeb EnhancedHtmlEditing ExcelServer ExcelServerSite ExcelServerWebApplication ExpirationWorkflow FeaturePushdown GlobalWebParts GradualUpgrade Hold ipfsAdminLinks IPFSAdminWeb IPFSDocumentConversion IPFSSiteFeatures IPFSWebFeatures LegacyDocumentLibrary ListTargeting LocalSiteDirectoryControl LocalSiteDirectoryMetaData LocalSiteDirectorySettingsLink MasterSiteDirectoryControl

MigrationLinks MySite MySiteBlog MySiteCleanup MySiteHost MySiteLayouts MySiteNavigation MySiteQuickLaunch Navigation NavigationProperties OffWFCommon OSearchBasicFeature OSearchCentralAdminLinks OSearchEnhancedFeature OSearchPortalAdminLinks OSearchSRPAdminLinks OsrvLinks OsrvTasks OssNavigation OSSSearchSearchCenterUrlFeature OSSSearchSearchCenterUrlSiteFeature PageConverters PortalLayouts PremiumRootSite PremiumRootSiteStapling PremiumSite PremiumSiteStapling PremiumWeb PremiumWebApplication ProfileSynch Publishing PublishingLayouts PublishingPrerequisites PublishingResources PublishingSite PublishingStapling PublishingWeb RecordsManagement RedirectPageContentTypeBinding RelatedLinksScopeSettingsLink ReportCenterCreation

ReportCenterSampleData Reporting ReportListTemplate ReviewWorkflows SearchAndProcess SearchWebParts SharedServices SignaturesWorkflow SitesList SkuUpgradeLinks SlideLibrary SlideLibraryActivation SpellChecking SPSDisco SpsSsoLinks SRPProfileAdmin StapledWorkflows TranslationWorkflow TransMgmtFunc TransMgmtLib UpgradeOnlyFile UserMigrator ViewFormPagesLockDown WebPartAdderGroups

Page 9: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Modular provisioning w/ Modular provisioning w/ featuresfeatures• Reusable pieces of customization• Extend existing sites• Easily installed / activated

Feature.xml• Feature name• ID• Description• Scope• Receiver Assembly• Activation Depencies• Element Manifests

Feature.xml• Feature name• ID• Description• Scope• Receiver Assembly• Activation Depencies• Element Manifests

Elements.xml• Custom actions• Custom views• Content Type• Definitions• Layout Pages• Modules (files)• List Instances• List Templates• Event Receivers• Delegate Controls• Workflow Bindings

Elements.xml• Custom actions• Custom views• Content Type• Definitions• Layout Pages• Modules (files)• List Instances• List Templates• Event Receivers• Delegate Controls• Workflow Bindings

Page 10: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

User Perspective of User Perspective of FeaturesFeatures• Once installed, power user can activate or

deactivated feature in context of site or site collection

Page 11: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Administrator Perspective of Administrator Perspective of FeaturesFeatures• Features have to be installed before use

– Files must first be copied into \Template\Features directory– Feature must then be installed

• Options for installing features– Command-line STSADM.EXE utility– Custom code using the WSS object model

REM - Batch file to install and activate a feature@SET SPDIR="c:\program files\common files\microsoft shared\web server extensions\12"

Echo Copying files to \Feature directoryxcopy /e /y Features\LitwareTimesheets\* %SPDIR%\Template\Features\LitwareTimesheets\

Echo Installing feature in WSS catalog%SPDIR%\bin\stsadm -o installfeature -filename LitwareTimesheets/feature.xml -force

Echo Restarting IISIISRESET

Echo Activating feature inside the content of a particular site%SPDIR%\bin\stsadm -o activatefeature -filename LitwareTimesheets/feature.xml -url http://localhost -force

Page 12: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Developer Perspective of Developer Perspective of FeaturesFeatures• Features composed of XML files and .aspx files

– XML in Collaborative Application Markup Language (CAML)– Features have ID, name and scope– Features are composed of elements– Generate GUID using “guidgen.exe” located in the dir. Local_Drive:\

Program Files\Microsoft Visual Studio 8\common7\tools <!-- Feature.xml --><?xml version="1.0" encoding="utf-8" ?><Feature Id="120DD0E1-94B4-4546-A113-E59299A1C34D" Title="Litware Timesheets" Description="This feature provides support for Litware timesheets." Version="1.0.0.0" Scope="Web" Hidden="FALSE" xmlns="http://schemas.microsoft.com/sharepoint/"> <ElementManifests> <ElementManifest Location="ListTemplates\Timesheets.xml"/> </ElementManifests></Feature> <!-- Timesheets.xml -->

<?xml version="1.0" encoding="utf-8" ?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ListTemplate> <!-- list definition --> </ListTemplate> <ListInstance> <!-- list instantiation --> </ListInstance> </Elements>

Page 13: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

WSS "V3" EventsWSS "V3" Events• Events architecture significantly improved

– Events supported for lists, document libraries and content types– Events supported for changes to list schema as well as items– Events supported at site collection and site level– Events supported for incoming email messages– Support for synchronous events and asynchronous events– Synchronous events occur before the fact and are cancel-able

• How do you get events to work– Create custom class inheriting a WSS receiver class

e.g. SPItemEventReceiver or SPWebEventReceiver– Compile class into assembly DLL and install in GAC– Add event configuration by installing and activating a feature

Page 14: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Event typesEvent typesItemAdded An item was added. 

ItemAdding An item is being added. 

ItemCheckedIn An item was checked in. 

ItemCheckedOut An item was checked out. 

ItemCheckingIn An item is being checked in. 

ItemCheckingOut An item is being checked out. 

ItemDeleted An item was deleted. 

ItemDeleting An item is being deleted. 

ItemFileConverted A file was converted. 

ItemFileMoved A file was moved. 

ItemFileMoving A file is being moved. 

ItemUncheckedOut An item was unchecked out. 

ItemUncheckingOut An item is being unchecked out. 

ItemUpdated An item was updated. 

ItemUpdating An item is being updated.  EmailReceived The list received an e-mail message. 

FieldAdded A field was added. 

FieldAdding A field is being added. 

FieldDeleted A field was removed. 

FieldDeleting A field is being removed. 

FieldUpdated A field was updated. 

FieldUpdating A field is being updated. 

ItemAttachmentAdded An attachment was added to the item. 

ItemAttachmentAdding An attachment is being added to the item. 

ItemAttachmentDeleted An attachment was removed from the item. 

ItemAttachmentDeleting

An attachment is being removed from the item. 

SiteDeleted A site collection was deleted. 

SiteDeleting A site collection is being deleted. 

WebDeleted A site was deleted. 

WebDeleting A site is being deleted. 

WebMoved A site was moved. 

WebMoving A site is being moved. 

Page 15: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Item-level EventsItem-level Events• Define the receiver class by inheriting from

SPItemEventReceiver

namespace Litware { public class TimesheetEventReceiver : Microsoft.SharePoint.SPItemEventReceiver { public override void ItemUpdating(SPItemEventProperties properties) { SPWeb web = properties.OpenWeb(); SPListItem timesheet = web.Lists[properties.ListId].GetItemById(properties.ListItemId); // check to make sure date is not day in future if (Convert.ToDateTime(timesheet["Submitted On"]).CompareTo(DateTime.Today) > 0) { properties.ErrorMessage = "You cannot enter future timesheets"; properties.Cancel = true; return; } } }}

Page 16: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Register receiver classRegister receiver class

<?xml version="1.0" encoding="utf-8" ?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <!-- Document library --> <Receivers ListTemplateId="101"> <Receiver> <Name>Timesheet handler</Name> <Class>Litware.TimesheetEventReceiver</Class> <Assembly>LitwareAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d4e5777b16a5749f</Assembly> <SequenceNumber>1000</SequenceNumber> <Type>ItemAdding</Type> </Receiver> </Receivers></Elements>

SPList list = web.Lists["Timesheets"];list.EventReceivers.Add(SPEventReceiverType.ItemAdding, "LitwareAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d4e5777b16a5749f", "Litware.TimesheetEventReceiver");

OM code

…through feature element or

Page 17: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Deployment of resourcesDeployment of resources• Deployment of necessary resources (aspx pages, images,

master pages) done using feature framework• Provisioning can be started directly from site definitions

(onet.xml)

<Module Name="MasterPages" Url="_catalogs/masterpage" Path="MasterPages" RootWebOnly="TRUE"> <File Url="Sample.master" Type="GhostableInLibrary"> <Property Name="ContentType" Value="Publishing Master Page" /> <Property Name="PublishingPreviewImage" Value="~SiteCollection/_catalogs/masterpage/en-us/Preview Images/SampleMaster.png, ~SiteCollection/_catalogs/masterpage/en-us/Preview Images/SampleMaster.png" /> <Property Name="MasterPageDescription" Value="Provides a top navigation band and a vertical navigation section, and presents them by using a black/white/red color scheme." /> </File></Module><Module Name="ResourceStyles" Url="Style Library" Path="Styles" RootWebOnly="TRUE"> <File Url="sample.css" Type="GhostableInLibrary" /></Module><Module Name="ResourceImages" Url="Style Library/Images" Path="Images" RootWebOnly="TRUE"> <File Url="logo.gif" Type="GhostableInLibrary" /></Module>

Page 18: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Updating a featureUpdating a feature• Not that straight forward case• Depends on the content of the feature

– Feature receiver component references can be easily updated, content types can’t…

• Plan and test feature structure carefully, including updating one

• It’s more convenient to hide the old feature and replace that rather the trying actually update the feature– Old deployments have to be still updated

Page 19: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Guidelines and practicesGuidelines and practices• Generate new GUID instantly

when feature.xml has been created

• Create necessary batch files (*.bat) for testing purposes – uninstall deactivate etc.

• Verify each feature before encapsulating it to solution

• Name the features uniquely, for example Company.Project.FeatureName

• Do not use same names for features and for site definitions• Hide feature from UI, is possible

Page 20: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Site Columns and Content Site Columns and Content typestypes

Page 21: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Site columns introductionSite columns introduction• You can add columns to sites and lists, and reference them

in content types.• A column represents an attribute, or piece of metadata, that

the user wants to manage in the portal

• A site column is a reusable column definition, or template, that you can assign to multiple lists across multiple SharePoint sites

• Site columns decrease re-work and help you ensure consistency of metadata across sites and lists.

Page 22: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Use Case – OOB field Use Case – OOB field • Multiple OOB fields available to be used in different

scenarios

Page 23: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Creating and deleting columnsCreating and deleting columns

• Creating Columns– You can create columns in three ways:

• By using the Windows SharePoint Services user interface• By using the Windows SharePoint Services object model• By deploying a Feature that installs the column based on an XML definition file

In each case, columns created at the site level are site columns, while those created at the list level are list columns.

• Deleting Columns– If a site collection contains lists that contain a site column you want to

delete, you cannot delete that site column.– If you delete a column from a list, that column is also deleted from any list

content type on that list.– When you delete a column, all data associated with that column is also

deleted.

Page 24: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Site column definition in Site column definition in xmlxml• When deployed using features, site columns are

defined using xml schema

<!-- Product Fields --><Field ID="{D7D8604D-0122-4b63-864A-589DC1B1018F}" Name="MCSProductCategory” StaticName="MCSProductCategory” SourceID="http://schemas.microsoft.com/sharepoint/v3" Group="MCS Columns" DisplayName="Product Category” Type="Choice" Required="FALSE” Sealed="FALSE"> <Default>Software</Default> <CHOICES> <CHOICE>Software</CHOICE> <CHOICE>Hardware</CHOICE> <CHOICE>Middleware</CHOICE> </CHOICES></Field><Field ID="{2081741E-4B73-47b4-88EA-18EF7FE29C34}" Name="MCSProductContactEmail" StaticName="MCSProductContactEmail" SourceID="http://schemas.microsoft.com/sharepoint/v3" Group="MCS Columns” DisplayName="Product Contact Email" Type="Text" Required="FALSE" Sealed="TRUE” MaxLength="255"></Field><Field ID="{4248FFE2-D63B-4b0c-90A1-46FC4E2B97A4}" Name="MCSProductContactName” StaticName="MCSProductContactName” SourceID="http://schemas.microsoft.com/sharepoint/v3" Group="MCS Columns” DisplayName="Product Contact Name" Type="Text" Required="FALSE" Sealed="TRUE” MaxLength="255"></Field>

Page 25: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Content types introductionContent types introduction• Content type is a reusable collection of settings you want to

apply to a certain category of content. • A content type can include the following information:

– Site columns– Custom New, Edit, and Display forms– Workflows– Document Template– Information Policy settings

Page 26: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Use Case 1 – DocumentUse Case 1 – Document

• Document based content types can be used to create default templates, which are available from different lists

Page 27: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Use Case 2 – Fields in a WCM pageUse Case 2 – Fields in a WCM page

• Content types are also used to define the different fields used in page layouts

Page 28: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Content type definition in xmlContent type definition in xml• When deployed using features, content types are defined

using xml schema• Fields are referenced using FieldRef elements

<ContentType ID="0x01010012067DD2DC0D4d42B3178FC35F456535" Name="veskuContentType" Group="veskuContentTypeGroup" Description="Custom Content Type for testing

purposes"> <FieldRefs> <FieldRef ID="{6D78E14B-0C85-4d75-8234-CFE75EAF78F6}" Name="vskuCustomText" DisplayName="vsku Text"/> <FieldRef ID="{5158D246-3742-4b3b-9233-096B792B9A9D}" Name="vskuCustomNote" DisplayName="vsku Note"/> <FieldRef ID="{A8344C5D-BCD9-498e-9AEF-1792C0B5D575}" Name="vskuCustomChoice" DisplayName="vsku Choice"/> </FieldRefs></ContentType>

Page 29: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Guidelines and practicesGuidelines and practices

• Name the site columns and content types uniquely, for example: – Company.Project.ContentTypeName– CompanyProjectSiteColumnName

• Note. SharePoint designer does not like additional commas

• With document content types, plan the template’s place carefully

• Create generic content type updater, you’ll need this one in multiple projects– Generic update mechanism for content types

Page 30: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Site columns & content Site columns & content types deploymenttypes deployment

Page 31: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Site DefinitionsSite Definitions

Page 32: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Site Definitions And TemplatesSite Definitions And Templates• Two-step process

– Creation of a site at a specific URL

– Populating the site based on a site template

• Designed to be a platform that can support different types of sites the template architecture can be extended

• Site templates– Use browser to save an existing site as a template

• Stored in the database• Can be extracted as STP file

– Create site definition• Collection of files making up the template• Stored on the front-end Web server as a physical folder

Page 33: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

The Provisioning FlowThe Provisioning Flow

Selection of a site templateSelection of a site template

Webtemp.xml Webtempsps.xmlWebtemp*.xml

RetrieveSite Definition in \12\Templates\SiteTemplates

RetrieveSite Definition in \12\Templates\SiteTemplates

Call to Microsoft.SharePoint.Publishing.PortalProvisioningProvider

Call to Microsoft.SharePoint.Publishing.PortalProvisioningProvider

InternetBlank.xml

PortalWebmanifest.xml

1 Site1 Site Portal = # SitesPortal = # Sites

CustomHierarchy.xml

Page 34: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Closer Look at Closer Look at ONET.XMLONET.XML• ONET.XML stores the core definition

• Global Template stores common definitions

navigation barsnavigation bars

list templateslist templates

document templatesdocument templates

configurationsconfigurations

featuresfeatures

modulesmodules

Page 35: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Associate Features in Onet.xmlAssociate Features in Onet.xml

• Features are associated in SiteFeatures or WebFeatures elements– Reference to unique identifier defined in the

Feature.xml

Page 36: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Site definitionsSite definitions

Page 37: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

SolutionsSolutions

Page 38: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Solution DeploymentSolution DeploymentMotivationMotivation

• How do you get your features, site definitions, web parts onto your SharePoint server?

• Old School Method:– Manually copy files onto the file system– Add web.config entries for assemblies– Do IIS reset– Repeat, on EVERY web front end!

Not efficient, more flexibility and reliability required

Page 39: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Solution DeploymentSolution DeploymentHow It WorksHow It Works

HelpDesk.wsp(WSS Solution Cab)

Feature Manifests

WSS Config

DB

UI, CommandLine, OM“deploy”command

adddelete

deployretract

Template Files

Assemblies

Web Front End Servers

NewNewWFEWFE

Page 40: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Solution DeploymentSolution Deployment

Page 41: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Upgrading a SolutionUpgrading a SolutionGeneral RulesGeneral Rules

Things you can do

• Add new files• Remove old versions of files• Add new features• Update/change receiver assembly• Add/change feature elements

(element .xml files)• Add or change feature properties

Things you cannot do

• Remove old features• Change a feature ID or scope• Remove feature elements

(element .xml files)• Remove feature properties

Page 42: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

Upgrading a SolutionUpgrading a SolutionProcessProcess

MySolution.wsp(“version 1.0.0.0”)

MySolution.wsp(“version 2.0.0.0”)

MySolution.wsp

Stsadm –o addsolution –filename mysolution.wsp

Deploy Solution

Stsadm –o upgradesolution -name mysolution.wsp –filename mysolutionv101.wsp –immediate -allowgacdeployment

SolutionID must bethe same!

SolutionID must bethe same!

Page 43: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

PitfallsPitfalls• Classic rules of code updates still apply

– Don’t break interfaces– For Web Parts, don’t break layout of property data

• Solutions themselves do not contain version information– You version their internal components– You keep track of which version is which

• The Solution Management pages in SharePoint Central Administration do not show version information

• VS.NET Extensions for WSS 3.0 cannot perform an upgrade– You can only do this via STSADM or an object model call

• .resx files can’t be deployed to app_globalresources– Create a timer definition to copy .resx files from 12 hive to

application

Page 44: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

““Upgrading” MetadataUpgrading” Metadata

• Sites, lists, etc., based on feature defs, site defs, etc., will not survive an update– Only changes from definitions are stored in database

• Change data depends on definition being stable– Data will conform to original schema

• Your only option is to:– Edit the original definition to mark it as hidden– Create a new definition in the same solution

• New ID and new target folder• Same display name

– Update the solution– Possibly script a bulk update of old sites

• Tools like Echo for SharePoint can help

Page 45: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

A Final Word on Deployment ModelsA Final Word on Deployment Models

• Solutions (.WSPs) are great, but…• MSIs offer:

– EULAs– Deployment of assets beyond what is delivered to

SharePoint sites (registry settings, register COM objects, install files anywhere in the file system, etc).

• Hybrid– Create a MSI that:

• Presents a EULA• Does non-WSS work• Deploys a WSS solution

Page 46: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

SummarySummary• XML based configuration ensures higher

quality for the deployments– Use features framework to create reusable

functionalities

• Use solution package to deploy the functionalities to SharePoint farm

• User interface customization is for end users, not for the developers

Page 47: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)
Page 48: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)

More informationMore information• SharePoint community

– http://sharepoint.microsoft.com/sharepoint/

• SharePoint product team blog– http://blogs.msdn.com/sharepoint/

• Visual Studio structure used in demos and more guidelines (in future)– http://blogs.msdn.com/vesku

Page 49: MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)