Interview Questions and Answers of SharePoint for Developers - Part III

Part 1 Part 2 Part 3 Part
4


Q. What files gets
created on a file system, when a Site collection is created
?


Ans.
Windows
SharePoint Services does not create any files or folders on the file system when
the site collection or sites are created; everything is created in the content
database. The Pages for the site collection are created as instances in the
content database. These instances refer to the actual file on the file
system.


Q. What are Customized and Uncustomized Files in
SharePoint ?


Ans.
There
are two types of Pages in SharePoint; site pages (also known as content pages)
and application pages.

Uncustomized :

When you create a new
SharePoint site in a site collection, Windows SharePoint Services provisions
instances of files into the content database that resides on the file system.
That means if you create a new Site "xyz" of type Team Site(or Team sIte Definition), an instance
of the Team Site Definition( Which
resides on the File System), i.e. "xyz" gets created in the Content database.
So, When ASP.NET receives a request for the file, it first finds the file in the
content database. This entry in the content database tells ASP.NET that the file
is actually based on a file on the file system and therefore, ASP.NET retrieves
the source of the file on the file system when it constructs the
page.

Customized :

A customized file is one in which the source of
the file lives exclusively in the site collection's content database. This
happens When you modify the file in any way through the SharePoint API, or by
SharePoint Designer 2007,which uses the SharePoint API via RPC and Web service
calls to change files in sites. So, When the file is requested, ASP.NET first
finds the file in the content database. The entry in the database tells ASP.NET
whether the file is customized or uncustomized. If it is customized, it contains
the source of the file, which is used by ASP.NET in the page contraction
phase.

Q. What are event
receivers?

Ans.
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.


Q. When would
you use an event receiver?

Ans.
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.


Q. If I wanted to restrict the deletion of the
documents from a document library, how would I go about it?

Ans.

You would create a event receiver for that list/library and implement the
ItemDeleting method. Simply, set: properties.Cancel= true and display a friendly
message using Properties.Message("How can u delete this... Its not your
stuff!");


Q. What is the difference between an asynchronous and
synchronous event receivers?

Ans.
An asynchronous event occurs after
an action has taken place, and a synchronous event occurs before an action has
take place. For example, an asynchronous event is ItemAdded, and its sister
synchronous event is ItemAdding


Q.
How do you Increase trust level for a single WebPart in the WebConfig
file.

Ans.
To list a Web Part with Full Permissions within
your Web Application while still retaining a WSS_Minimal permission set for all
other Web Parts, You need to create a Custom policy file. This file will be then
referenced in SharePoint Web.config file and will allow your specific webpart to
be of Full trust.
Steps :
1. Make a copy of the WSS_Minimal.Config file
from the 12\Config folder and paste it into the same folder renaming it to
Custom_WSS_Minimal.Config. Now, edit the Custom_WSS_Minimal.Config file using
NotePad. Obtain the Public Key Token for the Web Part assembly that you want to
deploy, using the following command: sn –Tp filename.dll. Create a new entry in
your Custom_WSS_Minimal.Config file for your WebPart. Save the File.
Finally,
Create a new TrustLevel element for your config file in the Web.Config called
Custom_WSS_Minimal that points to your custom file in the 12\config folder.
Recycle the Application Pool and You're Done.


Q. How does Windows SharePoint Services help render
the Webapplictaion in ShrePoint?


Ans.
When a new web applictaion is created
via Central Admin, Windows SharePoint Services creates a new Web application in
IIS. Then the WSS, loads the custom HTTP application and replaces all installed
HTTP handlers and modules with Windows SharePoint Services–specific ones. These
handlers and modules essentially tell IIS to route all file requests through the
ASP.NET 2.0 pipeline. This is because most files in a SharePoint site are stored
in a Microsoft SQL Server
database.


Part 1 Part 2 Part 3 Part
4