Microsoft Office SharePoint Server MOSS Web SharePoint Web SharePoint 22 Web SharePoint Web Web SharePoint Web Web f Lists.asmx Web Web CAML f

Similar documents
6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM

untitled

1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F

untitled

<ADB6ADB1C25EA8FAA6DB2D4D56432E706466>

untitled

untitled

基于ECO的UML模型驱动的数据库应用开发1.doc

概述

untitled

2 WF 1 T I P WF WF WF WF WF WF WF WF 2.1 WF WF WF WF WF WF

untitled

epub83-1

untitled

untitled

C H A P T E R 7 Windows Vista Windows Vista Windows Vista FAT16 FAT32 NTFS NTFS New Technology File System NTFS

一 個 SQL Injection 實 例 的 啟 示 頁 2 / 6 因 此, 在 知 名 網 站 上 看 到 SQL Injection, 讓 人 驚 心, 卻 不 意 外 網 站 專 案 外 包 是 目 前 業 界 的 常 態, 而 在 價 格 取 勝 的 制 度 下, 低 價 得 標 的 S

FileMaker 16 ODBC 和 JDBC 指南

第一章 章标题-F2 上空24,下空24

WebSphere Studio Application Developer IBM Portal Toolkit... 2/21 1. WebSphere Portal Portal WebSphere Application Server stopserver.bat -configfile..

untitled

幻灯片 1

epub 61-2

59 1 CSpace 2 CSpace CSpace URL CSpace 1 CSpace URL 2 Lucene 3 ID 4 ID Web 1. 2 CSpace LireSolr 3 LireSolr 3 Web LireSolr ID

untitled

FileMaker 15 ODBC 和 JDBC 指南

1 1 大概思路 创建 WebAPI 创建 CrossMainController 并编写 Nuget 安装 microsoft.aspnet.webapi.cors 跨域设置路由 编写 Jquery EasyUI 界面 运行效果 2 创建 WebAPI 创建 WebAPI, 新建 -> 项目 ->

软件概述

untitled

XXXXXXXX

《大话设计模式》第一章

Microsoft Word - template.doc


Chapter 9: Objects and Classes

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc

Microsoft Word - 01.DOC

基于UML建模的管理管理信息系统项目案例导航——VB篇

1.JasperReport ireport JasperReport ireport JDK JDK JDK JDK ant ant...6

1-1 database columnrow record field 不 DBMS Access Paradox SQL Server Linux MySQL Oracle IBM Informix IBM DB2 Sybase 1-2

目錄 C ontents Chapter MTA Chapter Chapter

untitled

Partition Key: 字 符 串 类 型, 表 示 当 前 Entity 的 分 区 信 息 这 个 Property 对 于 Table Service 自 动 纵 向 和 横 向 扩 展 至 关 重 要 Row Key: 字 符 串 类 型, 在 给 定 Partition Key 的

(TestFailure) JUnit Framework AssertionFailedError JUnit Composite TestSuite Test TestSuite run() run() JUnit

EJB-Programming-4-cn.doc

untitled

(DMO) 1 1 Microsoft Windows SQL Server 2005 SQL Server Analysis ServicesNotification Services SQL Server 8 SQL Server IP SQL Server 2005 SQL Server 20

學 科 100% ( 為 單 複 選 題, 每 題 2.5 分, 共 100 分 ) 1. 請 參 閱 附 圖 作 答 : (A) 選 項 A (B) 選 項 B (C) 選 項 C (D) 選 項 D Ans:D 2. 下 列 對 於 資 料 庫 正 規 化 (Normalization) 的 敘

BizSpark 初 创 公 司 计 划 指 南 目 录 什 么 是 BizSpark?... 1 计 划 概 述... 1 计 划 结 构 和 角 色... 1 初 创 公 司 资 格... 3 使 用 BizSpark 的 产 品 和 联 机 服 务 的 示 例 :... 3 职 责... 5

EJB-Programming-3.PDF

