anatomy of a share point solution

80

Upload: g-scott-singleton

Post on 29-Jan-2018

929 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Anatomy Of A Share Point Solution
Page 2: Anatomy Of A Share Point Solution
Page 3: Anatomy Of A Share Point Solution
Page 4: Anatomy Of A Share Point Solution
Page 5: Anatomy Of A Share Point Solution
Page 6: Anatomy Of A Share Point Solution
Page 7: Anatomy Of A Share Point Solution
Page 8: Anatomy Of A Share Point Solution

So what is a SharePointSolution?

Page 9: Anatomy Of A Share Point Solution

So what is a SharePointSolution?

Page 10: Anatomy Of A Share Point Solution

So what is a SharePointSolution?

-It’s a Cabinet File with the extension .WSP

Page 11: Anatomy Of A Share Point Solution

So what is a SharePointSolution?

-It’s a Cabinet File with the extension .WSP

-It installs STUFF in the hive

Page 12: Anatomy Of A Share Point Solution

So what is a SharePointSolution?

-It’s a Cabinet File with the extension .WSP

-It installs STUFF in the hive-it can install assemblies in the bin fldr or gac

Page 13: Anatomy Of A Share Point Solution

So what is a SharePointSolution?

-It’s a Cabinet File with the extension .WSP

-It installs STUFF in the hive-it can install assemblies in the bin fldr or gac-It can install feature definitions/site definitions

Page 14: Anatomy Of A Share Point Solution

So what is a SharePointSolution?

-It’s a Cabinet File with the extension .WSP

-It installs STUFF in the hive-it can install assemblies in the bin fldr or gac

-It can install class resources-It can install feature definitions/site definitions

Page 15: Anatomy Of A Share Point Solution

So what is a SharePointSolution?

-It’s a Cabinet File with the extension .WSP

-It installs STUFF in the hive-it can install assemblies in the bin fldr or gac

-It can install class resources-It can install web part packages

-It can install feature definitions/site definitions

Page 16: Anatomy Of A Share Point Solution

So what is a SharePointSolution?

-It’s a Cabinet File with the extension .WSP

-It installs STUFF in the hive-it can install assemblies in the bin fldr or gac

-It can install class resources-It can install web part packages

-It can install feature definitions/site definitions

zomg! then why doesn’t everyone use it?

Page 17: Anatomy Of A Share Point Solution
Page 18: Anatomy Of A Share Point Solution
Page 19: Anatomy Of A Share Point Solution
Page 20: Anatomy Of A Share Point Solution
Page 21: Anatomy Of A Share Point Solution
Page 22: Anatomy Of A Share Point Solution
Page 23: Anatomy Of A Share Point Solution
Page 24: Anatomy Of A Share Point Solution

So What Just Happened?

Page 25: Anatomy Of A Share Point Solution

So What Just Happened?

Solution was added to farm (Via StsAdm in this case) Manifest Examined, Features extracted to: [Hive]Template\Features\[foo]

Page 26: Anatomy Of A Share Point Solution

So What Just Happened?

Solution was added to farm (Via StsAdm in this case) Manifest Examined, Features extracted to: [Hive]Template\Features\[foo]

Solution Gets Deployed via timer jobs - global items go into hive, items for apps provisioned out to wfes etc.

Page 27: Anatomy Of A Share Point Solution

So What Just Happened?

Solution was added to farm (Via StsAdm in this case) Manifest Examined, Features extracted to: [Hive]Template\Features\[foo]

Solution Gets Deployed via timer jobs - global items go into hive, items for apps provisioned out to wfes etc.

Features then available and activating them provisions the items specified in the feature elements file.

Page 28: Anatomy Of A Share Point Solution

The Anatomy of a Solution

<?xml version="1.0"?><Solution SolutionId="ee89a307-dc72-4622-9f81-a424ff247c1f" xmlns="http://schemas.microsoft.com/sharepoint/"> <Assemblies> <Assembly Location="WSP1.dll" DeploymentTarget="GlobalAssemblyCache" /> </Assemblies> <TemplateFiles> <TemplateFile Location="LAYOUTS\MYfirstSolution\SampleService.asmx" /> </TemplateFiles></Solution>

