SharePoint Object Model 概览1:Lists and Document Libraries

  SharePoint 对象模型包含 以下 分类:

• Data-related building blocks:
  • Lists and document libraries
  • Files and documents
  • Columns and field types
  • Content types
  • Queries and views
• Deployment- and maintenance-related building blocks:
  • Features
  • Solutions
  • Web sites and site collections
• Building blocks to create the UI:
  • Mobile pages, controls, and adapters
  • Ribbon
  • Pages and UI
  • Web Parts

• Control flow, action, and events:
  • Event handling
  • Alerts
  • Workflows

数据相关的对象

  Lists and Document Libraries

  Lists是最基本的数据容器,document libraries是包含了document的Lists.

  Lists由一个或多个列(sharepoint术语叫做fields)组成,用来组织数据

  SharePoint提供了一些和lists相关的API,包含:

• Server side, for working on the server (Microsoft.SharePoint namespace)
• Client side, for working on a client using JavaScript or  Silverlight (Microsoft.SharePoint.Clientnamespace)
• Migrating content between site collections (Microsoft.SharePoint.Deployment namespace) 

SharePoint内置了一些Lists and libraries,也可以将一个list模板导出在自己的代码中添加或修改列的类型,SPListTemplate 类提供了一些方法用来管理list模板。

以下是一些常用的List类型:

• GenericList: A generic list type for most custom lists
• DocumentLibrary: A document library for any kind of document
• DiscussionBoard: A discussion board list that’s able to create discussion threads
• Survey: A survey list that handles surveys
• Issue: An issue list to store and track issues
• UnspecifiedBaseType: An unspecified base type for any other kind of list

 基本的list类型是SPList,它提供了一些lists的公共属性,如果list是一个library,那么可 以用SPDocumentLibrary类来获得更详细的属性。可以用SPWeb对象的List属性来获取SPList对象,在客户端编程模型中,可以用SP.List来访问SPList对象。

SPListDataSource(客户端模型中用SP.ListDataSource)用来操作外部list(即连接到外部数据源的list)

当添加,删除,修改list的元素时,会触发一些和list相关的事件,SPListEventProperties类提供了一些list事件的属性,SPListEventReceiver中的一些方法用来捕获这些事件。

SPListItem类用来描述list中的每一行数据,可以用SPList对象的GetItem方法来获取SPListItem对象或者是SPListItemCollection对象,在客户端编程模型中,与之对应的方法是SP.ListItem。

lists支持versioning,SPListItemVersion用来得到list中不同版本的行数据。

Lists and Document Libraries 对象模型:

      

posted on 2012-07-31 15:13  feng.du  阅读(220)  评论(0编辑  收藏  举报

导航