Wednesday, June 10, 2009

SharePoint Server (MOSS and WSS) Interview questions (FAQ)- Part 1

Here I am providing some sharepoint interview questions on MOSS and WSS. This is the part-1 interview questions. Those who are preparing for sharepoint learning and jobs. This is good stuff to prepare.



1. What is Microsoft Windows SharePoint Services? How is it related to Microsoft Office SharePoint Server 2007?


Windows SharePoint Services is the solution that enables you to create Web sites for information sharing and document collaboration. Windows SharePoint Services -- a key piece of the information worker infrastructure delivered in Microsoft Windows Server 2003 -- provides additional functionality to the Microsoft Office system and other desktop applications, and it serves as a platform for application development.

Office SharePoint Server 2007 builds on top of Windows SharePoint Services 3.0 to provide additional capabilities including collaboration, portal, search, enterprise content management, business process and forms, and business intelligence.


2. What is Microsoft Windows Services?


Microsoft Windows Services is the engine that allows administrators to create Web sites for information sharing and document collaboration. Windows SharePoint Services provides additional functionality to the Microsoft Office System and other desktop applications, as well as serving as a plat form for application development. SharePoint sites provide communities for team collaboration, enabling users to work together on documents, tasks, and projects. The environment for easy and flexible deployment, administration, and application development



3. What are the various kinds of roles the users can have?


A user can be assigned one of the following roles

* Reader - Has read-only access to the Web site.

* Contributor - Can add content to existing document libraries and lists.

* Web Designer - Can create lists and document libraries and customize pages in the Web site.

Administrator - Has full control of the Web site.


4. What are the advanced features of MOSS 2007?


* User Interface (UI) and navigation enhancements

* Document management enhancements

* The new Workflow engine

* Office 2007 Integration

* New Web Parts

* New Site-type templates

* Enhancements to List technology

* Web Content Management

* Business Data Catalog

* Search enhancements

* Report Center

* Records Management

* Business Intelligence and Excel Server

* Forms Server and InfoPath

* The “Features” feature

* Alternate authentication providers and Forms-based authentication


5. What are safe controls, and what type of information, is placed in that element in a SharePoint web.config file?


When you deploy a WebPart to SharePoint, you must first make it as a safe control to use within SharePoint in the web.config file. Entries made in the safe controls element of SharePoint are encountered by the SharePointHandler object and will be loaded in the SharePoint environment properly, those not will not be loaded and will throw an error.

In the generic safe control entry (this is general, there could be more), there is generally the Assembly name, the namespace, the public key token numeric, the typename, and the safe declaration (whether it is safe or not). There are other optional elements.

6. What is a SPSite and SPWeb object, and what is the difference between each of the objects?

The SPSite object represents a collection of sites (site collection [a top level sites and all its subsites]). The SPWeb object represents an instance SharePoint Web, and SPWeb object contains things like the actual content. A SPSite object contains the various subsites and the information regarding them.

7. How would you go about getting a reference to a site?

Select For Unformatted Code

C#:

  1. oSPSite = new SPSite("http:/server");

  2. oSPWeb = oSPSite.OpenWeb();


8. What does a SPWebApplication object represent?

The SPWebApplication objects represents a SharePoint Web Application, which essentially is an IIS virtual server. Using the class you can instigate high level operations, such as getting all the features of an entire Web Application instance, or doing high level creation operations like creating new Web Applications through code.

9. How do you connect (reference) to a SharePoint list, and how do you insert a new List Item?

Select For Unformatted Code

C#:

  1. using(SPSite mySite = new SPSite("yourserver"))
  2. {
  3. using(SPWeb myWeb = mySite.OpenWeb())
  4. {
  5. SPList interviewList = myWeb.Lists["listtoinsert"];
  6. SPListItem newItem = interviewList.Items.Add();
  7. newItem["interview"] = "interview";
  8. newItem.Update();
  9. }
  10. }


10. How would you loop using SPList through all SharePont List items, assuming you know the name (in a string value) of the list you want to iterate through, and already have all the site code written?

Select For Unformatted Code

C#:

  1. SPList interviewList = myWeb.Lists["listtoiterate"];
  2. foreach (SPListItem interview in interviewList)
  3. {
  4. // Do Something
  5. }

11. How do you return SharePoint List items using SharePoint web services?


In order to retrieve list items from a SharePoint list through Web Services, you should use the lists.asmx web service by establishing a web reference in Visual Studio. The lists.asmx exposes the GetListItems method, which will allow the return of the full content of the list in an XML node. It will take parameters like the GUID of the name of the list you are querying against, the GUID of the view you are going to query, etc.


Select For Unformatted Code

The following code below enables you to read the response from MOSS List Web Service...

MOSSListWS.Lists list_svc = new MOSSListWS.Lists();

list_svc.Credentials = new System.Net.NetworkCredential(username,"password");

// The URL property for WebService retrieve

list_svc.Url = "http://ilocalhost/_vti_bin/lists.asmx";

XmlNode itemCollection = list_svc.GetListItems("listName", string.Empty, null, null, "0", null, "");

XmlDocument xmlDoc = new XmlDocument();

xmlDoc.LoadXml(itemCollection.OuterXml);

DataSet ds = new DataSet();

StringReader stringReader = new StringReader(xmlDoc.OuterXml);

ds.ReadXml(stringReader);

stringReader.Dispose();

dataGridView1.DataSource = ds.Tables[1];

For Querying to List

Web_Reference_Folder_Name.Lists listService = new Web_Reference_Folder_Name.Lists();

listService.Credentials= System.Net.CredentialCache.DefaultCredentials;

XmlDocument xmlDoc = new System.Xml.XmlDocument();

