welcome n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Welcome PowerPoint Presentation
Download Presentation
Welcome

Loading in 2 Seconds...

play fullscreen
1 / 73

Welcome - PowerPoint PPT Presentation


  • 254 Views
  • Uploaded on

Welcome. 12/19 SharePoint Server 2007 技術深入探討 – 進階開發篇. 敦群數位科技有限公司 vanGene Digital Inc 游家德 Jade Yu. Agenda. Platform technical overview SharePoint Site UI Customization SharePoint Content API introduction Web Part in SharePoint Event Handling in SharePoint Feature in SharePoint.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Welcome' - eugene


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
12 19 sharepoint server 2007

12/19 SharePoint Server 2007 技術深入探討 – 進階開發篇

敦群數位科技有限公司 vanGene Digital Inc

游家德 Jade Yu

agenda
Agenda
  • Platform technical overview
  • SharePoint Site UI Customization
  • SharePoint Content API introduction
  • Web Part in SharePoint
  • Event Handling in SharePoint
  • Feature in SharePoint
pictures of sharepoint platform
Pictures of SharePoint Platform

Business

Intelligence

Collaboration

BusinessProcesses

Portal

Content

Management

Search

Next generation e-mail, project management, workflow, blog and wiki support

Server-based spreadsheets plus BI portals built on SQL Server Analysis Services

Windows

SharePoint

Services“V3”

Server-based forms and workflow with smart client and browser interfaces

Enhanced SharePoint Portal aggregation and personalization

Great relevance

with rich people and

business data search

Integrated document, records and Web content management

workspace foundation for scalability and extensibility

role of wss3 0 in sharepoint framework
Role of WSS3.0 in SharePoint Framework

Office 12 Solutions Built On WSS V3

Collaboration

Portal

ECM

BI

Search

BPM

Project

Core Workspace Services

APIs

Fields/Forms

OM and SOAP

Events

Deployment

Storage

Repository

Metadata

Versioning

Backup

Security

Rights/Roles

Pluggable Auth

Per Item

Rights Trimming

Management

Admin UX

Delegation

Provisioning

Monitoring

Topology

Config Mgmt

Farm Services

Feature Policy

Extranet

Site Model

Rendering

Templates

Navigation

Visual Blueprint

Operating System Services

ASP.NET (Web Parts, Personalization, Master Pages, Provider Model for navigation, security, etc.)

Database

Workflow

Search

  • Windows SharePoint Services V3
    • Core Service platform
      • High level components
wss3 0 core functions
WSS3.0 Core Functions

Data Infrastructure

Object Model, Web Services, Events

Document Management, Workflow

Provisioning System

Page and Rendering Model

wss vs net framework
WSS vs .NET Framework

Windows

SharePoint

Services

“Version 2”

Windows SharePoint Services “v2”

ASP.NET 1.1

ASP.NET 2.0

Windows

SharePoint

Services

“Version 3”

Windows SharePoint Services “v3”

why move wss3 0 to net20
Why move WSS3.0 to .Net20
  • Goals

Build more directly on top of ASP.NET

Move core functionality to ASP.NET

  • Benefits

Leverage ASP.NET skills for WSS development

      • More consistency, less “SharePointisms”

Use more ASP.NET facilities

Provide & consume more ASP.NET interfaces

      • Web Parts, Membership, Site Map Providers, etc.
handling of sharepoint request
Handling of SharePoint Request

Windows

SharePoint

Services

“Version 2”

Windows

SharePoint

Services

“Version 3”

based on iis web applications
Based on IIS Web Applications
  • WSS now creates its own application

Does not “take over” the default app

  • No need for “exclusions”(排除路徑)
  • Unified application domains
  • Centralized Web configuration management object model
what do you want to customize
What do you want to customize?
  • List Fields / View
  • Cascading Style Sheets
  • UI Look and Feel
  • Workflow
tools for customization
Tools for Customization

Office SharePoint Designer + Browser

Microsoft Visual Studio

Web site construction

Custom Coding (if necessary)

Create lists and doclibs

Web Controls and Parts

Design Web pages

ASP.NET page coding

No-code data view/forms

Workflow actions

No-code workflows

Event handlers

Web part hookup

impacts and scope of customization
Impacts and scope of Customization
  • List
  • Site
  • SiteCollection
  • Site Definition
master page of site definition
Master Page of Site Definition
  • C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL\Master.page
folder of css
Folder of CSS
  • C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1028\STYLES\core.css
supports by sharepoint designer
Supports by SharePoint Designer
  • Use custom Master Pages for application chrome
    • Quick global changes
  • CSS tools for customizing SharePoint styles
    • “Core.css” automatically copied to local site
  • New safety nets
    • Users can restore original contents of site template pages, i.e. “re-ghost” pages
    • Versioning and Recycle Bin
    • “Contributor Mode” for fine-grained restrictions
  • Deep support for ASP.NET