Page 29: Anatomy Of A Share Point Solution

The Anatomy of a Solution

Manifest.xml

<?xml version="1.0"?><Solution SolutionId="ee89a307-dc72-4622-9f81-a424ff247c1f" xmlns="http://schemas.microsoft.com/sharepoint/"> <Assemblies> <Assembly Location="WSP1.dll" DeploymentTarget="GlobalAssemblyCache" /> </Assemblies> <TemplateFiles> <TemplateFile Location="LAYOUTS\MYfirstSolution\SampleService.asmx" /> </TemplateFiles></Solution>

Page 30: Anatomy Of A Share Point Solution

The Anatomy of a Solution

Manifest.xmlSet’s the solution ID which is a GUID

<?xml version="1.0"?><Solution SolutionId="ee89a307-dc72-4622-9f81-a424ff247c1f" xmlns="http://schemas.microsoft.com/sharepoint/"> <Assemblies> <Assembly Location="WSP1.dll" DeploymentTarget="GlobalAssemblyCache" /> </Assemblies> <TemplateFiles> <TemplateFile Location="LAYOUTS\MYfirstSolution\SampleService.asmx" /> </TemplateFiles></Solution>

Page 31: Anatomy Of A Share Point Solution

The Anatomy of a Solution

Manifest.xmlSet’s the solution ID which is a GUIDInstalls Assemblies, GAC or Local

<?xml version="1.0"?><Solution SolutionId="ee89a307-dc72-4622-9f81-a424ff247c1f" xmlns="http://schemas.microsoft.com/sharepoint/"> <Assemblies> <Assembly Location="WSP1.dll" DeploymentTarget="GlobalAssemblyCache" /> </Assemblies> <TemplateFiles> <TemplateFile Location="LAYOUTS\MYfirstSolution\SampleService.asmx" /> </TemplateFiles></Solution>

Page 32: Anatomy Of A Share Point Solution

The Anatomy of a Solution

Manifest.xmlSet’s the solution ID which is a GUIDInstalls Assemblies, GAC or LocalInstalls HIve files

<?xml version="1.0"?><Solution SolutionId="ee89a307-dc72-4622-9f81-a424ff247c1f" xmlns="http://schemas.microsoft.com/sharepoint/"> <Assemblies> <Assembly Location="WSP1.dll" DeploymentTarget="GlobalAssemblyCache" /> </Assemblies> <TemplateFiles> <TemplateFile Location="LAYOUTS\MYfirstSolution\SampleService.asmx" /> </TemplateFiles></Solution>

Page 33: Anatomy Of A Share Point Solution

The Anatomy of a Solution

Manifest.xmlSet’s the solution ID which is a GUIDInstalls Assemblies, GAC or LocalInstalls HIve filesincludes feature.xml feature defs

<?xml version="1.0"?><Solution SolutionId="ee89a307-dc72-4622-9f81-a424ff247c1f" xmlns="http://schemas.microsoft.com/sharepoint/"> <Assemblies> <Assembly Location="WSP1.dll" DeploymentTarget="GlobalAssemblyCache" /> </Assemblies> <TemplateFiles> <TemplateFile Location="LAYOUTS\MYfirstSolution\SampleService.asmx" /> </TemplateFiles></Solution>

Page 34: Anatomy Of A Share Point Solution

The Anatomy of a Solution

Manifest.xmlSet’s the solution ID which is a GUIDInstalls Assemblies, GAC or LocalInstalls HIve filesincludes feature.xml feature defs

<?xml version="1.0"?><Solution SolutionId="ee89a307-dc72-4622-9f81-a424ff247c1f" xmlns="http://schemas.microsoft.com/sharepoint/"> <Assemblies> <Assembly Location="WSP1.dll" DeploymentTarget="GlobalAssemblyCache" /> </Assemblies> <TemplateFiles> <TemplateFile Location="LAYOUTS\MYfirstSolution\SampleService.asmx" /> </TemplateFiles></Solution>

CAML!? CAML! YUK!

Page 35: Anatomy Of A Share Point Solution

bing it FTW!

Page 36: Anatomy Of A Share Point Solution

Getting Intellisense in VS makes it easy-peasy-lemon-squeezy!

