Interview Questions and Answers of SharePoint for Developers - Part II

Part 1 Part 2 Part
3
Part
4


Q. When do you use
SPSiteDataQuery ?


Ans. You
can use SPSiteDataQuery when you need to extract data from more than one
list\library in your site colletcion. The data is extracted on the basis of the
query you write and is
returened as a Datatable. You can also specify the
GUID for the lists\libraries you want to query against.

Q. How do you create a Custom action for an item in a
list ?


Ans. This can be
done by adding a new feature into SharePoint. You would need to use customaction
tag in your elements.xml file and will have to set various properties like
imageurl or UrlAction for your customaction. You can later add this feature into
sharepoint using stsadm install feature command.

Q. How would you bind this CustomAction to a specific
list ?


Ans. To do this you
can either create a new list type(again a feature) and use the listtype number
for the new list in your RegistrationType property of the Customaction. The
CustomAction will then show up only for the items of this list type. or You can
create a new content type and then use that content type's id in your
cutsomaction to bind the custom action to items of just that content type. Add
the new content type to the list where you need this customaction.



Q. How will you deploy an existing
asp.net webapplication or website in SharePoint?

Ans.
You would
need to wrap the web application in a solution package in order to deploy it in
12 hive or say ShraePoint. It is recommended to create a feature first, and then
wrap everything in a Solution package. See example Create and Deploy Custom aspx Page as Feature and Solution Package of SharePoint 2007


Q. How will you cancel a deployment from central admin
-> solution managment, if its stuck at "deploying" or "Error".


Ans.
You can either try to force execute timer jobs using
execadmsvcjobs command or can cancel the dpeloyment using stsadm command stsadm
–o cancaldeployment –id {GUID} command. The Id here would be GUID of the timer
or deployment job. You can get the Id from stsadm enumdeployment command. This
will display all the deployments which are process or are stuck with Error.



Q. How do make an existing
non-publishing site Publishing?

Ans.
You can simply activate the
SharePoint Publishing Feature for the Site, you want to make publishing.



Q. Can you name some of the tools
used for SharePoint Administration?

Ans.
What Tools Are Used for SharePoint Administration?


Q. What are Application Pages in SharePoint?


Ans.
Unlike site pages (for example, default.aspx), a
custom application page is deployed once per Web server and cannot be customized
on a site-by-site basis. Application pages are based in the virtual _layouts
directory. In addition, they are compiled into a single assembly DLL.
A good
example of an Application Page is the default Site Settings page: every site has
one, and it's not customizable on a per site basis (although the contents can be
different for sites).
With application pages, you can also add inline code.
With site pages, you cannot add inline code.



Q. What is Authentication and
Authorization?

Ans .
An authentication system is how you
identify yourself to the computer. The goal behind an authentication system is
to verify that the user is actually who they say they are.
Once the system
knows who the user is through authentication, authorization is how the system
decides what the user can do.




Q. How do you deploy a User Control
in SharePoint ?

Ans.
You deploy your User Control
either by a Custom webpart, which will simply load the control on the page or
can use tools like SmartPart, which is again a webpart to load user control on
the page. User Control can be deployed using a custom solution package for the
webapplication or you can also the control in the webpart solution package so
that it gets deployed in _controlstemplate folder.



Q. Which
is faster a WebPart or a User Control?

Ans.
A
WebPart renders faster than a User Control. A User Control in SharePoint is
usually loaded by a webpart which adds an overhead. User Controls however, gives
you an Interface to add controls and styles.



Q.
What SharePoint Databases are Created during the standard Install?



Ans. During standard
install, the following databases are created :


SharePoint_AdminContent

SharePoint_Config
WWS_Search_SERVERNAME%_%GUID_3%

SharedServicesContent_%GUID_4%
SharedServices1_DB_%GUID_5%

SharedServices1_Search_DB_%
GUID_6%WSS_Content_%GUID_7%




Q. What are content types?


Ans.
A content type is a flexible and reusable WSS type
definition (or we can a template) that defines the columns and behavior for an
item in a list or a document in a document library. For example, you can create
a content type for a leave approval document with a unique set of columns, an
event handler, and its own document template and attach it with a document
library/libraries.



Q. Can a
content type have receivers associated with it?

Ans.
Yes, a
content type can have an event receiver associated with it, either inheriting
from the SPListEventReciever base class for list level events, or inheriting
from the SPItemEventReciever base class. Whenever the content type is
instantiated, it will be subject to the event receivers that are associated with
it.



Q. Can you add a Cutsom Http Handler in SharePoint
?

Ans.
Yes, a Custom httphandler can be deployed in
_layouts folder in SharePoint. Also, we need to be register the handler in the
webapp's webconfig file.



Q. While creating a Web part, which is the ideal
location to Initialize my new controls?
Override the
CreateChildControls method to include your new controls. You can control the
exact rendering of your controls by calling the .Render method in the web parts
Render method.



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

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.



Q. How Do you deploy Files in 12 hive when using
wspbuilder or vsewss?

Ans.
Typically, you can add these
files in the 12 hive folder structure
in your project. In Vsewss
however, you will have to create this structure manually.

Part 1 Part 2 Part
3
Part
4