Alexander Meijers & Roel Hans Bethlehem
Introduction Alexander Meijers Architect at Sparked Subject matter Expert for SharePoint and Search http://www.bloggix.com/blogs/microsoft http://www.dutchsug.nl Roel Hans Bethlehem Architect at Sparked Subject matter Expert for SharePoint
Alexander Meijers
Architect at Sparked
Subject matter Expert for SharePoint and Search
http://www.bloggix.com/blogs/microsoft
http://www.dutchsug.nl
Roel Hans Bethlehem
Architect at Sparked
Subject matter Expert for SharePoint
Agenda Project & tools Keep to the Basics Locations Permissions Development Styling Multilanguage Deployment
Project & tools
Keep to the Basics
Locations
Permissions
Development
Styling
Multilanguage
Deployment
Setup a development project Create single solution Add for each namespace in your project a class library project Create a namespace for deployment Create a duplicate tree of the 12 Hives Make use of tools like Add in for WSP Builder ( http://www.codeplex.com ) SharePoint installer ( http://www.codeplex.com ) Use features Installing components Changes to config files
Create single solution
Add for each namespace in your project a class library project
Create a namespace for deployment
Create a duplicate tree of the 12 Hives
Make use of tools like
Add in for WSP Builder ( http://www.codeplex.com )
SharePoint installer ( http://www.codeplex.com )
Use features
Installing components
Changes to config files
Tools WSPBuilder Creates SharePoint Solutions files based on a folder structure Deploy solutions SharePoint Installer Creating user friendly installation and deployments for SharePoint 2007 solutions VSeWSS 1.2 Visual Studio 2008 extensions STSDEV Generate Visual Studio project files and solution files STSADM 184 operations through command line on the web server Custom extensions possible
WSPBuilder
Creates SharePoint Solutions files based on a folder structure
Deploy solutions
SharePoint Installer
Creating user friendly installation and deployments for SharePoint 2007 solutions
VSeWSS 1.2
Visual Studio 2008 extensions
STSDEV
Generate Visual Studio project files and solution files
STSADM
184 operations through command line on the web server
Custom extensions possible
Demo Tools & Project setup
Tools & Project setup
Keep to the basics Use standard functionality as much as possible All SharePoint functionality out-of-the-box will still work like search, versioning and publishing Use SharePoint as storage Powerful API model Do not change or replace existing files
Use standard functionality as much as possible
All SharePoint functionality out-of-the-box will still work like search, versioning and publishing
Use SharePoint as storage
Powerful API model
Do not change or replace existing files
Master pages, layouts, CSS, images, scripts Into a library inside your site collection Can be referenced by ~site, ~sitecollection and ~masterpage Only available within the site collection Too many site collection makes it harder to update these files Updatable through the web interface Into the _LAYOUTS folder Can be referenced by path to folder Available for every Sharepoint website in farm One place for easy updating these files Only updatable directly on the server All web applications on the server share this folder
Into a library inside your site collection
Can be referenced by ~site, ~sitecollection and ~masterpage
Only available within the site collection
Too many site collection makes it harder to update these files
Updatable through the web interface
Into the _LAYOUTS folder
Can be referenced by path to folder
Available for every Sharepoint website in farm
One place for easy updating these files
Only updatable directly on the server
All web applications on the server share this folder
Code Access Security “ Request for the permission of type Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c failed ”
“ Request for the permission of type Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c failed ”
Code Access Security What is it? Security model use by the SharePoint API Ensure your code provides error handling in the event that required permissions are not available Arrange Web applications to operate in a partially trusted environment System.Security. AllowPartiallyTrustedCallersAttribute() Level of trust Full, High, Medium, Low, Minimal Custom like WSS_Minimal, WSS_Medium
Security model use by the SharePoint API
Ensure your code provides error handling in the event that required permissions are not available
Arrange Web applications to operate in a partially trusted environment
System.Security. AllowPartiallyTrustedCallersAttribute()
Level of trust
Full, High, Medium, Low, Minimal
Custom like WSS_Minimal, WSS_Medium
Code Access Security What are the options? Decorate your code with Request Permissions Declarative Security like [SomePermissionAttribute(SecurityAction.Demand, Unrestricted = true)] Deployment and CAS Trustlevel in your web.config GAC Custom policy file
Decorate your code with Request Permissions
Declarative Security like [SomePermissionAttribute(SecurityAction.Demand, Unrestricted = true)]
Deployment and CAS
Trustlevel in your web.config
GAC
Custom policy file
Snippet: <PermissionSet class="NamedPermissionSet" version="1" Name="SPRestricted"> <IPermission class="AspNetHostingPermission" version="1" Level=“Medium" /> </PermissionSet> Custom policy example
Snippet:
<PermissionSet class="NamedPermissionSet"
version="1"
Name="SPRestricted">
<IPermission
class="AspNetHostingPermission"
version="1"
Level=“Medium"
/>
</PermissionSet>
Permissions Who am I? Your code runs with permissions of the logged on user Set up proper testing Especially for anonymous internet facing sites I always use Firefox since it does not log me on Coding & Elevation Impersonation SPSecurity.RunWithElevatedPrivileges
Your code runs with permissions of the logged on user
Set up proper testing
Especially for anonymous internet facing sites
I always use Firefox since it does not log me on
Coding & Elevation
Impersonation
SPSecurity.RunWithElevatedPrivileges
Demo Elevation
Elevation
Web Part development Do not use any code in your Web Part Always load an UserControl Use the ControlTemplates folder Put the logic into the control Code and design should be separated Put only properties in your Web Part Two namespaces System.Web.UI.WebControls.WebParts Microsoft.SharePoint.WebParts
Do not use any code in your Web Part
Always load an UserControl
Use the ControlTemplates folder
Put the logic into the control
Code and design should be separated
Put only properties in your Web Part
Two namespaces
System.Web.UI.WebControls.WebParts
Microsoft.SharePoint.WebParts
Web Part development Think of Show only accessible / all content Check if content is published or not Recursive reading SPWeb objects UX & Design AJAX Silverlight SharePoint objects like EditorPart & EntityEditorWithPicker
Think of
Show only accessible / all content
Check if content is published or not
Recursive reading SPWeb objects
UX & Design
AJAX
Silverlight
SharePoint objects like EditorPart & EntityEditorWithPicker
Demo Web Part Development
Web Part Development
Dispose or not to dispose? Two objects in the API model which needs to be disposed of SPSite SPWeb Dispose only when created yourself by SPSite site1 = site2; Use method Dispose() with try, catch, finally or using(…) {…} Do not dispose contextual objects SPContext.Current.Web.Dispose(); Tool SPDisposeCheck
Two objects in the API model which needs to be disposed of
SPSite
SPWeb
Dispose only when created yourself by
SPSite site1 = site2;
Use method Dispose() with try, catch, finally
or using(…) {…}
Do not dispose contextual objects
SPContext.Current.Web.Dispose();
Tool SPDisposeCheck
Demo Dispose or not to dispose?
Dispose or not to dispose?
Styling, what are the options? CSS stylesheet reference (configurable) Own site definitions, masterpages and templates Separation of layout and content Full control ONET.XML editing Themes Different styles en color schemes for users (only reason to use it!) Testing your theme is terrible Schema files for lists CAML knowledge required Full control of list layout
CSS stylesheet reference (configurable)
Own site definitions, masterpages and templates
Separation of layout and content
Full control
ONET.XML editing
Themes
Different styles en color schemes for users (only reason to use it!)
Testing your theme is terrible
Schema files for lists
CAML knowledge required
Full control of list layout
Styling, what are the options? Use Firefox with the “Web developer” add on Easy retrieval of styling Enabling / Disabling certain elements Visualizing your divs and tables Accessibility Out-of-the-box is not conform standards Accessibility Kit for SharePoint http://aks.hisoftware.com/index.html Resources Heather Solomon http://www.heathersolomon.com/ SharePoint Branding Tool http://www.codeplex.com/BrandingTool
Use Firefox with the “Web developer” add on
Easy retrieval of styling
Enabling / Disabling certain elements
Visualizing your divs and tables
Accessibility
Out-of-the-box is not conform standards
Accessibility Kit for SharePoint http://aks.hisoftware.com/index.html
Resources
Heather Solomon http://www.heathersolomon.com/
SharePoint Branding Tool http://www.codeplex.com/BrandingTool
Demo Enabling a theme with a feature
Enabling a theme with a feature
Multilanguage Variations Is really a copying mechanism Resources files Resource folders Resx files Custom code must support Multilanguage Web Part output Editor Parts Custom forms
Variations
Is really a copying mechanism
Resources files
Resource folders
Resx files
Custom code must support Multilanguage
Web Part output
Editor Parts
Custom forms
Resource files Application resources Used within the normal execution of the SharePoint application. Think of Application Pages, Web Parts and Controls For multilangual lists: 12CONFIGResources For local webapplications: <Website URL>App_GlobalResources Caveat: cannot deploy by WSP package Provisioning resources are used when provisioning elements. Think of features, site definitions and list definitions 12TEMPLATEFEATURES<feature>ResourcesResources.<culture>.resx 12TEMPLATEFEATURES<feature>Resources 12Resources Administrative application resources Used within the normal execution of the SharePoint application. Think of Application Pages, Web Parts and Controls inside the administrative environment 12CONFIGAdminResources <Website URL><port>App_GlobalResources
Application resources
Used within the normal execution of the SharePoint application. Think of Application Pages, Web Parts and Controls
For multilangual lists: 12CONFIGResources
For local webapplications: <Website URL>App_GlobalResources
Caveat: cannot deploy by WSP package
Provisioning resources
are used when provisioning elements. Think of features, site definitions and list definitions
12TEMPLATEFEATURES<feature>ResourcesResources.<culture>.resx
12TEMPLATEFEATURES<feature>Resources
12Resources
Administrative application resources
Used within the normal execution of the SharePoint application. Think of Application Pages, Web Parts and Controls inside the administrative environment
12CONFIGAdminResources
<Website URL><port>App_GlobalResources
Resource files usage C# HttpContext.GetGlobalResourceObject("MyResource", "MyName").ToString(); ASPX properties <%$Resources:MyResource, MyName%> XML $Resources:MyResource, MyName XML features, using the default resource file $Resources:MyName
C#
HttpContext.GetGlobalResourceObject("MyResource", "MyName").ToString();
ASPX properties
<%$Resources:MyResource, MyName%>
XML
$Resources:MyResource, MyName
XML features, using the default resource file
$Resources:MyName
Demo Using a resources for custom multi language Web Part
Using a resources for
custom multi language Web Part
Solution deployment Deploy the Solution package to the farm Retract the Solutions package When a new web server is added, automatically deploy the solution to it Deploy new versions of the Solution Solution - A CAB file containing Manifest.xml file All the files for the Features, Web Parts, Site or list def changes, etc... that make up your solution
Deploy the Solution package to the farm
Retract the Solutions package
When a new web server is added, automatically deploy the solution to it
Deploy new versions of the Solution
Solution - A CAB file containing
Manifest.xml file
All the files for the Features, Web Parts, Site or list def changes, etc... that make up your solution
Solution deployment “ Featurize” your custom development Any SharePoint element Changes in your web.config Copying files to specific web folders Deploy features and other assets by WSP Solution package
“ Featurize” your custom development
Any SharePoint element
Changes in your web.config
Copying files to specific web folders
Deploy features and other assets by WSP Solution package
Development and testing Your development machine does not go into production Use a buildserver Always test with different set of browsers (level 1 and level 2) Watch out for rights
Your development machine does not go into production
Use a buildserver
Always test with different set of browsers (level 1 and level 2)
Watch out for rights
CodePlex The starting point of a lot of new SharePoint functionality Community Kit For SharePoint http://www.codeplex.com/CKS SharePoint learning kit http://www.codeplex.com/SLK SharePoint Features http://www.codeplex.com/features Podcasting kit for SharePoint http://www.codeplex.com/pks Smartpart for SharePoint http://www.codeplex.com/smartpart SharePoint AJAX toolkit http://www.codeplex.com/sharepointajax
The starting point of a lot of new SharePoint functionality
Community Kit For SharePoint http://www.codeplex.com/CKS
SharePoint learning kit http://www.codeplex.com/SLK
SharePoint Features http://www.codeplex.com/features
Podcasting kit for SharePoint http://www.codeplex.com/pks
Smartpart for SharePoint http://www.codeplex.com/smartpart
SharePoint AJAX toolkit http://www.codeplex.com/sharepointajax
Resources Best practices resource center for SharePoint 2007 http://technet.microsoft.com/en-us/office/sharepointserver/bb736746.aspx Patterns and practices SharePoint guidance http://www.codeplex.com/spg Best practices for SharePoint guidance http://msdn.microsoft.com/en-us/library/dd203468.aspx SharePoint Deployment Planning Services https://iwsolve.partners.extranet.microsoft.com/SDPS/ Downloadable book: Design and build sites for Office SharePoint Server 2007 http://go.microsoft.com/fwlink/?LinkId=110087 Other resources such as http://www.codeplex.com / http://www.dutchsug.nl / www.microsoft.com/sharepoint
Best practices resource center for SharePoint 2007 http://technet.microsoft.com/en-us/office/sharepointserver/bb736746.aspx
Patterns and practices SharePoint guidance http://www.codeplex.com/spg
Best practices for SharePoint guidance http://msdn.microsoft.com/en-us/library/dd203468.aspx
SharePoint Deployment Planning Services https://iwsolve.partners.extranet.microsoft.com/SDPS/
Downloadable book: Design and build sites for Office SharePoint Server 2007 http://go.microsoft.com/fwlink/?LinkId=110087
Other resources such as http://www.codeplex.com / http://www.dutchsug.nl / www.microsoft.com/sharepoint
Gary Lapointe STSADM http://stsadm.blogspot.com/ Firebug https://addons.mozilla.org/nl/firefox/addon/1843 Yslow https://addons.mozilla.org/nl/firefox/addon/5369 More resources
Gary Lapointe STSADM http://stsadm.blogspot.com/
Firebug https://addons.mozilla.org/nl/firefox/addon/1843
Yslow https://addons.mozilla.org/nl/firefox/addon/5369
Questions?
Questions?
Alexander Meijers [email_address] Roel Hans Bethlehem [email_address] Contact us
Alexander Meijers
[email_address]
Roel Hans Bethlehem
[email_address]
Presentación que realice en el Evento Nacional de Gobierno Abierto, realizado los ...
In this presentation we will describe our experience developing with a highly dyna...
Presentation to the LITA Forum 7th November 2014 Albuquerque, NM
Un recorrido por los cambios que nos generará el wearabletech en el futuro
Um paralelo entre as novidades & mercado em Wearable Computing e Tecnologias Assis...
Microsoft finally joins the smartwatch and fitness tracker game by introducing the...
This Wiki page contains an overview of SharePoint 2013 Best Practices ... GUI tool for configuring the ... solutions, sandbox solutions, or sharepoint ...
Read more
... and best practices for configuring solutions ... This white paper illustrates best practices for ... SharePoint Server 2007: This white paper ...
Read more
... issues for SharePoint 2010 solution ... and follow proven practices. The SharePoint Guidance ... best way to get started with Developing ...
Read more
... against known Microsoft dispose best practices. ... SharePoint Solutions Through Code.NET Best ... for developing solutions ...
Read more
Best Practices for Developing ... Applies to: SharePoint ... This topic describes some best practices in developing sandboxed solutions.
Read more
Many of these best practices still valid for SharePoint ... solutions based on the SharePoint 2010 ... SharePoint 2010 development best practices ...
Read more
You'll get some guidelines and best practices that will help ... 2013 Core Solutions: (04) Developing SharePoint ... Configuring Remote Hosted ...
Read more
... plus programming best practices. ... SharePoint Development Practices and ... Microsoft SharePoint solution you will have to make ...
Read more
Best Practices when developing larger solutions? ... best-practices-when-developing ... for Sharepoint 2010. Are there any best practices ...
Read more
Add a comment