Information-Driven Applications

Download Report

Transcript Information-Driven Applications

Microsoft Australia
Application Platform Special Interest Group
John Hodgson
Product Technology Specialist
[email protected]
1
Agenda
Development Options
Development Environment
Web Part Deployment Methods
Debugging Options
Distribution And Management
Document and Lists access
Site and List Definitions
Future Of Web Parts (i.e., “Whidbey”)
Additional Resources
2
Servers
3
SharePoint Investments
Enterprise Portal
Solution built on top
of Windows
SharePoint Services
SharePoint Portal Server



Hub and Aggregator
for SharePoint
personal, team and
portal sites
Team Collaboration
Solution well beyond
file servers




SharePoint Services


Scalable Workspace
Platform
News and Links
Site Directory and
Connections
Personal Sites
Audience Targeting
Index, Search and Alerts
Single Sign-On
BizTalk Integration




Document Storage
and Collaboration
Flexible Lists
Web Part Pages
Page Personalization
Site Life Cycle
Management
Scale-Up/Out
Foundation
4
SharePoint Out of The Box
5
Development Options
Web Parts
ASP.NET
Document Library Events
Templates
6
Development Environments
One machine method
Your “workstation” is
Windows Server 2003
http://www.msfn.org/win2k3/
Two (or more) machine method
Develop on Windows XP
Deploy to Windows Server 2003
On local Virtual PC or VMWare image
On remote development server
8
Development Workstation
Requirements
Visual Studio .NET
2002 or 2003
Ignore its warning about FrontPage Server Extensions
Web Part Project Template
for Visual Studio .NET
http://msdn.microsoft.com/sharepoint
Copy object model DLLs from Server
C:\Program Files\Common Files\Microsoft Shared
\web server extensions\60\ISAPI
Microsoft.SharePoint.DLL
Microsoft.SharePoint.Portal.DLL
Microsoft.SharePoint.Portal.SingleSignon.DLL
Microsoft.SharePoint.Portal.SingleSignon.Security.DLL
10
Debugging Web Parts
Methods
Direct
Attach to instance of W3WP.EXE
“Automatic”
Denote URL of a given Web Part Page as application
start page
You’re really debugging the page, not the
Web Part assembly
One server per developer is the ideal
Not polite to pause shared Web server
If multiple instances, not easy to identify which
instance of W3WP.EXE is “yours”
Web.config has useful settings
16
Debugging Web Parts (cont.)
Deploying to the GAC makes debugging a
little harder
Must be able to reach PDB file
Options:
Deploy to the bin directory while debugging
Use manual installation
Use gacutil -i on the PDB after
stsadm …… -globalinstall
Default.aspx?contents=1
17
Web.Config Settings
Turn on debugging
<SharePoint> <SafeMode CallStack=“true" />
<system.web> <customErrors mode="Off" />
Change site’s Trust Level for the site
<system.web> <trust level="WSS_Minimal"
originUrl= ""/>
Also “WSS_Medium” or “Full”
19
Web.Config Settings (cont.)
Other Web Part settings under <SharePoint>
<SafeMode MaxControls="50" CallStack="false" />
<WebPartLimits MaxZoneParts="50"
PropertySize="1048576" />
<WebPartCache Storage="CacheObject" />
also “Database” or “None”
<WebPartWorkItem Timeout="7000" />
<WebPartControls DatasheetControlGuid="65BCBEE47728-41a0-97BE-14E1CAE36AAE" />
Substitute your own Datasheet control instead of the Office 2003
default
<OnlineLibrary
Url="http://r.office.microsoft.com/r/hlidAwsGallery" />
Also configurable in SharePoint Central Administration
20
Distributing Web Parts
CAB files
Two-step process with STSADM
Stsadm –o addwppack –filename filename
Stsadm –o addwppack –name filename
Use WPMove Web service
Download from GotDotNet
MSI files
Install directly on each server
21
Distributing Web Parts
Site definitions/templates
Can include custom Web Part pages
DWP info embedded as XML data islands
Converted to DB entries after page is
processed
Site definitions can also include
Custom lists and libraries
Custom ASPX pages
Event handlers
Design elements and resources
22
Connecting Parts Together
Parts sharing data through events
Imagine audio signals
Consumer and provider of data
Client and server interfaces
IList
IRow
ICell
IFilter
IParams
Transformers
23
Developing Web Parts
24
Accessing List Data
Object Model
Available objects under
Microsoft.SharePoint namespace:
SPList – Basic list object for getting to list data
SPListCollection – Collection of list objects
SPListItem – Item/Row in a list
SPListItemCollection – Collection of list items
SPView – View of a SharePoint list
SPField – Field/Column in a list
SPListTemplate – Template of a list
25
Accessing List Data
Web Services
Remotely view and edit SharePoint List
data
http://[server]/_vti_bin/Lists.asmx
Operations available
AddAttachment
UpdateList
DeleteList
UpdateListItems
GetAttachmentCollection
AddList
GetListItemChanges
GetListAndView
GetList
GetListCollection
GetListItems
DeleteAttachment
26
ASP.Net Apps
27
Accessing Document Libraries
Object Model
Available objects under
Microsoft.SharePoint namespace:
SPFile – File object
SPFileCollection – Collection of files
SPFileVersion – Version of a file
SPFolder – Folder object
SPDocumentLibrary – Document Library object
SPDocDiscussion – Discussions on a file
SPDocTemplate – Used when creating a new file
28
Accessing Document Libraries
Remote
Access
Set Metadata
Batch File
Upload
File/IO
Version
Control
Check-In/
Check-Out
Object Model