slide20

Application Customization

Changing the application look and feel using CSS and Master Pages

types of development deliverables
Types of Development Deliverables

Data

Metadata

Behavior

ASP.NET extensions

Packaged Feature and Site Solutions

slide23
Data
  • Programmatic access to data and documents
  • Custom (or customized) lists, libraries, views

Calendars / Contacts / Announcements / Links / Surveys / Discussions …

  • Content Migration APIs
  • Change logs
metadata
Metadata
  • Column Templates

Centralized Field Management

E.g., all “Priority” fields should have 3 choices: 1, 2, 3

  • Content Types

Reusable definition of a list schema

Hierarchical

Associate Behaviors

      • Events
      • Document Templates
      • Workflows
behavior events
Behavior – Events
  • Before and after events
  • List schema events
  • SPWeb deletion events
  • Events on lists and libraries
  • Pre-synchronous with cancellation and filtering
  • Multiple event receivers
  • Event Receivers per-list Item
  • Attach events at web or item level
behavior workflow
Behavior – Workflow
  • Windows Workflow Foundation is embedded
  • Projects

Workflow activities

Workflow assemblies

Workflow metadata

Workflow UI

  • Tools

Visual Studio

SharePoint Designer

asp net extensions
ASP.NET Extensions
  • It’s never “should I use ASP.NET or SharePoint sites?,” it’s “should I use ASP.NET to write from scratch or to extend SharePoint sites?”
  • Web Parts
  • Custom controls
  • Custom pages
  • Master pages
  • User/role providers
features
Features
  • Combination of list/view/Web Part/Event Handler/workflow component/etc.
  • Can be packaged and deployed as a single set
  • Site Definitions are now largely sets of features
  • Sharable across site definitions
site definitions
Site Definitions
  • Low-level instructions and resources for creating, rendering sites

All sites are based on a site definition

Created with XML and ASP.NET resources

Can execute code during site creation

  • Whole new kinds of sites

Team software development

University courses

Specialized project management

Blogs/Wikis

Activity monitors

customization issues
Customization Issues:
  • Store Enhancements
    • Event Receivers
    • Workflows
    • Field Types
    • Content Migration
    • Security Policies
  • Site Metadata
    • Site Columns
    • Content Types
    • List Definitions
  • UI Enhancements
    • Web Parts
    • Master Pages
    • View Definitions
  • Smart Clients
    • SOAP
    • WebDAV
    • FrontPage RPCs
  • Provisioning
    • Site Definitions
    • Feature Definitions
    • Provisioning Assemblies
terms of wss3 0 moss2007
Terms of WSS3.0/MOSS2007
  • Server Farm
  • Web Application(Virtual Server)
  • Site Collection(SPSite)
  • Site(Web)
scenarios for using content api
Scenarios for using Content API
  • Web Page / Window Form / Console Aps.
  • Retrieve Data in WSS for customized use
  • Update Data in WSS