VB控件教程大全

Oracle高级复制配置手册_业务广告_.doc

untitled

目錄

2 Requirements Documentation Doc Name Doc No. 1.0 Version No. Total Page Generated By V6.0.0 Generated Date 2011/10/21 Checked By Checked Date 2011/10

Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0,

untitled

<4D F736F F D20C9CFBAA3CAD0BCC6CBE3BBFAB5C8BCB6BFBCCAD4C8FDBCB6BFBCCAD4B4F3B8D95FBDA8D2E9B8E55F5F E646F63>

Chapter 9: Objects and Classes

R D B M S O R D B M S R D B M S / O R D B M S R D B M S O R D B M S 4 O R D B M S R D B M 3. ORACLE Server O R A C L E U N I X Windows NT w w

第3章.doc

CDWA Mapping. 22 Dublin Core Mapping

1. 2. Flex Adobe 3.

摘 要 在 這 忙 碌 的 社 會 中, 普 遍 人 們 運 動 時 間 其 實 並 不 充 裕, 體 力 越 來 越 差 的 情 況 下 還 隨 意 飲 食 導 致 身 體 健 康 越 來 越 差, 因 此 本 專 題 打 算 利 用 健 康 飲 食 的 方 式 改 善 這 些 人 的 體 質,

提问袁小兵:

摘 要 本 校 多 媒 體 設 計 系 與 上 海 戲 劇 學 院 創 意 學 院 在 多 次 聯 繫 交 流 之 下, 已 簽 署 合 作 備 忘 錄, 積 極 尋 求 兩 校 合 作 教 學 與 共 同 創 作 之 機 會 藉 由 本 系 學 生 作 品 腦 殘 公 寓 入 圍 第 五 屆 中

目 录 第 五 部 分 第 六 部 分 第 七 部 分 第 八 部 分 投 标 邀 请 投 标 人 须 知 附 表 评 标 方 法 和 评 分 细 则 项 目 需 求 和 技 术 方 案 要 求 1

臺銀人壽「98年九至十一職等人員甄試」

untitled

PowerPoint Presentation

季刊9web.indd

穨文件1

<4D F736F F F696E74202D20332D322E432B2BC3E6CFF2B6D4CFF3B3CCD0F2C9E8BCC6A1AAD6D8D4D8A1A2BCCCB3D0A1A2B6E0CCACBACDBEDBBACF2E707074>

導讀 ASP.NET HTML ASP 第一篇 基礎篇第 1 章 認識 ASP.NET ASP.NET ASP.NET ASP.NET ASP.NET 第 2 章 認識 Visual Studio 20 開發環境 Visual Studio 20 Visual Studio 20 第二篇 C# 程式

附录J:Eclipse教程

穨ac3-4.PDF


目 录 目 录 平 台 概 述 技 术 架 构 技 术 特 点 基 于 统 一 平 台 的 多 产 品 线 支 撑 先 进 性 安 全 性 开 放 性 高 性 能 和

Microsoft Word - ch04三校.doc

ASP.NET实现下拉框二级联动组件

ebook46-23

Microsoft Word - 34

Microsoft PowerPoint - L17_Inheritance_v4.pptx

VB程序设计教程

f2.eps

