anatomy of a share point solution

Post on 29-Jan-2018

929 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

So what is a SharePointSolution?

So what is a SharePointSolution?

So what is a SharePointSolution?

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

So what is a SharePointSolution?

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

-It installs STUFF in the hive

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

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

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

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

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?

So What Just Happened?

So What Just Happened?

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

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.

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.

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>

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>

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>

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>

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>

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>

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!

bing it FTW!

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

FeatureManifest

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

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

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

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

The Assemblies RegionProcesses when solution is deployed

adds your assemblies to local bin or GAC

allows you to specify safe control types

The ApplicationResources

The ApplicationResources

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

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

The TemplateFiles RegionDo I need to mention it again?

Copies Files into the HIVE Under the Template directory

The RootFiles Region

The RootFiles RegionCopies files to a location off the root HIVE

The RootFiles RegionCopies files to a location off the root HIVE

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

DwpFiles Region

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

DwpFiles Region

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

Copies Featureless WebPart Definitions to Web Applications (Huh?)

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

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

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

The real meat of a feature

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.

The basic CAML elements

The basic CAML elements

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

The basic CAML elements

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

The basic CAML elements

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

The basic CAML elements

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

The basic CAML elements

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

The basic CAML elements

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

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>

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>

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

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>

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>

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>

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>

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>

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>

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

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>

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>

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

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

If there’s anyone left in the room

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

DEMO

Thanks for spending your valuable Saturday with us!

http://gscottsingleton.comscott@gscottsingleton.comtwitter: @scottsingleton

http://shareclave.org

top related