Thursday, May 17, 2012

sharepoint interview


What is the advantage in using windowsPowerShell over stsam in sharepoinnt2010?
Stsadm accepts and return text,windows powershell is built on the Microsoft .Net Framework and accepts and returns .net framework objects.
Windows powershell also gives you access to the file system on the computer and enables you to access other data stores.Windows powershell used to take scheduling backup.


What is feature in sharepoint?
Sharepoint feature is an functional component that can be activated and deactivated at various scopes throughtout sharepoint instances
1.farm lavel
2. web application level
3.site level
4.web level
What is Feature Stapling?
Feature Stapling  is extending site definition.
Feature Stapling  is the great way if the site definition is already in use (and sites have been created).
 Feature Stapling has two features. A "Stapler" feature which staples another feature to the site definition and
the "Staplee" feature which will be stapled.
For Example suppose you want to apply a custom Theme to all of the "Publishing site" site definitions.
This can be solved by creating a feature which will apply the Custom theme to the site and
it can be associated with the publishing site's site definition.
Or Suppose if you want to activate a custom list to all the Team sites ,
this can also be solved creating a feature which on activating when you create a team site the custom list gets created.
What is Out of box?
* It is OOB when There is no need to deploy server code
* It is OOB when the user does not need to do any coding at all
There is an in between status, where users may use a CEWP or a CQWP and enter JScript and CAML code.
This requires user coding, but no server side deployment. Another awesome "in-between" option is using JQuery.
sharepoint webpart lifecycle
1.OnInit-To configure the webpart like web browsable properties.
2.OnLoad-To load to add controls.
3.CreateChildControls-To create controls,set it properties.
4.LoadViewState-ViewState of webpart populated here.Only at Postback
5.OnPreRender-It is used to change webpart properties.
6.Render Contents-It generates output in html.
7.OnUnload-To unload webpart.
8.dispose-To free the memory.
Debugging SharePoint 2010 Web Parts from Visual Studio 2010
Deploy your Web Part
Add the Web Part to Page
In your code, create a break point.
Go to “Debug” menu, and choose “Attach to Process”.
Under “Attach to:” section, click on “Select …” button.
Uncheck all options, checking ONLY “Managed (v2.0, v1.1, v1.0) code”.
Check the “Show processes in all sessions” checkbox.
Select all “w3wp.exe” Processes, then click on the “Attach” button.
Run your page that contains the Web Part. You should now hit your break point,
and will be able to step through your code.
Event Receivers
An event is an action that contains block of code to be executed while adding/added deleting/ed.. etc
An event receiver is a class that contains one or more methods known as event handlers that are executed automatically
by SharePoint in response to events such as adding item to a list.
You can use event handlers for data validation, data integrity etc.
SharePoint categories events into of two types
1. Before events (synchronous events)
2. After events (asynchronous events).
1. Before events (synchronous events):
These events fires before an action occurs and before SharePoint has written any data to the content database.
For example ItemAdding event will fire when trying to add an item to a list.
These events does support cancelling of event action. These events are always end with 'ing' like FieldAdding,
ItemAdding, ItemUpdating, WebAdding, WebDeleting etc. These events are also know as synchronous events.
 2. After events (asynchronous events):
These events fire after the event action has completed and after SharePoint Foundation has written
to the content database to commit the event action. These events does not support cancelling of event action.
These events does support cancelling of event action. These events are always end with 'ed' like FieldAdded, ItemAdded,
ItemUpdated, WebAdded, WebDeleted etc. These events are also know as asynchronous events.

Events, Event Receivers & Object Model:
Event receivers are nothing but custom classes which are derived from event receiver base classes that are
 defined by Microsoft in Microsoft.SharePoint assembly.

Some of the base classes are
SPItemEventReceiver: There are related to SharePoint items.
SPListEventReceiver: Related to lists.
SPWebEventReceiver: Related to webs.
SPWorkflowEventReceiver: Related to workflows instances. etc.