Page 37: Anatomy Of A Share Point Solution

FeatureManifest

<FeatureManifests> <!--This Reference is relative to the Location in YOUR CAB!! --> <FeatureManifest Location="MyFirstFeature\Feature.xml"/> <FeatureManifest Location="MySecondFeature\Feature.xml"/> </FeatureManifests>

Page 38: Anatomy Of A Share Point Solution

FeatureManifest

<FeatureManifests> <!--This Reference is relative to the Location in YOUR CAB!! --> <FeatureManifest Location="MyFirstFeature\Feature.xml"/> <FeatureManifest Location="MySecondFeature\Feature.xml"/> </FeatureManifests>

Includes Child Feature Manifest CAML Files

Page 39: Anatomy Of A Share Point Solution

FeatureManifest

<FeatureManifests> <!--This Reference is relative to the Location in YOUR CAB!! --> <FeatureManifest Location="MyFirstFeature\Feature.xml"/> <FeatureManifest Location="MySecondFeature\Feature.xml"/> </FeatureManifests>

Includes Child Feature Manifest CAML FilesLocation is relative to root of your solution CAbinet file

Page 40: Anatomy Of A Share Point Solution

FeatureManifest

<FeatureManifests> <!--This Reference is relative to the Location in YOUR CAB!! --> <FeatureManifest Location="MyFirstFeature\Feature.xml"/> <FeatureManifest Location="MySecondFeature\Feature.xml"/> </FeatureManifests>

Includes Child Feature Manifest CAML FilesLocation is relative to root of your solution CAbinet file

basically copies the manifest to hive and includes the files defined in the feature caml (more later..)

Page 41: Anatomy Of A Share Point Solution

The Assemblies RegionProcesses when solution is deployed

adds your assemblies to local bin or GAC

allows you to specify safe control types

Page 42: Anatomy Of A Share Point Solution

The ApplicationResources

Page 43: Anatomy Of A Share Point Solution

The ApplicationResources

Again - ‘Cause it’s in the Manifest it processes when solution is deployed

Page 44: Anatomy Of A Share Point Solution

The ApplicationResources

Again - ‘Cause it’s in the Manifest it processes when solution is deployed

Places files in the Resources DIR of the root IIS folder of deployed web applications

Page 45: Anatomy Of A Share Point Solution

The TemplateFiles RegionDo I need to mention it again?

Copies Files into the HIVE Under the Template directory

Page 46: Anatomy Of A Share Point Solution

The RootFiles Region

Page 47: Anatomy Of A Share Point Solution

The RootFiles RegionCopies files to a location off the root HIVE

Page 48: Anatomy Of A Share Point Solution

The RootFiles RegionCopies files to a location off the root HIVE

Really the best place to put global web services, etc.

Page 49: Anatomy Of A Share Point Solution

DwpFiles Region

<DwpFiles> <DwpFile Location="MyNonFeatureWebPart.webpart" /> </DwpFiles>

Page 50: Anatomy Of A Share Point Solution

DwpFiles Region

<DwpFiles> <DwpFile Location="MyNonFeatureWebPart.webpart" /> </DwpFiles>

Copies Featureless WebPart Definitions to Web Applications (Huh?)

Page 51: Anatomy Of A Share Point Solution

DwpFiles Region

<DwpFiles> <DwpFile Location="MyNonFeatureWebPart.webpart" /> </DwpFiles>

Copies Featureless WebPart Definitions to Web Applications (Huh?)

Supports either v2 (.DWP) or V3 (.webpart) definition files

Page 52: Anatomy Of A Share Point Solution

Quick-Tip Manifest Location Summary

Assemblies

The parameter DeploymentTarget determines whether to deploy the assembly to the GAC or to a directory (WebApplication).

With the GAC option assemblies are copied to C:\WINDOWS\assembly. With the WebApplication option the files are copied to C:\Inetpub\wwwroot\wss\VirtualDirectories\80\bin.

Features: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\

TemplateFiles: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\

Application Resources: C:\Inetpub\wwwroot\wss\VirtualDirectories\{virtual app port}\resources

Global resources: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\

Web Parts: C:\Inetpub\wwwroot\wss\VirtualDirectories\80\wpcatalog