Web Services


















WebDAV
FrontPage RPC
29
Extending Document Libraries
Event Handlers
Useful for implementing workflow
Used by TeamPlate, SourceCode, Nintex
Useful for triggering business logic
Logging, notification, etc…
BizTalk Server 2004 Adapter now available
Types of events
CheckIn, CheckOut, UncheckOut
Copy, Move, Delete, Insert, Update
Events are asynchronous
Can not prevent deletions
Can not get document data
30
Document Library Events
31
Site / List Templates
What is a Site Definition?
What is a Custom Template?
What is a List Definition?
What is a Custom List Template?
32
Why Create Site Definitions?
Don’t take our word for it – look at:
Visual Studio Team System
BizTalk Server 2004 Business Activity Monitor
Microsoft Business Systems Business Portal
for Great Plains
Project Server 2003
SharePoint Portal Server 2003
Class Server (v.next)
33
Site Definition Files
Everything is underneath:
C:\Program Files
\Common Files
\Microsoft Shared
\web server extensions
\60\template
Minimalist
site definition
File Scopes
Server Language
E.g., \1033
Site Definition
E.g., \1033\STS
List definition
List Definition
E.g.,
\1033\STS\LISTS\DOCLIB
Site definition
Enumeration of site definitions
35
SCHEMA.XML Fields
<Field Type="Choice"
BaseType="Text"
Name="Area">
<CHOICES>
<CHOICE>Views</CHOICE>
<CHOICE>Site Design</CHOICE>
<CHOICE>Layouts</CHOICE>
<CHOICE>Schema Design</CHOICE>
<CHOICE>Fields</CHOICE>
<CHOICE>Forms</CHOICE>
<CHOICE>Projects</CHOICE>
<CHOICE>Inter-Team Issues</CHOICE>
<CHOICE>Schedule</CHOICE>
<CHOICE>Spec</CHOICE>
<CHOICE>Headcount</CHOICE>
<CHOICE>Misc</CHOICE>
</CHOICES>
</Field>
42
SCHEMA.XML Views
<View BaseViewID="1" Type="HTML" WebPartZoneID="Main"
DisplayName="BLog HTML Preview"
DefaultView="FALSE"
Url="Forms/BLogAsHTML.aspx">
<GroupByHeader/>
<GroupByFooter/>
<ViewHeader/>
<ViewBody/>
<ViewFooter/>
<PagedRowset/>
<PagedRecurrenceRowset/>
<RowLimit Paged="FALSE">1</RowLimit>
<ViewEmpty/>
<ViewBidiHeader/>
<Toolbar Type="Standard" />
<ViewFields />
<Query />
</View>
43
SCHEMA.XML Toolbars
<Toolbar Position="After" Type="Freeform">
<HTML><![CDATA[ <table> .. more
HTML..]]></HTML>
. .
<URL Cmd="New" />
. .
<HTML><![CDATA[ HREF="JavaScript:void
window.open(']]></HTML>
. .
<HttpVDir/>
. .
<HTML><![CDATA[');]]></HTML>
</Toolbar>
44
SCHEMA.XML Forms
<Form Type="DisplayForm"
Url="DispForm.aspx"
WebPartZoneID="Main">
<ListFormOpening/>
<ListFormButtons/>
<ListFormBody/>
</Form>
45
Site Definition Walk-Through
46
How To Quickly Create Your
Own Site Definition
1. Copy the ‘sts’ directory and rename it ‘stsfoo’
2. Copy WEBTEMP.XML to WEBTEMPFOO.XML
3. Remove all but one Configuration from
WEBTEMPFOO.XML
4. Give your Configuration an interesting title
5. Ensure that ‘Template Name’ points to ‘stsfoo’
6. Give ‘Template ID’ a number greater than 10,000
7. Run IISRESET
8. Create a new Site
47
Advanced Site Definition
Features
Specify a page to go to immediately after site creation
ExecuteUrl Url="config.aspx"
Replace top navigation in site pages
AlternateHeader="PortalHeader.aspx“
Alter JScript functions (e.g. customize edit menu dropdown)
CustomJSUrl=“owscustom.js”
Add/Edit CSS attributes
AlternateCSS=“owscustom.css”
Customize the File Open/Save dialog in Office
FileDialogPostProcessor ID=[GUID]
Disable features on your site (Backup, Subsite Creation, etc...)
DisableWebDesignFeatures="wdfbackup; wdfNewSubSite“
Provide a custom security provider to SharePoint Portal Server search
ExternalSecurityProvider ID=[GUID] Type=“...”
48
Editing Deployed Site
Definitions
ONLY modify deployed site definitions if
you absolutely have to.
If possible:
Build new versions of site definitions
Operate new version in parallel with old
versions
Ensure that new sites use the new versions.
Mark old site definitions as hidden but left intact
Data can be moved from old sites to new sites
Old sites can be updated in a controlled
fashion with the object model
49
Editing Deployed Site
Definitions (cont.)
Guidelines for modifying a site definition already in use
Adding features is less dangerous than changing or deleting them
Changing often results in loss of data
Deleting often results in broken views
Add to the end of the <Fields> section to avoid shuffling your data
If you rely on ghosting to push your changes to all sites, beware of
customized pages stored in the database
The ‘vti_hasdefaultcontent’ field available from SPFile.Properties
can be used to determine whether or not a file is ghosted
If your changes affect create-time sections of the site definition,
use the object model to simulate these actions on existing sites
50
Tips And Tricks
Create a new site definition – don’t modify a shipped
site definition
Start from a copy of a similar site definition
Marking configurations as ‘Hidden’ in WEBTEMP.XML
is a good way to create site definitions for use by
custom applications (or retire outdated ones)
The ‘ExportList’ method documented in the ‘URL
Protocol’ section of the SDK is a convenient way to
generate CAML
Customizations to meeting workspaces need to retain
a template ID of ‘2’
SharePoint ‘applications’ often combine Web Parts,
Event Handlers, Web Services, and Site Definitions
Use the DisableWebDesignFeatures attribute of the
Project element in ONET.XML to block FrontPage
51
FrontPage 2003
52
Understanding “Ghosting”
Pages and list schema are read from the site
definition files and cached at IIS process startup
Page source is on the disk, not in the DB
Pulled from the cache at runtime
It still appears to be present in the site, hence the term
“ghosted”
Pages are only written to the database when
customized within a site
Browser-based customization (i.e. adding/removing
web parts) does not change the actual ASPX pages,
hence doesn’t unghost
FrontPage customization often changes ASPX pages
Maximizes scalability
Reuse un-customized pages across sites
Reduce unnecessary data storage and retrieval
53
Windows SharePoint Services
And ASP.NET “Whidbey”
Current version of Windows SharePoint Services
will work on ASP.NET “Whidbey”
Windows SharePoint Services, after
Service Pack 2, will run as-is on Whidbey runtime
ASP.NET team will provide a Windows SharePoint
Services Web Part that can encapsulate a “Whidbey”
Web Part
Next version of Windows SharePoint Services
will build on top of ASP.NET “Whidbey”
Backward-compatible object model will
permit continued use of current Web Parts
54
ASP.NET “Whidbey” Web Parts
Web Part concept integrated directly into ASP.NET
Can be used in any type of Web site
Windows or form authentication
Provider model for persistence/personalization
Fully integrated into ASP.NET control model
Any ASP.NET server-side control can be a Web Part
User Controls can also be Web Parts
Connections are significantly enhanced
One attribute (c.f., overriding multiple methods)
Rich data types (c.f., list, row, cell, parameters)
Zones become objects, not just containers
Great Visual Studio designer experience
55
When To Build What
Pre-Whidbey RTM deliverables should be built
using current Windows SharePoint Services
Web Part infrastructure
Such Web Parts will run in the next version of
Windows SharePoint Services
By all means, experiment with Whidbey Web Parts
during its beta period
When ASP.NET “Whidbey” ships, build new Web
Parts using the new technology
Current Windows SharePoint Services sites will be
able to use them once wrapper is ready
56
Web-Based Resources
Developer Information
Third-Party Sites
http://msdn.microsoft.com/sharepoint
http://gotdotnet.com/team/sharepoint
barracuda.net
gotsharepoint.com
sharepointd2d.com
sharepointexperts.com
sharepointserver.com
sharepointsolutions.com
sharepointuniversity.com
spsfaq.com
wssdemo.com
wssfaq.com
Product Information
http://microsoft.com/sharepoint
Web Component Directory
http:/microsoft.com/sharepoint/webparts
57
Books
The Rational Guide To:
Building SharePoint Web Parts
by Darrin Bishop
(Mann – coming soon)
Microsoft SharePoint: Building
Office 2003 Solutions
by Scot P. Hillier
(APress)
58
More Books
Building ASP.NET Server Controls
by Rob Cameron, Dale Michalk (APress)
Developing Microsoft ASP.NET Server
Controls and Components
by Nikhil Kothari, Vandana Datye
(Microsoft Press)
Professional ASP.NET Server Controls:
Building Custom Controls with C#
by Matt Butler, Thiru Thangarathinam,
Matt Milner, Michael Clark, Ryan O'Keefe,
Angelo Kastroulis, Jan Narkiewicz, Daniel
Cazzulino
(Wrox)
59
Give Documentation Feedback
Windows SharePoint Services
[email protected]
Microsoft Office SharePoint Portal Server
2003
[email protected]
60
Microsoft Events and Communities
Not getting event invites anymore? Don’t know what's on in your state?
Subscribe to TechNet Flash via TechNet Lounge
• http://www.microsoft.com/australia/technet
Visit MSDN Community Website and join MSDN Connections
• http://www.microsoft.com/australia/msdn
Subscribe to MSDN Flash Newsletter (events)
• http://msdn.microsoft.com/flash
Or…Visit the Profile Center and subscribe to all of them
https://profile.microsoft.com/RegSysSubscriptionCnt/SubCntDefault.aspx
61
© 2003-2004 Microsoft Corporation. All rights reserved.
This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
62