Remember all these classes(except SPEmailEventReceiver and SPFeatureReceiver) are derived from a common base class
know as SPEventReceiverBase.

Microsoft.SharePoint.SPWebEventReceiver class.
Types of Event Receivers
1.List Events
2.ListItem Events
3.List Email Events
4.Web Events
5.List Workflow Events

 Whats New with webparts in Visual Studio 2010
A developer can create two types of webparts using Visual Studio 2010.

1. Visual Webparts - Allows you to Drag and Drop the controls from the Toolbox to WebPart Design surface.
You can of course write your custom code in the code file. You can also package and deploy your webparts directly to
Sharepoint from VS by pressing Clt+F5. Visual studio 2010 also provides you with three different views
 for developing webparts. The views are split view, design view and Source view(as we have in SharePoint Designer 2007).

2. ASP.Net WebParts - Where a developer can build up User Interface and logic in a class file.
You do not have designer for drag and drop of controls. This webpart inherits from standard ASP.Net webpart.
 For Deployment we can again use ctrl+f5 to deploy this webpart.

What is a workflow?
 Workflows are the way an organization functions, a series of actions that correspond to a work process,
such as the process for purchase orders.SharePoint 2010 helps you automate these workflows,
thereby increasing the efficiency and productivity of the organization.

 What are the types of workflow that you can design in SharePoint 2010.
 you can design List Workflows, Reusable List Workflows and Site workflows using SharePoint designer 2010.

Reusable List Workflows -
You can create a reusable list workflow (reusable workflow) in the top-level site in the site collection,
and that workflow can be made globally reusable — meaning that the workflow can be associated to any list, library,
or content type in the site collection. You can also create a reusable workflow in any subsite in the site collection;
 this workflow is available for reuse in that particular subsite.

Site workflows - A site workflow is associated to a site — not to a list, library, or content type.
So unlike most workflows, a site workflow is not running on a specific list item. Because of this, many of the actions that are available for items not available for site workflows.
How to configure Search in sharepoint2010?

  1.  Go to SharePoint Central Administration.
  2. Click on Application management then select Manage Service application. 
  3. Click New and select Search Service Application 
  4. Give a name for your Service application.
  5. Select Search Service account or register new Service account in the drop down.
  6. Better create a new application pool for your Search service 
  7. It will take some time to configure the service.
  8. Click on the Search Service Application 1  and next select content source.
  9. Add new content source.
  10. You have to configure Full and incremental crawl schedules in the preceding screen.
  11. Now go back and start a Full crawl.
How to configure FBA in sharepoint2010?
  1. MS SQL database as membership store for users.  
    aspnet_regsql.exe that creates a database for us.
    A) Setting up ASP.NET Forms Authentication User and Role Data Source 
    1. Create Database 
    2. Configure Membership and Role Provider 
    3. Create User
    B) Create Web Application and Site Collections
    a. Go to Central Administration ? Application Management ? Select ‘Manage Web Application’ link present under ‘Web Applications’ section.
    b. Click on ‘New’ option in the ribbon.
    c.Select authentication type as claim based authentication.
    d.Next select claimbased authentication types,check enable forms based authentication check box
    e.Add asp.net membership provider name ,asp.net role manager name

    C) Configure Web.Config file 
    1. Configuring FBA web application web.config file in 
    Add Connection String,
    Add Membership Provider and Role Provider.
  2. 2. Configuring Central Administration web application web.config file in 
    Add Connection String,
    Add Membership Provider and Role Provider

  3. 3. Configuring Security Token Service web.config file 
    in 
    Add Connection String,
    Add Membership Provider and Role Provider

    D) Adding User Policy to the FBA Web Application
    a. Go to Central Administration ? Manage Web Applications ? Select the FBA web application and click on ‘User Policy’ option in the ribbon.
    b.
     Click on ‘Add Users’ link and select ‘Default’ as the zone and click on ‘Next’ button.





No comments:

Post a Comment