3.1 SQL Server 2005 Analysis Services Unified Dimension Model (UDM) 3 ( Ad-Hoc) SQL Server 2005 E - R T-SQL(Star Schema) (Data Mart) (ETL) ( Ora

2 ADO.NET Internet 1.2

Java 1 Java String Date

概述

IsPostBack 2

FY.DOC

本 课 程 作 为 非 计 算 机 专 业 本 科 通 识 课 程, 是 一 门 理 论 和 实 践 紧 密 结 合 的 实 用 课 程, 内 容 包 括 计 算 机 基 础 部 分 和 程 序 设 计 部 分 计 算 机 基 础 部 分 涵 盖 计 算 机 软 硬 件 组 成 数 制 表 示 操

epub 94-3

untitled

務 相 關 的 約 點 及 內 容 / 托 嬰 契 約 (2) 居 家 托 育 人 員 在 中 心 托 育 人 員 2. 瞭 解 契 約 ( 到 ) 宅 托 兒 契 約 一 天 的 工 作 重 的 意 義 (3) 契 約 的 意 義 分 點 及 內 容 法 律 效 類 自 由 與 限 制 及 2.

教案模板4-2

untitled

<4D F736F F D20C6F3D2B5CDF8D5BECFB5CDB3BCBCCAF5B9E6B7B6CAE9A3A8C6C0B9C0D3C3A3A92E646F63>

使用 Scene7 Media Portal

Visual Basic D 3D

Transcription:

Web Chapter 22 SharePoint Web

Microsoft Office SharePoint Server MOSS Web SharePoint Web SharePoint 22 Web 21 22-1 SharePoint Web Web SharePoint Web Web f Lists.asmx Web Web CAML f Views.asmx View SharePoint Web Web 22-2 SQL Server Oracle CRUD Create Retrieve Update Delete Web GetList GetListItems 306

21 Microsoft SharePoint 07 307 22.2 22.1 22.1 Column GetList XML Attribute.2 / Title DocTemplateUrl URL DefaultViewUrl URL Description ImageUrl URL Name GUID BaseType FeatureId GUID Created Modified LastDeleted ServerTemplate ID Version Direction RTL LTR none ThumbnailSize WebImageHeight Web WebImageWidth Web Flags ItemCount AnonymousPermMask RootFolder WriteSecurity

Web 21 308 22 / Author EventSinkAssembly EventSinkClass EventSinkData EmailInsertsFolder EmailAlias WebFullUrl URL WebId Web ID SendToLocation ScopeId MajorVersionLimit MajorWithMinorVersionLimit WorkflowId ID HasUniqueScopes AllowDeletion AllowMultiResponses EnableAttachments EnableModeration EnableVersioning Hidden MultipleDataList Ordered ShowUser ID EnableMinorVersion RequireCheckout 22.1

Lists.asmxWeb Windows Lists.asmxWeb Web SharePoint _vti_bin Web http://[portal-server]/_vti_bin/lists.asmx http:// [Portal-Server]/sitedirectory/HR/_vti_bin/Lists.asmx HR Web Windows siteurl TextBox retrievelistsbutton sitelists ListView titlelists ListBox Click sitelists SelectedIndexChanged 22.1 GetListCollection GetListItems using System; using System.Xml; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace ListRetriever public partial class Form1 : Form private win2k3r2lab.lists listservice = null; public Form1() InitializeComponent(); 22.2 21 private void retrievelistsbutton_click(object sender, EventArgs e) listservice = new ListRetriever.win2k3r2lab.Lists(); listservice.credentials = new System.Net.NetworkCredential("Administrator", "password"); listservice.url = siteurl.text; XmlNode listcollection = listservice.getlistcollection(); sitelists.items.clear(); MessageBox.Show(listCollection.ChildNodes[0].OuterXml); 22.1 ListRetriever Microsoft SharePoint 07 309

22 21 Web foreach (XmlNode listnode in listcollection.childnodes) ListViewItem lvi = new ListViewItem(); lvi.text = listnode.attributes.getnameditem("title").value; lvi.tag = listnode.attributes.getnameditem("id").value; lvi.subitems.add( listnode.attributes.getnameditem("servertemplate").value); sitelists.items.add(lvi); private void sitelists_selectedindexchanged(object sender, EventArgs e) titlelist.items.clear(); if (sitelists.selecteditems.count == 0) return; string listguid = (string)sitelists.selecteditems[0].tag; XmlNode itemcollection = listservice.getlistitems( listguid, string.empty, null, null, "0", null, string.empty); foreach (XmlNode item in itemcollection.selectnodes("//*[local-name()='row']")) titlelist.items.add( item.attributes.getnameditem("ows_title") == null? "No title" : item.attributes.getnameditem("ows_title").value); 22.1 ListRetriever Web XML GetListCollection XML 22.1 GetListItems XML ADO RecordSet XML ADO.NET DataSet DataSet GetListItems XML Attribute ows_ SharePoint 01 Office Web Server SharePoint ows_id Attribute ows_title Attribute 310

SharePoint SharePoint SharePoint GUI GUI XML Attribute Web UpdateList SharePoint UpdateList f listname /GUID f listproperties XML f newfields XML XML f updatefields XML f deletefields XML 22.2 21 f listversion XML.1.2 UpdateList Microsoft SharePoint 07 311

Web 21 312 22 AllowMultiResponses Description Direction LTR RTL None EnableAssignedToEmail EnableAttachments EnableModeration True EnableVersioning True Hidden / MultipleDataList Web Ordered ShowUser Title 22.2 UpdateList

First Name Last Name // GUID string listguid = "3DE6337E-7E49-4AD6-9936-8440CF7711"; win2k3r2lab.lists listservice = new ListUpdater.win2k3r2lab.Lists(); listservice.url = "http://win2k3r2lab/sitedirectory/research/_vti_bin/lists.asmx"; listservice.credentials = new System.Net.NetworkCredential("Administrator", "password"); XmlDocument doc = new XmlDocument(); // XmlElement properties = doc.createelement("list"); properties.setattribute("title", "Updated List Title"); properties.setattribute("description", "Updated List Description"); // (first name, last name) XmlElement newfields = doc.createelement("fields"); XmlElement newmethod = doc.createelement("method"); newfields.appendchild(newmethod); newmethod.setattribute("id", "1"); XmlElement newfield = doc.createelement("field"); newmethod.appendchild(newfield); newfield.setattribute("readonly", "FALSE"); newfield.setattribute("displayname", "First Name"); newfield.setattribute("name", "FirstName"); newfield.setattribute("type", "Text"); newfield.setattribute("frombasetype", "TRUE"); // last name newmethod = doc.createelement("method"); newmethod.setattribute("id", "2"); newfield = doc.createelement("field"); newfield.setattribute("readonly", "FALSE"); newfield.setattribute("displayname", "Last Name"); newfield.setattribute("name", "LastName"); newfield.setattribute("type", "Text"); newfield.setattribute("frombasetype", "TRUE"); newmethod.appendchild(newfield); newfields.appendchild(newmethod); 22.2 21 listservice.updatelist(listguid, (XmlNode)properties, (XmlNode)newFields, null, null, string.empty); XML <Fields> <Method Cmd="#"> <Field> Microsoft SharePoint 07 313

22 Web 21 < > <Formula>..</Formula> </Field> </Method> </Fields> <Formula> // newfields = doc.createelement("fields"); newfield = doc.createelement("field"); newfields.appendchild(newfield); newmethod = doc.createelement("method"); newmethod.setattribute("id", "3"); newfield.setattribute("readonly", "TRUE"); newfield.setattribute("displayname", "Full Name"); newfield.setattribute("name", "FullName"); newfield.setattribute("type", "Calculated"); newfield.setattribute("resulttype", "Text"); newmethod.appendchild(newfield); XmlElement formula = doc.createelement("formula"); formula.innertext = "=[Last Name]&\", \"&[First Name]"; XmlElement formuladisplaynames = doc.createelement("formuladisplaynames"); formuladisplaynames.innertext = "=[Last Name]&[First Name]"; newfield.appendchild(formula); newfield.appendchild(formuladisplaynames); XmlElement fieldrefs = doc.createelement("fieldrefs"); fieldrefs.innerxml = "<FieldRef Name='First Name'/><FieldRef Name='Last Name'/>"; newfield.appendchild(fieldrefs); newfields.appendchild(newmethod); listservice.updatelist(listguid, null, (XmlNode)newFields, null, null, string.empty); GUID Task DefectTracking Contacts 314

XML <batch> GUID ID <batch> 22.2 using System; using System.Xml; using System.Collections.Generic; using System.Text; namespace ItemUpdater class Program static void Main(string[] args) win2k3r2lab.lists listservice = new ItemUpdater.win2k3r2lab.Lists(); listservice.credentials = new System.Net.NetworkCredential("Administrator", "password"); listservice.url = "http://win2k3r2lab/sitedirectory/research/ _vti_bin/lists.asmx"; XmlDocument doc = new XmlDocument(); XmlElement batchelement = doc.createelement("batch"); batchelement.setattribute("onerror", "Continue"); batchelement.setattribute("listversion", "1"); batchelement.innerxml = "<Method ID=\"1\" Cmd=\"New\"> " + "<Field Name=\"Title\">This is a new item</field>" + "<Field Name=\"First_x00_Name\">Bob</Field>" + "<Field Name=\"Last_x00_Name\">Jones</Field>" + "</Method>"+ "<Method ID=\"2\" Cmd=\"Update\">" + "<Field Name=\"ID\">4</Field>" + "<Field Name=\"Title\">Title Changed!</Field>" + "</Method>" + "<Method ID=\"3\" Cmd=\"Delete\">" + "<Field Name=\"ID\">4</Field>" + "</Method>"; 22.2 21 XmlNode results = listservice.updatelistitems 22.2 Microsoft SharePoint 07 315

22 21 Web ("Updated List Title", batchelement); Console.WriteLine(results.OuterXml); Console.ReadLine(); 22.2 UpdateListItems XmlNode XML ID UpdateListItems First Name field First_x00_Name x00 XML NOTE SharePoint SharePoint Web SharePoint SharePoint XML / XML 07 / SharePoint MOSS 07 Content Type 316

SharePoint Folder Order Item SharePoint / SharePoint SharePoint SharePoint SharePoint 03 Order Order Number Order Item SKU Item Number New Order New Order Item Web ViewFields XML 22.3 GetListItems <QueryOptions> XML <Folder> 22.2 21 using System; using System.Xml; using System.Collections.Generic; using System.Text; namespace HierarchyDemo class Program 22.3 Microsoft SharePoint 07 317

22 21 Web static void Main(string[] args) win2k3r2lab.lists listservice = new HierarchyDemo.win2k3r2lab.Lists(); listservice.credentials = new System.Net.NetworkCredential("Administrator", "password"); XmlDocument doc = new XmlDocument(); XmlNode viewfieldsparent = doc.createelement("viewfields"); viewfieldsparent.innerxml = "<FieldRef Name=\"ID\"/>" + "<FieldRef Name=\"Order_x00_Number\"/>"; XmlNode listitems = listservice.getlistitems( "Hierarchy Demo", "", null, viewfieldsparent, "0", null, ""); foreach (XmlNode item in listitems.selectnodes("//*[local-name()='row']")) Console.WriteLine("Order: " + item.attributes.getnameditem("ows_title").value); Console.WriteLine("Order #: " + item.attributes.getnameditem("ows_order_x00_number").value); string foldername = item.attributes.getnameditem("ows_title").value; XmlNode queryoptions = doc.createelement("queryoptions"); queryoptions.innerxml = "<Folder>" + foldername + "</Folder>"; XmlNode viewfields = doc.createelement("viewfields"); viewfields.innerxml = "<FieldRef Name=\"ID\"/>" + "<FieldRef Name=\"OrderItem\"/>" + "<FieldRef Name=\"SKU\"/>"; XmlNode subitems = listservice.getlistitems( "Hierarchy Demo", "", null, viewfields, "0", queryoptions, ""); int x = 0; foreach (XmlNode subitem in subitems.selectnodes("//*[local-name()='row']")) if (x > 0) // Console.WriteLine( string.format("\titem 0: 1", subitem.attributes.getnameditem("ows_orderitem").value, subitem.attributes.getnameditem("ows_title").value)); Console.WriteLine("\tSKU: " + subitem.attributes.getnameditem("ows_sku").value); x++; 22.3 318

Console.ReadLine(); 22.3 Order: First Order Order #: 1001.00000000000 Item 1.00000000000000: MP3 Player SKU: MP3100 / / SharePoint Microsoft Office SharePoint 07 22-3 SharePoint MOSS MOSS 07 Web 22.3 21 GetVersionCollection XmlNode versions = listservice.getversioncollection("updated List Title", "4", "Title"); XML <Versions xmlns="http://schemas.microsoft.com/sharepoint/soap/"> <Version Title="Title Changed Again Again Again" Modified="6/26/06 3:21:44 AM" /> Microsoft SharePoint 07 3

22 Web 21 <Version Title="Title Changed Again Again" Modified="6/26/06 3:21: AM" /> <Version Title="Title Changed Again" Modified="6/26/06 3:21:08 AM" /> <Version Title="Title Changed!" Modified="6/26/06 2:38:16 AM" /> </Versions> Web GetListItemChanges ows_owshiddenversion Web API Web Web Web 22-4 CAML GetListItems Web Web Visual Studio 05 Web URL http://lab/sitedirectory/research/_vti_bin/lists. asmx http://lab/_vti_bin/lists.asmx URL 3

CAML CAML SharePoint SDK win2k3r2lab.lists listservice = new GetListItemsQuery.win2k3r2lab.Lists(); listservice.credentials = new System.Net.NetworkCredential("Administrator", "password"); listservice.url = "http://win2k3r2lab/sitedirectory/research/_vti_bin/lists.asmx"; XmlDocument doc = new XmlDocument(); XmlElement query = doc.createelement("query"); query.innerxml = "<OrderBy>" + "<FieldRef Name=\"Title\"/>"+ "</OrderBy>"+ "<Where>" + "<Eq>" + "<FieldRef Name=\"First_x00_Name\"/>" + "<Value Type=\"Text\">Bob</Value>"+ "</Eq>"+ "</Where>"; XmlNode results = listservice.getlistitems("updated List Title", "", query, null, "0", null, ""); Console.WriteLine(results.OuterXml); foreach (XmlNode item in results.selectnodes("//*[local-name()='row']")) Console.WriteLine( string.format("0 : 1", item.attributes.getnameditem("ows_title").value, item.attributes.getnameditem("ows_full_x00_name").value)); Console.ReadLine(); 22.4 21 Bob This is a new item : string;#jones, Bob Title Changed Again Again Again : string;#jones, Bob ;# Microsoft SharePoint 07 321

22-5 SharePoint Web 22 21 Web First Name Bob Last Name Title win2k3r2lab.views viewservice = new ViewDemo.win2k3r2lab.Views(); viewservice.credentials = new System.Net.NetworkCredential("Administrator", "password"); viewservice.url = "http://win2k3r2lab/sitedirectory/research/_vti_bin/views.asmx"; XmlDocument doc = new XmlDocument(); XmlNode viewfields = doc.createelement("viewfields"); viewfields.innerxml = "<FieldRef Name=\"Last_x00_Name\"/>" + "<FieldRef Name=\"ows_Title\"/>"; XmlNode query = doc.createelement("query"); query.innerxml = "<Where>" + "<Eq>" + "<FieldRef Name=\"First_x00_Name\"/>"+ "<Value>Bob</Value>" + "</Eq>" + "</Where>"; viewservice.addview( "Updated List Title", "Bob Items", viewfields, query, null, "HTML", false); 322

viewservice.deleteview("updated List Title", "Bob Items"); XmlNode viewcollection = viewservice.getviewcollection("list Name"); Views XML View f Name GUID f DisplayName f DefaultView f URL f ImageUrl 22.5 21 Web SharePoint Web Web Web Microsoft SharePoint 07 3

NOTE