Site definitions The SiteDefinitionManifests list contains descriptions of all site definition folders. The Location attribute defines the name of the folder that contains the site definition. This folder contains the ONET.xml and other components of the site definition.

Target Folder: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates

Page 53: Anatomy Of A Share Point Solution

The Feature Filesif you thought the manifest was complicated...

Page 54: Anatomy Of A Share Point Solution

The real meat of a feature

Page 55: Anatomy Of A Share Point Solution

The real meat of a feature

<ElementManifests> <ElementManifest Location="MySiteColumns.xml"/> <ElementManifest Location="MyContentTypes.xml"/> <ElementManifest Location="MyListDefs.xml"/> <ElementManifest Location="MyListInstances.xml"/> <ElementManifest Location="ICouldGoOnandOn.xml"/> </ElementManifests>

The Element Manifest - or more aptly put the SharePoint CAML definitions of what the

feature does.

Page 56: Anatomy Of A Share Point Solution

The basic CAML elements

Page 57: Anatomy Of A Share Point Solution

The basic CAML elements

<?xml version="1.0" encoding="utf-8" ?>

Page 58: Anatomy Of A Share Point Solution

The basic CAML elements

<?xml version="1.0" encoding="utf-8" ?><Elements xmlns="http://schemas.microsoft.com/sharepoint/">

Page 59: Anatomy Of A Share Point Solution

The basic CAML elements

<?xml version="1.0" encoding="utf-8" ?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ContentType></ContentType>

Page 60: Anatomy Of A Share Point Solution

The basic CAML elements

<?xml version="1.0" encoding="utf-8" ?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ContentType></ContentType> <ContentTypeBinding/>

Page 61: Anatomy Of A Share Point Solution

The basic CAML elements

<?xml version="1.0" encoding="utf-8" ?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ContentType></ContentType> <ContentTypeBinding/> <HideCustomAction/>

Page 62: Anatomy Of A Share Point Solution

The basic CAML elements

<?xml version="1.0" encoding="utf-8" ?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ContentType></ContentType> <ContentTypeBinding/> <HideCustomAction/> <Control></Control>

Page 63: Anatomy Of A Share Point Solution

The basic CAML elements

<?xml version="1.0" encoding="utf-8" ?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ContentType></ContentType> <ContentTypeBinding/> <HideCustomAction/> <Control></Control> <CustomAction></CustomAction>

Page 64: Anatomy Of A Share Point Solution

The basic CAML elements

<?xml version="1.0" encoding="utf-8" ?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ContentType></ContentType> <ContentTypeBinding/> <HideCustomAction/> <Control></Control> <CustomAction></CustomAction> <CustomActionGroup></CustomActionGroup>

Page 65: Anatomy Of A Share Point Solution

The basic CAML elements

<?xml version="1.0" encoding="utf-8" ?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ContentType></ContentType> <ContentTypeBinding/> <HideCustomAction/> <Control></Control> <CustomAction></CustomAction> <CustomActionGroup></CustomActionGroup> <DocumentConverter/>

Page 66: Anatomy Of A Share Point Solution

The basic CAML elements

<?xml version="1.0" encoding="utf-8" ?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ContentType></ContentType> <ContentTypeBinding/> <HideCustomAction/> <Control></Control> <CustomAction></CustomAction> <CustomActionGroup></CustomActionGroup> <DocumentConverter/> <FeatureSiteTemplateAssociation></FeatureSiteTemplateAssociation>

Page 67: Anatomy Of A Share Point Solution

The basic CAML elements

<?xml version="1.0" encoding="utf-8" ?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ContentType></ContentType> <ContentTypeBinding/> <HideCustomAction/> <Control></Control> <CustomAction></CustomAction> <CustomActionGroup></CustomActionGroup> <DocumentConverter/> <FeatureSiteTemplateAssociation></FeatureSiteTemplateAssociation> <Field></Field>

Page 68: Anatomy Of A Share Point Solution

The basic CAML elements

<?xml version="1.0" encoding="utf-8" ?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ContentType></ContentType> <ContentTypeBinding/> <HideCustomAction/> <Control></Control> <CustomAction></CustomAction> <CustomActionGroup></CustomActionGroup> <DocumentConverter/> <FeatureSiteTemplateAssociation></FeatureSiteTemplateAssociation> <Field></Field> <ListInstance></ListInstance>

