Slide deck from the Developer 101 Session: Anatomy of a SharePoint Solution.
This deck accompanied the session that discussed why it's important to use a solution deployment package (wsp) with SharePoint and the basic constructs of a the Solution Manifest File.
10. So what is a SharePoint
Solution?
-It’s a Cabinet File with the extension .WSP
11. So what is a SharePoint
Solution?
-It’s a Cabinet File with the extension .WSP
-It installs STUFF in the hive
12. So what is a SharePoint
Solution?
-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
13. So what is a SharePoint
Solution?
-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
14. So what is a SharePoint
Solution?
-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
-It can install class resources
15. So what is a SharePoint
Solution?
-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
-It can install class resources
-It can install web part packages
16. So what is a SharePoint
Solution?
-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
-It can install class resources
-It can install web part packages
zomg! then why doesn’t everyone use it?
25. So What Just
Happened?
Solution was added to farm (Via StsAdm in this case)
Manifest Examined, Features extracted to:
[Hive]TemplateFeatures[foo]
26. So What Just
Happened?
Solution was added to farm (Via StsAdm in this case)
Manifest Examined, Features extracted to:
[Hive]TemplateFeatures[foo]
Solution Gets Deployed via timer jobs - global items
go into hive, items for apps provisioned out to wfes
etc.
27. So What Just
Happened?
Solution was added to farm (Via StsAdm in this case)
Manifest Examined, Features extracted to:
[Hive]TemplateFeatures[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.
28. 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="LAYOUTSMYfirstSolutionSampleService.asmx" />
</TemplateFiles>
</Solution>
29. 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="LAYOUTSMYfirstSolutionSampleService.asmx" />
</TemplateFiles>
</Solution>
30. The Anatomy of a Solution
Manifest.xml
Set’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="LAYOUTSMYfirstSolutionSampleService.asmx" />
</TemplateFiles>
</Solution>
31. The Anatomy of a Solution
Manifest.xml
Set’s the solution ID which is a GUID
Installs 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="LAYOUTSMYfirstSolutionSampleService.asmx" />
</TemplateFiles>
</Solution>
32. The Anatomy of a Solution
Manifest.xml
Set’s the solution ID which is a GUID
Installs Assemblies, GAC or Local
Installs 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="LAYOUTSMYfirstSolutionSampleService.asmx" />
</TemplateFiles>
</Solution>
33. The Anatomy of a Solution
Manifest.xml
Set’s the solution ID which is a GUID
Installs Assemblies, GAC or Local
Installs HIve files
includes 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="LAYOUTSMYfirstSolutionSampleService.asmx" />
</TemplateFiles>
</Solution>
34. The Anatomy of a Solution
Manifest.xml
Set’s the solution ID which is a GUID
Installs Assemblies, GAC or Local
Installs HIve files
includes feature.xml feature defs
<?xml version="1.0"?>
<Solution SolutionId="ee89a307-dc72-4622-9f81-a424ff247c1f"
xmlns="http://schemas.microsoft.com/sharepoint/">
CAML!? CAML! YUK!
<Assemblies>
<Assembly Location="WSP1.dll" DeploymentTarget="GlobalAssemblyCache" />
</Assemblies>
<TemplateFiles>
<TemplateFile Location="LAYOUTSMYfirstSolutionSampleService.asmx" />
</TemplateFiles>
</Solution>
37. FeatureManifest
<FeatureManifests>
<!--This Reference is relative to the Location in YOUR CAB!! -->
<FeatureManifest Location="MyFirstFeatureFeature.xml"/>
<FeatureManifest Location="MySecondFeatureFeature.xml"/>
</FeatureManifests>
38. FeatureManifest
Includes Child Feature Manifest CAML Files
<FeatureManifests>
<!--This Reference is relative to the Location in YOUR CAB!! -->
<FeatureManifest Location="MyFirstFeatureFeature.xml"/>
<FeatureManifest Location="MySecondFeatureFeature.xml"/>
</FeatureManifests>
39. FeatureManifest
Includes Child Feature Manifest CAML Files
Location is relative to root of your solution
CAbinet file
<FeatureManifests>
<!--This Reference is relative to the Location in YOUR CAB!! -->
<FeatureManifest Location="MyFirstFeatureFeature.xml"/>
<FeatureManifest Location="MySecondFeatureFeature.xml"/>
</FeatureManifests>
40. FeatureManifest
Includes Child Feature Manifest CAML Files
Location 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..)
<FeatureManifests>
<!--This Reference is relative to the Location in YOUR CAB!! -->
<FeatureManifest Location="MyFirstFeatureFeature.xml"/>
<FeatureManifest Location="MySecondFeatureFeature.xml"/>
</FeatureManifests>
41. The Assemblies Region
Processes when solution is deployed
adds your assemblies to local bin or GAC
allows you to specify safe control types
44. 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
45. The TemplateFiles Region
Do I need to mention it again?
Copies Files into the HIVE Under the
Template directory
50. DwpFiles Region
Copies Featureless WebPart Definitions to
Web Applications (Huh?)
<DwpFiles>
<DwpFile Location="MyNonFeatureWebPart.webpart" />
</DwpFiles>
51. DwpFiles Region
Copies Featureless WebPart Definitions to
Web Applications (Huh?)
Supports either v2 (.DWP) or V3 (.webpart)
definition files
<DwpFiles>
<DwpFile Location="MyNonFeatureWebPart.webpart" />
</DwpFiles>
52. 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:WINDOWSassembly. With the WebApplication option the files are copied to
C:InetpubwwwrootwssVirtualDirectories80bin.
Features: C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATEFEATURES
TemplateFiles: C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATE
Application Resources: C:InetpubwwwrootwssVirtualDirectories{virtual app port}resources
Global resources: C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATEFEATURES
Web Parts: C:InetpubwwwrootwssVirtualDirectories80wpcatalog
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 FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATESiteTemplates
55. The real meat of a feature
The Element Manifest - or more aptly put the
SharePoint CAML definitions of what the
feature does.
<ElementManifests>
<ElementManifest Location="MySiteColumns.xml"/>
<ElementManifest Location="MyContentTypes.xml"/>
<ElementManifest Location="MyListDefs.xml"/>
<ElementManifest Location="MyListInstances.xml"/>
<ElementManifest Location="ICouldGoOnandOn.xml"/>
</ElementManifests>
This is a Introductory Class
Doctor Strangelove! Anyone Get it
Prize for questions. What file format is a WSP? What does DDF Stand for? (CABinet, Diamond Directive File)
Developing Software Since 1989, Cobol->Clipper 87->Pascal->FoxPro->C++->C#
Took a year off to build a house, Summer off to chase the pipe dream of being an FF Guide
Got lucky enough to get in on SharePoint before the boom
in the SharePoint 2010 TAP Program
I tweet frequently, Really need to blog more.
Next Slide is HAWT - Ask Why do I work with SharePoint?
I work with SharePoint &#x2018;cause the chicks dig it!
this is what I saw when I installed screen caps on devs boxes. But no worries I added a &#x201C;Fail&#x201D; catcher! it didn&#x2019;t work. This slide ends when mouse hovers Web Service Name. Next Slide is Ransom Note
This is the type of ransom note I used to get from my developers when they&#x2019;d go out to clients
This is actually my #1 Rule for my developers/Designers. #2 is learning what an IDisposable Object is (SPDispose is not an excuse to be a poor programmer)
this is 5 min 5 seconds.
because you&#x2019;re going to go out and BING it, Yes Virginia, it&#x2019;s a verb now, and you&#x2019;re going to look for the CAML.NET intellisense intal for VS 2008
because when you add in CAML intellisense into Visual Studio you make the whole think easy-peasy-lemon-squeezy. So what do all these XML elements and attributes mean? What can I put into a Manifest File?
I can Add Feature Manifests. Explain Features.
1-include child features CAML files
2-Location is alwys relative
3 -basically copies the stuff declared in the feature CAML into a Hive Location
I can Add Feature Manifests. Explain Features.
1-include child features CAML files
2-Location is alwys relative
3 -basically copies the stuff declared in the feature CAML into a Hive Location
I can Add Feature Manifests. Explain Features.
1-include child features CAML files
2-Location is alwys relative
3 -basically copies the stuff declared in the feature CAML into a Hive Location
The Assemblies region
1-Processes when solution is deployed
2-Adds assemblies to the bin or gac
3-Allows you to specify Safe Control Types
Application Resource Region
1-Same deal with processing scope
please files in the resource dir of IIS Folder
Application Resource Region
1-Same deal with processing scope
please files in the resource dir of IIS Folder
Template File Region
Do I really need to mention when this gets processed? it&#x2019;s in the manifest so it gets processed when the solution is deployed. - Files here get copied into the Hive&#x2019;s Template Directory.. the LayoutsMyFirstSolution folder to be specific
RootFiles -kinda the same as template files but back one directory -- relative to the actual 12 HIVE folder
RootFiles -kinda the same as template files but back one directory -- relative to the actual 12 HIVE folder
DWPFiles
Copies WebPart definition files to wpCatalog directory - this is called featureless webparts.
Misnomer, archaic, handles both v2 (.dwp) and v3 (.webpart) files
DWPFiles
Copies WebPart definition files to wpCatalog directory - this is called featureless webparts.
Misnomer, archaic, handles both v2 (.dwp) and v3 (.webpart) files