how to get the root object for spsite
How to get the root object for SPSite
  • Web Page
    • SPSite oSite=SPControl.GetContextSite(httpcontext.current);or
    • SPSite oSite=new SPSite(“http://MOSS”));
  • Non-Web Form
    • SPSite oSite=new SPSite(“http://MOSS”));
codes to get spweb object
Codes to Get SPWeb object

SPSite oSite=new SPSite(“http://MOSS”));

SPWeb oWeb=SPSite.AllWebs[“/WebURL”];

codes to get splistcollection splist
Codes to get SPLISTCollection/SPList

SPSite oSite=new SPSite(“http://MOSS”));

SPWeb oWeb=SPSite.AllWebs[“/WebURL”];

SPListCollection oLists = oWeb.Lists;

foreach(SPList oList in oLists)

{

console.write(oList.Title);

}

codes to get splistitemcollection splistitem
Codes to get SPListItemCollection/SPListItem

SPSite oSite=new SPSite(“http://MOSS”));

SPWeb oWeb=SPSite.AllWebs[“/WebURL”];

SPList oList = oWeb[“listname”];

foreach(SPListItem oListItem in oList.Items)

{

console.write(oListItem[“Title”]);

}

create a new listitem
Create a new ListItem

SPSite oSite=new SPSite(“http://MOSS”));

SPWeb oWeb=SPSite.AllWebs[“/WebURL”];

oWeb.AllowUnsafeUpdate=true;

SPList oList = oWeb[“listname”];

SPListItem oli = oList.Items.Add();

oli[“Field”]=“Field_value”;

oli.update();

recommendations about using api
Recommendations about using API
  • Reduce the SQL pass through between using SharePoint Object.
    • Get root object as early as possible, and release as late as possible.
    • You should use object loaded from previous API call in memory
sample of bad good coding
Sample of bad / good coding
  • Bad Coding

oWeb.List[“name”][0][“Title”]=“new title”;

oWeb.List[“name”][0][“start_date”]=“2007/7/7”;

oWeb.List[“name”][0][“start_date”]=“2007/7/31”;

oWeb.List[“name”][0].update();

sample of bad good coding1
Sample of bad / good coding
  • Good Coding

oListItem=oWeb.List[“name”][0];

oListItem[“Title”]=“new title”;

oListItem[“start_date”]=“2007/7/7”;

oListItem[“End_date”]=“2007/7/31”;

oListItem.update();

slide45

Using SharePoint Content API

Write Console to access data in SharePoint

webpart in sharepoint
WebPart in SharePoint
  • Web Parts are now in ASP.NET 2.0
  • ASP.NET 2.0 Web Parts supported
  • Full Compatibility for WSS “v2” Web Parts
    • WSS “v2” Web Part class rebased on .NET 2.0 web parts MyV2WebPart -> Microsoft.SharePoint.WebPartPages.WebPart -> Microsoft.Web.UI.WebControls.WebParts.WebPart
  • Improved user interface for Web Parts
types of webpart in sharepoint
Types of WebPart in SharePoint
  • SharePoint WebPart(WSS WebPart)
  • ASP.NET WebPart
  • Hybrid WebPart
how to implement and deploy web part in sharepoint
How to implement and deploy Web Part in SharePoint
  • Create a WebPart Project in VS.NET 2005
  • Assign Strong Name and version information
  • Copy Dll to bin folder and add SafeControl section in web.config
  • Add web part to WebPart Gallery
  • Add web part to WebPage Page
slide50

Implementation of WebPart

Implement a “Hello World” Web Part

slide51

Implementation of WebPart

Implement a WebPart with Paramaters

slide52

Implementation of WebPart

Implement a WebPart with WebControls

why do you need event handler
Why do you need “Event Handler”
  • Add some customized action when user do something
    • Notification
    • Verification
    • Extra-action
powerful event handler in sharepoint
Powerful Event Handler in SharePoint
  • Events architecture significantly improved
    • Events supported for lists, document libraries and content types
    • Events supported for changes to list schema as well as items
    • Events supported at site collection and site level
    • Events supported for incoming email messages
    • Support for synchronous events and asynchronous events
    • Synchronous events occur before the fact and are cancel-able
how to implement your event handler
How to implement your Event Handler
  • Create an EventHandler DLL
  • Register the dll to GAC(c:\windows\Assembly)
  • Register the EventHanlder to List in SharePoint
sample code for eventhandler
Sample Code for EventHandler
  • using System;using System.Collections.Generic;using System.Text;using Microsoft.SharePoint;using System.Net.Mail;namespace myEventHandler{public class handler : SPItemEventReceiver{ public override void ItemAdding(SPItemEventProperties properties) { //do something }}}
build options
Build options
  • strong name your EventHandler assembly
  • Version for Assembly
register for list eventhandler
Register for List EventHandler

SPSite site = new SPSite("http://sp:81/SiteDirectory/site1");SPWeb web = site.OpenWeb();SPList survey = web.Lists[“ListName"];string assemblyName = “myEventHandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a34245adab33a20a";string className = “myEventHandler";survey.EventReceivers.Add(SPEventReceiverType.ItemAdding, assemblyName, className);MessageBox.Show("Done");

slide61

Implementation of EventHandler

Write an event Handler to log action performed by user

how to implement your feature
How to implement your feature
  • Compose the definition files
    • Feature.XML
    • Elements.XML
  • Implement the action aspx
  • Install your feature to SharePoint
  • Activate the Feature
feature xml
Feature.xml

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

<Feature Id="DE98E72D-80FF-4031-88B0-2E4DEF6312C8"

Title="Save Site As Template"

Description="Adds a 'Save Site As Template' link to the Look and Feel menu in Site Settings."

Version="1.0.0.0"

Scope="Web"

Hidden="FALSE"

xmlns="http://schemas.microsoft.com/sharepoint/" >

<ElementManifests>

<ElementManifest Location="Elements.xml" />

</ElementManifests>

</Feature>

elements xml
Elements.xml
  • <?xml version="1.0" encoding="utf-8" ?>
  • <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  • <CustomAction
  • Id="SPSolutions.SaveSiteAsTemplate"
  • GroupId="Customization"
  • Location="Microsoft.SharePoint.SiteSettings"
  • Sequence="1000"
  • Title="Save site as template">
  • <UrlAction Url="_layouts/savetmpl.aspx"/>
  • </CustomAction>
  • </Elements>
install your feature to sharepoint
Install your feature to SharePoint

Using STSADM.exe

stsadm -o installfeature -name SaveSiteAsTemplate

slide72

Implementation of “Feature”

Add a customized feature to Site Admin Menu