XmlNode ndQuery = xmlDoc.CreateNode(XmlNodeType.Element,"Query","");

XmlNode ndViewFields = xmlDoc.CreateNode(XmlNodeType.Element,"ViewFields","");

XmlNode ndQueryOptions = xmlDoc.CreateNode(XmlNodeType.Element,"QueryOptions","");

ndQueryOptions.InnerXml = "FALSE" + "TRUE";

ndViewFields.InnerXml = "Field1' />Field2'/>";

ndQuery.InnerXml = "Field1'/>" + "5000Field2'/>" + "2003-07-03T00:00:00 ";

try

{

XmlNode ndListItems = listService.GetListItems("List_Name", null, ndQuery,ndViewFields, null, ndQueryOptions);

MessageBox.Show(ndListItems.OuterXml);

}

catch (System.Web.Services.Protocols.SoapException ex)

{

MessageBox.Show("Message:\n" + ex.Message + "\nDetail:\n" + ex.Detail.InnerText +

"\nStackTrace:\n" + ex.StackTrace);

}


12. What is CAML, and why would you use it?


CAML stands for Collaborative Application Markup Language. CAML is an XML based language which provides data constructs that build up the SharePoint fields, view, and is used for table definition during site provisioning. CAML is responsible for rending data and the resulting HTML that is output to the user in SharePoint. CAML can be used for a variety of circumstances, overall is used to query, build and customize SharePoint based sites. A general use would be building a CAML query in a SharePoint WebPart in order to retrieve values from a SharePoint list.


13. What are WebPart properties, and what are some of the attributes you see when declaring WebPart properties in code?


WebPart properties are just like ASP.NET control properties, they are used to interact with and specify attributes that should be applied to a WebPart by a user. Some of the attributes you see with ASP.NET 2.0 properties are


WebDescription, WebDisplayName, Category, Personalizable, and WebBrowsable.

Although most of these properties come from the System.Web.UI.WebControls.WebParts class, ones like Category come out of System.ComponentModel namespace.

14. What is a SharePoint Solution File? How does it differ from WebPart .cab files in legacy development? What does it contain?


A SharePoint solution file is essentially a .cabinet file with all a developers custom componets suffixed with a .wsp extension that aids in deployment. The big difference with SharePoint solution files is that a solution:

allows deployment to all WFE’s in a farm is highly manageable from the interface allowing deployment, retraction, and versioning Can package all types of assets like site definitions, feature definitions (and associated components), Webparts, etc.

Can provide Code Access Security provisioning to avoid GAC deployments


15. What is a .ddf file and what does it have to do with SharePoint Solution creation?


A .ddf file is a data directive file and is used when building the SharePoint solution bundle specifying the source files and their destination locations. The important thing for someone to understand is that the .ddf file will be passed as a parameter to the MAKECAB utility to orchestrate construction of the SharePoint solution field.


16. What file does a SharePoint solution package use to orchestrate (describe) its packaged contents?


The solution Manifest.XML file.


17. What deployment mechanism can you use to instigate Code Access Security attributes for your WebParts?


SharePoint solution files can add in order to handle code access security deployment issues. This is done in the element in the SharePoint solution manifest.XML, which makes it easier to get assemblies the appropriate permissions in order to operate in the bin directory of the web application.


18. What is a SharePoint Feature? What files are used to define a feature?


A SharePoint Feature is a functional component that can be activated and deactivate at various scopes throughout a SharePoint instances, such as at the farm, site collection, web, etc. Features have their own receiver architecture, which allow you to trap events such as when a feature is installing, uninstalling, activated, or deactivated. They are helpful because they allow ease of upgrades and versioning.


The two files that are used to define a feature are the feature.xml and manifest.xml file. The feature XML file defines the actual feature and will make SharePoint aware of the installed feature. The manifest file contains details about the feature such as functionality.


19. What types of SharePoint assets can be deployed with a SharePoint feature?


Features can do a lot. For example, you could deploy

Simple site customizations, Custom site navigation, WebParts, pages, list types, list instances, event handlers, workflows, custom actions


20. What are event receivers?


Event receivers are classes that inherit from the SpItemEventReciever or SPListEventReciever base class (both of which derive out of the abstract base class SPEventRecieverBase), and provide the option of responding to events as they occur within SharePoint, such as adding an item or deleting an item.


21. When would you use an event receiver?


Since event receivers respond to events, you could use a receiver for something as simple as canceling an action, such as deleting a document library by using the Cancel property. This would essentially prevent users from deleting any documents if you wanted to maintain retention of stored data.


22. What base class do event receivers inherit from?


Event receivers either inherit from the SPListEventReciever base class or the SPItemEventReciever base class, both which derive from the abstract base class SPEventReceiverBase.


23. What is a content type?


A content type is an information blueprint basically that can be re-used throughout a SharePoint environment for defining things like metadata and associated behaviors. It is basically an extension of a SharePoint list, however makes it portable for use throughout an instance regardless of where the instantiation occurs, ergo has location independence.


Multiple content types can exist in one document library assuming that the appropriate document library settings are enabled. The content type will contain things like the metadata, listform pages, workflows, templates (if a document content type), and associated custom written functionality.


24. Can a list definition be derived from a custom content type?


Yes, a list definition can derive from a content type which can be seen in the schema.XML of the list definition in the element.


25. What is a Content Type then?

A content type is an object that is stored within MOSS that defines several elements of a piece of content, including:

  • Document Template that the content will be based on
  • Columns that the content will have associated with it (metadata)
  • Workflows that the content will use
  • Information Management policies that apply to the content
  • Conversion types for the content



No comments:

Post a Comment