Q.
What is a SharePoint Feature? What files are used to define a feature? Ans. A SharePoint
Feature is a functional component that can be activated and deactivate at
various scopes throughout a SharePoint instances.
Scopes
include
Farm
WebApplication
Site
(site collection)
Web
(site)
Features
have their own receiver architecture, which allow you to trap events such as
when a feature is
installing
uninstalling
activated
deactivated
The
element types that can be defined by a feature include
menu
commands
link
commands
page
templates
page
instances
list
definitions
list
instances
event
handlers
workflows
The
two files that are used to define a feature are
feature.xml
manifest
file(elements.xml)
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.
Common
stsadm commands associated with feature are
stsadm
-o installfeature
stsadm
-o uninstallfeature
stsadm
-o activatefeature
stsadm
-o deactivatefeature
Q.
What are content types ? Ans. A content type is a flexible and reusable WSS type
definition 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 customer presentation document with a unique
set of columns, an event handler, and its own document template.
-You
can create a second content type for a customer proposal document with a
different set of columns, a workflow, and a different document template.
Then
you can attach both the contenttypes to a document library, which allows you to
capture metadata based on the contenttype selected during creation of the
document.
Content
type can be created by the following
from
the rootweb of a site collection, go to Site Action > Site Settings >
Galleries > Site content types
using
a feature
Q.
What does SPWeb.EnsureUser method do?
Ans.
Checks whether the specified login name belongs to a valid user of the Web
site, and if the login name does not already exist, adds it to the Web site.
e.g SPUser usr = myWeb.EnsureUser("mmangaldas");
Q.
While creating a Webpart, which is the ideal location to Initialize my new
controls ? Ans.
Override the CreateChildControls method to include your new controls. To make
sure that the new controls are initialized.. call 'EnsureChildControls' in the
webparts Render method. You can control the exact Rendering of your controls by
calling the .Render method in the webparts Render method.
Q.
How to query from multiple lists ? Ans. Use SPSiteDataQuery to fetch data
from multiple lists. more details..
Q.
How Does SharePoint work? Ans. The browser sends a DAV packet to IIS asking to perform
a document check in. PKMDASL.DLL, an ISAPI DLL, parses the packet and sees that
it has the proprietary INVOKE command. Because of the existence of this
command, the packet is passed off to msdmserv.exe, who in turn processes the
packet and uses EXOLEDB to access the WSS, perform the operation and send the
results back to the user in the form of XML.
Q.
What is the difference between Syncronous & Asyncronous events? Ans. Syncronous calls
ending with 'ing' E.g. ItemDeleting Event Handler code execute BEFORE action is
committed WSS waits for code to return Option to cancel and return error code
Asyncronous
calls ending with 'ed' E.g. ItemDeleted Event Handler code executes AFTER
action is committed WSS does not wait for code to return Executed in its own
Worker thread.
Q.
What is ServerUpdate() ? Ans. Any changes in the list, i.e. new addition or modification
of an item.. the operation is complete by calling the Update method.But if a
List is set to maintain versions .. and you are editing an item, but don't want
to save it as a new version, then use the SystemUpdate method instead and pass
in 'false' as the parameter.
Q.
What is query.ViewAttributes OR How can you force SPQuery to return results
from all the folders of the list? Ans. If you use SPQuery on any SPlist
.. it will bring back results from the current folder only. If you want to get
results from all the folders in the list.. then you need to specify the scope
of the query by the use of ViewAttributes..
e.g.
query.ViewAttributes = "Scope=\"Recursive\"";
Q.
What are the two base classes a WebPart you are going to use within SharePoint
2007 can inherit from? Ans. There are two base classes that a WebPart which is
going to be consumed by SharePoint can inherit from, either the SharePoint
WebPart Base class or the ASP.NET 2.0 WebPart base class. When inheriting from
the SharePoint WebPart Base class your derived WebPart class will inherit from
Microsoft.SharePoint.WebPartPages.WebPart. When inheriting from the ASP.NET 2.0
WebPart base class your derived WebPart class will inherit from
System.Web.UI.WebControls.WebParts.WebPart. It is considered good practice to
use the ASP.NET WebPart base class since the old base class is meant for
backwards compatibility with previous version of SharePoint, however there are
four exception when it is better to leverage functionality from the SharePoint
WebPart base class:
Cross
page connections
Connections
between Web Parts that are outside of a Web Part zone
Client-side
connections (Web Part Page Services Component)
Data
caching infrastructure
No comments:
Post a Comment