1 / 49

MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Ser

MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Services (MCS). Agenda. Rakenteiden luonti Features, Site definitions, content types etc. Ylläpito ja päivitys tuotannossa Kuinka olla devistara ylläpitäjän silmissä.

jaden
Download Presentation

MOSS tietorakenteet ja metadatan pohjaisten rakenteiden käyttöönotto Aku Heikkerö, Vesa Juvonen Microsoft Consulting Ser

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. Agenda • Rakenteiden luonti • Features, Site definitions, content types etc. • Ylläpito ja päivitys tuotannossa • Kuinka olla devistara ylläpitäjän silmissä

  3. 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

  4. Feature Framework

  5. 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

  6. 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 Windows SharePoint Services v3 Features IssueTrackingWorkflow LinksList MobilityRedirect NoCodeWorkflowLibrary PictureLibrary SiteSettings SPSearchFeature SurveysList TasksList TeamCollab UpgradeLinks WebPageLibrary WikiWelcome WorkflowHistoryList WorkflowProcessList XmlFormLibrary AdminLinks AnnouncementsList BasicWebParts ContactsList ContentLightup ContentTypeSettings ctypes CustomList DataSourceLibrary DiscussionsList DocumentLibrary EventsList fields GanttTasksList GridList IssuesList

  7. 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 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

  8. Modular provisioning w/ features • Reusable pieces of customization • Extend existing sites • Easily installed / activated • Elements.xml • Customactions • Customviews • ContentType • Definitions • Layout Pages • Modules (files) • ListInstances • ListTemplates • EventReceivers • DelegateControls • WorkflowBindings • Feature.xml • Feature name • ID • Description • Scope • ReceiverAssembly • ActivationDepencies • ElementManifests

  9. User Perspective of Features • Once installed, power user can activate or deactivated feature in context of site or site collection

  10. 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

  11. 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.xml --> <?xmlversion="1.0" encoding="utf-8" ?> <FeatureId="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> <ElementManifestLocation="ListTemplates\Timesheets.xml"/> </ElementManifests> </Feature> <!-- Timesheets.xml --> <?xmlversion="1.0" encoding="utf-8" ?> <Elementsxmlns="http://schemas.microsoft.com/sharepoint/"> <ListTemplate> <!-- list definition --> </ListTemplate> <ListInstance> <!-- list instantiation --> </ListInstance> </Elements>

  12. 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

  13. Eventtypes

  14. Item-level Events • Define the receiver class by inheriting from SPItemEventReceiver namespace Litware { public classTimesheetEventReceiver : Microsoft.SharePoint.SPItemEventReceiver { public override voidItemUpdating(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; } } } }

  15. Register receiver class …through feature element or <?xmlversion="1.0"encoding="utf-8" ?> <Elementsxmlns="http://schemas.microsoft.com/sharepoint/"> <!-- Document library --> <ReceiversListTemplateId="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> OM code SPList list = web.Lists["Timesheets"]; list.EventReceivers.Add(SPEventReceiverType.ItemAdding, "LitwareAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d4e5777b16a5749f", "Litware.TimesheetEventReceiver");

  16. 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) <ModuleName="MasterPages" Url="_catalogs/masterpage" Path="MasterPages" RootWebOnly="TRUE"> <FileUrl="Sample.master" Type="GhostableInLibrary"> <PropertyName="ContentType" Value="Publishing Master Page" /> <PropertyName="PublishingPreviewImage" Value="~SiteCollection/_catalogs/masterpage/en-us/Preview Images/SampleMaster.png, ~SiteCollection/_catalogs/masterpage/en-us/Preview Images/SampleMaster.png" /> <PropertyName="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> <ModuleName="ResourceStyles" Url="Style Library" Path="Styles" RootWebOnly="TRUE"> <FileUrl="sample.css" Type="GhostableInLibrary" /> </Module> <ModuleName="ResourceImages" Url="Style Library/Images" Path="Images" RootWebOnly="TRUE"> <FileUrl="logo.gif" Type="GhostableInLibrary" /> </Module>

  17. 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

  18. 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

  19. SiteColumns and Contenttypes

  20. Sitecolumnsintroduction • 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.

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

  22. Creating and deletingcolumns • 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.

  23. Sitecolumn definition in xml • When deployed using features, site columns are defined using xml schema <!--ProductFields--> <FieldID="{D7D8604D-0122-4b63-864A-589DC1B1018F}" Name="MCSProductCategory” StaticName="MCSProductCategory” SourceID="http://schemas.microsoft.com/sharepoint/v3" Group="MCSColumns" DisplayName="ProductCategory”Type="Choice" Required="FALSE” Sealed="FALSE"> <Default>Software</Default> <CHOICES> <CHOICE>Software</CHOICE> <CHOICE>Hardware</CHOICE> <CHOICE>Middleware</CHOICE> </CHOICES> </Field> <FieldID="{2081741E-4B73-47b4-88EA-18EF7FE29C34}" Name="MCSProductContactEmail"StaticName="MCSProductContactEmail" SourceID="http://schemas.microsoft.com/sharepoint/v3" Group="MCSColumns” DisplayName="ProductContact Email" Type="Text" Required="FALSE" Sealed="TRUE” MaxLength="255"></Field> <FieldID="{4248FFE2-D63B-4b0c-90A1-46FC4E2B97A4}" Name="MCSProductContactName” StaticName="MCSProductContactName” SourceID="http://schemas.microsoft.com/sharepoint/v3" Group="MCSColumns” DisplayName="ProductContactName" Type="Text" Required="FALSE" Sealed="TRUE” MaxLength="255"></Field>

  24. 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

  25. Use Case 1 – Document • Document based content types can be used to create default templates, which are available from different lists

  26. Use Case 2 – Fields in a WCM page • Content types are also used to define the different fields used in page layouts

  27. Contenttype definition in xml • When deployed using features, content types are defined using xml schema • Fields are referenced using FieldRef elements <ContentTypeID="0x01010012067DD2DC0D4d42B3178FC35F456535" Name="veskuContentType" Group="veskuContentTypeGroup" Description="Custom Content Type for testing purposes"> <FieldRefs> <FieldRefID="{6D78E14B-0C85-4d75-8234-CFE75EAF78F6}" Name="vskuCustomText" DisplayName="vsku Text"/> <FieldRefID="{5158D246-3742-4b3b-9233-096B792B9A9D}" Name="vskuCustomNote" DisplayName="vsku Note"/> <FieldRefID="{A8344C5D-BCD9-498e-9AEF-1792C0B5D575}" Name="vskuCustomChoice" DisplayName="vsku Choice"/> </FieldRefs> </ContentType>

  28. 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

  29. Sitecolumns & contenttypesdeployment

  30. SiteDefinitions

  31. 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

  32. The Provisioning Flow Webtemp.xml Webtemp*.xml Webtempsps.xml Selection of a site template RetrieveSite Definition in \12\Templates\SiteTemplates Call to Microsoft.SharePoint.Publishing.PortalProvisioningProvider PortalWebmanifest.xml InternetBlank.xml CustomHierarchy.xml 1 Site Portal = # Sites

  33. Closer Look at ONET.XML • ONET.XML stores the core definition • Global Template stores common definitions ONET.XML navigation bars list templates document templates configurations features modules

  34. 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

  35. Sitedefinitions

  36. Solutions

  37. Solution DeploymentMotivation • 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

  38. Solution DeploymentHow It Works WSS Config DB HelpDesk.wsp(WSS Solution Cab) add delete Feature Manifests Template Files UI, CommandLine, OM“deploy”command deploy Assemblies retract New WFE Web Front End Servers

  39. SolutionDeployment

  40. Upgrading a SolutionGeneral Rules Things you can do Things you cannot do Remove old features Change a feature ID or scope Remove feature elements (element .xml files) Remove feature properties • 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

  41. Upgrading a SolutionProcess Stsadm –o addsolution –filename mysolution.wsp MySolution.wsp(“version 1.0.0.0”) MySolution.wsp Deploy Solution SolutionID must bethe same! MySolution.wsp(“version 2.0.0.0”) Stsadm –o upgradesolution -name mysolution.wsp –filename mysolutionv101.wsp –immediate -allowgacdeployment

  42. 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

  43. “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

  44. 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

  45. 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

  46. Moreinformation • 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

More Related