Page 69: Anatomy Of A Share Point Solution

The basic CAML elements

<?xml version="1.0" encoding="utf-8" ?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ContentType></ContentType> <ContentTypeBinding/> <HideCustomAction/> <Control></Control> <CustomAction></CustomAction> <CustomActionGroup></CustomActionGroup> <DocumentConverter/> <FeatureSiteTemplateAssociation></FeatureSiteTemplateAssociation> <Field></Field> <ListInstance></ListInstance> <ListTemplate></ListTemplate>

Page 70: Anatomy Of A Share Point Solution

The basic CAML elements

<?xml version="1.0" encoding="utf-8" ?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ContentType></ContentType> <ContentTypeBinding/> <HideCustomAction/> <Control></Control> <CustomAction></CustomAction> <CustomActionGroup></CustomActionGroup> <DocumentConverter/> <FeatureSiteTemplateAssociation></FeatureSiteTemplateAssociation> <Field></Field> <ListInstance></ListInstance> <ListTemplate></ListTemplate> <Module></Module>

Page 71: Anatomy Of A Share Point Solution

The basic CAML elements

<?xml version="1.0" encoding="utf-8" ?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ContentType></ContentType> <ContentTypeBinding/> <HideCustomAction/> <Control></Control> <CustomAction></CustomAction> <CustomActionGroup></CustomActionGroup> <DocumentConverter/> <FeatureSiteTemplateAssociation></FeatureSiteTemplateAssociation> <Field></Field> <ListInstance></ListInstance> <ListTemplate></ListTemplate> <Module></Module> <Receivers></Receivers>

Page 72: Anatomy Of A Share Point Solution

The basic CAML elements

<?xml version="1.0" encoding="utf-8" ?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ContentType></ContentType> <ContentTypeBinding/> <HideCustomAction/> <Control></Control> <CustomAction></CustomAction> <CustomActionGroup></CustomActionGroup> <DocumentConverter/> <FeatureSiteTemplateAssociation></FeatureSiteTemplateAssociation> <Field></Field> <ListInstance></ListInstance> <ListTemplate></ListTemplate> <Module></Module> <Receivers></Receivers> <UserMigrator/>

Page 73: Anatomy Of A Share Point Solution

The basic CAML elements

<?xml version="1.0" encoding="utf-8" ?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ContentType></ContentType> <ContentTypeBinding/> <HideCustomAction/> <Control></Control> <CustomAction></CustomAction> <CustomActionGroup></CustomActionGroup> <DocumentConverter/> <FeatureSiteTemplateAssociation></FeatureSiteTemplateAssociation> <Field></Field> <ListInstance></ListInstance> <ListTemplate></ListTemplate> <Module></Module> <Receivers></Receivers> <UserMigrator/> <Workflow></Workflow>

Page 74: Anatomy Of A Share Point Solution

The basic CAML elements

<?xml version="1.0" encoding="utf-8" ?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ContentType></ContentType> <ContentTypeBinding/> <HideCustomAction/> <Control></Control> <CustomAction></CustomAction> <CustomActionGroup></CustomActionGroup> <DocumentConverter/> <FeatureSiteTemplateAssociation></FeatureSiteTemplateAssociation> <Field></Field> <ListInstance></ListInstance> <ListTemplate></ListTemplate> <Module></Module> <Receivers></Receivers> <UserMigrator/> <Workflow></Workflow></Elements>

Page 75: Anatomy Of A Share Point Solution

Now that I’ve pulled out your fingernails...

Page 76: Anatomy Of A Share Point Solution

Now that I’ve pulled out your fingernails...

If there’s anyone left in the room

Page 77: Anatomy Of A Share Point Solution

Now that I’ve pulled out your fingernails...

Let’s look at the ways to reduce the level of effort!

If there’s anyone left in the room

Page 78: Anatomy Of A Share Point Solution

DEMO

Page 79: Anatomy Of A Share Point Solution

Thanks for spending your valuable Saturday with us!

http://[email protected]: @scottsingleton

Page 80: Anatomy Of A Share Point Solution

http://shareclave.org