SharePoint object model and related attributes

Source: Internet
Author: User

SharePoint object model and related attributes

First, let's get started with the development of SharePoint object models.
SharePoint object model Overview
Some basic objects
Farm, service, web application, site, web
List, view, field, item
Main functions
File structure
Permission System
Query

Collection)
Many objects have collections.
Spweb-spwebcollection
Splist-splistcollection
...
Operation
Get: xxcollection [idx], xxcollection. getxxxbyxxx
Add: xxcollection. Add
DEL: xxcollection. Delete, XX. Delete, XX. Recycle
Update: XX. Update

Collection)
Downstream access
Site. allwebs
Web. Lists
List. Views
...
Upstream access
Web. Site
List. parentweb
View. parentlist
...
Four URLs
Absolute URL
[Moss]
Server-relative URL
/Sites/myweb/doc/folder/file.doc
XX. serverrelativeurl
Site-relative URL
DOC/folder/file.doc
XX. url
Relative URL
File.doc (base = folder)
Server farm
Spfarm
Spfarm. Local current server farm
Content Service
Spwebservice
Spwebservice. contentservice current content service
WebService. webapplications
Web Applications
Spwebapplication
Webapp. Sites

Website acquisition
Get the website set through the spsite Constructor
Use absolute URL
Site. allwebs [idx]
Site. rootweb
Site. openweb ()
Top-level sites and sub-sites
Spcontext. Current
Use in context
The most frequently used container
List: Web. Lists
File: Web. Files
Folder: Web. Folders
User: Web. Users
GROUP: Web. Groups
Recycle Bin: Web. recyclebin

Splist
The most important data container in SharePoint
Content
List. Items
List. Views
List. Fields
List. folders (*)

Splist
Several attributes
Basetype and basetemplate
Rootfolder
List acquisition
Web. Lists [idx]
Web. getlist ()
Server-relative URL
Web. getlistfromurl ()
Web. getlistfromwebpartpageurl ()
Site-relative URL
Web. getlistsoftype ()

Spview
Display Channel
View inclusion
Query: filtering and sorting
Viewfields: The displayed Field
Schemaxml: Basic settings
Viewbody: display style
URL: view Address

Spview
Obtain
List. views [idx]
Guid, index, name
List. getview ()
Guid
Web. getviewfromurl ()
Server-relative URL

Spfield
Spfield (base class)
Spfieldtext
Spfieldcomputed
Spfieldmultichoice
Spfieldchoice
Spfieldlookup
Spfielduser
...
Spfield
Several attributes
Title (display name) and internalname (internal name)
Type: Type
Schemaxml: Basic settings
Obtain
Fields [idx]
Index, display name
Fields. getfield ()
Fields. getfieldbyinternalname ()
Splistitem
Obtain
Items [idx]
Items. getitembyid (), list. getitembyid ()
List. getitembyuniqueid ()
List. getitems ()
New
Items. Add ()-> modify-> item. Update ()

Spfile and spfolder
Obtain
Web. GetFile (), Web. getfolder ()
Web. rootfolder, list. rootfolder (*)
Folder. Files, folder. subfolders
Foreach traversal requires the "Browse Directory" permission

Special List spdocumentlibrary
Inherited from splist
Attribute
Iscatalog: Default template library, Web Part Library, Master Library
The following is a simple demo.
Access the document library to traverse all the files and folders in it

