SharePoint Development for [TITLE] Developers...
Transcript of SharePoint Development for [TITLE] Developers...
[TITLE] SharePoint Development for ASP.Net
Developers
Tarek Bohsali
Microsoft
[PRESENTATION TITLE]
[PRESENTATION TITLE]
AGENDA
• SharePoint Basics
• Packaging and Deployment
• Common Artifacts
• Remote Applications
• Demo
• Visual Web Parts
• List Definitions
• Event Receivers
• Client Object Model
SharePoint .NET
WHY SHAREPOINT?
Data Storage
Presentation
Security
Clustering
API‟s
Office Integration
Features
Data Storage
Presentation
Security
Clustering
API‟s
Office Integration
Features
SHAREPOINT TERMINOLOGY
Farm
Feature
Solution Package Event Receiver
Web Application
Web Part
Site Definition
CAML
Feature Receiver
Central Administration
Declarative Workflow
Client Object Model
Timer Job
List Definition
List Instance
Content Database
Content Type
Persisted Object
Site Column
Site Collection
Elevated Privileges
Theme
Application Page
Safe Control
Scope
ONET
Publishing Page
Field Control
Layout Page
Team Site List View
STSADM
SHAREPOINT ARCHITECTURE
[PRESENTATION TITLE]
[PRESENTATION TITLE]
SERVER FARMS
• A collection of SharePoint role servers and a
SQL database server
• Servers can perform one or more functions
(web front end, search, application, etc.)
• Farm-level features are managed via Central
Administration
• Custom code can be deployed at the Farm level
and managed centrally
• Solution Packages allow custom code to be
automatically deployed across the farm
Server Farm
Web Front Ends
Application
Database
[PRESENTATION TITLE]
[PRESENTATION TITLE]
WEB APPLICATIONS AND SITE COLLECTIONS
• Web application = IIS Virtual Server
• Each web application may be assigned its own app
pool
• Web applications may utilize multiple service
applications
• Site collections reside within web applications
• Site collection functionality derived from underlying
site definition
• Special site collection types include My Sites,
Shared Services Provider, Publishing Web
[PRESENTATION TITLE]
[PRESENTATION TITLE]
SOLUTION PACKAGES
• Solution Packages are “bundles” of functionality
deployed to the farm or site collection (sandbox)
• May contain one or more Features, assemblies,
pages, controls, and other artifacts
• SharePoint framework handles installation and
configuration of solution items automatically across
entire farm
• Automated packaging and deployment in Visual
Studio 2010
WSP
Mapped Folders
Assemblies
Web Parts
[PRESENTATION TITLE]
[PRESENTATION TITLE]
SANDBOX SOLUTIONS
• Trusted solutions which run in isolated process
• Load balanced execution
• Uploaded to solution directory in site collection
• Administratively controlled via quotas
• Can be automatically disabled
• Subset of OM functionality
• Ability to use trusted proxy for restricted operations
Full Object
Model
Subset Object
Model
MyWebPart.dll
Proxy
Runtime
[PRESENTATION TITLE]
[PRESENTATION TITLE]
FEATURES
• A „Feature‟ is a defined set of functionality
encapsulated within a specific format
• Features are the basic building block of WSS v3
and MOSS development
• Features may be comprised of any combination of
code, including web parts, workflows, and site
definitions
• Features may be deployed manually or
automatically on a local or global basis
• Features are heavily dependent on CAML
Solution
Feature
XML
Receiver
Assembly
Project Item
Web Part Template Workflow
[PRESENTATION TITLE]
[PRESENTATION TITLE]
WEB PARTS
• Web Parts are a specific type of server control that
inherit from System.Web.UI.WebPart
• Web Parts contain discreet functionality that is exposed
to the user in the context of a Web Part Page
• Classic Web Parts do not have an IDE; Visual Web
Parts host ASP.NET User Controls
• Web Parts execute in the context of the current user
• Web Parts may be deployed individually or in
conjunction with other artifacts
Page
Form
Web Part
Controls
Web Part Manager
[PRESENTATION TITLE]
[PRESENTATION TITLE]
LIST ELEMENTS, TYPES AND VIEWS
• Lists are virtual data repositories for unstructured content
• Fields defined by associated content types and user-defined columns
• Common lists types included OOTB
• Custom list types may be created in UI or code
• List data is stored in the content database associated with the site collection
• Maximum limit for list items is 30M+
• Be aware of performance implications and throttling when storing/retrieving large amounts
of list data
• Lists have associated views defined in UI or CAML
• Custom field types may be created programmatically
[PRESENTATION TITLE]
[PRESENTATION TITLE]
EVENT RECEIVERS
• Event Receivers are handler assemblies that respond
to events on specific objects (Webs, Lists, Features,
etc.)
• Event receivers override built-in methods:
• Adding/Added
• Updating/Updated
• Activated/Deactivated
• Installing/Uninstalling
• Event Receivers have no UI or user feedback
mechanism
• Event Receivers must run with Full Trust in the GAC
Content
Database
[PRESENTATION TITLE]
[PRESENTATION TITLE]
RELATIONAL DATA
• LINQ to SharePoint
• CAML joins
var q = from announcement in dc.announcements
where announcement.Expires >= DateTime.Today
select new { announcement.Title, announcement.Body };
<Joins>
<Join Type='LEFT ListAlias='List1'>
<Eq>
<FieldRef Name='Field1' RefType='Id' />
<FieldRef Name='ID' List='List1' />
</Eq>
</Join>
<Join Type='LEFT' ListAlias='List2'>
<Eq>
<FieldRef List='List1' Name='SomeFieldName' RefType='Id' />
<FieldRef List='List2' Name=‟ID‟ />
</Eq>
</Join>
</Joins>
[PRESENTATION TITLE]
[PRESENTATION TITLE]
WORKFLOW
• SharePoint Workflow inherits and builds upon Windows
Workflow Foundation (WF)
• Simple workflows can be created in SharePoint Designer,
advanced workflows require Visual Studio
• Two types of workflow – Sequential and State Machine
• User interaction provided via InfoPath forms or custom
ASPX pages
• Workflows are tied directly to lists and list items
• Built-in history, tasks, and tracking mechanisms
[PRESENTATION TITLE]
[PRESENTATION TITLE]
WEB SERVICES
• SharePoint Web Services provide remote access to a number of Object Model functions
• Web services are limited in scope to several primary functional areas, such as Farm, Site, Web,
List, List Items, List Views, etc.
• Web services require a great deal of XML manipulation
• Many web service functions require a solid understanding of CAML
• Custom web services should be deployed as WCF solutions
• Can increase load on Web Front End Servers
• Deploy isolated WFE if used heavily
[PRESENTATION TITLE]
[PRESENTATION TITLE]
REST
• HTTP-based XML data transfer
• Stateless, cacheable,
uniform
• Conforms to Atom Publishing Protocol
• Direct integration with SharePoint Services
(Excel) and Lists
• Sample queries:
• http://myserver/_vti_bin/listdata.svc
• http://myserver/_vti_bin/Ex
celRest.aspx/Docs/Docum
ents/sampleWorkbook.xlsx
/model/Ranges('Sheet1!A1
|G5')
[PRESENTATION TITLE]
[PRESENTATION TITLE]
CLIENT OBJECT MODEL
• Subset of server OM
functionality
• .NET, Silverlight,
JavaScript
• Sync and Async
processing
• Request throttling
• Batch object handling
Content
Database
Server
Object
Model
Client
Service
JavaScript Controls
JavaScript OM
Proxy
Managed Controls
Proxy
Managed OM
Browser
Client Server