Wednesday, December 23, 2009

Object Hierarchy of WSS

Object Hierarchy of WSS

WSS 3.0 Object model is divided into three hierarchies:
1) Physical Object Hierarchy
2) Content Hierarchy
3) Services Hierarchy


All object hierarchy contains classes and containers


Physical Object Hierarchy includes classes that represent Physical Entities such as Servers and files AND Containers of such entities such as Farms and Folders


Content Hierarchy includes classes that represent publishable items of data such as list items, and classes that represents nested containers of data such as lists, Content DB, websites, collections of websites, Web Applications


Service Hierarchy includes classes that represent services and instances

Physical Object Hierarchy: There are four major classes in this Hierarchy

SPFarm:
1) WSS 3.0 farm is represented by SPFarm class. Server farm is one or more WFE, Zero or more AS and SQL Server.
2) The SPFarm class represents a farm of one or more physical servers, so it is included in the Physical Hierarchy. But it can also be considered the top level of the Content Hierarchy; for example, all the (non-configuration) content of a Windows SharePoint Services farm can be backed up and restored.
3) SPFarm class can also be thought of as representing the configuration database that is associated with the farm because Windows SharePoint Services 3.0 has no class that represents the configuration database itself
4) SPFarm OBJECT has three classes: SPServer, SPService and SPSolution
5) SPFarm inherits from SPPersistedObject, which means that the object (there is only one) that instantiates the class persists in the configuration database.
6) SPFarm has static members for creating farms and returning references to the local farm or a remote farm.
7) SPFarm has many members that can be used for developing administration functionality.

Some of the more important members can help in the administration of the following:
· Backup and restoration of the farm
· Upgrades of the farm
· Migration of (moving) the farm
· Error reporting
· Caching

SPServer:
1) A physical server is represented by the SPServer class.
2) It has an Address property that holds the IP address of the server and a Role property that identifies the server's role in the farm
3) If there is just one server, its Role is SingleServer. If there is more than one, the front-end servers have the role WebFrontEnd an
4) d almost all other servers have the role Application
5) However, the Role property of a server that is physically hosting a Windows SharePoint Services content database typically has the value Invalid. This is because such servers typically run only one Windows SharePoint Services service—the Database Service (which is a Windows service)—and this database service is really just an alias for the SQL Server Windows service which is not part of Windows SharePoint Services. Hence, it is not really running any Windows SharePoint Services code, and it does not really fit into the Application role.
6) The SPServer class also has a ServiceInstances property that holds references to all the instances of Windows services and Web services that are running on the server
7) SPServer inherits from SPPersistedObject

SPFolder: Notice that the entity represented by an SPFolder object or an SPFile object might be located in a Windows SharePoint Services content database instead of in the file system of a server. For example, a spreadsheet file in a Windows SharePoint Services document library is stored in a cell of a database, not in a folder on one of the servers.
1) Represents a folder on a SharePoint Web site.
2) Various folder properties in the Microsoft.SharePoint namespace return a folder object; however, the GetFile method of the SPWeb class returns any folder from within a site or subsite.
3) Use the Folders property of the SPWeb class, or the SubFolders property of the SPFolder class, to return an SPFolderCollection object that represents the collection of folders for a site or folder. Use an indexer to return a single folder from the collection. For example, if the collection is assigned to a variable named collFolders, use collFolders[index] in C#, or collFolders(index) in Visual Basic, where index is either the index number of the folder in the collection or the display name of the folder.


SPFile:
1) SPFile Class represents a file in a SharePoint Web site that can be a Web Part Page, an item in a document library, or a file in a folder.
2) Use the GetFile or GetFileAsString method of the SPWeb class to return a single file object. Otherwise, use the Files property of either the SPWeb or SPFolder class to return an SPFileCollection object that represents the collection of files for a site or folder. Use an indexer to return a single file from the collection







Learn Windows PowerShell

Now SharePoint IT Professional should get ready for PowerShell. SharePoint 2010 has more than 500+ PowerShell Commands so tight your belts to get solid hands on PowerShell. I would like to start series on PowerShell Commands and Scripts to cover beginners and Advanced Users.




What is PowerShell?
Windows PowerShell is task based command line shell and scripting language designed for System Administrators. PowerShell is built on .NET Framework CLR and accepts and returns .NET Objects. Windows PowerShell includes an interactive prompt and scripting environment. Windows PowerShell does not process text. Instead, it processes objects based on the .NET Framework platform. Windows PowerShell comes with a large set of built-in commands with a consistent interface.



Windows PowerShell gives you access to the file system on the computer. In addition, Windows PowerShell providers enable you to access other data stores, such as the registry and the digital signature certificate stores, as easily as you access the file system. Windows PowerShell uses its own language



What is Cmdlet?
Cmdlet (pronounced "command-let") is a single-feature command that manipulates objects in Windows PowerShell. You can recognize cmdlets by their name format -- a verb and noun separated by a dash (-), such as Get-Help, Get-Process, and Start-Service. Most cmdlets are designed to be used in combination with other cmdlets. For example, the "get" cmdlets only retrieve data, the "set" cmdlets only establish or change data, the "format" cmdlets only format data, and the "out" cmdlets only direct the output to a specified destination. You can write your own cmdlets and share them with other users.



What are Processing Objects?
PowerShell indirectly uses objects of .NET framework. So what does it mean? .NET objects are instance of .NET Framework Class and these classes are data and methods (operations)associated with that data. But here think object as a Data entity that has Properties (which are Characteristics) and methods (which are actions that you can perform on object)
Major advantage of using PowerShell is it makes easier to pipeline commands, means to pass output of one command to another command as input. The cmdlet that receives an object can act directly on its properties, and methods.
You can send the output of a command to a file or printer, or you can use the pipeline operator () to send the output to another command.



What is Script?
If you run particular commands or command sequences repeatedly, or if you develop a series of commands to perform a complex task, you will want to save your commands in a file and execute the command file, instead of typing commands at the prompt. A file of commands is called a script.
In Windows PowerShell, script files have a .ps1 file name extension. To run a script, type the name of the script at the command prompt. The file name extension is optional. You must specify the fully qualified path to the script file, even if the script is in the current directory


Technorati Tags:



--


Thanks & Regards


Pramod Attarde


SharePoint Architect


Visit my Blogs at - http://sharepointproficient.spaces.live.com/


Join SharePoint 2010 Discussion Group on Linkedin - http://www.linkedin.com/groups?gid=2265830&trk=myg_ugrp_ovr