Spweb = (New spsite ("http: // MOSS/sites/Hello"). openweb ();
Spdocumentlibrary doclib = (spdocumentlibrary) web. Lists ["shared document"];
Doclib. Lists. includerootfolder = true;
Gothroughdoclib (doclib, doclib. rootfolder, 0 );

Static void gothroughdoclib (spdocumentlibrary doclib, spfolder folder, int level)
{
Splistitemcollection items = doclib. getitemsinfolder (doclib. defaultview, folder );
If (items. Count = 0)
Return;

For (INT I = 0; I <level; I ++)
Console. Write ("");
Foreach (splistitem item in items)
{
If (item. filesystemobjecttype = spfilesystemobjecttype. folder)
{
Console. writeline ("[{0}]", item. Name );
Gothroughdoclib (doclib, item. folder, level + 1 );
}
Else
Console. writeline (item. Name );
}
}

Moss class library description:

Windows SharePoint Services Class Library: Microsoft. sharePoint spsite function: represents a collection of sites on a virtual server, including a top-level site and all its subsites. indicates the website set of a virtual server, including a top-set website and all its sub-sites.
Namespace: Microsoft. SharePoint
Spsite
Function:
Represents a collection of sites on a virtual server, including a top-level site and all its subsites.
A collection of websites representing a virtual server, including a top-set website and all its sub-sites
Allwebs: indicates the set of websites in the preceding sense.
Quota: the quota of a user specified by the website
Iisallowsanonymous: whether IIS allows anonymous logon
Portalurl: the URL of the portal where the website is located. This parameter is null for WSS websites.
URL: the URL of the website
Spweb
Function:
Represents a Sharepoint site.
A site that represents SharePoint
Alerts: a collection of all notifications
Allusers: a collection of all user objects. This user can be a Website user or an authenticated domain user.
Configuration: the configuration ID used to create the site,
Doctemplates: Document Template used for this website
Emailinsertsenabled: gets a value indicating whether the document library of this website receives attachments from the public file emails of excahnge.
Eventhandlersenabled: whether to read the documentation library of this website to receive event processing
Files: Get all files under the root directory of this website
Folders: obtains all the first-level folders of this site.
Groups: gets the group of this site's delivery site
Includesupportingfolders: gets or sets whether enumeration is supported for files in folders or folders on this site
Isadaccountcreationmode: obtains whether the user accessing the site automatically creates an account in the Active Directory.
Isrootweb: Gets whether the site is the first site in the site set
Lists: obtains the set of all lists on this site.
Modules: gets the modules used in this site
Portalmember: whether it is associated with the portal
Portalsubscriptionurl: Always URL for alerts in the portal
Presenceenabled: gets or sets whether to record user online information
Properties: attribute set, which contains the WSS version or region information.
Publicfolderrooturl: Get the URL of the email attachment in the public folder that the document library receives
Roles: gets the user group of the site
Sitegroups: gets the cross-site group of the website set
Siteusers: obtains all users in the site set.
Users: obtains the user set of this site.
Microsoft. Sharepoint. spweb. viewstyles: Get the view style of the site
Webs: gets a collection of all sub-sites below this site
Spalert
Function:
Represents an alert, which generates periodic e-mail communications sent to a user about the list, list item, document, or document library to which the alert applies.
Indicates a notification. It generates a regular email notification and sends it to the user to update the list, list items, documents, document libraries, and other messages associated with the notification.
Spalertfrequency: the frequency of the notification, which is once a day, once a week, and sent immediately
Speventtype: Event Type: All, delete, add, discuss, modify
Item: list item or document of the notification
List: the list or document library to which the notification belongs.
User: the person to be notified.
Splist
Represents a list on a Sharepoint web site.
Represents a list of SharePoint sites
Allowdeletion: whether the list can be deleted
Allowmultiresponses: Specifies whether a survey allows multiple replies. Therefore, a survey is a list
Anonymouspermmask: whether anonymous users are allowed to access
Basetemplate: Specifies the template type based on the list, the template types include notification, contact, custom table, data source, discussion board, document library, event, custom list, invalid list, problem tracking, Link, list template library, image library, and survey., task, Web Part Library, website template library, XML table Library
Basetype: basic type of the list. The types include: discussion board, document library, custom list, problem tracking, investigation, no type, unused
Defaultview: default view
Direction: Reading direction
Enableattachments: whether attachments can be added
Enablemoderation: Whether approval is required
Enableversioning: whether the version is supported
Eventsinkassembly: Strong name of Event Notification Assembly supported
Eventsinkclass: supports Event Notification class names
Eventsinkdata: any string defined in Event Notification of the Document Library
Excludefromtemplate: whether to include content when the list is saved as a template
Fields: a set of fields in the list
Forms: a table set used to display, edit, and add list items in the list.
Hidden: whether the list is hidden
Imageurl: the server relative address of the icon in the list
Itemcount: number of items in the list
Items: list item set
Lists: List set of the List
Multipledatalist: Specifies whether the list in the Meeting Workspace contains multiple meeting instances.
OnQuicklaunch: whether the Quick Start of the home page is displayed
Ordered: whether to allow users to re-Sort list items
Parentweb: List of parent websites
Permissions: permission set
Propertiesxml: The markup language of the collaborative application, representing the attribute values of the list.
Readsecurity: read permission settings
Rootfolder: Get the folder containing all files in the list
Schemaxml: Get the XML style of this list
Showuser: whether the user name is displayed in the survey
Views: all views in this list
Writesecurity: Specifies the write settings.
Splistevent
Represents an event that occurs within a document library.
Function: Events in the Document Library
Listid: guid of the document library where the event occurs
Propertiesafter: Status attribute of the document library after an event occurs
Type: Event Type: check in, check out, copy, delete, insert, invalid, cut, undo check out, update
Urlafter: returns the relative address of the website of the document or folder. In case of any event, except for the deletion event
Userdisplayname: Display name of the user who triggered the event
Userid: the user ID that triggers the event
Userloginname: the logon name of the user who triggered the event
Weburl: the absolute URL of the website where the event occurs
Splistitem
Function:
Represents an item, or row, in a list.
Indicates a list item or a row in the list.
Attachments: The attachment associated with the list item
Fields: the list field set where the list item is located
File: files in the document library represented by the list
Listitems: parent list
Moderationinformation: Approval information, including status and description
Parentlist: parent list
XML: XML format of data in the list
Spissuelist
This class inherits from splist
Function: indicates a list of problems.
Enableassignedtoemail: whether to send an email notification when the list item is associated with the user
Spfield
Function:
Represents a field in a list on a Sharepoint web site.
Represents a field in the list of SharePoint sites
Cantogglehidden: Indicates whether this field can be hidden on the user interface.
Defaultformula: Default formula of the Plan Field
Direction: Reading Sequence
Displaysize: Display size
Fieldreferences: A character array that indicates the name of a field referenced by a computer
Filterable: Indicates whether this field can be filtered.
Filterablenorecurrence: obtains whether to create a filter for fields in the view, but does not trigger repeated events.
Frombasetype: whether to generate from basic fields
Hidden: whether to display in the view
Internalname: Internal name
Parentlist: List of fields
Readonlyfield: can this field be modified?
Reorderable: Can the values in a field be reordered?
Required: determines whether this field is required
Sealed: can this field be inherited by other fields?
Sortable: can be sorted?
Type: Field Type:
Typeasstring: the character of the field name

From: http://blog.sina.com.cn/s/blog_53864cba0100hyqo.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.