Download presentation
Presentation is loading. Please wait.
Published bySteven Griffith Modified over 9 years ago
3
MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS)
4
Agenda Rakenteiden luonti –Features, Site definitions, content types etc. Ylläpito ja päivitys tuotannossa Kuinka olla devistara ylläpitäjän silmissä
5
Who are we? Aku Heikkerö –Software Development Consultant, BPIO Service Line, Enterprise Services, Microsoft Finland –Email: aku.heikkero@microsoft.com 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: vesa.juvonen@microsoft.com –Blog: http://blogs.msdn.com/vesku
6
Feature Framework
7
The 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
8
Windows SharePoint Services v3 Features AdminLinks AnnouncementsList BasicWebParts ContactsList ContentLightup ContentTypeSettings ctypes CustomList DataSourceLibrary DiscussionsList DocumentLibrary EventsList fields GanttTasksList GridList IssuesList 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 IssueTrackingWorkflow LinksList MobilityRedirect NoCodeWorkflowLibrary PictureLibrary SiteSettings SPSearchFeature SurveysList TasksList TeamCollab UpgradeLinks WebPageLibrary WikiWelcome WorkflowHistoryList WorkflowProcessList XmlFormLibrary
9
Microsoft Office SharePoint Services 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 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
10
Modular provisioning w/ features 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
11
User Perspective of Features Once installed, power user can activate or deactivated feature in context of site or site collection
12
Administrator Perspective of Features 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 directory xcopy /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 IIS IISRESET Echo Activating feature inside the content of a particular site %SPDIR%\bin\stsadm -o activatefeature -filename LitwareTimesheets/feature.xml -url http://localhost -force
13
Developer Perspective of Features 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 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/">
14
WSS "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
15
Event types ItemAddedAn item was added. ItemAddingAn item is being added. ItemCheckedInAn item was checked in. ItemCheckedOutAn item was checked out. ItemCheckingInAn item is being checked in. ItemCheckingOutAn item is being checked out. ItemDeletedAn item was deleted. ItemDeletingAn item is being deleted. ItemFileConvertedA file was converted. ItemFileMovedA file was moved. ItemFileMovingA file is being moved. ItemUncheckedOutAn item was unchecked out. ItemUncheckingOutAn item is being unchecked out. ItemUpdatedAn item was updated. ItemUpdatingAn item is being updated. EmailReceivedThe list received an e-mail message. FieldAddedA field was added. FieldAddingA field is being added. FieldDeletedA field was removed. FieldDeletingA field is being removed. FieldUpdatedA field was updated. FieldUpdatingA field is being updated. ItemAttachmentAddedAn attachment was added to the item. ItemAttachmentAddingAn attachment is being added to the item. ItemAttachmentDeletedAn attachment was removed from the item. ItemAttachmentDeletingAn attachment is being removed from the item. SiteDeletedA site collection was deleted. SiteDeletingA site collection is being deleted. WebDeletedA site was deleted. WebDeletingA site is being deleted. WebMovedA site was moved. WebMovingA site is being moved.
16
Item-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; }
17
Register receiver class Timesheet handler Litware.TimesheetEventReceiver LitwareAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d4e5777b16a5749f 1000 ItemAdding 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
18
Deployment 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)
19
Updating 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
20
Guidelines 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
21
Site Columns and Content types
22
Site 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.
23
Use Case – OOB field Multiple OOB fields available to be used in different scenarios
24
Creating 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.
25
Site column definition in xml When deployed using features, site columns are defined using xml schema <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"> Software Software Hardware Middleware <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 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">
26
Content 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
27
Use Case 1 – Document Document based content types can be used to create default templates, which are available from different lists
28
Use Case 2 – Fields in a WCM page Content types are also used to define the different fields used in page layouts
29
Content 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"> <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"/>
30
Guidelines 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
31
Site columns & content types deployment
32
Site Definitions
33
Site 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
34
The Provisioning Flow Selection of a site template Webtemp.xmlWebtempsps.xmlWebtemp*.xml Retrieve Site Definition in \12\Templates\ SiteTemplates Call to Microsoft.SharePoint. Publishing. PortalProvisioningProvider InternetBlank.xml PortalWebmanifest.xml 1 Site Portal = # Sites CustomHierarchy.xml
35
Closer Look at ONET.XML ONET.XML stores the core definition Global Template stores common definitions navigation bars list templates document templates configurations features modules ONET.XML
36
1 2 3 Associate Features in Onet.xml Features are associated in SiteFeatures or WebFeatures elements –Reference to unique identifier defined in the Feature.xml
37
Site definitions
38
Solutions
39
Solution Deployment Motivation 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
40
Solution Deployment How It Works HelpDesk.wsp (WSS Solution Cab) Feature Manifests WSS Config DB UI, Command Line, OM “deploy” command add delete deploy retract Template Files Assemblies Web Front End Servers NewWFE
41
Solution Deployment
42
Upgrading a Solution General 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
43
Upgrading a Solution Process 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 be the same!
44
Pitfalls 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
45
“Upgrading” 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
46
A 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
47
Summary 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
49
More 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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.