Download presentation
Presentation is loading. Please wait.
Published byBlaze Lane Modified over 10 years ago
1
MSG313: SharePoint ™ Portal Server Top 10 Programming Tasks Andrew Datars Program Manager SharePoint Portal Server Microsoft Corporation
2
Agenda Overview Overview Top 10 Programming Tasks Preview Top 10 Programming Tasks Preview Technical Background Technical Background Top 10 Programming Tasks Top 10 Programming Tasks Resources Resources
3
Overview The flexible portal solution that lets you find, share and publish information easily within business units and across enterprises The flexible portal solution that lets you find, share and publish information easily within business units and across enterprises Simplest access to business information Integrated document management to unleash portal productivity Easiest and most effective way to build and customize intranet portals
4
Top 10 Programming Tasks Issuing Full-Text Searches (More depth in Search Programming presentation) Issuing Full-Text Searches (More depth in Search Programming presentation) Creating a web part (More depth in Web Part presentation) Creating a web part (More depth in Web Part presentation) Document Management Tasks Document Management Tasks Creating Categories Creating Document Profiles and Properties Creating and Configuring Folders Importing files from a file share Reading and Setting Document Properties Enumerating Folders Creating Subscriptions Creating Subscriptions Extending Search Extending Search
5
Technical Background Technologies Technologies Workspace structure Workspace structure URNs and URLs URNs and URLs Binding Binding Searching – ADO and XMLHTTP Searching – ADO and XMLHTTP
6
Technologies PKMCDO read/write PKMCDO read/write SharePoint Portal Server object model, ships only with SharePoint Portal Server Complementary to CDO for Exchange 2000 Leverages CDO / ADO binding model XMLHTTP read-only XMLHTTP read-only HTTP-DAV object model, part of platform SDK Exposes HTTP-DAV requests and responses ADO read-only ADO read-only ActiveX ® data objects, part of platform SDK Exposes database services (including queries)
7
ADO Versus PKMCDO Use ADO for read-only tasks Use ADO for read-only tasks Reading file streams and properties Enumerating folders Searching Use PKMCDO for read-write tasks Use PKMCDO for read-write tasks Creating and editing properties of Workspaces Folders Documents Etc. Automating document management Both use same URL binding model Both use same URL binding model
8
ADO Versus XMLHTTP Use ADO read-only Use ADO read-only Integrate with existing ADO apps Bind to data controls that require ADO Prefer to program with ADO Use XMLHTTP read-only Use XMLHTTP read-only Bind directly to XML response Use XSL to format results Control the size of the result set Prefer to program with XML
9
ADO Versus XMLHTTP Architectural Relationship Client App OLE DB Provider (MSDAIPP) DASLListener Web Store ContentSource ADO ASP or Web Part WebDAV SEARCH ADO Command OLE DB Command Recordset Rowset WebDAV SEARCH XML Results
10
Workspace Structure Workspace Root (http://server/wksp) Workspace Root (http://server/wksp)http://server/wksp Interesting for this talk Categories Documents System Interesting, but not for this talk Portal Portal Content SHADOW Wholly uninteresting System categories Management _TEMP_ LOCKS
11
URNs And URLs URN is a name (“Andrew”) URN is a name (“Andrew”) Used to identify properties and profiles More precise than a friendly name Has a namespace Example urn:schemas-microsoft-com:office:office#Milestone URL is a place (“Atlanta, GA”) URL is a place (“Atlanta, GA”) Used to identify a location Does not have a namespace, but is hierarchical Example http://tahoeweb/tahoe/system/schema/Milestone.pdef
12
Binding Binding connects an object with a physical storage element Binding connects an object with a physical storage element KnowledgeFolder => Folder KnowledgeContentClass => Document Profile KnowledgeCategoryFolder => Category Etc. URL is the connective glue URL is the connective glue Dim oFolder as New PKMCDO.KnowledgeFolder oFolder.DataSource.Open http://server/wksp/myfolder http://server/wksp/myfolder
13
Programming Task: Issuing Full Text Searches User Scenario User Scenario I want to return a list of all documents written by Sherri Hart with the word “thermafill” in the document Special Item to Note Special Item to Note Searches only return published documents
14
Searching With XMLHTTP Uses XMLHTTPRequest object Uses XMLHTTPRequest object Client or server solution Client or server solution Use ServerXMLHTTP for server side calls Use XMLHTTP for client calls Custom SEARCH verb Custom SEARCH verb Results returned in XML Results returned in XML Custom header controls number and paging of results Custom header controls number and paging of results Used by Dashboard web site Used by Dashboard web site
15
Search Example – XMLHTTP Dim strQuery As String Dim xh As New XMLHTTPRequest xh.open "SEARCH", strWorkspaceUrl, False xh.setRequestHeader "content-type", “text/xml” xh.send strQuery xh.responseXML.save "sample1.xml"
16
Search Example – Query String SELECT "DAV:displayname" FROM Scope('deep traversal of "/wksp"') WHERE "urn:schemas-microsoft- com:office:office#Author" = 'Sherri Hart' AND FREETEXT('thermafill') </a:searchrequest>
17
Programming Task: Create Web Part User Scenario User Scenario I want to create a Web Part to display HTML content
18
Create Web Part Create new WebPart with UI Create new WebPart with UI Edit content Edit content Add HTML/VBScript content VBScript: VBScript: Function getContent(xmlPart) getContent = “ “ Hello World </font>” End Function HTML: HTML: Hello World </Font>
19
Programming Task: Creating Categories Scenario Scenario I want to create a place on my server where I can organize some or all of my documents in a category called Budget with a subcategory called FY01
20
Creating Categories Dim oF as New PKMCDO.KnowledgeCategoryFolder oF.Category = “:Budgets:FY01” oF.Datasource.Save
21
Programming Task Creating Document Profiles Scenario Scenario I want to create a document profile called “Specification”
22
Creating Document Profiles Dim oCC as New PKMCDO.KnowledgeContentClass oCC.Name = “urn:content- classes:Specification” oCC.AddPropertyDef(“Title”)oCC.AddPropertyDef(“Author”)oCC.AddPropertyDef(“Milestone”)oCC.DataSource.Save
23
Programming Task Creating And Configuring Folders User Scenario User Scenario I want to create a folder called “myfolder” in my Documents directory and set access to the folder
24
Creating And Configuring Folders Dim oF as New PKMCDO.KnowledgeFolder oF.Contentclass = “urn:content- classes:myfolder” oF.Authors=Array(“DOMAIN\johndoe”)oF.Readers=Array(“DOMAIN\jackdoe”) oF.Approvers=Array(“DOMAIN\johndoe”, “DOMAIN\janedoe”) oF.Coordinators=Array(“DOMAIN\jilldoe”, “DOMAIN\janedoe”) oF.Datasource.SaveTo "http://server/wksp/Documents/myfolder"
25
Programming Task Importing Files User Scenario User Scenario I want to copy a file on my harddrive called C:\test.txt to my “myfolder” folder on my SharePoint Portal Server and overwrite it if the file already exists on the server
26
Importing Files Dim objDoc as New PKMCDO.KnowledgeDocument objDoc.ContentClass = “urn:content- classes:BaseDocument” Set objStream = objDoc.OpenStream objStream.Type = adTypeBinary objStream.SetEOS objStream.LoadFromFile “C:\test.txt” objStream.Flush Set objStream = Nothing objDoc.DataSource.SaveTo _ “http://server/wksp/Documents/myfolder/tes t.txt”,,, adCreateOverwrite
27
Programming Task Reading and Setting Properties User Scenario User Scenario I want to assign a document to my Budget category in my FY01 subcategory
28
Manipulating Properties Dim oDoc as New PKMCDO.KnowledgeDocument oDoc.DataSource.Open “http://server/wksp/myfolder/mydoc.doc” Debug.Print oDoc.BestBetKeywords Debug.Print oDoc.BestBetCategories Debug.Print oDoc.Categories Debug.Print oDoc.Title Debug.Print oDoc.Description oDoc.Categories = Array(“:Budgets:FY01”) oDoc.DataSource.Save
29
Programming Task: Publishing And Versioning Documents User Scenario User Scenario I want to check-out, modify and check-in a document and then see the version history Special Item to Note Special Item to Note If you get access denied on Save/SaveTo, make sure you’ve bound to the working copy
30
Publishing And Versioning Documents Dim oVersion as New PKMCDO.KnowledgeVersion Dim sPath as String sPath = “http://server/wksp/Documents/myfolder/my. doc” http://server/wksp/Documents/myfolder/my. dochttp://server/wksp/Documents/myfolder/my. doc Dim oRS as ADODB.Recordset Set oRS = oVersion.Checkout(sPath) ---Modify the Document--- Set oRS = oVersion.Checkin(sPath) Set oRS = oVersion.VersionHistory(sPath)
31
Programming Task Enumerating Folders User Scenario User Scenario I want to get a list of all of the subfolders and files in my “myfolder” folder
32
Enumerating Folders Dim oF as New PKMCDO.KnowledgeFolder Dim oRS as ADODB.Recordset oFolder.DataSource.Open “http://server/wksp/Documents/myfolder” http://server/wksp/Documents/myfolder Set oRS = oF.Subfolders While Not oRS.EOF Debug.Print oRS.Fields("DAV:href") oRS.MoveNextWend Set oRS = oF.Items While Not oRS.EOF Debug.Print oRS.Fields("DAV:href") oRS.MoveNextWend
33
Programming Task Creating Subscriptions User Scenario User Scenario I want to be notified when documents are published to the “myfolder” folder Special Item to Note Special Item to Note If you want to be notified when documents are checked-in or checked-out, you will need to poll for this using VersionStatus on all documents
34
Managing Subscriptions Dim oSubMgr as New PKMCDO.SubscriptionManager strSubscriptionUrl = oSubMgr.CreateSubscription( “http://server/wksp/Documents/myfolder”,strQuery,NType,1,“your_email@microsoft.com”,strQuery,32767,"")
35
Resources SharePoint Portal Server Web Site http://www.microsoft.com/Servers/Sharepoint/ SharePoint Portal Server Web Site http://www.microsoft.com/Servers/Sharepoint/ http://www.microsoft.com/Servers/Sharepoint/ SharePoint News Groups http://www.microsoft.com/servers/sharepoint/ newsgroup.htm SharePoint News Groups http://www.microsoft.com/servers/sharepoint/ newsgroup.htm http://www.microsoft.com/servers/sharepoint/ newsgroup.htm http://www.microsoft.com/servers/sharepoint/ newsgroup.htm Digital Dashboard Web Site http://www.microsoft.com/digitaldashboard Digital Dashboard Web Site http://www.microsoft.com/digitaldashboard http://www.microsoft.com/digitaldashboard Microsoft ® Training and Certification http://www.microsoft.com/trainingandservices/ default.asp Microsoft ® Training and Certification http://www.microsoft.com/trainingandservices/ default.asp http://www.microsoft.com/trainingandservices/ default.asp http://www.microsoft.com/trainingandservices/ default.asp
36
Resources MSDN SharePoint Portal Server 2001 as a Collaborative Solutions Platform http://msdn.microsoft.com/library/techart/tahoe.htm SharePoint Portal Server 2001 as a Collaborative Solutions Platform http://msdn.microsoft.com/library/techart/tahoe.htm http://msdn.microsoft.com/library/techart/tahoe.htm SharePoint Portal Server – Document Management and Much More http://msdn.microsoft.com/library/periodic/period00/ MSTahoe.htm SharePoint Portal Server – Document Management and Much More http://msdn.microsoft.com/library/periodic/period00/ MSTahoe.htm http://msdn.microsoft.com/library/periodic/period00/ MSTahoe.htm http://msdn.microsoft.com/library/periodic/period00/ MSTahoe.htmPartners Digital Dashboard Solution Providers http://www.microsoft.com/business/digitaldashboard/ ddpartners.asp Digital Dashboard Solution Providers http://www.microsoft.com/business/digitaldashboard/ ddpartners.asp http://www.microsoft.com/business/digitaldashboard/ ddpartners.asp http://www.microsoft.com/business/digitaldashboard/ ddpartners.asp Microsoft Direct Access http://www.microsoft.com/directaccess Microsoft Direct Access http://www.microsoft.com/directaccess http://www.microsoft.com/directaccess
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.